ent

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package ent holds the generated Ent client for the team system of record.

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAgent          = "Agent"
	TypeAgentRole      = "AgentRole"
	TypeAgentSkill     = "AgentSkill"
	TypeAllowlistEntry = "AllowlistEntry"
	TypeAuthSession    = "AuthSession"
	TypeChat           = "Chat"
	TypeChatMember     = "ChatMember"
	TypeIdentity       = "Identity"
	TypeMagicLinkToken = "MagicLinkToken"
	TypeMessage        = "Message"
	TypeUser           = "User"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Agent

type Agent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Persona holds the value of the "persona" field.
	Persona string `json:"persona,omitempty"`
	// Model holds the value of the "model" field.
	Model string `json:"model,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider string `json:"provider,omitempty"`
	// Visibility holds the value of the "visibility" field.
	Visibility agent.Visibility `json:"visibility,omitempty"`
	// Featured holds the value of the "featured" field.
	Featured bool `json:"featured,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy uuid.UUID `json:"created_by,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AgentQuery when eager-loading is set.
	Edges AgentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Agent is the model entity for the Agent schema.

func (*Agent) ExecContext

func (c *Agent) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Agent) QueryContext

func (c *Agent) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Agent) QueryCreator

func (_m *Agent) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Agent entity.

func (*Agent) QueryRoles

func (_m *Agent) QueryRoles() *AgentRoleQuery

QueryRoles queries the "roles" edge of the Agent entity.

func (*Agent) QuerySkills

func (_m *Agent) QuerySkills() *AgentSkillQuery

QuerySkills queries the "skills" edge of the Agent entity.

func (*Agent) String

func (_m *Agent) String() string

String implements the fmt.Stringer.

func (*Agent) Unwrap

func (_m *Agent) Unwrap() *Agent

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

func (_m *Agent) Update() *AgentUpdateOne

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

func (*Agent) Value

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

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

type AgentClient

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

AgentClient is a client for the Agent schema.

func NewAgentClient

func NewAgentClient(c config) *AgentClient

NewAgentClient returns a client for the Agent from the given config.

func (*AgentClient) Create

func (c *AgentClient) Create() *AgentCreate

Create returns a builder for creating a Agent entity.

func (*AgentClient) CreateBulk

func (c *AgentClient) CreateBulk(builders ...*AgentCreate) *AgentCreateBulk

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

func (*AgentClient) Delete

func (c *AgentClient) Delete() *AgentDelete

Delete returns a delete builder for Agent.

func (*AgentClient) DeleteOne

func (c *AgentClient) DeleteOne(_m *Agent) *AgentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgentClient) DeleteOneID

func (c *AgentClient) DeleteOneID(id uuid.UUID) *AgentDeleteOne

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

func (*AgentClient) ExecContext

func (c *AgentClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentClient) Get

func (c *AgentClient) Get(ctx context.Context, id uuid.UUID) (*Agent, error)

Get returns a Agent entity by its id.

func (*AgentClient) GetX

func (c *AgentClient) GetX(ctx context.Context, id uuid.UUID) *Agent

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

func (*AgentClient) Hooks

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

Hooks returns the client hooks.

func (*AgentClient) Intercept

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

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

func (*AgentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AgentClient) MapCreateBulk

func (c *AgentClient) MapCreateBulk(slice any, setFunc func(*AgentCreate, int)) *AgentCreateBulk

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

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) QueryContext

func (c *AgentClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentClient) QueryCreator

func (c *AgentClient) QueryCreator(_m *Agent) *UserQuery

QueryCreator queries the creator edge of a Agent.

func (*AgentClient) QueryRoles

func (c *AgentClient) QueryRoles(_m *Agent) *AgentRoleQuery

QueryRoles queries the roles edge of a Agent.

func (*AgentClient) QuerySkills

func (c *AgentClient) QuerySkills(_m *Agent) *AgentSkillQuery

QuerySkills queries the skills edge of a Agent.

func (*AgentClient) Update

func (c *AgentClient) Update() *AgentUpdate

Update returns an update builder for Agent.

func (*AgentClient) UpdateOne

func (c *AgentClient) UpdateOne(_m *Agent) *AgentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgentClient) UpdateOneID

func (c *AgentClient) UpdateOneID(id uuid.UUID) *AgentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentClient) Use

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

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

type AgentCreate

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

AgentCreate is the builder for creating a Agent entity.

func (*AgentCreate) AddRoleIDs

func (_c *AgentCreate) AddRoleIDs(ids ...uuid.UUID) *AgentCreate

AddRoleIDs adds the "roles" edge to the AgentRole entity by IDs.

func (*AgentCreate) AddRoles

func (_c *AgentCreate) AddRoles(v ...*AgentRole) *AgentCreate

AddRoles adds the "roles" edges to the AgentRole entity.

func (*AgentCreate) AddSkillIDs

func (_c *AgentCreate) AddSkillIDs(ids ...uuid.UUID) *AgentCreate

AddSkillIDs adds the "skills" edge to the AgentSkill entity by IDs.

func (*AgentCreate) AddSkills

func (_c *AgentCreate) AddSkills(v ...*AgentSkill) *AgentCreate

AddSkills adds the "skills" edges to the AgentSkill entity.

func (*AgentCreate) Exec

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

Exec executes the query.

func (*AgentCreate) ExecContext

func (c *AgentCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentCreate) ExecX

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

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

func (*AgentCreate) Mutation

func (_c *AgentCreate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentCreate) QueryContext

func (c *AgentCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentCreate) Save

func (_c *AgentCreate) Save(ctx context.Context) (*Agent, error)

Save creates the Agent in the database.

func (*AgentCreate) SaveX

func (_c *AgentCreate) SaveX(ctx context.Context) *Agent

SaveX calls Save and panics if Save returns an error.

func (*AgentCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentCreate) SetCreatedBy

func (_c *AgentCreate) SetCreatedBy(v uuid.UUID) *AgentCreate

SetCreatedBy sets the "created_by" field.

func (*AgentCreate) SetCreator

func (_c *AgentCreate) SetCreator(v *User) *AgentCreate

SetCreator sets the "creator" edge to the User entity.

func (*AgentCreate) SetCreatorID

func (_c *AgentCreate) SetCreatorID(id uuid.UUID) *AgentCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*AgentCreate) SetDescription

func (_c *AgentCreate) SetDescription(v string) *AgentCreate

SetDescription sets the "description" field.

func (*AgentCreate) SetFeatured

func (_c *AgentCreate) SetFeatured(v bool) *AgentCreate

SetFeatured sets the "featured" field.

func (*AgentCreate) SetID

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

SetID sets the "id" field.

func (*AgentCreate) SetModel

func (_c *AgentCreate) SetModel(v string) *AgentCreate

SetModel sets the "model" field.

func (*AgentCreate) SetName

func (_c *AgentCreate) SetName(v string) *AgentCreate

SetName sets the "name" field.

func (*AgentCreate) SetNillableCreatedAt

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

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

func (*AgentCreate) SetNillableDescription

func (_c *AgentCreate) SetNillableDescription(v *string) *AgentCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentCreate) SetNillableFeatured

func (_c *AgentCreate) SetNillableFeatured(v *bool) *AgentCreate

SetNillableFeatured sets the "featured" field if the given value is not nil.

func (*AgentCreate) SetNillableID

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

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

func (*AgentCreate) SetNillableModel

func (_c *AgentCreate) SetNillableModel(v *string) *AgentCreate

SetNillableModel sets the "model" field if the given value is not nil.

func (*AgentCreate) SetNillablePersona

func (_c *AgentCreate) SetNillablePersona(v *string) *AgentCreate

SetNillablePersona sets the "persona" field if the given value is not nil.

func (*AgentCreate) SetNillableProvider

func (_c *AgentCreate) SetNillableProvider(v *string) *AgentCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*AgentCreate) SetNillableUpdatedAt

func (_c *AgentCreate) SetNillableUpdatedAt(v *time.Time) *AgentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*AgentCreate) SetNillableVisibility

func (_c *AgentCreate) SetNillableVisibility(v *agent.Visibility) *AgentCreate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*AgentCreate) SetPersona

func (_c *AgentCreate) SetPersona(v string) *AgentCreate

SetPersona sets the "persona" field.

func (*AgentCreate) SetProvider

func (_c *AgentCreate) SetProvider(v string) *AgentCreate

SetProvider sets the "provider" field.

func (*AgentCreate) SetSlug

func (_c *AgentCreate) SetSlug(v string) *AgentCreate

SetSlug sets the "slug" field.

func (*AgentCreate) SetUpdatedAt

func (_c *AgentCreate) SetUpdatedAt(v time.Time) *AgentCreate

SetUpdatedAt sets the "updated_at" field.

func (*AgentCreate) SetVisibility

func (_c *AgentCreate) SetVisibility(v agent.Visibility) *AgentCreate

SetVisibility sets the "visibility" field.

type AgentCreateBulk

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

AgentCreateBulk is the builder for creating many Agent entities in bulk.

func (*AgentCreateBulk) Exec

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

Exec executes the query.

func (*AgentCreateBulk) ExecContext

func (c *AgentCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentCreateBulk) ExecX

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

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

func (*AgentCreateBulk) QueryContext

func (c *AgentCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentCreateBulk) Save

func (_c *AgentCreateBulk) Save(ctx context.Context) ([]*Agent, error)

Save creates the Agent entities in the database.

func (*AgentCreateBulk) SaveX

func (_c *AgentCreateBulk) SaveX(ctx context.Context) []*Agent

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

type AgentDelete

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

AgentDelete is the builder for deleting a Agent entity.

func (*AgentDelete) Exec

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

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

func (*AgentDelete) ExecContext

func (c *AgentDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentDelete) ExecX

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

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

func (*AgentDelete) QueryContext

func (c *AgentDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentDelete) Where

func (_d *AgentDelete) Where(ps ...predicate.Agent) *AgentDelete

Where appends a list predicates to the AgentDelete builder.

type AgentDeleteOne

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

AgentDeleteOne is the builder for deleting a single Agent entity.

func (*AgentDeleteOne) Exec

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

Exec executes the deletion query.

func (*AgentDeleteOne) ExecX

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

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

func (*AgentDeleteOne) Where

func (_d *AgentDeleteOne) Where(ps ...predicate.Agent) *AgentDeleteOne

Where appends a list predicates to the AgentDelete builder.

type AgentEdges

type AgentEdges struct {
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Skills holds the value of the skills edge.
	Skills []*AgentSkill `json:"skills,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*AgentRole `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

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

func (AgentEdges) CreatorOrErr

func (e AgentEdges) CreatorOrErr() (*User, error)

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

func (AgentEdges) RolesOrErr

func (e AgentEdges) RolesOrErr() ([]*AgentRole, error)

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

func (AgentEdges) SkillsOrErr

func (e AgentEdges) SkillsOrErr() ([]*AgentSkill, error)

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

type AgentGroupBy

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

AgentGroupBy is the group-by builder for Agent entities.

func (*AgentGroupBy) Aggregate

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

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

func (*AgentGroupBy) Bool

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

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

func (*AgentGroupBy) BoolX

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

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

func (*AgentGroupBy) Bools

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

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

func (*AgentGroupBy) BoolsX

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

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

func (*AgentGroupBy) Float64

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

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

func (*AgentGroupBy) Float64X

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

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

func (*AgentGroupBy) Float64s

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

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

func (*AgentGroupBy) Float64sX

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

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

func (*AgentGroupBy) Int

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

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

func (*AgentGroupBy) IntX

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

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

func (*AgentGroupBy) Ints

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

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

func (*AgentGroupBy) IntsX

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

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

func (*AgentGroupBy) Scan

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

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

func (*AgentGroupBy) ScanX

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

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

func (*AgentGroupBy) String

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

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

func (*AgentGroupBy) StringX

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

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

func (*AgentGroupBy) Strings

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

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

func (*AgentGroupBy) StringsX

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

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

type AgentMutation

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

AgentMutation represents an operation that mutates the Agent nodes in the graph.

func (*AgentMutation) AddField

func (m *AgentMutation) 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 (*AgentMutation) AddRoleIDs

func (m *AgentMutation) AddRoleIDs(ids ...uuid.UUID)

AddRoleIDs adds the "roles" edge to the AgentRole entity by ids.

func (*AgentMutation) AddSkillIDs

func (m *AgentMutation) AddSkillIDs(ids ...uuid.UUID)

AddSkillIDs adds the "skills" edge to the AgentSkill entity by ids.

func (*AgentMutation) AddedEdges

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

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

func (*AgentMutation) AddedField

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

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

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

func (*AgentMutation) AddedIDs

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

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

func (*AgentMutation) ClearCreator

func (m *AgentMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*AgentMutation) ClearDescription

func (m *AgentMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*AgentMutation) ClearEdge

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

func (m *AgentMutation) 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 (*AgentMutation) ClearModel

func (m *AgentMutation) ClearModel()

ClearModel clears the value of the "model" field.

func (*AgentMutation) ClearPersona

func (m *AgentMutation) ClearPersona()

ClearPersona clears the value of the "persona" field.

func (*AgentMutation) ClearProvider

func (m *AgentMutation) ClearProvider()

ClearProvider clears the value of the "provider" field.

func (*AgentMutation) ClearRoles

func (m *AgentMutation) ClearRoles()

ClearRoles clears the "roles" edge to the AgentRole entity.

func (*AgentMutation) ClearSkills

func (m *AgentMutation) ClearSkills()

ClearSkills clears the "skills" edge to the AgentSkill entity.

func (*AgentMutation) ClearedEdges

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

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

func (*AgentMutation) ClearedFields

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

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

func (AgentMutation) Client

func (m AgentMutation) 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 (*AgentMutation) CreatedAt

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

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

func (*AgentMutation) CreatedBy

func (m *AgentMutation) CreatedBy() (r uuid.UUID, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*AgentMutation) CreatorCleared

func (m *AgentMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*AgentMutation) CreatorID

func (m *AgentMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*AgentMutation) CreatorIDs

func (m *AgentMutation) CreatorIDs() (ids []uuid.UUID)

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

func (*AgentMutation) Description

func (m *AgentMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*AgentMutation) DescriptionCleared

func (m *AgentMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*AgentMutation) EdgeCleared

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

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

func (*AgentMutation) ExecContext

func (c *AgentMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentMutation) Featured

func (m *AgentMutation) Featured() (r bool, exists bool)

Featured returns the value of the "featured" field in the mutation.

func (*AgentMutation) Field

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

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

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

func (*AgentMutation) Fields

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

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

func (m *AgentMutation) 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 (*AgentMutation) Model

func (m *AgentMutation) Model() (r string, exists bool)

Model returns the value of the "model" field in the mutation.

func (*AgentMutation) ModelCleared

func (m *AgentMutation) ModelCleared() bool

ModelCleared returns if the "model" field was cleared in this mutation.

func (*AgentMutation) Name

func (m *AgentMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*AgentMutation) OldCreatedAt

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

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

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

OldCreatedBy returns the old "created_by" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldDescription

func (m *AgentMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldFeatured

func (m *AgentMutation) OldFeatured(ctx context.Context) (v bool, err error)

OldFeatured returns the old "featured" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldField

func (m *AgentMutation) 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 (*AgentMutation) OldModel

func (m *AgentMutation) OldModel(ctx context.Context) (v string, err error)

OldModel returns the old "model" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldName

func (m *AgentMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldPersona

func (m *AgentMutation) OldPersona(ctx context.Context) (v string, err error)

OldPersona returns the old "persona" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldProvider

func (m *AgentMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldSlug

func (m *AgentMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldUpdatedAt

func (m *AgentMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Agent entity. If the Agent 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 (*AgentMutation) OldVisibility

func (m *AgentMutation) OldVisibility(ctx context.Context) (v agent.Visibility, err error)

OldVisibility returns the old "visibility" field's value of the Agent entity. If the Agent 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 (*AgentMutation) Op

func (m *AgentMutation) Op() Op

Op returns the operation name.

func (*AgentMutation) Persona

func (m *AgentMutation) Persona() (r string, exists bool)

Persona returns the value of the "persona" field in the mutation.

func (*AgentMutation) PersonaCleared

func (m *AgentMutation) PersonaCleared() bool

PersonaCleared returns if the "persona" field was cleared in this mutation.

func (*AgentMutation) Provider

func (m *AgentMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*AgentMutation) ProviderCleared

func (m *AgentMutation) ProviderCleared() bool

ProviderCleared returns if the "provider" field was cleared in this mutation.

func (*AgentMutation) QueryContext

func (c *AgentMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentMutation) RemoveRoleIDs

func (m *AgentMutation) RemoveRoleIDs(ids ...uuid.UUID)

RemoveRoleIDs removes the "roles" edge to the AgentRole entity by IDs.

func (*AgentMutation) RemoveSkillIDs

func (m *AgentMutation) RemoveSkillIDs(ids ...uuid.UUID)

RemoveSkillIDs removes the "skills" edge to the AgentSkill entity by IDs.

func (*AgentMutation) RemovedEdges

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

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

func (*AgentMutation) RemovedIDs

func (m *AgentMutation) 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 (*AgentMutation) RemovedRolesIDs

func (m *AgentMutation) RemovedRolesIDs() (ids []uuid.UUID)

RemovedRoles returns the removed IDs of the "roles" edge to the AgentRole entity.

func (*AgentMutation) RemovedSkillsIDs

func (m *AgentMutation) RemovedSkillsIDs() (ids []uuid.UUID)

RemovedSkills returns the removed IDs of the "skills" edge to the AgentSkill entity.

func (*AgentMutation) ResetCreatedAt

func (m *AgentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AgentMutation) ResetCreatedBy

func (m *AgentMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*AgentMutation) ResetCreator

func (m *AgentMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*AgentMutation) ResetDescription

func (m *AgentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AgentMutation) ResetEdge

func (m *AgentMutation) 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 (*AgentMutation) ResetFeatured

func (m *AgentMutation) ResetFeatured()

ResetFeatured resets all changes to the "featured" field.

func (*AgentMutation) ResetField

func (m *AgentMutation) 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 (*AgentMutation) ResetModel

func (m *AgentMutation) ResetModel()

ResetModel resets all changes to the "model" field.

func (*AgentMutation) ResetName

func (m *AgentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AgentMutation) ResetPersona

func (m *AgentMutation) ResetPersona()

ResetPersona resets all changes to the "persona" field.

func (*AgentMutation) ResetProvider

func (m *AgentMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*AgentMutation) ResetRoles

func (m *AgentMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*AgentMutation) ResetSkills

func (m *AgentMutation) ResetSkills()

ResetSkills resets all changes to the "skills" edge.

func (*AgentMutation) ResetSlug

func (m *AgentMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*AgentMutation) ResetUpdatedAt

func (m *AgentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AgentMutation) ResetVisibility

func (m *AgentMutation) ResetVisibility()

ResetVisibility resets all changes to the "visibility" field.

func (*AgentMutation) RolesCleared

func (m *AgentMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the AgentRole entity was cleared.

func (*AgentMutation) RolesIDs

func (m *AgentMutation) RolesIDs() (ids []uuid.UUID)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*AgentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentMutation) SetCreatedBy

func (m *AgentMutation) SetCreatedBy(u uuid.UUID)

SetCreatedBy sets the "created_by" field.

func (*AgentMutation) SetCreatorID

func (m *AgentMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*AgentMutation) SetDescription

func (m *AgentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AgentMutation) SetFeatured

func (m *AgentMutation) SetFeatured(b bool)

SetFeatured sets the "featured" field.

func (*AgentMutation) SetField

func (m *AgentMutation) 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 (*AgentMutation) SetID

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

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

func (*AgentMutation) SetModel

func (m *AgentMutation) SetModel(s string)

SetModel sets the "model" field.

func (*AgentMutation) SetName

func (m *AgentMutation) SetName(s string)

SetName sets the "name" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) SetPersona

func (m *AgentMutation) SetPersona(s string)

SetPersona sets the "persona" field.

func (*AgentMutation) SetProvider

func (m *AgentMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*AgentMutation) SetSlug

func (m *AgentMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*AgentMutation) SetUpdatedAt

func (m *AgentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*AgentMutation) SetVisibility

func (m *AgentMutation) SetVisibility(a agent.Visibility)

SetVisibility sets the "visibility" field.

func (*AgentMutation) SkillsCleared

func (m *AgentMutation) SkillsCleared() bool

SkillsCleared reports if the "skills" edge to the AgentSkill entity was cleared.

func (*AgentMutation) SkillsIDs

func (m *AgentMutation) SkillsIDs() (ids []uuid.UUID)

SkillsIDs returns the "skills" edge IDs in the mutation.

func (*AgentMutation) Slug

func (m *AgentMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (AgentMutation) Tx

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

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

func (*AgentMutation) Type

func (m *AgentMutation) Type() string

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

func (*AgentMutation) UpdatedAt

func (m *AgentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*AgentMutation) Visibility

func (m *AgentMutation) Visibility() (r agent.Visibility, exists bool)

Visibility returns the value of the "visibility" field in the mutation.

func (*AgentMutation) Where

func (m *AgentMutation) Where(ps ...predicate.Agent)

Where appends a list predicates to the AgentMutation builder.

func (*AgentMutation) WhereP

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

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

type AgentQuery

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

AgentQuery is the builder for querying Agent entities.

func (*AgentQuery) Aggregate

func (_q *AgentQuery) Aggregate(fns ...AggregateFunc) *AgentSelect

Aggregate returns a AgentSelect configured with the given aggregations.

func (*AgentQuery) All

func (_q *AgentQuery) All(ctx context.Context) ([]*Agent, error)

All executes the query and returns a list of Agents.

func (*AgentQuery) AllX

func (_q *AgentQuery) AllX(ctx context.Context) []*Agent

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

func (*AgentQuery) Clone

func (_q *AgentQuery) Clone() *AgentQuery

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

func (*AgentQuery) Count

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

Count returns the count of the given query.

func (*AgentQuery) CountX

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

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

func (*AgentQuery) ExecContext

func (c *AgentQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentQuery) Exist

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

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

func (*AgentQuery) ExistX

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

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

func (*AgentQuery) First

func (_q *AgentQuery) First(ctx context.Context) (*Agent, error)

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

func (*AgentQuery) FirstID

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

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

func (*AgentQuery) FirstIDX

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

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

func (*AgentQuery) FirstX

func (_q *AgentQuery) FirstX(ctx context.Context) *Agent

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

func (*AgentQuery) GroupBy

func (_q *AgentQuery) GroupBy(field string, fields ...string) *AgentGroupBy

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

client.Agent.Query().
	GroupBy(agent.FieldSlug).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AgentQuery) IDs

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

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

func (*AgentQuery) IDsX

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

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

func (*AgentQuery) Limit

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

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

func (*AgentQuery) Offset

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

Offset to start from.

func (*AgentQuery) Only

func (_q *AgentQuery) Only(ctx context.Context) (*Agent, error)

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

func (*AgentQuery) OnlyID

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

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

func (*AgentQuery) OnlyIDX

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

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

func (*AgentQuery) OnlyX

func (_q *AgentQuery) OnlyX(ctx context.Context) *Agent

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

func (*AgentQuery) Order

func (_q *AgentQuery) Order(o ...agent.OrderOption) *AgentQuery

Order specifies how the records should be ordered.

func (*AgentQuery) QueryContext

func (c *AgentQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentQuery) QueryCreator

func (_q *AgentQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*AgentQuery) QueryRoles

func (_q *AgentQuery) QueryRoles() *AgentRoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*AgentQuery) QuerySkills

func (_q *AgentQuery) QuerySkills() *AgentSkillQuery

QuerySkills chains the current query on the "skills" edge.

func (*AgentQuery) Select

func (_q *AgentQuery) Select(fields ...string) *AgentSelect

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

client.Agent.Query().
	Select(agent.FieldSlug).
	Scan(ctx, &v)

func (*AgentQuery) Unique

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

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

func (_q *AgentQuery) Where(ps ...predicate.Agent) *AgentQuery

Where adds a new predicate for the AgentQuery builder.

func (*AgentQuery) WithCreator

func (_q *AgentQuery) WithCreator(opts ...func(*UserQuery)) *AgentQuery

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

func (*AgentQuery) WithRoles

func (_q *AgentQuery) WithRoles(opts ...func(*AgentRoleQuery)) *AgentQuery

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

func (*AgentQuery) WithSkills

func (_q *AgentQuery) WithSkills(opts ...func(*AgentSkillQuery)) *AgentQuery

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

type AgentRole

type AgentRole struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Role holds the value of the "role" field.
	Role agentrole.Role `json:"role,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 AgentRoleQuery when eager-loading is set.
	Edges AgentRoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

AgentRole is the model entity for the AgentRole schema.

func (*AgentRole) ExecContext

func (c *AgentRole) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRole) QueryAgent

func (_m *AgentRole) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the AgentRole entity.

func (*AgentRole) QueryContext

func (c *AgentRole) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRole) QueryUser

func (_m *AgentRole) QueryUser() *UserQuery

QueryUser queries the "user" edge of the AgentRole entity.

func (*AgentRole) String

func (_m *AgentRole) String() string

String implements the fmt.Stringer.

func (*AgentRole) Unwrap

func (_m *AgentRole) Unwrap() *AgentRole

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

func (_m *AgentRole) Update() *AgentRoleUpdateOne

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

func (*AgentRole) Value

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

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

type AgentRoleClient

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

AgentRoleClient is a client for the AgentRole schema.

func NewAgentRoleClient

func NewAgentRoleClient(c config) *AgentRoleClient

NewAgentRoleClient returns a client for the AgentRole from the given config.

func (*AgentRoleClient) Create

func (c *AgentRoleClient) Create() *AgentRoleCreate

Create returns a builder for creating a AgentRole entity.

func (*AgentRoleClient) CreateBulk

func (c *AgentRoleClient) CreateBulk(builders ...*AgentRoleCreate) *AgentRoleCreateBulk

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

func (*AgentRoleClient) Delete

func (c *AgentRoleClient) Delete() *AgentRoleDelete

Delete returns a delete builder for AgentRole.

func (*AgentRoleClient) DeleteOne

func (c *AgentRoleClient) DeleteOne(_m *AgentRole) *AgentRoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgentRoleClient) DeleteOneID

func (c *AgentRoleClient) DeleteOneID(id uuid.UUID) *AgentRoleDeleteOne

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

func (*AgentRoleClient) ExecContext

func (c *AgentRoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleClient) Get

func (c *AgentRoleClient) Get(ctx context.Context, id uuid.UUID) (*AgentRole, error)

Get returns a AgentRole entity by its id.

func (*AgentRoleClient) GetX

func (c *AgentRoleClient) GetX(ctx context.Context, id uuid.UUID) *AgentRole

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

func (*AgentRoleClient) Hooks

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

Hooks returns the client hooks.

func (*AgentRoleClient) Intercept

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

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

func (*AgentRoleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AgentRoleClient) MapCreateBulk

func (c *AgentRoleClient) MapCreateBulk(slice any, setFunc func(*AgentRoleCreate, int)) *AgentRoleCreateBulk

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

func (c *AgentRoleClient) Query() *AgentRoleQuery

Query returns a query builder for AgentRole.

func (*AgentRoleClient) QueryAgent

func (c *AgentRoleClient) QueryAgent(_m *AgentRole) *AgentQuery

QueryAgent queries the agent edge of a AgentRole.

func (*AgentRoleClient) QueryContext

func (c *AgentRoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleClient) QueryUser

func (c *AgentRoleClient) QueryUser(_m *AgentRole) *UserQuery

QueryUser queries the user edge of a AgentRole.

func (*AgentRoleClient) Update

func (c *AgentRoleClient) Update() *AgentRoleUpdate

Update returns an update builder for AgentRole.

func (*AgentRoleClient) UpdateOne

func (c *AgentRoleClient) UpdateOne(_m *AgentRole) *AgentRoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgentRoleClient) UpdateOneID

func (c *AgentRoleClient) UpdateOneID(id uuid.UUID) *AgentRoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentRoleClient) Use

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

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

type AgentRoleCreate

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

AgentRoleCreate is the builder for creating a AgentRole entity.

func (*AgentRoleCreate) Exec

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

Exec executes the query.

func (*AgentRoleCreate) ExecContext

func (c *AgentRoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleCreate) ExecX

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

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

func (*AgentRoleCreate) Mutation

func (_c *AgentRoleCreate) Mutation() *AgentRoleMutation

Mutation returns the AgentRoleMutation object of the builder.

func (*AgentRoleCreate) QueryContext

func (c *AgentRoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleCreate) Save

func (_c *AgentRoleCreate) Save(ctx context.Context) (*AgentRole, error)

Save creates the AgentRole in the database.

func (*AgentRoleCreate) SaveX

func (_c *AgentRoleCreate) SaveX(ctx context.Context) *AgentRole

SaveX calls Save and panics if Save returns an error.

func (*AgentRoleCreate) SetAgent

func (_c *AgentRoleCreate) SetAgent(v *Agent) *AgentRoleCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentRoleCreate) SetAgentID

func (_c *AgentRoleCreate) SetAgentID(v uuid.UUID) *AgentRoleCreate

SetAgentID sets the "agent_id" field.

func (*AgentRoleCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentRoleCreate) SetID

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

SetID sets the "id" field.

func (*AgentRoleCreate) SetNillableCreatedAt

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

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

func (*AgentRoleCreate) SetNillableID

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

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

func (*AgentRoleCreate) SetRole

SetRole sets the "role" field.

func (*AgentRoleCreate) SetUser

func (_c *AgentRoleCreate) SetUser(v *User) *AgentRoleCreate

SetUser sets the "user" edge to the User entity.

func (*AgentRoleCreate) SetUserID

func (_c *AgentRoleCreate) SetUserID(v uuid.UUID) *AgentRoleCreate

SetUserID sets the "user_id" field.

type AgentRoleCreateBulk

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

AgentRoleCreateBulk is the builder for creating many AgentRole entities in bulk.

func (*AgentRoleCreateBulk) Exec

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

Exec executes the query.

func (*AgentRoleCreateBulk) ExecContext

func (c *AgentRoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleCreateBulk) ExecX

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

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

func (*AgentRoleCreateBulk) QueryContext

func (c *AgentRoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleCreateBulk) Save

func (_c *AgentRoleCreateBulk) Save(ctx context.Context) ([]*AgentRole, error)

Save creates the AgentRole entities in the database.

func (*AgentRoleCreateBulk) SaveX

func (_c *AgentRoleCreateBulk) SaveX(ctx context.Context) []*AgentRole

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

type AgentRoleDelete

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

AgentRoleDelete is the builder for deleting a AgentRole entity.

func (*AgentRoleDelete) Exec

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

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

func (*AgentRoleDelete) ExecContext

func (c *AgentRoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleDelete) ExecX

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

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

func (*AgentRoleDelete) QueryContext

func (c *AgentRoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleDelete) Where

Where appends a list predicates to the AgentRoleDelete builder.

type AgentRoleDeleteOne

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

AgentRoleDeleteOne is the builder for deleting a single AgentRole entity.

func (*AgentRoleDeleteOne) Exec

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

Exec executes the deletion query.

func (*AgentRoleDeleteOne) ExecX

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

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

func (*AgentRoleDeleteOne) Where

Where appends a list predicates to the AgentRoleDelete builder.

type AgentRoleEdges

type AgentRoleEdges struct {
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (AgentRoleEdges) AgentOrErr

func (e AgentRoleEdges) AgentOrErr() (*Agent, error)

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

func (AgentRoleEdges) UserOrErr

func (e AgentRoleEdges) UserOrErr() (*User, error)

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

type AgentRoleGroupBy

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

AgentRoleGroupBy is the group-by builder for AgentRole entities.

func (*AgentRoleGroupBy) Aggregate

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

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

func (*AgentRoleGroupBy) Bool

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

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

func (*AgentRoleGroupBy) BoolX

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

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

func (*AgentRoleGroupBy) Bools

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

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

func (*AgentRoleGroupBy) BoolsX

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

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

func (*AgentRoleGroupBy) Float64

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

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

func (*AgentRoleGroupBy) Float64X

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

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

func (*AgentRoleGroupBy) Float64s

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

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

func (*AgentRoleGroupBy) Float64sX

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

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

func (*AgentRoleGroupBy) Int

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

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

func (*AgentRoleGroupBy) IntX

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

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

func (*AgentRoleGroupBy) Ints

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

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

func (*AgentRoleGroupBy) IntsX

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

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

func (*AgentRoleGroupBy) Scan

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

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

func (*AgentRoleGroupBy) ScanX

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

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

func (*AgentRoleGroupBy) String

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

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

func (*AgentRoleGroupBy) StringX

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

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

func (*AgentRoleGroupBy) Strings

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

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

func (*AgentRoleGroupBy) StringsX

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

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

type AgentRoleMutation

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

AgentRoleMutation represents an operation that mutates the AgentRole nodes in the graph.

func (*AgentRoleMutation) AddField

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) AddedEdges

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

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

func (*AgentRoleMutation) AddedField

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

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

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

func (*AgentRoleMutation) AddedIDs

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

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

func (*AgentRoleMutation) AgentCleared

func (m *AgentRoleMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*AgentRoleMutation) AgentID

func (m *AgentRoleMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*AgentRoleMutation) AgentIDs

func (m *AgentRoleMutation) AgentIDs() (ids []uuid.UUID)

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

func (*AgentRoleMutation) ClearAgent

func (m *AgentRoleMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentRoleMutation) ClearEdge

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

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) ClearUser

func (m *AgentRoleMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AgentRoleMutation) ClearedEdges

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

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

func (*AgentRoleMutation) ClearedFields

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

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

func (AgentRoleMutation) Client

func (m AgentRoleMutation) 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 (*AgentRoleMutation) CreatedAt

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

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

func (*AgentRoleMutation) EdgeCleared

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

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

func (*AgentRoleMutation) ExecContext

func (c *AgentRoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleMutation) Field

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

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

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

func (*AgentRoleMutation) Fields

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

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

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) OldAgentID

func (m *AgentRoleMutation) OldAgentID(ctx context.Context) (v uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the AgentRole entity. If the AgentRole 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 (*AgentRoleMutation) OldCreatedAt

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

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

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) OldRole

func (m *AgentRoleMutation) OldRole(ctx context.Context) (v agentrole.Role, err error)

OldRole returns the old "role" field's value of the AgentRole entity. If the AgentRole 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 (*AgentRoleMutation) OldUserID

func (m *AgentRoleMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the AgentRole entity. If the AgentRole 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 (*AgentRoleMutation) Op

func (m *AgentRoleMutation) Op() Op

Op returns the operation name.

func (*AgentRoleMutation) QueryContext

func (c *AgentRoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleMutation) RemovedEdges

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

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

func (*AgentRoleMutation) RemovedIDs

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) ResetAgent

func (m *AgentRoleMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*AgentRoleMutation) ResetAgentID

func (m *AgentRoleMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*AgentRoleMutation) ResetCreatedAt

func (m *AgentRoleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AgentRoleMutation) ResetEdge

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

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) ResetRole

func (m *AgentRoleMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*AgentRoleMutation) ResetUser

func (m *AgentRoleMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AgentRoleMutation) ResetUserID

func (m *AgentRoleMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*AgentRoleMutation) Role

func (m *AgentRoleMutation) Role() (r agentrole.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*AgentRoleMutation) SetAgentID

func (m *AgentRoleMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*AgentRoleMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AgentRoleMutation) SetField

func (m *AgentRoleMutation) 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 (*AgentRoleMutation) SetID

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

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

func (*AgentRoleMutation) SetOp

func (m *AgentRoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentRoleMutation) SetRole

func (m *AgentRoleMutation) SetRole(a agentrole.Role)

SetRole sets the "role" field.

func (*AgentRoleMutation) SetUserID

func (m *AgentRoleMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (AgentRoleMutation) Tx

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

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

func (*AgentRoleMutation) Type

func (m *AgentRoleMutation) Type() string

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

func (*AgentRoleMutation) UserCleared

func (m *AgentRoleMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AgentRoleMutation) UserID

func (m *AgentRoleMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*AgentRoleMutation) UserIDs

func (m *AgentRoleMutation) UserIDs() (ids []uuid.UUID)

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

func (*AgentRoleMutation) Where

func (m *AgentRoleMutation) Where(ps ...predicate.AgentRole)

Where appends a list predicates to the AgentRoleMutation builder.

func (*AgentRoleMutation) WhereP

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

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

type AgentRoleQuery

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

AgentRoleQuery is the builder for querying AgentRole entities.

func (*AgentRoleQuery) Aggregate

func (_q *AgentRoleQuery) Aggregate(fns ...AggregateFunc) *AgentRoleSelect

Aggregate returns a AgentRoleSelect configured with the given aggregations.

func (*AgentRoleQuery) All

func (_q *AgentRoleQuery) All(ctx context.Context) ([]*AgentRole, error)

All executes the query and returns a list of AgentRoles.

func (*AgentRoleQuery) AllX

func (_q *AgentRoleQuery) AllX(ctx context.Context) []*AgentRole

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

func (*AgentRoleQuery) Clone

func (_q *AgentRoleQuery) Clone() *AgentRoleQuery

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

func (*AgentRoleQuery) Count

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

Count returns the count of the given query.

func (*AgentRoleQuery) CountX

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

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

func (*AgentRoleQuery) ExecContext

func (c *AgentRoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleQuery) Exist

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

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

func (*AgentRoleQuery) ExistX

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

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

func (*AgentRoleQuery) First

func (_q *AgentRoleQuery) First(ctx context.Context) (*AgentRole, error)

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

func (*AgentRoleQuery) FirstID

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

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

func (*AgentRoleQuery) FirstIDX

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

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

func (*AgentRoleQuery) FirstX

func (_q *AgentRoleQuery) FirstX(ctx context.Context) *AgentRole

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

func (*AgentRoleQuery) GroupBy

func (_q *AgentRoleQuery) GroupBy(field string, fields ...string) *AgentRoleGroupBy

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 {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AgentRole.Query().
	GroupBy(agentrole.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AgentRoleQuery) IDs

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

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

func (*AgentRoleQuery) IDsX

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

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

func (*AgentRoleQuery) Limit

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

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

func (*AgentRoleQuery) Offset

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

Offset to start from.

func (*AgentRoleQuery) Only

func (_q *AgentRoleQuery) Only(ctx context.Context) (*AgentRole, error)

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

func (*AgentRoleQuery) OnlyID

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

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

func (*AgentRoleQuery) OnlyIDX

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

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

func (*AgentRoleQuery) OnlyX

func (_q *AgentRoleQuery) OnlyX(ctx context.Context) *AgentRole

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

func (*AgentRoleQuery) Order

Order specifies how the records should be ordered.

func (*AgentRoleQuery) QueryAgent

func (_q *AgentRoleQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*AgentRoleQuery) QueryContext

func (c *AgentRoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleQuery) QueryUser

func (_q *AgentRoleQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AgentRoleQuery) Select

func (_q *AgentRoleQuery) Select(fields ...string) *AgentRoleSelect

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 {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
}

client.AgentRole.Query().
	Select(agentrole.FieldAgentID).
	Scan(ctx, &v)

func (*AgentRoleQuery) Unique

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

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

Where adds a new predicate for the AgentRoleQuery builder.

func (*AgentRoleQuery) WithAgent

func (_q *AgentRoleQuery) WithAgent(opts ...func(*AgentQuery)) *AgentRoleQuery

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

func (*AgentRoleQuery) WithUser

func (_q *AgentRoleQuery) WithUser(opts ...func(*UserQuery)) *AgentRoleQuery

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

type AgentRoleSelect

type AgentRoleSelect struct {
	*AgentRoleQuery
	// contains filtered or unexported fields
}

AgentRoleSelect is the builder for selecting fields of AgentRole entities.

func (*AgentRoleSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AgentRoleSelect) Bool

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

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

func (*AgentRoleSelect) BoolX

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

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

func (*AgentRoleSelect) Bools

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

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

func (*AgentRoleSelect) BoolsX

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

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

func (AgentRoleSelect) ExecContext

func (c AgentRoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleSelect) Float64

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

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

func (*AgentRoleSelect) Float64X

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

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

func (*AgentRoleSelect) Float64s

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

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

func (*AgentRoleSelect) Float64sX

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

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

func (*AgentRoleSelect) Int

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

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

func (*AgentRoleSelect) IntX

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

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

func (*AgentRoleSelect) Ints

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

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

func (*AgentRoleSelect) IntsX

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

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

func (AgentRoleSelect) QueryContext

func (c AgentRoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleSelect) Scan

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

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

func (*AgentRoleSelect) ScanX

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

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

func (*AgentRoleSelect) String

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

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

func (*AgentRoleSelect) StringX

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

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

func (*AgentRoleSelect) Strings

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

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

func (*AgentRoleSelect) StringsX

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

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

type AgentRoleUpdate

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

AgentRoleUpdate is the builder for updating AgentRole entities.

func (*AgentRoleUpdate) ClearAgent

func (_u *AgentRoleUpdate) ClearAgent() *AgentRoleUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentRoleUpdate) ClearUser

func (_u *AgentRoleUpdate) ClearUser() *AgentRoleUpdate

ClearUser clears the "user" edge to the User entity.

func (*AgentRoleUpdate) Exec

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

Exec executes the query.

func (*AgentRoleUpdate) ExecContext

func (c *AgentRoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleUpdate) ExecX

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

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

func (*AgentRoleUpdate) Mutation

func (_u *AgentRoleUpdate) Mutation() *AgentRoleMutation

Mutation returns the AgentRoleMutation object of the builder.

func (*AgentRoleUpdate) QueryContext

func (c *AgentRoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleUpdate) Save

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

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

func (*AgentRoleUpdate) SaveX

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

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

func (*AgentRoleUpdate) SetAgent

func (_u *AgentRoleUpdate) SetAgent(v *Agent) *AgentRoleUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentRoleUpdate) SetAgentID

func (_u *AgentRoleUpdate) SetAgentID(v uuid.UUID) *AgentRoleUpdate

SetAgentID sets the "agent_id" field.

func (*AgentRoleUpdate) SetNillableAgentID

func (_u *AgentRoleUpdate) SetNillableAgentID(v *uuid.UUID) *AgentRoleUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*AgentRoleUpdate) SetNillableRole

func (_u *AgentRoleUpdate) SetNillableRole(v *agentrole.Role) *AgentRoleUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*AgentRoleUpdate) SetNillableUserID

func (_u *AgentRoleUpdate) SetNillableUserID(v *uuid.UUID) *AgentRoleUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*AgentRoleUpdate) SetRole

SetRole sets the "role" field.

func (*AgentRoleUpdate) SetUser

func (_u *AgentRoleUpdate) SetUser(v *User) *AgentRoleUpdate

SetUser sets the "user" edge to the User entity.

func (*AgentRoleUpdate) SetUserID

func (_u *AgentRoleUpdate) SetUserID(v uuid.UUID) *AgentRoleUpdate

SetUserID sets the "user_id" field.

func (*AgentRoleUpdate) Where

Where appends a list predicates to the AgentRoleUpdate builder.

type AgentRoleUpdateOne

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

AgentRoleUpdateOne is the builder for updating a single AgentRole entity.

func (*AgentRoleUpdateOne) ClearAgent

func (_u *AgentRoleUpdateOne) ClearAgent() *AgentRoleUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentRoleUpdateOne) ClearUser

func (_u *AgentRoleUpdateOne) ClearUser() *AgentRoleUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AgentRoleUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AgentRoleUpdateOne) ExecContext

func (c *AgentRoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentRoleUpdateOne) ExecX

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

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

func (*AgentRoleUpdateOne) Mutation

func (_u *AgentRoleUpdateOne) Mutation() *AgentRoleMutation

Mutation returns the AgentRoleMutation object of the builder.

func (*AgentRoleUpdateOne) QueryContext

func (c *AgentRoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentRoleUpdateOne) Save

func (_u *AgentRoleUpdateOne) Save(ctx context.Context) (*AgentRole, error)

Save executes the query and returns the updated AgentRole entity.

func (*AgentRoleUpdateOne) SaveX

func (_u *AgentRoleUpdateOne) SaveX(ctx context.Context) *AgentRole

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

func (*AgentRoleUpdateOne) Select

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

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

func (*AgentRoleUpdateOne) SetAgent

func (_u *AgentRoleUpdateOne) SetAgent(v *Agent) *AgentRoleUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentRoleUpdateOne) SetAgentID

func (_u *AgentRoleUpdateOne) SetAgentID(v uuid.UUID) *AgentRoleUpdateOne

SetAgentID sets the "agent_id" field.

func (*AgentRoleUpdateOne) SetNillableAgentID

func (_u *AgentRoleUpdateOne) SetNillableAgentID(v *uuid.UUID) *AgentRoleUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*AgentRoleUpdateOne) SetNillableRole

func (_u *AgentRoleUpdateOne) SetNillableRole(v *agentrole.Role) *AgentRoleUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*AgentRoleUpdateOne) SetNillableUserID

func (_u *AgentRoleUpdateOne) SetNillableUserID(v *uuid.UUID) *AgentRoleUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*AgentRoleUpdateOne) SetRole

SetRole sets the "role" field.

func (*AgentRoleUpdateOne) SetUser

func (_u *AgentRoleUpdateOne) SetUser(v *User) *AgentRoleUpdateOne

SetUser sets the "user" edge to the User entity.

func (*AgentRoleUpdateOne) SetUserID

func (_u *AgentRoleUpdateOne) SetUserID(v uuid.UUID) *AgentRoleUpdateOne

SetUserID sets the "user_id" field.

func (*AgentRoleUpdateOne) Where

Where appends a list predicates to the AgentRoleUpdate builder.

type AgentRoles

type AgentRoles []*AgentRole

AgentRoles is a parsable slice of AgentRole.

type AgentSelect

type AgentSelect struct {
	*AgentQuery
	// contains filtered or unexported fields
}

AgentSelect is the builder for selecting fields of Agent entities.

func (*AgentSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AgentSelect) Bool

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

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

func (*AgentSelect) BoolX

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

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

func (*AgentSelect) Bools

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

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

func (*AgentSelect) BoolsX

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

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

func (AgentSelect) ExecContext

func (c AgentSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSelect) Float64

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

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

func (*AgentSelect) Float64X

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

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

func (*AgentSelect) Float64s

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

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

func (*AgentSelect) Float64sX

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

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

func (*AgentSelect) Int

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

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

func (*AgentSelect) IntX

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

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

func (*AgentSelect) Ints

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

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

func (*AgentSelect) IntsX

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

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

func (AgentSelect) QueryContext

func (c AgentSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSelect) Scan

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

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

func (*AgentSelect) ScanX

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

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

func (*AgentSelect) String

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

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

func (*AgentSelect) StringX

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

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

func (*AgentSelect) Strings

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

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

func (*AgentSelect) StringsX

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

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

type AgentSkill

type AgentSkill struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	// Skill holds the value of the "skill" field.
	Skill string `json:"skill,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AgentSkillQuery when eager-loading is set.
	Edges AgentSkillEdges `json:"edges"`
	// contains filtered or unexported fields
}

AgentSkill is the model entity for the AgentSkill schema.

func (*AgentSkill) ExecContext

func (c *AgentSkill) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkill) QueryAgent

func (_m *AgentSkill) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the AgentSkill entity.

func (*AgentSkill) QueryContext

func (c *AgentSkill) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkill) String

func (_m *AgentSkill) String() string

String implements the fmt.Stringer.

func (*AgentSkill) Unwrap

func (_m *AgentSkill) Unwrap() *AgentSkill

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

func (_m *AgentSkill) Update() *AgentSkillUpdateOne

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

func (*AgentSkill) Value

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

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

type AgentSkillClient

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

AgentSkillClient is a client for the AgentSkill schema.

func NewAgentSkillClient

func NewAgentSkillClient(c config) *AgentSkillClient

NewAgentSkillClient returns a client for the AgentSkill from the given config.

func (*AgentSkillClient) Create

func (c *AgentSkillClient) Create() *AgentSkillCreate

Create returns a builder for creating a AgentSkill entity.

func (*AgentSkillClient) CreateBulk

func (c *AgentSkillClient) CreateBulk(builders ...*AgentSkillCreate) *AgentSkillCreateBulk

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

func (*AgentSkillClient) Delete

func (c *AgentSkillClient) Delete() *AgentSkillDelete

Delete returns a delete builder for AgentSkill.

func (*AgentSkillClient) DeleteOne

func (c *AgentSkillClient) DeleteOne(_m *AgentSkill) *AgentSkillDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgentSkillClient) DeleteOneID

func (c *AgentSkillClient) DeleteOneID(id uuid.UUID) *AgentSkillDeleteOne

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

func (*AgentSkillClient) ExecContext

func (c *AgentSkillClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillClient) Get

Get returns a AgentSkill entity by its id.

func (*AgentSkillClient) GetX

func (c *AgentSkillClient) GetX(ctx context.Context, id uuid.UUID) *AgentSkill

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

func (*AgentSkillClient) Hooks

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

Hooks returns the client hooks.

func (*AgentSkillClient) Intercept

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

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

func (*AgentSkillClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AgentSkillClient) MapCreateBulk

func (c *AgentSkillClient) MapCreateBulk(slice any, setFunc func(*AgentSkillCreate, int)) *AgentSkillCreateBulk

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

func (c *AgentSkillClient) Query() *AgentSkillQuery

Query returns a query builder for AgentSkill.

func (*AgentSkillClient) QueryAgent

func (c *AgentSkillClient) QueryAgent(_m *AgentSkill) *AgentQuery

QueryAgent queries the agent edge of a AgentSkill.

func (*AgentSkillClient) QueryContext

func (c *AgentSkillClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillClient) Update

func (c *AgentSkillClient) Update() *AgentSkillUpdate

Update returns an update builder for AgentSkill.

func (*AgentSkillClient) UpdateOne

func (c *AgentSkillClient) UpdateOne(_m *AgentSkill) *AgentSkillUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgentSkillClient) UpdateOneID

func (c *AgentSkillClient) UpdateOneID(id uuid.UUID) *AgentSkillUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentSkillClient) Use

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

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

type AgentSkillCreate

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

AgentSkillCreate is the builder for creating a AgentSkill entity.

func (*AgentSkillCreate) Exec

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

Exec executes the query.

func (*AgentSkillCreate) ExecContext

func (c *AgentSkillCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillCreate) ExecX

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

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

func (*AgentSkillCreate) Mutation

func (_c *AgentSkillCreate) Mutation() *AgentSkillMutation

Mutation returns the AgentSkillMutation object of the builder.

func (*AgentSkillCreate) QueryContext

func (c *AgentSkillCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillCreate) Save

func (_c *AgentSkillCreate) Save(ctx context.Context) (*AgentSkill, error)

Save creates the AgentSkill in the database.

func (*AgentSkillCreate) SaveX

func (_c *AgentSkillCreate) SaveX(ctx context.Context) *AgentSkill

SaveX calls Save and panics if Save returns an error.

func (*AgentSkillCreate) SetAgent

func (_c *AgentSkillCreate) SetAgent(v *Agent) *AgentSkillCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentSkillCreate) SetAgentID

func (_c *AgentSkillCreate) SetAgentID(v uuid.UUID) *AgentSkillCreate

SetAgentID sets the "agent_id" field.

func (*AgentSkillCreate) SetID

SetID sets the "id" field.

func (*AgentSkillCreate) SetNillableID

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

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

func (*AgentSkillCreate) SetSkill

func (_c *AgentSkillCreate) SetSkill(v string) *AgentSkillCreate

SetSkill sets the "skill" field.

type AgentSkillCreateBulk

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

AgentSkillCreateBulk is the builder for creating many AgentSkill entities in bulk.

func (*AgentSkillCreateBulk) Exec

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

Exec executes the query.

func (*AgentSkillCreateBulk) ExecContext

func (c *AgentSkillCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillCreateBulk) ExecX

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

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

func (*AgentSkillCreateBulk) QueryContext

func (c *AgentSkillCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillCreateBulk) Save

func (_c *AgentSkillCreateBulk) Save(ctx context.Context) ([]*AgentSkill, error)

Save creates the AgentSkill entities in the database.

func (*AgentSkillCreateBulk) SaveX

func (_c *AgentSkillCreateBulk) SaveX(ctx context.Context) []*AgentSkill

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

type AgentSkillDelete

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

AgentSkillDelete is the builder for deleting a AgentSkill entity.

func (*AgentSkillDelete) Exec

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

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

func (*AgentSkillDelete) ExecContext

func (c *AgentSkillDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillDelete) ExecX

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

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

func (*AgentSkillDelete) QueryContext

func (c *AgentSkillDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillDelete) Where

Where appends a list predicates to the AgentSkillDelete builder.

type AgentSkillDeleteOne

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

AgentSkillDeleteOne is the builder for deleting a single AgentSkill entity.

func (*AgentSkillDeleteOne) Exec

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

Exec executes the deletion query.

func (*AgentSkillDeleteOne) ExecX

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

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

func (*AgentSkillDeleteOne) Where

Where appends a list predicates to the AgentSkillDelete builder.

type AgentSkillEdges

type AgentSkillEdges struct {
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// contains filtered or unexported fields
}

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

func (AgentSkillEdges) AgentOrErr

func (e AgentSkillEdges) AgentOrErr() (*Agent, error)

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

type AgentSkillGroupBy

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

AgentSkillGroupBy is the group-by builder for AgentSkill entities.

func (*AgentSkillGroupBy) Aggregate

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

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

func (*AgentSkillGroupBy) Bool

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

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

func (*AgentSkillGroupBy) BoolX

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

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

func (*AgentSkillGroupBy) Bools

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

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

func (*AgentSkillGroupBy) BoolsX

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

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

func (*AgentSkillGroupBy) Float64

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

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

func (*AgentSkillGroupBy) Float64X

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

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

func (*AgentSkillGroupBy) Float64s

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

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

func (*AgentSkillGroupBy) Float64sX

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

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

func (*AgentSkillGroupBy) Int

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

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

func (*AgentSkillGroupBy) IntX

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

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

func (*AgentSkillGroupBy) Ints

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

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

func (*AgentSkillGroupBy) IntsX

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

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

func (*AgentSkillGroupBy) Scan

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

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

func (*AgentSkillGroupBy) ScanX

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

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

func (*AgentSkillGroupBy) String

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

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

func (*AgentSkillGroupBy) StringX

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

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

func (*AgentSkillGroupBy) Strings

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

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

func (*AgentSkillGroupBy) StringsX

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

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

type AgentSkillMutation

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

AgentSkillMutation represents an operation that mutates the AgentSkill nodes in the graph.

func (*AgentSkillMutation) AddField

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) AddedEdges

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

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

func (*AgentSkillMutation) AddedField

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

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

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

func (*AgentSkillMutation) AddedIDs

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

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

func (*AgentSkillMutation) AgentCleared

func (m *AgentSkillMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*AgentSkillMutation) AgentID

func (m *AgentSkillMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*AgentSkillMutation) AgentIDs

func (m *AgentSkillMutation) AgentIDs() (ids []uuid.UUID)

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

func (*AgentSkillMutation) ClearAgent

func (m *AgentSkillMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentSkillMutation) ClearEdge

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

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) ClearedEdges

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

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

func (*AgentSkillMutation) ClearedFields

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

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

func (AgentSkillMutation) Client

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

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

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

func (*AgentSkillMutation) ExecContext

func (c *AgentSkillMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillMutation) Field

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

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

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

func (*AgentSkillMutation) Fields

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

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

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) OldAgentID

func (m *AgentSkillMutation) OldAgentID(ctx context.Context) (v uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the AgentSkill entity. If the AgentSkill 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 (*AgentSkillMutation) OldField

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) OldSkill

func (m *AgentSkillMutation) OldSkill(ctx context.Context) (v string, err error)

OldSkill returns the old "skill" field's value of the AgentSkill entity. If the AgentSkill 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 (*AgentSkillMutation) Op

func (m *AgentSkillMutation) Op() Op

Op returns the operation name.

func (*AgentSkillMutation) QueryContext

func (c *AgentSkillMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillMutation) RemovedEdges

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

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

func (*AgentSkillMutation) RemovedIDs

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) ResetAgent

func (m *AgentSkillMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*AgentSkillMutation) ResetAgentID

func (m *AgentSkillMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*AgentSkillMutation) ResetEdge

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

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) ResetSkill

func (m *AgentSkillMutation) ResetSkill()

ResetSkill resets all changes to the "skill" field.

func (*AgentSkillMutation) SetAgentID

func (m *AgentSkillMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*AgentSkillMutation) SetField

func (m *AgentSkillMutation) 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 (*AgentSkillMutation) SetID

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

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

func (*AgentSkillMutation) SetOp

func (m *AgentSkillMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentSkillMutation) SetSkill

func (m *AgentSkillMutation) SetSkill(s string)

SetSkill sets the "skill" field.

func (*AgentSkillMutation) Skill

func (m *AgentSkillMutation) Skill() (r string, exists bool)

Skill returns the value of the "skill" field in the mutation.

func (AgentSkillMutation) Tx

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

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

func (*AgentSkillMutation) Type

func (m *AgentSkillMutation) Type() string

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

func (*AgentSkillMutation) Where

func (m *AgentSkillMutation) Where(ps ...predicate.AgentSkill)

Where appends a list predicates to the AgentSkillMutation builder.

func (*AgentSkillMutation) WhereP

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

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

type AgentSkillQuery

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

AgentSkillQuery is the builder for querying AgentSkill entities.

func (*AgentSkillQuery) Aggregate

func (_q *AgentSkillQuery) Aggregate(fns ...AggregateFunc) *AgentSkillSelect

Aggregate returns a AgentSkillSelect configured with the given aggregations.

func (*AgentSkillQuery) All

func (_q *AgentSkillQuery) All(ctx context.Context) ([]*AgentSkill, error)

All executes the query and returns a list of AgentSkills.

func (*AgentSkillQuery) AllX

func (_q *AgentSkillQuery) AllX(ctx context.Context) []*AgentSkill

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

func (*AgentSkillQuery) Clone

func (_q *AgentSkillQuery) Clone() *AgentSkillQuery

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

func (*AgentSkillQuery) Count

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

Count returns the count of the given query.

func (*AgentSkillQuery) CountX

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

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

func (*AgentSkillQuery) ExecContext

func (c *AgentSkillQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillQuery) Exist

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

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

func (*AgentSkillQuery) ExistX

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

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

func (*AgentSkillQuery) First

func (_q *AgentSkillQuery) First(ctx context.Context) (*AgentSkill, error)

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

func (*AgentSkillQuery) FirstID

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

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

func (*AgentSkillQuery) FirstIDX

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

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

func (*AgentSkillQuery) FirstX

func (_q *AgentSkillQuery) FirstX(ctx context.Context) *AgentSkill

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

func (*AgentSkillQuery) GroupBy

func (_q *AgentSkillQuery) GroupBy(field string, fields ...string) *AgentSkillGroupBy

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 {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AgentSkill.Query().
	GroupBy(agentskill.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AgentSkillQuery) IDs

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

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

func (*AgentSkillQuery) IDsX

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

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

func (*AgentSkillQuery) Limit

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

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

func (*AgentSkillQuery) Offset

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

Offset to start from.

func (*AgentSkillQuery) Only

func (_q *AgentSkillQuery) Only(ctx context.Context) (*AgentSkill, error)

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

func (*AgentSkillQuery) OnlyID

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

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

func (*AgentSkillQuery) OnlyIDX

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

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

func (*AgentSkillQuery) OnlyX

func (_q *AgentSkillQuery) OnlyX(ctx context.Context) *AgentSkill

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

func (*AgentSkillQuery) Order

Order specifies how the records should be ordered.

func (*AgentSkillQuery) QueryAgent

func (_q *AgentSkillQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*AgentSkillQuery) QueryContext

func (c *AgentSkillQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillQuery) Select

func (_q *AgentSkillQuery) Select(fields ...string) *AgentSkillSelect

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 {
	AgentID uuid.UUID `json:"agent_id,omitempty"`
}

client.AgentSkill.Query().
	Select(agentskill.FieldAgentID).
	Scan(ctx, &v)

func (*AgentSkillQuery) Unique

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

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

Where adds a new predicate for the AgentSkillQuery builder.

func (*AgentSkillQuery) WithAgent

func (_q *AgentSkillQuery) WithAgent(opts ...func(*AgentQuery)) *AgentSkillQuery

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

type AgentSkillSelect

type AgentSkillSelect struct {
	*AgentSkillQuery
	// contains filtered or unexported fields
}

AgentSkillSelect is the builder for selecting fields of AgentSkill entities.

func (*AgentSkillSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AgentSkillSelect) Bool

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

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

func (*AgentSkillSelect) BoolX

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

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

func (*AgentSkillSelect) Bools

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

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

func (*AgentSkillSelect) BoolsX

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

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

func (AgentSkillSelect) ExecContext

func (c AgentSkillSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillSelect) Float64

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

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

func (*AgentSkillSelect) Float64X

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

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

func (*AgentSkillSelect) Float64s

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

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

func (*AgentSkillSelect) Float64sX

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

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

func (*AgentSkillSelect) Int

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

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

func (*AgentSkillSelect) IntX

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

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

func (*AgentSkillSelect) Ints

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

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

func (*AgentSkillSelect) IntsX

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

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

func (AgentSkillSelect) QueryContext

func (c AgentSkillSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillSelect) Scan

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

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

func (*AgentSkillSelect) ScanX

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

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

func (*AgentSkillSelect) String

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

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

func (*AgentSkillSelect) StringX

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

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

func (*AgentSkillSelect) Strings

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

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

func (*AgentSkillSelect) StringsX

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

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

type AgentSkillUpdate

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

AgentSkillUpdate is the builder for updating AgentSkill entities.

func (*AgentSkillUpdate) ClearAgent

func (_u *AgentSkillUpdate) ClearAgent() *AgentSkillUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentSkillUpdate) Exec

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

Exec executes the query.

func (*AgentSkillUpdate) ExecContext

func (c *AgentSkillUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillUpdate) ExecX

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

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

func (*AgentSkillUpdate) Mutation

func (_u *AgentSkillUpdate) Mutation() *AgentSkillMutation

Mutation returns the AgentSkillMutation object of the builder.

func (*AgentSkillUpdate) QueryContext

func (c *AgentSkillUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillUpdate) Save

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

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

func (*AgentSkillUpdate) SaveX

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

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

func (*AgentSkillUpdate) SetAgent

func (_u *AgentSkillUpdate) SetAgent(v *Agent) *AgentSkillUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentSkillUpdate) SetAgentID

func (_u *AgentSkillUpdate) SetAgentID(v uuid.UUID) *AgentSkillUpdate

SetAgentID sets the "agent_id" field.

func (*AgentSkillUpdate) SetNillableAgentID

func (_u *AgentSkillUpdate) SetNillableAgentID(v *uuid.UUID) *AgentSkillUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*AgentSkillUpdate) SetNillableSkill

func (_u *AgentSkillUpdate) SetNillableSkill(v *string) *AgentSkillUpdate

SetNillableSkill sets the "skill" field if the given value is not nil.

func (*AgentSkillUpdate) SetSkill

func (_u *AgentSkillUpdate) SetSkill(v string) *AgentSkillUpdate

SetSkill sets the "skill" field.

func (*AgentSkillUpdate) Where

Where appends a list predicates to the AgentSkillUpdate builder.

type AgentSkillUpdateOne

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

AgentSkillUpdateOne is the builder for updating a single AgentSkill entity.

func (*AgentSkillUpdateOne) ClearAgent

func (_u *AgentSkillUpdateOne) ClearAgent() *AgentSkillUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*AgentSkillUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AgentSkillUpdateOne) ExecContext

func (c *AgentSkillUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentSkillUpdateOne) ExecX

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

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

func (*AgentSkillUpdateOne) Mutation

func (_u *AgentSkillUpdateOne) Mutation() *AgentSkillMutation

Mutation returns the AgentSkillMutation object of the builder.

func (*AgentSkillUpdateOne) QueryContext

func (c *AgentSkillUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentSkillUpdateOne) Save

Save executes the query and returns the updated AgentSkill entity.

func (*AgentSkillUpdateOne) SaveX

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

func (*AgentSkillUpdateOne) Select

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

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

func (*AgentSkillUpdateOne) SetAgent

func (_u *AgentSkillUpdateOne) SetAgent(v *Agent) *AgentSkillUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*AgentSkillUpdateOne) SetAgentID

func (_u *AgentSkillUpdateOne) SetAgentID(v uuid.UUID) *AgentSkillUpdateOne

SetAgentID sets the "agent_id" field.

func (*AgentSkillUpdateOne) SetNillableAgentID

func (_u *AgentSkillUpdateOne) SetNillableAgentID(v *uuid.UUID) *AgentSkillUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*AgentSkillUpdateOne) SetNillableSkill

func (_u *AgentSkillUpdateOne) SetNillableSkill(v *string) *AgentSkillUpdateOne

SetNillableSkill sets the "skill" field if the given value is not nil.

func (*AgentSkillUpdateOne) SetSkill

SetSkill sets the "skill" field.

func (*AgentSkillUpdateOne) Where

Where appends a list predicates to the AgentSkillUpdate builder.

type AgentSkills

type AgentSkills []*AgentSkill

AgentSkills is a parsable slice of AgentSkill.

type AgentUpdate

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

AgentUpdate is the builder for updating Agent entities.

func (*AgentUpdate) AddRoleIDs

func (_u *AgentUpdate) AddRoleIDs(ids ...uuid.UUID) *AgentUpdate

AddRoleIDs adds the "roles" edge to the AgentRole entity by IDs.

func (*AgentUpdate) AddRoles

func (_u *AgentUpdate) AddRoles(v ...*AgentRole) *AgentUpdate

AddRoles adds the "roles" edges to the AgentRole entity.

func (*AgentUpdate) AddSkillIDs

func (_u *AgentUpdate) AddSkillIDs(ids ...uuid.UUID) *AgentUpdate

AddSkillIDs adds the "skills" edge to the AgentSkill entity by IDs.

func (*AgentUpdate) AddSkills

func (_u *AgentUpdate) AddSkills(v ...*AgentSkill) *AgentUpdate

AddSkills adds the "skills" edges to the AgentSkill entity.

func (*AgentUpdate) ClearCreator

func (_u *AgentUpdate) ClearCreator() *AgentUpdate

ClearCreator clears the "creator" edge to the User entity.

func (*AgentUpdate) ClearDescription

func (_u *AgentUpdate) ClearDescription() *AgentUpdate

ClearDescription clears the value of the "description" field.

func (*AgentUpdate) ClearModel

func (_u *AgentUpdate) ClearModel() *AgentUpdate

ClearModel clears the value of the "model" field.

func (*AgentUpdate) ClearPersona

func (_u *AgentUpdate) ClearPersona() *AgentUpdate

ClearPersona clears the value of the "persona" field.

func (*AgentUpdate) ClearProvider

func (_u *AgentUpdate) ClearProvider() *AgentUpdate

ClearProvider clears the value of the "provider" field.

func (*AgentUpdate) ClearRoles

func (_u *AgentUpdate) ClearRoles() *AgentUpdate

ClearRoles clears all "roles" edges to the AgentRole entity.

func (*AgentUpdate) ClearSkills

func (_u *AgentUpdate) ClearSkills() *AgentUpdate

ClearSkills clears all "skills" edges to the AgentSkill entity.

func (*AgentUpdate) Exec

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

Exec executes the query.

func (*AgentUpdate) ExecContext

func (c *AgentUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentUpdate) ExecX

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

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

func (*AgentUpdate) Mutation

func (_u *AgentUpdate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdate) QueryContext

func (c *AgentUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentUpdate) RemoveRoleIDs

func (_u *AgentUpdate) RemoveRoleIDs(ids ...uuid.UUID) *AgentUpdate

RemoveRoleIDs removes the "roles" edge to AgentRole entities by IDs.

func (*AgentUpdate) RemoveRoles

func (_u *AgentUpdate) RemoveRoles(v ...*AgentRole) *AgentUpdate

RemoveRoles removes "roles" edges to AgentRole entities.

func (*AgentUpdate) RemoveSkillIDs

func (_u *AgentUpdate) RemoveSkillIDs(ids ...uuid.UUID) *AgentUpdate

RemoveSkillIDs removes the "skills" edge to AgentSkill entities by IDs.

func (*AgentUpdate) RemoveSkills

func (_u *AgentUpdate) RemoveSkills(v ...*AgentSkill) *AgentUpdate

RemoveSkills removes "skills" edges to AgentSkill entities.

func (*AgentUpdate) Save

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

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

func (*AgentUpdate) SaveX

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

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

func (*AgentUpdate) SetCreatedBy

func (_u *AgentUpdate) SetCreatedBy(v uuid.UUID) *AgentUpdate

SetCreatedBy sets the "created_by" field.

func (*AgentUpdate) SetCreator

func (_u *AgentUpdate) SetCreator(v *User) *AgentUpdate

SetCreator sets the "creator" edge to the User entity.

func (*AgentUpdate) SetCreatorID

func (_u *AgentUpdate) SetCreatorID(id uuid.UUID) *AgentUpdate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*AgentUpdate) SetDescription

func (_u *AgentUpdate) SetDescription(v string) *AgentUpdate

SetDescription sets the "description" field.

func (*AgentUpdate) SetFeatured

func (_u *AgentUpdate) SetFeatured(v bool) *AgentUpdate

SetFeatured sets the "featured" field.

func (*AgentUpdate) SetModel

func (_u *AgentUpdate) SetModel(v string) *AgentUpdate

SetModel sets the "model" field.

func (*AgentUpdate) SetName

func (_u *AgentUpdate) SetName(v string) *AgentUpdate

SetName sets the "name" field.

func (*AgentUpdate) SetNillableCreatedBy

func (_u *AgentUpdate) SetNillableCreatedBy(v *uuid.UUID) *AgentUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*AgentUpdate) SetNillableDescription

func (_u *AgentUpdate) SetNillableDescription(v *string) *AgentUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentUpdate) SetNillableFeatured

func (_u *AgentUpdate) SetNillableFeatured(v *bool) *AgentUpdate

SetNillableFeatured sets the "featured" field if the given value is not nil.

func (*AgentUpdate) SetNillableModel

func (_u *AgentUpdate) SetNillableModel(v *string) *AgentUpdate

SetNillableModel sets the "model" field if the given value is not nil.

func (*AgentUpdate) SetNillableName

func (_u *AgentUpdate) SetNillableName(v *string) *AgentUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*AgentUpdate) SetNillablePersona

func (_u *AgentUpdate) SetNillablePersona(v *string) *AgentUpdate

SetNillablePersona sets the "persona" field if the given value is not nil.

func (*AgentUpdate) SetNillableProvider

func (_u *AgentUpdate) SetNillableProvider(v *string) *AgentUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*AgentUpdate) SetNillableSlug

func (_u *AgentUpdate) SetNillableSlug(v *string) *AgentUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*AgentUpdate) SetNillableVisibility

func (_u *AgentUpdate) SetNillableVisibility(v *agent.Visibility) *AgentUpdate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*AgentUpdate) SetPersona

func (_u *AgentUpdate) SetPersona(v string) *AgentUpdate

SetPersona sets the "persona" field.

func (*AgentUpdate) SetProvider

func (_u *AgentUpdate) SetProvider(v string) *AgentUpdate

SetProvider sets the "provider" field.

func (*AgentUpdate) SetSlug

func (_u *AgentUpdate) SetSlug(v string) *AgentUpdate

SetSlug sets the "slug" field.

func (*AgentUpdate) SetUpdatedAt

func (_u *AgentUpdate) SetUpdatedAt(v time.Time) *AgentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AgentUpdate) SetVisibility

func (_u *AgentUpdate) SetVisibility(v agent.Visibility) *AgentUpdate

SetVisibility sets the "visibility" field.

func (*AgentUpdate) Where

func (_u *AgentUpdate) Where(ps ...predicate.Agent) *AgentUpdate

Where appends a list predicates to the AgentUpdate builder.

type AgentUpdateOne

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

AgentUpdateOne is the builder for updating a single Agent entity.

func (*AgentUpdateOne) AddRoleIDs

func (_u *AgentUpdateOne) AddRoleIDs(ids ...uuid.UUID) *AgentUpdateOne

AddRoleIDs adds the "roles" edge to the AgentRole entity by IDs.

func (*AgentUpdateOne) AddRoles

func (_u *AgentUpdateOne) AddRoles(v ...*AgentRole) *AgentUpdateOne

AddRoles adds the "roles" edges to the AgentRole entity.

func (*AgentUpdateOne) AddSkillIDs

func (_u *AgentUpdateOne) AddSkillIDs(ids ...uuid.UUID) *AgentUpdateOne

AddSkillIDs adds the "skills" edge to the AgentSkill entity by IDs.

func (*AgentUpdateOne) AddSkills

func (_u *AgentUpdateOne) AddSkills(v ...*AgentSkill) *AgentUpdateOne

AddSkills adds the "skills" edges to the AgentSkill entity.

func (*AgentUpdateOne) ClearCreator

func (_u *AgentUpdateOne) ClearCreator() *AgentUpdateOne

ClearCreator clears the "creator" edge to the User entity.

func (*AgentUpdateOne) ClearDescription

func (_u *AgentUpdateOne) ClearDescription() *AgentUpdateOne

ClearDescription clears the value of the "description" field.

func (*AgentUpdateOne) ClearModel

func (_u *AgentUpdateOne) ClearModel() *AgentUpdateOne

ClearModel clears the value of the "model" field.

func (*AgentUpdateOne) ClearPersona

func (_u *AgentUpdateOne) ClearPersona() *AgentUpdateOne

ClearPersona clears the value of the "persona" field.

func (*AgentUpdateOne) ClearProvider

func (_u *AgentUpdateOne) ClearProvider() *AgentUpdateOne

ClearProvider clears the value of the "provider" field.

func (*AgentUpdateOne) ClearRoles

func (_u *AgentUpdateOne) ClearRoles() *AgentUpdateOne

ClearRoles clears all "roles" edges to the AgentRole entity.

func (*AgentUpdateOne) ClearSkills

func (_u *AgentUpdateOne) ClearSkills() *AgentUpdateOne

ClearSkills clears all "skills" edges to the AgentSkill entity.

func (*AgentUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AgentUpdateOne) ExecContext

func (c *AgentUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AgentUpdateOne) ExecX

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

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

func (*AgentUpdateOne) Mutation

func (_u *AgentUpdateOne) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdateOne) QueryContext

func (c *AgentUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AgentUpdateOne) RemoveRoleIDs

func (_u *AgentUpdateOne) RemoveRoleIDs(ids ...uuid.UUID) *AgentUpdateOne

RemoveRoleIDs removes the "roles" edge to AgentRole entities by IDs.

func (*AgentUpdateOne) RemoveRoles

func (_u *AgentUpdateOne) RemoveRoles(v ...*AgentRole) *AgentUpdateOne

RemoveRoles removes "roles" edges to AgentRole entities.

func (*AgentUpdateOne) RemoveSkillIDs

func (_u *AgentUpdateOne) RemoveSkillIDs(ids ...uuid.UUID) *AgentUpdateOne

RemoveSkillIDs removes the "skills" edge to AgentSkill entities by IDs.

func (*AgentUpdateOne) RemoveSkills

func (_u *AgentUpdateOne) RemoveSkills(v ...*AgentSkill) *AgentUpdateOne

RemoveSkills removes "skills" edges to AgentSkill entities.

func (*AgentUpdateOne) Save

func (_u *AgentUpdateOne) Save(ctx context.Context) (*Agent, error)

Save executes the query and returns the updated Agent entity.

func (*AgentUpdateOne) SaveX

func (_u *AgentUpdateOne) SaveX(ctx context.Context) *Agent

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

func (*AgentUpdateOne) Select

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

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

func (*AgentUpdateOne) SetCreatedBy

func (_u *AgentUpdateOne) SetCreatedBy(v uuid.UUID) *AgentUpdateOne

SetCreatedBy sets the "created_by" field.

func (*AgentUpdateOne) SetCreator

func (_u *AgentUpdateOne) SetCreator(v *User) *AgentUpdateOne

SetCreator sets the "creator" edge to the User entity.

func (*AgentUpdateOne) SetCreatorID

func (_u *AgentUpdateOne) SetCreatorID(id uuid.UUID) *AgentUpdateOne

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*AgentUpdateOne) SetDescription

func (_u *AgentUpdateOne) SetDescription(v string) *AgentUpdateOne

SetDescription sets the "description" field.

func (*AgentUpdateOne) SetFeatured

func (_u *AgentUpdateOne) SetFeatured(v bool) *AgentUpdateOne

SetFeatured sets the "featured" field.

func (*AgentUpdateOne) SetModel

func (_u *AgentUpdateOne) SetModel(v string) *AgentUpdateOne

SetModel sets the "model" field.

func (*AgentUpdateOne) SetName

func (_u *AgentUpdateOne) SetName(v string) *AgentUpdateOne

SetName sets the "name" field.

func (*AgentUpdateOne) SetNillableCreatedBy

func (_u *AgentUpdateOne) SetNillableCreatedBy(v *uuid.UUID) *AgentUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableDescription

func (_u *AgentUpdateOne) SetNillableDescription(v *string) *AgentUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableFeatured

func (_u *AgentUpdateOne) SetNillableFeatured(v *bool) *AgentUpdateOne

SetNillableFeatured sets the "featured" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableModel

func (_u *AgentUpdateOne) SetNillableModel(v *string) *AgentUpdateOne

SetNillableModel sets the "model" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableName

func (_u *AgentUpdateOne) SetNillableName(v *string) *AgentUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*AgentUpdateOne) SetNillablePersona

func (_u *AgentUpdateOne) SetNillablePersona(v *string) *AgentUpdateOne

SetNillablePersona sets the "persona" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableProvider

func (_u *AgentUpdateOne) SetNillableProvider(v *string) *AgentUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableSlug

func (_u *AgentUpdateOne) SetNillableSlug(v *string) *AgentUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableVisibility

func (_u *AgentUpdateOne) SetNillableVisibility(v *agent.Visibility) *AgentUpdateOne

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*AgentUpdateOne) SetPersona

func (_u *AgentUpdateOne) SetPersona(v string) *AgentUpdateOne

SetPersona sets the "persona" field.

func (*AgentUpdateOne) SetProvider

func (_u *AgentUpdateOne) SetProvider(v string) *AgentUpdateOne

SetProvider sets the "provider" field.

func (*AgentUpdateOne) SetSlug

func (_u *AgentUpdateOne) SetSlug(v string) *AgentUpdateOne

SetSlug sets the "slug" field.

func (*AgentUpdateOne) SetUpdatedAt

func (_u *AgentUpdateOne) SetUpdatedAt(v time.Time) *AgentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AgentUpdateOne) SetVisibility

func (_u *AgentUpdateOne) SetVisibility(v agent.Visibility) *AgentUpdateOne

SetVisibility sets the "visibility" field.

func (*AgentUpdateOne) Where

func (_u *AgentUpdateOne) Where(ps ...predicate.Agent) *AgentUpdateOne

Where appends a list predicates to the AgentUpdate builder.

type Agents

type Agents []*Agent

Agents is a parsable slice of Agent.

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 AllowlistEntries

type AllowlistEntries []*AllowlistEntry

AllowlistEntries is a parsable slice of AllowlistEntry.

type AllowlistEntry

type AllowlistEntry struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// AddedBy holds the value of the "added_by" field.
	AddedBy uuid.UUID `json:"added_by,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,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 AllowlistEntryQuery when eager-loading is set.
	Edges AllowlistEntryEdges `json:"edges"`
	// contains filtered or unexported fields
}

AllowlistEntry is the model entity for the AllowlistEntry schema.

func (*AllowlistEntry) ExecContext

func (c *AllowlistEntry) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntry) QueryAddedByUser

func (_m *AllowlistEntry) QueryAddedByUser() *UserQuery

QueryAddedByUser queries the "added_by_user" edge of the AllowlistEntry entity.

func (*AllowlistEntry) QueryContext

func (c *AllowlistEntry) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntry) String

func (_m *AllowlistEntry) String() string

String implements the fmt.Stringer.

func (*AllowlistEntry) Unwrap

func (_m *AllowlistEntry) Unwrap() *AllowlistEntry

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

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

func (*AllowlistEntry) Value

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

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

type AllowlistEntryClient

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

AllowlistEntryClient is a client for the AllowlistEntry schema.

func NewAllowlistEntryClient

func NewAllowlistEntryClient(c config) *AllowlistEntryClient

NewAllowlistEntryClient returns a client for the AllowlistEntry from the given config.

func (*AllowlistEntryClient) Create

Create returns a builder for creating a AllowlistEntry entity.

func (*AllowlistEntryClient) CreateBulk

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

func (*AllowlistEntryClient) Delete

Delete returns a delete builder for AllowlistEntry.

func (*AllowlistEntryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AllowlistEntryClient) DeleteOneID

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

func (*AllowlistEntryClient) ExecContext

func (c *AllowlistEntryClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryClient) Get

Get returns a AllowlistEntry entity by its id.

func (*AllowlistEntryClient) GetX

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

func (*AllowlistEntryClient) Hooks

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

Hooks returns the client hooks.

func (*AllowlistEntryClient) Intercept

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

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

func (*AllowlistEntryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AllowlistEntryClient) MapCreateBulk

func (c *AllowlistEntryClient) MapCreateBulk(slice any, setFunc func(*AllowlistEntryCreate, int)) *AllowlistEntryCreateBulk

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

Query returns a query builder for AllowlistEntry.

func (*AllowlistEntryClient) QueryAddedByUser

func (c *AllowlistEntryClient) QueryAddedByUser(_m *AllowlistEntry) *UserQuery

QueryAddedByUser queries the added_by_user edge of a AllowlistEntry.

func (*AllowlistEntryClient) QueryContext

func (c *AllowlistEntryClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryClient) Update

Update returns an update builder for AllowlistEntry.

func (*AllowlistEntryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AllowlistEntryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*AllowlistEntryClient) Use

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

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

type AllowlistEntryCreate

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

AllowlistEntryCreate is the builder for creating a AllowlistEntry entity.

func (*AllowlistEntryCreate) Exec

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

Exec executes the query.

func (*AllowlistEntryCreate) ExecContext

func (c *AllowlistEntryCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryCreate) ExecX

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

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

func (*AllowlistEntryCreate) Mutation

Mutation returns the AllowlistEntryMutation object of the builder.

func (*AllowlistEntryCreate) QueryContext

func (c *AllowlistEntryCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryCreate) Save

Save creates the AllowlistEntry in the database.

func (*AllowlistEntryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AllowlistEntryCreate) SetAddedBy

SetAddedBy sets the "added_by" field.

func (*AllowlistEntryCreate) SetAddedByUser

func (_c *AllowlistEntryCreate) SetAddedByUser(v *User) *AllowlistEntryCreate

SetAddedByUser sets the "added_by_user" edge to the User entity.

func (*AllowlistEntryCreate) SetAddedByUserID

func (_c *AllowlistEntryCreate) SetAddedByUserID(id uuid.UUID) *AllowlistEntryCreate

SetAddedByUserID sets the "added_by_user" edge to the User entity by ID.

func (*AllowlistEntryCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AllowlistEntryCreate) SetEmail

SetEmail sets the "email" field.

func (*AllowlistEntryCreate) SetID

SetID sets the "id" field.

func (*AllowlistEntryCreate) SetNillableCreatedAt

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

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

func (*AllowlistEntryCreate) SetNillableID

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

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

func (*AllowlistEntryCreate) SetNillableNote

func (_c *AllowlistEntryCreate) SetNillableNote(v *string) *AllowlistEntryCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*AllowlistEntryCreate) SetNote

SetNote sets the "note" field.

type AllowlistEntryCreateBulk

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

AllowlistEntryCreateBulk is the builder for creating many AllowlistEntry entities in bulk.

func (*AllowlistEntryCreateBulk) Exec

Exec executes the query.

func (*AllowlistEntryCreateBulk) ExecContext

func (c *AllowlistEntryCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryCreateBulk) ExecX

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

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

func (*AllowlistEntryCreateBulk) QueryContext

func (c *AllowlistEntryCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryCreateBulk) Save

Save creates the AllowlistEntry entities in the database.

func (*AllowlistEntryCreateBulk) SaveX

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

type AllowlistEntryDelete

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

AllowlistEntryDelete is the builder for deleting a AllowlistEntry entity.

func (*AllowlistEntryDelete) Exec

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

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

func (*AllowlistEntryDelete) ExecContext

func (c *AllowlistEntryDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryDelete) ExecX

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

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

func (*AllowlistEntryDelete) QueryContext

func (c *AllowlistEntryDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryDelete) Where

Where appends a list predicates to the AllowlistEntryDelete builder.

type AllowlistEntryDeleteOne

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

AllowlistEntryDeleteOne is the builder for deleting a single AllowlistEntry entity.

func (*AllowlistEntryDeleteOne) Exec

Exec executes the deletion query.

func (*AllowlistEntryDeleteOne) ExecX

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

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

func (*AllowlistEntryDeleteOne) Where

Where appends a list predicates to the AllowlistEntryDelete builder.

type AllowlistEntryEdges

type AllowlistEntryEdges struct {
	// AddedByUser holds the value of the added_by_user edge.
	AddedByUser *User `json:"added_by_user,omitempty"`
	// contains filtered or unexported fields
}

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

func (AllowlistEntryEdges) AddedByUserOrErr

func (e AllowlistEntryEdges) AddedByUserOrErr() (*User, error)

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

type AllowlistEntryGroupBy

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

AllowlistEntryGroupBy is the group-by builder for AllowlistEntry entities.

func (*AllowlistEntryGroupBy) Aggregate

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

func (*AllowlistEntryGroupBy) Bool

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

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

func (*AllowlistEntryGroupBy) BoolX

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

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

func (*AllowlistEntryGroupBy) Bools

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

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

func (*AllowlistEntryGroupBy) BoolsX

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

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

func (*AllowlistEntryGroupBy) Float64

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

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

func (*AllowlistEntryGroupBy) Float64X

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

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

func (*AllowlistEntryGroupBy) Float64s

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

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

func (*AllowlistEntryGroupBy) Float64sX

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

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

func (*AllowlistEntryGroupBy) Int

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

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

func (*AllowlistEntryGroupBy) IntX

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

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

func (*AllowlistEntryGroupBy) Ints

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

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

func (*AllowlistEntryGroupBy) IntsX

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

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

func (*AllowlistEntryGroupBy) Scan

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

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

func (*AllowlistEntryGroupBy) ScanX

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

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

func (*AllowlistEntryGroupBy) String

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

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

func (*AllowlistEntryGroupBy) StringX

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

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

func (*AllowlistEntryGroupBy) Strings

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

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

func (*AllowlistEntryGroupBy) StringsX

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

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

type AllowlistEntryMutation

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

AllowlistEntryMutation represents an operation that mutates the AllowlistEntry nodes in the graph.

func (*AllowlistEntryMutation) AddField

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) AddedBy

func (m *AllowlistEntryMutation) AddedBy() (r uuid.UUID, exists bool)

AddedBy returns the value of the "added_by" field in the mutation.

func (*AllowlistEntryMutation) AddedByUserCleared

func (m *AllowlistEntryMutation) AddedByUserCleared() bool

AddedByUserCleared reports if the "added_by_user" edge to the User entity was cleared.

func (*AllowlistEntryMutation) AddedByUserID

func (m *AllowlistEntryMutation) AddedByUserID() (id uuid.UUID, exists bool)

AddedByUserID returns the "added_by_user" edge ID in the mutation.

func (*AllowlistEntryMutation) AddedByUserIDs

func (m *AllowlistEntryMutation) AddedByUserIDs() (ids []uuid.UUID)

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

func (*AllowlistEntryMutation) AddedEdges

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

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

func (*AllowlistEntryMutation) AddedField

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

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

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

func (*AllowlistEntryMutation) AddedIDs

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

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

func (*AllowlistEntryMutation) ClearAddedByUser

func (m *AllowlistEntryMutation) ClearAddedByUser()

ClearAddedByUser clears the "added_by_user" edge to the User entity.

func (*AllowlistEntryMutation) ClearEdge

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

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) ClearNote

func (m *AllowlistEntryMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*AllowlistEntryMutation) ClearedEdges

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

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

func (*AllowlistEntryMutation) ClearedFields

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

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

func (AllowlistEntryMutation) Client

func (m AllowlistEntryMutation) 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 (*AllowlistEntryMutation) CreatedAt

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

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

func (*AllowlistEntryMutation) EdgeCleared

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

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

func (*AllowlistEntryMutation) Email

func (m *AllowlistEntryMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*AllowlistEntryMutation) ExecContext

func (c *AllowlistEntryMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryMutation) Field

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

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

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

func (*AllowlistEntryMutation) Fields

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

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

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*AllowlistEntryMutation) Note

func (m *AllowlistEntryMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*AllowlistEntryMutation) NoteCleared

func (m *AllowlistEntryMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*AllowlistEntryMutation) OldAddedBy

func (m *AllowlistEntryMutation) OldAddedBy(ctx context.Context) (v uuid.UUID, err error)

OldAddedBy returns the old "added_by" field's value of the AllowlistEntry entity. If the AllowlistEntry 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 (*AllowlistEntryMutation) OldCreatedAt

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

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

func (m *AllowlistEntryMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the AllowlistEntry entity. If the AllowlistEntry 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 (*AllowlistEntryMutation) OldField

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) OldNote

func (m *AllowlistEntryMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the AllowlistEntry entity. If the AllowlistEntry 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 (*AllowlistEntryMutation) Op

func (m *AllowlistEntryMutation) Op() Op

Op returns the operation name.

func (*AllowlistEntryMutation) QueryContext

func (c *AllowlistEntryMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryMutation) RemovedEdges

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

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

func (*AllowlistEntryMutation) RemovedIDs

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) ResetAddedBy

func (m *AllowlistEntryMutation) ResetAddedBy()

ResetAddedBy resets all changes to the "added_by" field.

func (*AllowlistEntryMutation) ResetAddedByUser

func (m *AllowlistEntryMutation) ResetAddedByUser()

ResetAddedByUser resets all changes to the "added_by_user" edge.

func (*AllowlistEntryMutation) ResetCreatedAt

func (m *AllowlistEntryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AllowlistEntryMutation) ResetEdge

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) ResetEmail

func (m *AllowlistEntryMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*AllowlistEntryMutation) ResetField

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) ResetNote

func (m *AllowlistEntryMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*AllowlistEntryMutation) SetAddedBy

func (m *AllowlistEntryMutation) SetAddedBy(u uuid.UUID)

SetAddedBy sets the "added_by" field.

func (*AllowlistEntryMutation) SetAddedByUserID

func (m *AllowlistEntryMutation) SetAddedByUserID(id uuid.UUID)

SetAddedByUserID sets the "added_by_user" edge to the User entity by id.

func (*AllowlistEntryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AllowlistEntryMutation) SetEmail

func (m *AllowlistEntryMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*AllowlistEntryMutation) SetField

func (m *AllowlistEntryMutation) 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 (*AllowlistEntryMutation) SetID

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

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

func (*AllowlistEntryMutation) SetNote

func (m *AllowlistEntryMutation) SetNote(s string)

SetNote sets the "note" field.

func (*AllowlistEntryMutation) SetOp

func (m *AllowlistEntryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (AllowlistEntryMutation) Tx

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

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

func (*AllowlistEntryMutation) Type

func (m *AllowlistEntryMutation) Type() string

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

func (*AllowlistEntryMutation) Where

Where appends a list predicates to the AllowlistEntryMutation builder.

func (*AllowlistEntryMutation) WhereP

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

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

type AllowlistEntryQuery

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

AllowlistEntryQuery is the builder for querying AllowlistEntry entities.

func (*AllowlistEntryQuery) Aggregate

Aggregate returns a AllowlistEntrySelect configured with the given aggregations.

func (*AllowlistEntryQuery) All

All executes the query and returns a list of AllowlistEntries.

func (*AllowlistEntryQuery) AllX

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

func (*AllowlistEntryQuery) Clone

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

func (*AllowlistEntryQuery) Count

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

Count returns the count of the given query.

func (*AllowlistEntryQuery) CountX

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

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

func (*AllowlistEntryQuery) ExecContext

func (c *AllowlistEntryQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryQuery) Exist

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

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

func (*AllowlistEntryQuery) ExistX

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

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

func (*AllowlistEntryQuery) First

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

func (*AllowlistEntryQuery) FirstID

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

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

func (*AllowlistEntryQuery) FirstIDX

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

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

func (*AllowlistEntryQuery) FirstX

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

func (*AllowlistEntryQuery) GroupBy

func (_q *AllowlistEntryQuery) GroupBy(field string, fields ...string) *AllowlistEntryGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AllowlistEntry.Query().
	GroupBy(allowlistentry.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AllowlistEntryQuery) IDs

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

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

func (*AllowlistEntryQuery) IDsX

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

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

func (*AllowlistEntryQuery) Limit

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

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

func (*AllowlistEntryQuery) Offset

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

Offset to start from.

func (*AllowlistEntryQuery) Only

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

func (*AllowlistEntryQuery) OnlyID

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

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

func (*AllowlistEntryQuery) OnlyIDX

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

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

func (*AllowlistEntryQuery) OnlyX

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

func (*AllowlistEntryQuery) Order

Order specifies how the records should be ordered.

func (*AllowlistEntryQuery) QueryAddedByUser

func (_q *AllowlistEntryQuery) QueryAddedByUser() *UserQuery

QueryAddedByUser chains the current query on the "added_by_user" edge.

func (*AllowlistEntryQuery) QueryContext

func (c *AllowlistEntryQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryQuery) Select

func (_q *AllowlistEntryQuery) Select(fields ...string) *AllowlistEntrySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
}

client.AllowlistEntry.Query().
	Select(allowlistentry.FieldEmail).
	Scan(ctx, &v)

func (*AllowlistEntryQuery) Unique

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

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

Where adds a new predicate for the AllowlistEntryQuery builder.

func (*AllowlistEntryQuery) WithAddedByUser

func (_q *AllowlistEntryQuery) WithAddedByUser(opts ...func(*UserQuery)) *AllowlistEntryQuery

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

type AllowlistEntrySelect

type AllowlistEntrySelect struct {
	*AllowlistEntryQuery
	// contains filtered or unexported fields
}

AllowlistEntrySelect is the builder for selecting fields of AllowlistEntry entities.

func (*AllowlistEntrySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*AllowlistEntrySelect) Bool

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

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

func (*AllowlistEntrySelect) BoolX

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

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

func (*AllowlistEntrySelect) Bools

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

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

func (*AllowlistEntrySelect) BoolsX

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

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

func (AllowlistEntrySelect) ExecContext

func (c AllowlistEntrySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntrySelect) Float64

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

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

func (*AllowlistEntrySelect) Float64X

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

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

func (*AllowlistEntrySelect) Float64s

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

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

func (*AllowlistEntrySelect) Float64sX

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

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

func (*AllowlistEntrySelect) Int

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

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

func (*AllowlistEntrySelect) IntX

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

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

func (*AllowlistEntrySelect) Ints

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

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

func (*AllowlistEntrySelect) IntsX

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

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

func (AllowlistEntrySelect) QueryContext

func (c AllowlistEntrySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntrySelect) Scan

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

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

func (*AllowlistEntrySelect) ScanX

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

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

func (*AllowlistEntrySelect) String

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

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

func (*AllowlistEntrySelect) StringX

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

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

func (*AllowlistEntrySelect) Strings

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

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

func (*AllowlistEntrySelect) StringsX

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

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

type AllowlistEntryUpdate

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

AllowlistEntryUpdate is the builder for updating AllowlistEntry entities.

func (*AllowlistEntryUpdate) ClearAddedByUser

func (_u *AllowlistEntryUpdate) ClearAddedByUser() *AllowlistEntryUpdate

ClearAddedByUser clears the "added_by_user" edge to the User entity.

func (*AllowlistEntryUpdate) ClearNote

func (_u *AllowlistEntryUpdate) ClearNote() *AllowlistEntryUpdate

ClearNote clears the value of the "note" field.

func (*AllowlistEntryUpdate) Exec

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

Exec executes the query.

func (*AllowlistEntryUpdate) ExecContext

func (c *AllowlistEntryUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryUpdate) ExecX

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

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

func (*AllowlistEntryUpdate) Mutation

Mutation returns the AllowlistEntryMutation object of the builder.

func (*AllowlistEntryUpdate) QueryContext

func (c *AllowlistEntryUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryUpdate) Save

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

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

func (*AllowlistEntryUpdate) SaveX

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

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

func (*AllowlistEntryUpdate) SetAddedBy

SetAddedBy sets the "added_by" field.

func (*AllowlistEntryUpdate) SetAddedByUser

func (_u *AllowlistEntryUpdate) SetAddedByUser(v *User) *AllowlistEntryUpdate

SetAddedByUser sets the "added_by_user" edge to the User entity.

func (*AllowlistEntryUpdate) SetAddedByUserID

func (_u *AllowlistEntryUpdate) SetAddedByUserID(id uuid.UUID) *AllowlistEntryUpdate

SetAddedByUserID sets the "added_by_user" edge to the User entity by ID.

func (*AllowlistEntryUpdate) SetEmail

SetEmail sets the "email" field.

func (*AllowlistEntryUpdate) SetNillableAddedBy

func (_u *AllowlistEntryUpdate) SetNillableAddedBy(v *uuid.UUID) *AllowlistEntryUpdate

SetNillableAddedBy sets the "added_by" field if the given value is not nil.

func (*AllowlistEntryUpdate) SetNillableEmail

func (_u *AllowlistEntryUpdate) SetNillableEmail(v *string) *AllowlistEntryUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AllowlistEntryUpdate) SetNillableNote

func (_u *AllowlistEntryUpdate) SetNillableNote(v *string) *AllowlistEntryUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*AllowlistEntryUpdate) SetNote

SetNote sets the "note" field.

func (*AllowlistEntryUpdate) Where

Where appends a list predicates to the AllowlistEntryUpdate builder.

type AllowlistEntryUpdateOne

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

AllowlistEntryUpdateOne is the builder for updating a single AllowlistEntry entity.

func (*AllowlistEntryUpdateOne) ClearAddedByUser

func (_u *AllowlistEntryUpdateOne) ClearAddedByUser() *AllowlistEntryUpdateOne

ClearAddedByUser clears the "added_by_user" edge to the User entity.

func (*AllowlistEntryUpdateOne) ClearNote

ClearNote clears the value of the "note" field.

func (*AllowlistEntryUpdateOne) Exec

Exec executes the query on the entity.

func (*AllowlistEntryUpdateOne) ExecContext

func (c *AllowlistEntryUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AllowlistEntryUpdateOne) ExecX

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

ExecX is like Exec, but panics if an error occurs.

func (*AllowlistEntryUpdateOne) Mutation

Mutation returns the AllowlistEntryMutation object of the builder.

func (*AllowlistEntryUpdateOne) QueryContext

func (c *AllowlistEntryUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AllowlistEntryUpdateOne) Save

Save executes the query and returns the updated AllowlistEntry entity.

func (*AllowlistEntryUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*AllowlistEntryUpdateOne) Select

func (_u *AllowlistEntryUpdateOne) Select(field string, fields ...string) *AllowlistEntryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AllowlistEntryUpdateOne) SetAddedBy

SetAddedBy sets the "added_by" field.

func (*AllowlistEntryUpdateOne) SetAddedByUser

func (_u *AllowlistEntryUpdateOne) SetAddedByUser(v *User) *AllowlistEntryUpdateOne

SetAddedByUser sets the "added_by_user" edge to the User entity.

func (*AllowlistEntryUpdateOne) SetAddedByUserID

func (_u *AllowlistEntryUpdateOne) SetAddedByUserID(id uuid.UUID) *AllowlistEntryUpdateOne

SetAddedByUserID sets the "added_by_user" edge to the User entity by ID.

func (*AllowlistEntryUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*AllowlistEntryUpdateOne) SetNillableAddedBy

func (_u *AllowlistEntryUpdateOne) SetNillableAddedBy(v *uuid.UUID) *AllowlistEntryUpdateOne

SetNillableAddedBy sets the "added_by" field if the given value is not nil.

func (*AllowlistEntryUpdateOne) SetNillableEmail

func (_u *AllowlistEntryUpdateOne) SetNillableEmail(v *string) *AllowlistEntryUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AllowlistEntryUpdateOne) SetNillableNote

func (_u *AllowlistEntryUpdateOne) SetNillableNote(v *string) *AllowlistEntryUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*AllowlistEntryUpdateOne) SetNote

SetNote sets the "note" field.

func (*AllowlistEntryUpdateOne) Where

Where appends a list predicates to the AllowlistEntryUpdate builder.

type AuthSession

type AuthSession struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// TokenHash holds the value of the "token_hash" field.
	TokenHash string `json:"token_hash,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// LastSeenAt holds the value of the "last_seen_at" field.
	LastSeenAt time.Time `json:"last_seen_at,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// UserAgent holds the value of the "user_agent" field.
	UserAgent string `json:"user_agent,omitempty"`
	// CreatedIP holds the value of the "created_ip" field.
	CreatedIP string `json:"created_ip,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthSessionQuery when eager-loading is set.
	Edges AuthSessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthSession is the model entity for the AuthSession schema.

func (*AuthSession) ExecContext

func (c *AuthSession) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSession) QueryContext

func (c *AuthSession) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSession) QueryUser

func (_m *AuthSession) QueryUser() *UserQuery

QueryUser queries the "user" edge of the AuthSession entity.

func (*AuthSession) String

func (_m *AuthSession) String() string

String implements the fmt.Stringer.

func (*AuthSession) Unwrap

func (_m *AuthSession) Unwrap() *AuthSession

Unwrap unwraps the AuthSession 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 (*AuthSession) Update

func (_m *AuthSession) Update() *AuthSessionUpdateOne

Update returns a builder for updating this AuthSession. Note that you need to call AuthSession.Unwrap() before calling this method if this AuthSession was returned from a transaction, and the transaction was committed or rolled back.

func (*AuthSession) Value

func (_m *AuthSession) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the AuthSession. This includes values selected through modifiers, order, etc.

type AuthSessionClient

type AuthSessionClient struct {
	// contains filtered or unexported fields
}

AuthSessionClient is a client for the AuthSession schema.

func NewAuthSessionClient

func NewAuthSessionClient(c config) *AuthSessionClient

NewAuthSessionClient returns a client for the AuthSession from the given config.

func (*AuthSessionClient) Create

func (c *AuthSessionClient) Create() *AuthSessionCreate

Create returns a builder for creating a AuthSession entity.

func (*AuthSessionClient) CreateBulk

func (c *AuthSessionClient) CreateBulk(builders ...*AuthSessionCreate) *AuthSessionCreateBulk

CreateBulk returns a builder for creating a bulk of AuthSession entities.

func (*AuthSessionClient) Delete

func (c *AuthSessionClient) Delete() *AuthSessionDelete

Delete returns a delete builder for AuthSession.

func (*AuthSessionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthSessionClient) DeleteOneID

func (c *AuthSessionClient) DeleteOneID(id uuid.UUID) *AuthSessionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AuthSessionClient) ExecContext

func (c *AuthSessionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionClient) Get

Get returns a AuthSession entity by its id.

func (*AuthSessionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*AuthSessionClient) Hooks

func (c *AuthSessionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*AuthSessionClient) Intercept

func (c *AuthSessionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `authsession.Intercept(f(g(h())))`.

func (*AuthSessionClient) Interceptors

func (c *AuthSessionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AuthSessionClient) MapCreateBulk

func (c *AuthSessionClient) MapCreateBulk(slice any, setFunc func(*AuthSessionCreate, int)) *AuthSessionCreateBulk

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 (*AuthSessionClient) Query

func (c *AuthSessionClient) Query() *AuthSessionQuery

Query returns a query builder for AuthSession.

func (*AuthSessionClient) QueryContext

func (c *AuthSessionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionClient) QueryUser

func (c *AuthSessionClient) QueryUser(_m *AuthSession) *UserQuery

QueryUser queries the user edge of a AuthSession.

func (*AuthSessionClient) Update

func (c *AuthSessionClient) Update() *AuthSessionUpdate

Update returns an update builder for AuthSession.

func (*AuthSessionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthSessionClient) UpdateOneID

func (c *AuthSessionClient) UpdateOneID(id uuid.UUID) *AuthSessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthSessionClient) Use

func (c *AuthSessionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `authsession.Hooks(f(g(h())))`.

type AuthSessionCreate

type AuthSessionCreate struct {
	// contains filtered or unexported fields
}

AuthSessionCreate is the builder for creating a AuthSession entity.

func (*AuthSessionCreate) Exec

func (_c *AuthSessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthSessionCreate) ExecContext

func (c *AuthSessionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionCreate) ExecX

func (_c *AuthSessionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionCreate) Mutation

func (_c *AuthSessionCreate) Mutation() *AuthSessionMutation

Mutation returns the AuthSessionMutation object of the builder.

func (*AuthSessionCreate) QueryContext

func (c *AuthSessionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionCreate) Save

Save creates the AuthSession in the database.

func (*AuthSessionCreate) SaveX

func (_c *AuthSessionCreate) SaveX(ctx context.Context) *AuthSession

SaveX calls Save and panics if Save returns an error.

func (*AuthSessionCreate) SetCreatedAt

func (_c *AuthSessionCreate) SetCreatedAt(v time.Time) *AuthSessionCreate

SetCreatedAt sets the "created_at" field.

func (*AuthSessionCreate) SetCreatedIP

func (_c *AuthSessionCreate) SetCreatedIP(v string) *AuthSessionCreate

SetCreatedIP sets the "created_ip" field.

func (*AuthSessionCreate) SetExpiresAt

func (_c *AuthSessionCreate) SetExpiresAt(v time.Time) *AuthSessionCreate

SetExpiresAt sets the "expires_at" field.

func (*AuthSessionCreate) SetID

SetID sets the "id" field.

func (*AuthSessionCreate) SetLastSeenAt

func (_c *AuthSessionCreate) SetLastSeenAt(v time.Time) *AuthSessionCreate

SetLastSeenAt sets the "last_seen_at" field.

func (*AuthSessionCreate) SetNillableCreatedAt

func (_c *AuthSessionCreate) SetNillableCreatedAt(v *time.Time) *AuthSessionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AuthSessionCreate) SetNillableCreatedIP

func (_c *AuthSessionCreate) SetNillableCreatedIP(v *string) *AuthSessionCreate

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*AuthSessionCreate) SetNillableID

func (_c *AuthSessionCreate) SetNillableID(v *uuid.UUID) *AuthSessionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AuthSessionCreate) SetNillableLastSeenAt

func (_c *AuthSessionCreate) SetNillableLastSeenAt(v *time.Time) *AuthSessionCreate

SetNillableLastSeenAt sets the "last_seen_at" field if the given value is not nil.

func (*AuthSessionCreate) SetNillableUserAgent

func (_c *AuthSessionCreate) SetNillableUserAgent(v *string) *AuthSessionCreate

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*AuthSessionCreate) SetTokenHash

func (_c *AuthSessionCreate) SetTokenHash(v string) *AuthSessionCreate

SetTokenHash sets the "token_hash" field.

func (*AuthSessionCreate) SetUser

func (_c *AuthSessionCreate) SetUser(v *User) *AuthSessionCreate

SetUser sets the "user" edge to the User entity.

func (*AuthSessionCreate) SetUserAgent

func (_c *AuthSessionCreate) SetUserAgent(v string) *AuthSessionCreate

SetUserAgent sets the "user_agent" field.

func (*AuthSessionCreate) SetUserID

func (_c *AuthSessionCreate) SetUserID(v uuid.UUID) *AuthSessionCreate

SetUserID sets the "user_id" field.

type AuthSessionCreateBulk

type AuthSessionCreateBulk struct {
	// contains filtered or unexported fields
}

AuthSessionCreateBulk is the builder for creating many AuthSession entities in bulk.

func (*AuthSessionCreateBulk) Exec

Exec executes the query.

func (*AuthSessionCreateBulk) ExecContext

func (c *AuthSessionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionCreateBulk) ExecX

func (_c *AuthSessionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionCreateBulk) QueryContext

func (c *AuthSessionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionCreateBulk) Save

Save creates the AuthSession entities in the database.

func (*AuthSessionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type AuthSessionDelete

type AuthSessionDelete struct {
	// contains filtered or unexported fields
}

AuthSessionDelete is the builder for deleting a AuthSession entity.

func (*AuthSessionDelete) Exec

func (_d *AuthSessionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*AuthSessionDelete) ExecContext

func (c *AuthSessionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionDelete) ExecX

func (_d *AuthSessionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionDelete) QueryContext

func (c *AuthSessionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionDelete) Where

Where appends a list predicates to the AuthSessionDelete builder.

type AuthSessionDeleteOne

type AuthSessionDeleteOne struct {
	// contains filtered or unexported fields
}

AuthSessionDeleteOne is the builder for deleting a single AuthSession entity.

func (*AuthSessionDeleteOne) Exec

func (_d *AuthSessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuthSessionDeleteOne) ExecX

func (_d *AuthSessionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionDeleteOne) Where

Where appends a list predicates to the AuthSessionDelete builder.

type AuthSessionEdges

type AuthSessionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

AuthSessionEdges holds the relations/edges for other nodes in the graph.

func (AuthSessionEdges) UserOrErr

func (e AuthSessionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type AuthSessionGroupBy

type AuthSessionGroupBy struct {
	// contains filtered or unexported fields
}

AuthSessionGroupBy is the group-by builder for AuthSession entities.

func (*AuthSessionGroupBy) Aggregate

func (_g *AuthSessionGroupBy) Aggregate(fns ...AggregateFunc) *AuthSessionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AuthSessionGroupBy) Bool

func (s *AuthSessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) BoolX

func (s *AuthSessionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AuthSessionGroupBy) Bools

func (s *AuthSessionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) BoolsX

func (s *AuthSessionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AuthSessionGroupBy) Float64

func (s *AuthSessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) Float64X

func (s *AuthSessionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AuthSessionGroupBy) Float64s

func (s *AuthSessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) Float64sX

func (s *AuthSessionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AuthSessionGroupBy) Int

func (s *AuthSessionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) IntX

func (s *AuthSessionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AuthSessionGroupBy) Ints

func (s *AuthSessionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) IntsX

func (s *AuthSessionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AuthSessionGroupBy) Scan

func (_g *AuthSessionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AuthSessionGroupBy) ScanX

func (s *AuthSessionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AuthSessionGroupBy) String

func (s *AuthSessionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) StringX

func (s *AuthSessionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AuthSessionGroupBy) Strings

func (s *AuthSessionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AuthSessionGroupBy) StringsX

func (s *AuthSessionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AuthSessionMutation

type AuthSessionMutation struct {
	// contains filtered or unexported fields
}

AuthSessionMutation represents an operation that mutates the AuthSession nodes in the graph.

func (*AuthSessionMutation) AddField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) AddedEdges

func (m *AuthSessionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AuthSessionMutation) AddedField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) AddedFields

func (m *AuthSessionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AuthSessionMutation) AddedIDs

func (m *AuthSessionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AuthSessionMutation) ClearCreatedIP

func (m *AuthSessionMutation) ClearCreatedIP()

ClearCreatedIP clears the value of the "created_ip" field.

func (*AuthSessionMutation) ClearEdge

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ClearField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ClearUser

func (m *AuthSessionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AuthSessionMutation) ClearUserAgent

func (m *AuthSessionMutation) ClearUserAgent()

ClearUserAgent clears the value of the "user_agent" field.

func (*AuthSessionMutation) ClearedEdges

func (m *AuthSessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AuthSessionMutation) ClearedFields

func (m *AuthSessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AuthSessionMutation) Client

func (m AuthSessionMutation) 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 (*AuthSessionMutation) CreatedAt

func (m *AuthSessionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AuthSessionMutation) CreatedIP

func (m *AuthSessionMutation) CreatedIP() (r string, exists bool)

CreatedIP returns the value of the "created_ip" field in the mutation.

func (*AuthSessionMutation) CreatedIPCleared

func (m *AuthSessionMutation) CreatedIPCleared() bool

CreatedIPCleared returns if the "created_ip" field was cleared in this mutation.

func (*AuthSessionMutation) EdgeCleared

func (m *AuthSessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AuthSessionMutation) ExecContext

func (c *AuthSessionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionMutation) ExpiresAt

func (m *AuthSessionMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*AuthSessionMutation) Field

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) FieldCleared

func (m *AuthSessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AuthSessionMutation) Fields

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ID

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) IDs

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) LastSeenAt

func (m *AuthSessionMutation) LastSeenAt() (r time.Time, exists bool)

LastSeenAt returns the value of the "last_seen_at" field in the mutation.

func (*AuthSessionMutation) OldCreatedAt

func (m *AuthSessionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldCreatedIP

func (m *AuthSessionMutation) OldCreatedIP(ctx context.Context) (v string, err error)

OldCreatedIP returns the old "created_ip" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldExpiresAt

func (m *AuthSessionMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) OldLastSeenAt

func (m *AuthSessionMutation) OldLastSeenAt(ctx context.Context) (v time.Time, err error)

OldLastSeenAt returns the old "last_seen_at" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldTokenHash

func (m *AuthSessionMutation) OldTokenHash(ctx context.Context) (v string, err error)

OldTokenHash returns the old "token_hash" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldUserAgent

func (m *AuthSessionMutation) OldUserAgent(ctx context.Context) (v string, err error)

OldUserAgent returns the old "user_agent" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) OldUserID

func (m *AuthSessionMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the AuthSession entity. If the AuthSession 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 (*AuthSessionMutation) Op

func (m *AuthSessionMutation) Op() Op

Op returns the operation name.

func (*AuthSessionMutation) QueryContext

func (c *AuthSessionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionMutation) RemovedEdges

func (m *AuthSessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AuthSessionMutation) RemovedIDs

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ResetCreatedAt

func (m *AuthSessionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthSessionMutation) ResetCreatedIP

func (m *AuthSessionMutation) ResetCreatedIP()

ResetCreatedIP resets all changes to the "created_ip" field.

func (*AuthSessionMutation) ResetEdge

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ResetExpiresAt

func (m *AuthSessionMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*AuthSessionMutation) ResetField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) ResetLastSeenAt

func (m *AuthSessionMutation) ResetLastSeenAt()

ResetLastSeenAt resets all changes to the "last_seen_at" field.

func (*AuthSessionMutation) ResetTokenHash

func (m *AuthSessionMutation) ResetTokenHash()

ResetTokenHash resets all changes to the "token_hash" field.

func (*AuthSessionMutation) ResetUser

func (m *AuthSessionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AuthSessionMutation) ResetUserAgent

func (m *AuthSessionMutation) ResetUserAgent()

ResetUserAgent resets all changes to the "user_agent" field.

func (*AuthSessionMutation) ResetUserID

func (m *AuthSessionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*AuthSessionMutation) SetCreatedAt

func (m *AuthSessionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AuthSessionMutation) SetCreatedIP

func (m *AuthSessionMutation) SetCreatedIP(s string)

SetCreatedIP sets the "created_ip" field.

func (*AuthSessionMutation) SetExpiresAt

func (m *AuthSessionMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*AuthSessionMutation) SetField

func (m *AuthSessionMutation) 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 (*AuthSessionMutation) SetID

func (m *AuthSessionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of AuthSession entities.

func (*AuthSessionMutation) SetLastSeenAt

func (m *AuthSessionMutation) SetLastSeenAt(t time.Time)

SetLastSeenAt sets the "last_seen_at" field.

func (*AuthSessionMutation) SetOp

func (m *AuthSessionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthSessionMutation) SetTokenHash

func (m *AuthSessionMutation) SetTokenHash(s string)

SetTokenHash sets the "token_hash" field.

func (*AuthSessionMutation) SetUserAgent

func (m *AuthSessionMutation) SetUserAgent(s string)

SetUserAgent sets the "user_agent" field.

func (*AuthSessionMutation) SetUserID

func (m *AuthSessionMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (*AuthSessionMutation) TokenHash

func (m *AuthSessionMutation) TokenHash() (r string, exists bool)

TokenHash returns the value of the "token_hash" field in the mutation.

func (AuthSessionMutation) Tx

func (m AuthSessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AuthSessionMutation) Type

func (m *AuthSessionMutation) Type() string

Type returns the node type of this mutation (AuthSession).

func (*AuthSessionMutation) UserAgent

func (m *AuthSessionMutation) UserAgent() (r string, exists bool)

UserAgent returns the value of the "user_agent" field in the mutation.

func (*AuthSessionMutation) UserAgentCleared

func (m *AuthSessionMutation) UserAgentCleared() bool

UserAgentCleared returns if the "user_agent" field was cleared in this mutation.

func (*AuthSessionMutation) UserCleared

func (m *AuthSessionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AuthSessionMutation) UserID

func (m *AuthSessionMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*AuthSessionMutation) UserIDs

func (m *AuthSessionMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*AuthSessionMutation) Where

func (m *AuthSessionMutation) Where(ps ...predicate.AuthSession)

Where appends a list predicates to the AuthSessionMutation builder.

func (*AuthSessionMutation) WhereP

func (m *AuthSessionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AuthSessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AuthSessionQuery

type AuthSessionQuery struct {
	// contains filtered or unexported fields
}

AuthSessionQuery is the builder for querying AuthSession entities.

func (*AuthSessionQuery) Aggregate

func (_q *AuthSessionQuery) Aggregate(fns ...AggregateFunc) *AuthSessionSelect

Aggregate returns a AuthSessionSelect configured with the given aggregations.

func (*AuthSessionQuery) All

func (_q *AuthSessionQuery) All(ctx context.Context) ([]*AuthSession, error)

All executes the query and returns a list of AuthSessions.

func (*AuthSessionQuery) AllX

func (_q *AuthSessionQuery) AllX(ctx context.Context) []*AuthSession

AllX is like All, but panics if an error occurs.

func (*AuthSessionQuery) Clone

func (_q *AuthSessionQuery) Clone() *AuthSessionQuery

Clone returns a duplicate of the AuthSessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AuthSessionQuery) Count

func (_q *AuthSessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthSessionQuery) CountX

func (_q *AuthSessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*AuthSessionQuery) ExecContext

func (c *AuthSessionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionQuery) Exist

func (_q *AuthSessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*AuthSessionQuery) ExistX

func (_q *AuthSessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*AuthSessionQuery) First

func (_q *AuthSessionQuery) First(ctx context.Context) (*AuthSession, error)

First returns the first AuthSession entity from the query. Returns a *NotFoundError when no AuthSession was found.

func (*AuthSessionQuery) FirstID

func (_q *AuthSessionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first AuthSession ID from the query. Returns a *NotFoundError when no AuthSession ID was found.

func (*AuthSessionQuery) FirstIDX

func (_q *AuthSessionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*AuthSessionQuery) FirstX

func (_q *AuthSessionQuery) FirstX(ctx context.Context) *AuthSession

FirstX is like First, but panics if an error occurs.

func (*AuthSessionQuery) GroupBy

func (_q *AuthSessionQuery) GroupBy(field string, fields ...string) *AuthSessionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AuthSession.Query().
	GroupBy(authsession.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuthSessionQuery) IDs

func (_q *AuthSessionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of AuthSession IDs.

func (*AuthSessionQuery) IDsX

func (_q *AuthSessionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*AuthSessionQuery) Limit

func (_q *AuthSessionQuery) Limit(limit int) *AuthSessionQuery

Limit the number of records to be returned by this query.

func (*AuthSessionQuery) Offset

func (_q *AuthSessionQuery) Offset(offset int) *AuthSessionQuery

Offset to start from.

func (*AuthSessionQuery) Only

func (_q *AuthSessionQuery) Only(ctx context.Context) (*AuthSession, error)

Only returns a single AuthSession entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one AuthSession entity is found. Returns a *NotFoundError when no AuthSession entities are found.

func (*AuthSessionQuery) OnlyID

func (_q *AuthSessionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only AuthSession ID in the query. Returns a *NotSingularError when more than one AuthSession ID is found. Returns a *NotFoundError when no entities are found.

func (*AuthSessionQuery) OnlyIDX

func (_q *AuthSessionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*AuthSessionQuery) OnlyX

func (_q *AuthSessionQuery) OnlyX(ctx context.Context) *AuthSession

OnlyX is like Only, but panics if an error occurs.

func (*AuthSessionQuery) Order

Order specifies how the records should be ordered.

func (*AuthSessionQuery) QueryContext

func (c *AuthSessionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionQuery) QueryUser

func (_q *AuthSessionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AuthSessionQuery) Select

func (_q *AuthSessionQuery) Select(fields ...string) *AuthSessionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.AuthSession.Query().
	Select(authsession.FieldUserID).
	Scan(ctx, &v)

func (*AuthSessionQuery) Unique

func (_q *AuthSessionQuery) Unique(unique bool) *AuthSessionQuery

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 (*AuthSessionQuery) Where

Where adds a new predicate for the AuthSessionQuery builder.

func (*AuthSessionQuery) WithUser

func (_q *AuthSessionQuery) WithUser(opts ...func(*UserQuery)) *AuthSessionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type AuthSessionSelect

type AuthSessionSelect struct {
	*AuthSessionQuery
	// contains filtered or unexported fields
}

AuthSessionSelect is the builder for selecting fields of AuthSession entities.

func (*AuthSessionSelect) Aggregate

func (_s *AuthSessionSelect) Aggregate(fns ...AggregateFunc) *AuthSessionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthSessionSelect) Bool

func (s *AuthSessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) BoolX

func (s *AuthSessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AuthSessionSelect) Bools

func (s *AuthSessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) BoolsX

func (s *AuthSessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (AuthSessionSelect) ExecContext

func (c AuthSessionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionSelect) Float64

func (s *AuthSessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) Float64X

func (s *AuthSessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AuthSessionSelect) Float64s

func (s *AuthSessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) Float64sX

func (s *AuthSessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AuthSessionSelect) Int

func (s *AuthSessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) IntX

func (s *AuthSessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AuthSessionSelect) Ints

func (s *AuthSessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) IntsX

func (s *AuthSessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (AuthSessionSelect) QueryContext

func (c AuthSessionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionSelect) Scan

func (_s *AuthSessionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AuthSessionSelect) ScanX

func (s *AuthSessionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AuthSessionSelect) String

func (s *AuthSessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) StringX

func (s *AuthSessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AuthSessionSelect) Strings

func (s *AuthSessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AuthSessionSelect) StringsX

func (s *AuthSessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AuthSessionUpdate

type AuthSessionUpdate struct {
	// contains filtered or unexported fields
}

AuthSessionUpdate is the builder for updating AuthSession entities.

func (*AuthSessionUpdate) ClearCreatedIP

func (_u *AuthSessionUpdate) ClearCreatedIP() *AuthSessionUpdate

ClearCreatedIP clears the value of the "created_ip" field.

func (*AuthSessionUpdate) ClearUser

func (_u *AuthSessionUpdate) ClearUser() *AuthSessionUpdate

ClearUser clears the "user" edge to the User entity.

func (*AuthSessionUpdate) ClearUserAgent

func (_u *AuthSessionUpdate) ClearUserAgent() *AuthSessionUpdate

ClearUserAgent clears the value of the "user_agent" field.

func (*AuthSessionUpdate) Exec

func (_u *AuthSessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthSessionUpdate) ExecContext

func (c *AuthSessionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionUpdate) ExecX

func (_u *AuthSessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionUpdate) Mutation

func (_u *AuthSessionUpdate) Mutation() *AuthSessionMutation

Mutation returns the AuthSessionMutation object of the builder.

func (*AuthSessionUpdate) QueryContext

func (c *AuthSessionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionUpdate) Save

func (_u *AuthSessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*AuthSessionUpdate) SaveX

func (_u *AuthSessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*AuthSessionUpdate) SetCreatedIP

func (_u *AuthSessionUpdate) SetCreatedIP(v string) *AuthSessionUpdate

SetCreatedIP sets the "created_ip" field.

func (*AuthSessionUpdate) SetExpiresAt

func (_u *AuthSessionUpdate) SetExpiresAt(v time.Time) *AuthSessionUpdate

SetExpiresAt sets the "expires_at" field.

func (*AuthSessionUpdate) SetLastSeenAt

func (_u *AuthSessionUpdate) SetLastSeenAt(v time.Time) *AuthSessionUpdate

SetLastSeenAt sets the "last_seen_at" field.

func (*AuthSessionUpdate) SetNillableCreatedIP

func (_u *AuthSessionUpdate) SetNillableCreatedIP(v *string) *AuthSessionUpdate

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*AuthSessionUpdate) SetNillableExpiresAt

func (_u *AuthSessionUpdate) SetNillableExpiresAt(v *time.Time) *AuthSessionUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*AuthSessionUpdate) SetNillableLastSeenAt

func (_u *AuthSessionUpdate) SetNillableLastSeenAt(v *time.Time) *AuthSessionUpdate

SetNillableLastSeenAt sets the "last_seen_at" field if the given value is not nil.

func (*AuthSessionUpdate) SetNillableTokenHash

func (_u *AuthSessionUpdate) SetNillableTokenHash(v *string) *AuthSessionUpdate

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*AuthSessionUpdate) SetNillableUserAgent

func (_u *AuthSessionUpdate) SetNillableUserAgent(v *string) *AuthSessionUpdate

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*AuthSessionUpdate) SetNillableUserID

func (_u *AuthSessionUpdate) SetNillableUserID(v *uuid.UUID) *AuthSessionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*AuthSessionUpdate) SetTokenHash

func (_u *AuthSessionUpdate) SetTokenHash(v string) *AuthSessionUpdate

SetTokenHash sets the "token_hash" field.

func (*AuthSessionUpdate) SetUser

func (_u *AuthSessionUpdate) SetUser(v *User) *AuthSessionUpdate

SetUser sets the "user" edge to the User entity.

func (*AuthSessionUpdate) SetUserAgent

func (_u *AuthSessionUpdate) SetUserAgent(v string) *AuthSessionUpdate

SetUserAgent sets the "user_agent" field.

func (*AuthSessionUpdate) SetUserID

func (_u *AuthSessionUpdate) SetUserID(v uuid.UUID) *AuthSessionUpdate

SetUserID sets the "user_id" field.

func (*AuthSessionUpdate) Where

Where appends a list predicates to the AuthSessionUpdate builder.

type AuthSessionUpdateOne

type AuthSessionUpdateOne struct {
	// contains filtered or unexported fields
}

AuthSessionUpdateOne is the builder for updating a single AuthSession entity.

func (*AuthSessionUpdateOne) ClearCreatedIP

func (_u *AuthSessionUpdateOne) ClearCreatedIP() *AuthSessionUpdateOne

ClearCreatedIP clears the value of the "created_ip" field.

func (*AuthSessionUpdateOne) ClearUser

func (_u *AuthSessionUpdateOne) ClearUser() *AuthSessionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AuthSessionUpdateOne) ClearUserAgent

func (_u *AuthSessionUpdateOne) ClearUserAgent() *AuthSessionUpdateOne

ClearUserAgent clears the value of the "user_agent" field.

func (*AuthSessionUpdateOne) Exec

func (_u *AuthSessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuthSessionUpdateOne) ExecContext

func (c *AuthSessionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthSessionUpdateOne) ExecX

func (_u *AuthSessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AuthSessionUpdateOne) Mutation

func (_u *AuthSessionUpdateOne) Mutation() *AuthSessionMutation

Mutation returns the AuthSessionMutation object of the builder.

func (*AuthSessionUpdateOne) QueryContext

func (c *AuthSessionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthSessionUpdateOne) Save

Save executes the query and returns the updated AuthSession entity.

func (*AuthSessionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*AuthSessionUpdateOne) Select

func (_u *AuthSessionUpdateOne) Select(field string, fields ...string) *AuthSessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AuthSessionUpdateOne) SetCreatedIP

func (_u *AuthSessionUpdateOne) SetCreatedIP(v string) *AuthSessionUpdateOne

SetCreatedIP sets the "created_ip" field.

func (*AuthSessionUpdateOne) SetExpiresAt

func (_u *AuthSessionUpdateOne) SetExpiresAt(v time.Time) *AuthSessionUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*AuthSessionUpdateOne) SetLastSeenAt

func (_u *AuthSessionUpdateOne) SetLastSeenAt(v time.Time) *AuthSessionUpdateOne

SetLastSeenAt sets the "last_seen_at" field.

func (*AuthSessionUpdateOne) SetNillableCreatedIP

func (_u *AuthSessionUpdateOne) SetNillableCreatedIP(v *string) *AuthSessionUpdateOne

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetNillableExpiresAt

func (_u *AuthSessionUpdateOne) SetNillableExpiresAt(v *time.Time) *AuthSessionUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetNillableLastSeenAt

func (_u *AuthSessionUpdateOne) SetNillableLastSeenAt(v *time.Time) *AuthSessionUpdateOne

SetNillableLastSeenAt sets the "last_seen_at" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetNillableTokenHash

func (_u *AuthSessionUpdateOne) SetNillableTokenHash(v *string) *AuthSessionUpdateOne

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetNillableUserAgent

func (_u *AuthSessionUpdateOne) SetNillableUserAgent(v *string) *AuthSessionUpdateOne

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetNillableUserID

func (_u *AuthSessionUpdateOne) SetNillableUserID(v *uuid.UUID) *AuthSessionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*AuthSessionUpdateOne) SetTokenHash

func (_u *AuthSessionUpdateOne) SetTokenHash(v string) *AuthSessionUpdateOne

SetTokenHash sets the "token_hash" field.

func (*AuthSessionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*AuthSessionUpdateOne) SetUserAgent

func (_u *AuthSessionUpdateOne) SetUserAgent(v string) *AuthSessionUpdateOne

SetUserAgent sets the "user_agent" field.

func (*AuthSessionUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*AuthSessionUpdateOne) Where

Where appends a list predicates to the AuthSessionUpdate builder.

type AuthSessions

type AuthSessions []*AuthSession

AuthSessions is a parsable slice of AuthSession.

type Chat

type Chat struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type chat.Type `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy uuid.UUID `json:"created_by,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID *uuid.UUID `json:"agent_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 ChatQuery when eager-loading is set.
	Edges ChatEdges `json:"edges"`
	// contains filtered or unexported fields
}

Chat is the model entity for the Chat schema.

func (*Chat) ExecContext

func (c *Chat) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Chat) QueryAgent

func (_m *Chat) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Chat entity.

func (*Chat) QueryContext

func (c *Chat) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Chat) QueryCreator

func (_m *Chat) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Chat entity.

func (*Chat) QueryMembers

func (_m *Chat) QueryMembers() *ChatMemberQuery

QueryMembers queries the "members" edge of the Chat entity.

func (*Chat) QueryMessages

func (_m *Chat) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Chat entity.

func (*Chat) String

func (_m *Chat) String() string

String implements the fmt.Stringer.

func (*Chat) Unwrap

func (_m *Chat) Unwrap() *Chat

Unwrap unwraps the Chat 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 (*Chat) Update

func (_m *Chat) Update() *ChatUpdateOne

Update returns a builder for updating this Chat. Note that you need to call Chat.Unwrap() before calling this method if this Chat was returned from a transaction, and the transaction was committed or rolled back.

func (*Chat) Value

func (_m *Chat) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Chat. This includes values selected through modifiers, order, etc.

type ChatClient

type ChatClient struct {
	// contains filtered or unexported fields
}

ChatClient is a client for the Chat schema.

func NewChatClient

func NewChatClient(c config) *ChatClient

NewChatClient returns a client for the Chat from the given config.

func (*ChatClient) Create

func (c *ChatClient) Create() *ChatCreate

Create returns a builder for creating a Chat entity.

func (*ChatClient) CreateBulk

func (c *ChatClient) CreateBulk(builders ...*ChatCreate) *ChatCreateBulk

CreateBulk returns a builder for creating a bulk of Chat entities.

func (*ChatClient) Delete

func (c *ChatClient) Delete() *ChatDelete

Delete returns a delete builder for Chat.

func (*ChatClient) DeleteOne

func (c *ChatClient) DeleteOne(_m *Chat) *ChatDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatClient) DeleteOneID

func (c *ChatClient) DeleteOneID(id uuid.UUID) *ChatDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChatClient) ExecContext

func (c *ChatClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatClient) Get

func (c *ChatClient) Get(ctx context.Context, id uuid.UUID) (*Chat, error)

Get returns a Chat entity by its id.

func (*ChatClient) GetX

func (c *ChatClient) GetX(ctx context.Context, id uuid.UUID) *Chat

GetX is like Get, but panics if an error occurs.

func (*ChatClient) Hooks

func (c *ChatClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChatClient) Intercept

func (c *ChatClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chat.Intercept(f(g(h())))`.

func (*ChatClient) Interceptors

func (c *ChatClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChatClient) MapCreateBulk

func (c *ChatClient) MapCreateBulk(slice any, setFunc func(*ChatCreate, int)) *ChatCreateBulk

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 (*ChatClient) Query

func (c *ChatClient) Query() *ChatQuery

Query returns a query builder for Chat.

func (*ChatClient) QueryAgent

func (c *ChatClient) QueryAgent(_m *Chat) *AgentQuery

QueryAgent queries the agent edge of a Chat.

func (*ChatClient) QueryContext

func (c *ChatClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatClient) QueryCreator

func (c *ChatClient) QueryCreator(_m *Chat) *UserQuery

QueryCreator queries the creator edge of a Chat.

func (*ChatClient) QueryMembers

func (c *ChatClient) QueryMembers(_m *Chat) *ChatMemberQuery

QueryMembers queries the members edge of a Chat.

func (*ChatClient) QueryMessages

func (c *ChatClient) QueryMessages(_m *Chat) *MessageQuery

QueryMessages queries the messages edge of a Chat.

func (*ChatClient) Update

func (c *ChatClient) Update() *ChatUpdate

Update returns an update builder for Chat.

func (*ChatClient) UpdateOne

func (c *ChatClient) UpdateOne(_m *Chat) *ChatUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatClient) UpdateOneID

func (c *ChatClient) UpdateOneID(id uuid.UUID) *ChatUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatClient) Use

func (c *ChatClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chat.Hooks(f(g(h())))`.

type ChatCreate

type ChatCreate struct {
	// contains filtered or unexported fields
}

ChatCreate is the builder for creating a Chat entity.

func (*ChatCreate) AddMemberIDs

func (_c *ChatCreate) AddMemberIDs(ids ...uuid.UUID) *ChatCreate

AddMemberIDs adds the "members" edge to the ChatMember entity by IDs.

func (*ChatCreate) AddMembers

func (_c *ChatCreate) AddMembers(v ...*ChatMember) *ChatCreate

AddMembers adds the "members" edges to the ChatMember entity.

func (*ChatCreate) AddMessageIDs

func (_c *ChatCreate) AddMessageIDs(ids ...uuid.UUID) *ChatCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatCreate) AddMessages

func (_c *ChatCreate) AddMessages(v ...*Message) *ChatCreate

AddMessages adds the "messages" edges to the Message entity.

func (*ChatCreate) Exec

func (_c *ChatCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatCreate) ExecContext

func (c *ChatCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatCreate) ExecX

func (_c *ChatCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatCreate) Mutation

func (_c *ChatCreate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatCreate) QueryContext

func (c *ChatCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatCreate) Save

func (_c *ChatCreate) Save(ctx context.Context) (*Chat, error)

Save creates the Chat in the database.

func (*ChatCreate) SaveX

func (_c *ChatCreate) SaveX(ctx context.Context) *Chat

SaveX calls Save and panics if Save returns an error.

func (*ChatCreate) SetAgent

func (_c *ChatCreate) SetAgent(v *Agent) *ChatCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*ChatCreate) SetAgentID

func (_c *ChatCreate) SetAgentID(v uuid.UUID) *ChatCreate

SetAgentID sets the "agent_id" field.

func (*ChatCreate) SetCreatedAt

func (_c *ChatCreate) SetCreatedAt(v time.Time) *ChatCreate

SetCreatedAt sets the "created_at" field.

func (*ChatCreate) SetCreatedBy

func (_c *ChatCreate) SetCreatedBy(v uuid.UUID) *ChatCreate

SetCreatedBy sets the "created_by" field.

func (*ChatCreate) SetCreator

func (_c *ChatCreate) SetCreator(v *User) *ChatCreate

SetCreator sets the "creator" edge to the User entity.

func (*ChatCreate) SetCreatorID

func (_c *ChatCreate) SetCreatorID(id uuid.UUID) *ChatCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ChatCreate) SetID

func (_c *ChatCreate) SetID(v uuid.UUID) *ChatCreate

SetID sets the "id" field.

func (*ChatCreate) SetName

func (_c *ChatCreate) SetName(v string) *ChatCreate

SetName sets the "name" field.

func (*ChatCreate) SetNillableAgentID

func (_c *ChatCreate) SetNillableAgentID(v *uuid.UUID) *ChatCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ChatCreate) SetNillableCreatedAt

func (_c *ChatCreate) SetNillableCreatedAt(v *time.Time) *ChatCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ChatCreate) SetNillableID

func (_c *ChatCreate) SetNillableID(v *uuid.UUID) *ChatCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ChatCreate) SetNillableName

func (_c *ChatCreate) SetNillableName(v *string) *ChatCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*ChatCreate) SetType

func (_c *ChatCreate) SetType(v chat.Type) *ChatCreate

SetType sets the "type" field.

type ChatCreateBulk

type ChatCreateBulk struct {
	// contains filtered or unexported fields
}

ChatCreateBulk is the builder for creating many Chat entities in bulk.

func (*ChatCreateBulk) Exec

func (_c *ChatCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatCreateBulk) ExecContext

func (c *ChatCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatCreateBulk) ExecX

func (_c *ChatCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatCreateBulk) QueryContext

func (c *ChatCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatCreateBulk) Save

func (_c *ChatCreateBulk) Save(ctx context.Context) ([]*Chat, error)

Save creates the Chat entities in the database.

func (*ChatCreateBulk) SaveX

func (_c *ChatCreateBulk) SaveX(ctx context.Context) []*Chat

SaveX is like Save, but panics if an error occurs.

type ChatDelete

type ChatDelete struct {
	// contains filtered or unexported fields
}

ChatDelete is the builder for deleting a Chat entity.

func (*ChatDelete) Exec

func (_d *ChatDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChatDelete) ExecContext

func (c *ChatDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatDelete) ExecX

func (_d *ChatDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChatDelete) QueryContext

func (c *ChatDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatDelete) Where

func (_d *ChatDelete) Where(ps ...predicate.Chat) *ChatDelete

Where appends a list predicates to the ChatDelete builder.

type ChatDeleteOne

type ChatDeleteOne struct {
	// contains filtered or unexported fields
}

ChatDeleteOne is the builder for deleting a single Chat entity.

func (*ChatDeleteOne) Exec

func (_d *ChatDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatDeleteOne) ExecX

func (_d *ChatDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatDeleteOne) Where

func (_d *ChatDeleteOne) Where(ps ...predicate.Chat) *ChatDeleteOne

Where appends a list predicates to the ChatDelete builder.

type ChatEdges

type ChatEdges struct {
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Members holds the value of the members edge.
	Members []*ChatMember `json:"members,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// contains filtered or unexported fields
}

ChatEdges holds the relations/edges for other nodes in the graph.

func (ChatEdges) AgentOrErr

func (e ChatEdges) AgentOrErr() (*Agent, error)

AgentOrErr returns the Agent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatEdges) CreatorOrErr

func (e ChatEdges) CreatorOrErr() (*User, error)

CreatorOrErr returns the Creator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatEdges) MembersOrErr

func (e ChatEdges) MembersOrErr() ([]*ChatMember, error)

MembersOrErr returns the Members value or an error if the edge was not loaded in eager-loading.

func (ChatEdges) MessagesOrErr

func (e ChatEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

type ChatGroupBy

type ChatGroupBy struct {
	// contains filtered or unexported fields
}

ChatGroupBy is the group-by builder for Chat entities.

func (*ChatGroupBy) Aggregate

func (_g *ChatGroupBy) Aggregate(fns ...AggregateFunc) *ChatGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChatGroupBy) Bool

func (s *ChatGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) BoolX

func (s *ChatGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatGroupBy) Bools

func (s *ChatGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) BoolsX

func (s *ChatGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatGroupBy) Float64

func (s *ChatGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) Float64X

func (s *ChatGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatGroupBy) Float64s

func (s *ChatGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) Float64sX

func (s *ChatGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatGroupBy) Int

func (s *ChatGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) IntX

func (s *ChatGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatGroupBy) Ints

func (s *ChatGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) IntsX

func (s *ChatGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatGroupBy) Scan

func (_g *ChatGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatGroupBy) ScanX

func (s *ChatGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatGroupBy) String

func (s *ChatGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) StringX

func (s *ChatGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatGroupBy) Strings

func (s *ChatGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatGroupBy) StringsX

func (s *ChatGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatMember

type ChatMember struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// ChatID holds the value of the "chat_id" field.
	ChatID uuid.UUID `json:"chat_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Role holds the value of the "role" field.
	Role chatmember.Role `json:"role,omitempty"`
	// JoinedAt holds the value of the "joined_at" field.
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatMemberQuery when eager-loading is set.
	Edges ChatMemberEdges `json:"edges"`
	// contains filtered or unexported fields
}

ChatMember is the model entity for the ChatMember schema.

func (*ChatMember) ExecContext

func (c *ChatMember) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMember) QueryChat

func (_m *ChatMember) QueryChat() *ChatQuery

QueryChat queries the "chat" edge of the ChatMember entity.

func (*ChatMember) QueryContext

func (c *ChatMember) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMember) QueryUser

func (_m *ChatMember) QueryUser() *UserQuery

QueryUser queries the "user" edge of the ChatMember entity.

func (*ChatMember) String

func (_m *ChatMember) String() string

String implements the fmt.Stringer.

func (*ChatMember) Unwrap

func (_m *ChatMember) Unwrap() *ChatMember

Unwrap unwraps the ChatMember 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 (*ChatMember) Update

func (_m *ChatMember) Update() *ChatMemberUpdateOne

Update returns a builder for updating this ChatMember. Note that you need to call ChatMember.Unwrap() before calling this method if this ChatMember was returned from a transaction, and the transaction was committed or rolled back.

func (*ChatMember) Value

func (_m *ChatMember) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ChatMember. This includes values selected through modifiers, order, etc.

type ChatMemberClient

type ChatMemberClient struct {
	// contains filtered or unexported fields
}

ChatMemberClient is a client for the ChatMember schema.

func NewChatMemberClient

func NewChatMemberClient(c config) *ChatMemberClient

NewChatMemberClient returns a client for the ChatMember from the given config.

func (*ChatMemberClient) Create

func (c *ChatMemberClient) Create() *ChatMemberCreate

Create returns a builder for creating a ChatMember entity.

func (*ChatMemberClient) CreateBulk

func (c *ChatMemberClient) CreateBulk(builders ...*ChatMemberCreate) *ChatMemberCreateBulk

CreateBulk returns a builder for creating a bulk of ChatMember entities.

func (*ChatMemberClient) Delete

func (c *ChatMemberClient) Delete() *ChatMemberDelete

Delete returns a delete builder for ChatMember.

func (*ChatMemberClient) DeleteOne

func (c *ChatMemberClient) DeleteOne(_m *ChatMember) *ChatMemberDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatMemberClient) DeleteOneID

func (c *ChatMemberClient) DeleteOneID(id uuid.UUID) *ChatMemberDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChatMemberClient) ExecContext

func (c *ChatMemberClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberClient) Get

Get returns a ChatMember entity by its id.

func (*ChatMemberClient) GetX

func (c *ChatMemberClient) GetX(ctx context.Context, id uuid.UUID) *ChatMember

GetX is like Get, but panics if an error occurs.

func (*ChatMemberClient) Hooks

func (c *ChatMemberClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChatMemberClient) Intercept

func (c *ChatMemberClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatmember.Intercept(f(g(h())))`.

func (*ChatMemberClient) Interceptors

func (c *ChatMemberClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChatMemberClient) MapCreateBulk

func (c *ChatMemberClient) MapCreateBulk(slice any, setFunc func(*ChatMemberCreate, int)) *ChatMemberCreateBulk

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 (*ChatMemberClient) Query

func (c *ChatMemberClient) Query() *ChatMemberQuery

Query returns a query builder for ChatMember.

func (*ChatMemberClient) QueryChat

func (c *ChatMemberClient) QueryChat(_m *ChatMember) *ChatQuery

QueryChat queries the chat edge of a ChatMember.

func (*ChatMemberClient) QueryContext

func (c *ChatMemberClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberClient) QueryUser

func (c *ChatMemberClient) QueryUser(_m *ChatMember) *UserQuery

QueryUser queries the user edge of a ChatMember.

func (*ChatMemberClient) Update

func (c *ChatMemberClient) Update() *ChatMemberUpdate

Update returns an update builder for ChatMember.

func (*ChatMemberClient) UpdateOne

func (c *ChatMemberClient) UpdateOne(_m *ChatMember) *ChatMemberUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatMemberClient) UpdateOneID

func (c *ChatMemberClient) UpdateOneID(id uuid.UUID) *ChatMemberUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatMemberClient) Use

func (c *ChatMemberClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatmember.Hooks(f(g(h())))`.

type ChatMemberCreate

type ChatMemberCreate struct {
	// contains filtered or unexported fields
}

ChatMemberCreate is the builder for creating a ChatMember entity.

func (*ChatMemberCreate) Exec

func (_c *ChatMemberCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatMemberCreate) ExecContext

func (c *ChatMemberCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberCreate) ExecX

func (_c *ChatMemberCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberCreate) Mutation

func (_c *ChatMemberCreate) Mutation() *ChatMemberMutation

Mutation returns the ChatMemberMutation object of the builder.

func (*ChatMemberCreate) QueryContext

func (c *ChatMemberCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberCreate) Save

func (_c *ChatMemberCreate) Save(ctx context.Context) (*ChatMember, error)

Save creates the ChatMember in the database.

func (*ChatMemberCreate) SaveX

func (_c *ChatMemberCreate) SaveX(ctx context.Context) *ChatMember

SaveX calls Save and panics if Save returns an error.

func (*ChatMemberCreate) SetChat

func (_c *ChatMemberCreate) SetChat(v *Chat) *ChatMemberCreate

SetChat sets the "chat" edge to the Chat entity.

func (*ChatMemberCreate) SetChatID

func (_c *ChatMemberCreate) SetChatID(v uuid.UUID) *ChatMemberCreate

SetChatID sets the "chat_id" field.

func (*ChatMemberCreate) SetID

SetID sets the "id" field.

func (*ChatMemberCreate) SetJoinedAt

func (_c *ChatMemberCreate) SetJoinedAt(v time.Time) *ChatMemberCreate

SetJoinedAt sets the "joined_at" field.

func (*ChatMemberCreate) SetNillableID

func (_c *ChatMemberCreate) SetNillableID(v *uuid.UUID) *ChatMemberCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ChatMemberCreate) SetNillableJoinedAt

func (_c *ChatMemberCreate) SetNillableJoinedAt(v *time.Time) *ChatMemberCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*ChatMemberCreate) SetNillableRole

func (_c *ChatMemberCreate) SetNillableRole(v *chatmember.Role) *ChatMemberCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ChatMemberCreate) SetRole

SetRole sets the "role" field.

func (*ChatMemberCreate) SetUser

func (_c *ChatMemberCreate) SetUser(v *User) *ChatMemberCreate

SetUser sets the "user" edge to the User entity.

func (*ChatMemberCreate) SetUserID

func (_c *ChatMemberCreate) SetUserID(v uuid.UUID) *ChatMemberCreate

SetUserID sets the "user_id" field.

type ChatMemberCreateBulk

type ChatMemberCreateBulk struct {
	// contains filtered or unexported fields
}

ChatMemberCreateBulk is the builder for creating many ChatMember entities in bulk.

func (*ChatMemberCreateBulk) Exec

func (_c *ChatMemberCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatMemberCreateBulk) ExecContext

func (c *ChatMemberCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberCreateBulk) ExecX

func (_c *ChatMemberCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberCreateBulk) QueryContext

func (c *ChatMemberCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberCreateBulk) Save

func (_c *ChatMemberCreateBulk) Save(ctx context.Context) ([]*ChatMember, error)

Save creates the ChatMember entities in the database.

func (*ChatMemberCreateBulk) SaveX

func (_c *ChatMemberCreateBulk) SaveX(ctx context.Context) []*ChatMember

SaveX is like Save, but panics if an error occurs.

type ChatMemberDelete

type ChatMemberDelete struct {
	// contains filtered or unexported fields
}

ChatMemberDelete is the builder for deleting a ChatMember entity.

func (*ChatMemberDelete) Exec

func (_d *ChatMemberDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChatMemberDelete) ExecContext

func (c *ChatMemberDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberDelete) ExecX

func (_d *ChatMemberDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberDelete) QueryContext

func (c *ChatMemberDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberDelete) Where

Where appends a list predicates to the ChatMemberDelete builder.

type ChatMemberDeleteOne

type ChatMemberDeleteOne struct {
	// contains filtered or unexported fields
}

ChatMemberDeleteOne is the builder for deleting a single ChatMember entity.

func (*ChatMemberDeleteOne) Exec

func (_d *ChatMemberDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatMemberDeleteOne) ExecX

func (_d *ChatMemberDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberDeleteOne) Where

Where appends a list predicates to the ChatMemberDelete builder.

type ChatMemberEdges

type ChatMemberEdges struct {
	// Chat holds the value of the chat edge.
	Chat *Chat `json:"chat,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

ChatMemberEdges holds the relations/edges for other nodes in the graph.

func (ChatMemberEdges) ChatOrErr

func (e ChatMemberEdges) ChatOrErr() (*Chat, error)

ChatOrErr returns the Chat value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ChatMemberEdges) UserOrErr

func (e ChatMemberEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ChatMemberGroupBy

type ChatMemberGroupBy struct {
	// contains filtered or unexported fields
}

ChatMemberGroupBy is the group-by builder for ChatMember entities.

func (*ChatMemberGroupBy) Aggregate

func (_g *ChatMemberGroupBy) Aggregate(fns ...AggregateFunc) *ChatMemberGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChatMemberGroupBy) Bool

func (s *ChatMemberGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) BoolX

func (s *ChatMemberGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatMemberGroupBy) Bools

func (s *ChatMemberGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) BoolsX

func (s *ChatMemberGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChatMemberGroupBy) Float64

func (s *ChatMemberGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) Float64X

func (s *ChatMemberGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatMemberGroupBy) Float64s

func (s *ChatMemberGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) Float64sX

func (s *ChatMemberGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatMemberGroupBy) Int

func (s *ChatMemberGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) IntX

func (s *ChatMemberGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatMemberGroupBy) Ints

func (s *ChatMemberGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) IntsX

func (s *ChatMemberGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChatMemberGroupBy) Scan

func (_g *ChatMemberGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatMemberGroupBy) ScanX

func (s *ChatMemberGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatMemberGroupBy) String

func (s *ChatMemberGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) StringX

func (s *ChatMemberGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatMemberGroupBy) Strings

func (s *ChatMemberGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatMemberGroupBy) StringsX

func (s *ChatMemberGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatMemberMutation

type ChatMemberMutation struct {
	// contains filtered or unexported fields
}

ChatMemberMutation represents an operation that mutates the ChatMember nodes in the graph.

func (*ChatMemberMutation) AddField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) AddedEdges

func (m *ChatMemberMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChatMemberMutation) AddedField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) AddedFields

func (m *ChatMemberMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChatMemberMutation) AddedIDs

func (m *ChatMemberMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChatMemberMutation) ChatCleared

func (m *ChatMemberMutation) ChatCleared() bool

ChatCleared reports if the "chat" edge to the Chat entity was cleared.

func (*ChatMemberMutation) ChatID

func (m *ChatMemberMutation) ChatID() (r uuid.UUID, exists bool)

ChatID returns the value of the "chat_id" field in the mutation.

func (*ChatMemberMutation) ChatIDs

func (m *ChatMemberMutation) ChatIDs() (ids []uuid.UUID)

ChatIDs returns the "chat" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ChatID instead. It exists only for internal usage by the builders.

func (*ChatMemberMutation) ClearChat

func (m *ChatMemberMutation) ClearChat()

ClearChat clears the "chat" edge to the Chat entity.

func (*ChatMemberMutation) ClearEdge

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ClearField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ClearUser

func (m *ChatMemberMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ChatMemberMutation) ClearedEdges

func (m *ChatMemberMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChatMemberMutation) ClearedFields

func (m *ChatMemberMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChatMemberMutation) Client

func (m ChatMemberMutation) 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 (*ChatMemberMutation) EdgeCleared

func (m *ChatMemberMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChatMemberMutation) ExecContext

func (c *ChatMemberMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberMutation) Field

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) FieldCleared

func (m *ChatMemberMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChatMemberMutation) Fields

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ID

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) IDs

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) JoinedAt

func (m *ChatMemberMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*ChatMemberMutation) OldChatID

func (m *ChatMemberMutation) OldChatID(ctx context.Context) (v uuid.UUID, err error)

OldChatID returns the old "chat_id" field's value of the ChatMember entity. If the ChatMember 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 (*ChatMemberMutation) OldField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) OldJoinedAt

func (m *ChatMemberMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the ChatMember entity. If the ChatMember 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 (*ChatMemberMutation) OldRole

func (m *ChatMemberMutation) OldRole(ctx context.Context) (v chatmember.Role, err error)

OldRole returns the old "role" field's value of the ChatMember entity. If the ChatMember 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 (*ChatMemberMutation) OldUserID

func (m *ChatMemberMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the ChatMember entity. If the ChatMember 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 (*ChatMemberMutation) Op

func (m *ChatMemberMutation) Op() Op

Op returns the operation name.

func (*ChatMemberMutation) QueryContext

func (c *ChatMemberMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberMutation) RemovedEdges

func (m *ChatMemberMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChatMemberMutation) RemovedIDs

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ResetChat

func (m *ChatMemberMutation) ResetChat()

ResetChat resets all changes to the "chat" edge.

func (*ChatMemberMutation) ResetChatID

func (m *ChatMemberMutation) ResetChatID()

ResetChatID resets all changes to the "chat_id" field.

func (*ChatMemberMutation) ResetEdge

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ResetField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) ResetJoinedAt

func (m *ChatMemberMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*ChatMemberMutation) ResetRole

func (m *ChatMemberMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*ChatMemberMutation) ResetUser

func (m *ChatMemberMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ChatMemberMutation) ResetUserID

func (m *ChatMemberMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ChatMemberMutation) Role

func (m *ChatMemberMutation) Role() (r chatmember.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*ChatMemberMutation) SetChatID

func (m *ChatMemberMutation) SetChatID(u uuid.UUID)

SetChatID sets the "chat_id" field.

func (*ChatMemberMutation) SetField

func (m *ChatMemberMutation) 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 (*ChatMemberMutation) SetID

func (m *ChatMemberMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ChatMember entities.

func (*ChatMemberMutation) SetJoinedAt

func (m *ChatMemberMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*ChatMemberMutation) SetOp

func (m *ChatMemberMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMemberMutation) SetRole

func (m *ChatMemberMutation) SetRole(c chatmember.Role)

SetRole sets the "role" field.

func (*ChatMemberMutation) SetUserID

func (m *ChatMemberMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (ChatMemberMutation) Tx

func (m ChatMemberMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChatMemberMutation) Type

func (m *ChatMemberMutation) Type() string

Type returns the node type of this mutation (ChatMember).

func (*ChatMemberMutation) UserCleared

func (m *ChatMemberMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ChatMemberMutation) UserID

func (m *ChatMemberMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ChatMemberMutation) UserIDs

func (m *ChatMemberMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*ChatMemberMutation) Where

func (m *ChatMemberMutation) Where(ps ...predicate.ChatMember)

Where appends a list predicates to the ChatMemberMutation builder.

func (*ChatMemberMutation) WhereP

func (m *ChatMemberMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChatMemberMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChatMemberQuery

type ChatMemberQuery struct {
	// contains filtered or unexported fields
}

ChatMemberQuery is the builder for querying ChatMember entities.

func (*ChatMemberQuery) Aggregate

func (_q *ChatMemberQuery) Aggregate(fns ...AggregateFunc) *ChatMemberSelect

Aggregate returns a ChatMemberSelect configured with the given aggregations.

func (*ChatMemberQuery) All

func (_q *ChatMemberQuery) All(ctx context.Context) ([]*ChatMember, error)

All executes the query and returns a list of ChatMembers.

func (*ChatMemberQuery) AllX

func (_q *ChatMemberQuery) AllX(ctx context.Context) []*ChatMember

AllX is like All, but panics if an error occurs.

func (*ChatMemberQuery) Clone

func (_q *ChatMemberQuery) Clone() *ChatMemberQuery

Clone returns a duplicate of the ChatMemberQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChatMemberQuery) Count

func (_q *ChatMemberQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatMemberQuery) CountX

func (_q *ChatMemberQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChatMemberQuery) ExecContext

func (c *ChatMemberQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberQuery) Exist

func (_q *ChatMemberQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChatMemberQuery) ExistX

func (_q *ChatMemberQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChatMemberQuery) First

func (_q *ChatMemberQuery) First(ctx context.Context) (*ChatMember, error)

First returns the first ChatMember entity from the query. Returns a *NotFoundError when no ChatMember was found.

func (*ChatMemberQuery) FirstID

func (_q *ChatMemberQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ChatMember ID from the query. Returns a *NotFoundError when no ChatMember ID was found.

func (*ChatMemberQuery) FirstIDX

func (_q *ChatMemberQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChatMemberQuery) FirstX

func (_q *ChatMemberQuery) FirstX(ctx context.Context) *ChatMember

FirstX is like First, but panics if an error occurs.

func (*ChatMemberQuery) GroupBy

func (_q *ChatMemberQuery) GroupBy(field string, fields ...string) *ChatMemberGroupBy

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 {
	ChatID uuid.UUID `json:"chat_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ChatMember.Query().
	GroupBy(chatmember.FieldChatID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatMemberQuery) IDs

func (_q *ChatMemberQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ChatMember IDs.

func (*ChatMemberQuery) IDsX

func (_q *ChatMemberQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ChatMemberQuery) Limit

func (_q *ChatMemberQuery) Limit(limit int) *ChatMemberQuery

Limit the number of records to be returned by this query.

func (*ChatMemberQuery) Offset

func (_q *ChatMemberQuery) Offset(offset int) *ChatMemberQuery

Offset to start from.

func (*ChatMemberQuery) Only

func (_q *ChatMemberQuery) Only(ctx context.Context) (*ChatMember, error)

Only returns a single ChatMember entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatMember entity is found. Returns a *NotFoundError when no ChatMember entities are found.

func (*ChatMemberQuery) OnlyID

func (_q *ChatMemberQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ChatMember ID in the query. Returns a *NotSingularError when more than one ChatMember ID is found. Returns a *NotFoundError when no entities are found.

func (*ChatMemberQuery) OnlyIDX

func (_q *ChatMemberQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChatMemberQuery) OnlyX

func (_q *ChatMemberQuery) OnlyX(ctx context.Context) *ChatMember

OnlyX is like Only, but panics if an error occurs.

func (*ChatMemberQuery) Order

Order specifies how the records should be ordered.

func (*ChatMemberQuery) QueryChat

func (_q *ChatMemberQuery) QueryChat() *ChatQuery

QueryChat chains the current query on the "chat" edge.

func (*ChatMemberQuery) QueryContext

func (c *ChatMemberQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberQuery) QueryUser

func (_q *ChatMemberQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ChatMemberQuery) Select

func (_q *ChatMemberQuery) Select(fields ...string) *ChatMemberSelect

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 {
	ChatID uuid.UUID `json:"chat_id,omitempty"`
}

client.ChatMember.Query().
	Select(chatmember.FieldChatID).
	Scan(ctx, &v)

func (*ChatMemberQuery) Unique

func (_q *ChatMemberQuery) Unique(unique bool) *ChatMemberQuery

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 (*ChatMemberQuery) Where

Where adds a new predicate for the ChatMemberQuery builder.

func (*ChatMemberQuery) WithChat

func (_q *ChatMemberQuery) WithChat(opts ...func(*ChatQuery)) *ChatMemberQuery

WithChat tells the query-builder to eager-load the nodes that are connected to the "chat" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatMemberQuery) WithUser

func (_q *ChatMemberQuery) WithUser(opts ...func(*UserQuery)) *ChatMemberQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ChatMemberSelect

type ChatMemberSelect struct {
	*ChatMemberQuery
	// contains filtered or unexported fields
}

ChatMemberSelect is the builder for selecting fields of ChatMember entities.

func (*ChatMemberSelect) Aggregate

func (_s *ChatMemberSelect) Aggregate(fns ...AggregateFunc) *ChatMemberSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatMemberSelect) Bool

func (s *ChatMemberSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) BoolX

func (s *ChatMemberSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatMemberSelect) Bools

func (s *ChatMemberSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) BoolsX

func (s *ChatMemberSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ChatMemberSelect) ExecContext

func (c ChatMemberSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberSelect) Float64

func (s *ChatMemberSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) Float64X

func (s *ChatMemberSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatMemberSelect) Float64s

func (s *ChatMemberSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) Float64sX

func (s *ChatMemberSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatMemberSelect) Int

func (s *ChatMemberSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) IntX

func (s *ChatMemberSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatMemberSelect) Ints

func (s *ChatMemberSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) IntsX

func (s *ChatMemberSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (ChatMemberSelect) QueryContext

func (c ChatMemberSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberSelect) Scan

func (_s *ChatMemberSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatMemberSelect) ScanX

func (s *ChatMemberSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatMemberSelect) String

func (s *ChatMemberSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) StringX

func (s *ChatMemberSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatMemberSelect) Strings

func (s *ChatMemberSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatMemberSelect) StringsX

func (s *ChatMemberSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatMemberUpdate

type ChatMemberUpdate struct {
	// contains filtered or unexported fields
}

ChatMemberUpdate is the builder for updating ChatMember entities.

func (*ChatMemberUpdate) ClearChat

func (_u *ChatMemberUpdate) ClearChat() *ChatMemberUpdate

ClearChat clears the "chat" edge to the Chat entity.

func (*ChatMemberUpdate) ClearUser

func (_u *ChatMemberUpdate) ClearUser() *ChatMemberUpdate

ClearUser clears the "user" edge to the User entity.

func (*ChatMemberUpdate) Exec

func (_u *ChatMemberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatMemberUpdate) ExecContext

func (c *ChatMemberUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberUpdate) ExecX

func (_u *ChatMemberUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberUpdate) Mutation

func (_u *ChatMemberUpdate) Mutation() *ChatMemberMutation

Mutation returns the ChatMemberMutation object of the builder.

func (*ChatMemberUpdate) QueryContext

func (c *ChatMemberUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberUpdate) Save

func (_u *ChatMemberUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChatMemberUpdate) SaveX

func (_u *ChatMemberUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChatMemberUpdate) SetChat

func (_u *ChatMemberUpdate) SetChat(v *Chat) *ChatMemberUpdate

SetChat sets the "chat" edge to the Chat entity.

func (*ChatMemberUpdate) SetChatID

func (_u *ChatMemberUpdate) SetChatID(v uuid.UUID) *ChatMemberUpdate

SetChatID sets the "chat_id" field.

func (*ChatMemberUpdate) SetNillableChatID

func (_u *ChatMemberUpdate) SetNillableChatID(v *uuid.UUID) *ChatMemberUpdate

SetNillableChatID sets the "chat_id" field if the given value is not nil.

func (*ChatMemberUpdate) SetNillableRole

func (_u *ChatMemberUpdate) SetNillableRole(v *chatmember.Role) *ChatMemberUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ChatMemberUpdate) SetNillableUserID

func (_u *ChatMemberUpdate) SetNillableUserID(v *uuid.UUID) *ChatMemberUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ChatMemberUpdate) SetRole

SetRole sets the "role" field.

func (*ChatMemberUpdate) SetUser

func (_u *ChatMemberUpdate) SetUser(v *User) *ChatMemberUpdate

SetUser sets the "user" edge to the User entity.

func (*ChatMemberUpdate) SetUserID

func (_u *ChatMemberUpdate) SetUserID(v uuid.UUID) *ChatMemberUpdate

SetUserID sets the "user_id" field.

func (*ChatMemberUpdate) Where

Where appends a list predicates to the ChatMemberUpdate builder.

type ChatMemberUpdateOne

type ChatMemberUpdateOne struct {
	// contains filtered or unexported fields
}

ChatMemberUpdateOne is the builder for updating a single ChatMember entity.

func (*ChatMemberUpdateOne) ClearChat

func (_u *ChatMemberUpdateOne) ClearChat() *ChatMemberUpdateOne

ClearChat clears the "chat" edge to the Chat entity.

func (*ChatMemberUpdateOne) ClearUser

func (_u *ChatMemberUpdateOne) ClearUser() *ChatMemberUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*ChatMemberUpdateOne) Exec

func (_u *ChatMemberUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatMemberUpdateOne) ExecContext

func (c *ChatMemberUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMemberUpdateOne) ExecX

func (_u *ChatMemberUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatMemberUpdateOne) Mutation

func (_u *ChatMemberUpdateOne) Mutation() *ChatMemberMutation

Mutation returns the ChatMemberMutation object of the builder.

func (*ChatMemberUpdateOne) QueryContext

func (c *ChatMemberUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMemberUpdateOne) Save

Save executes the query and returns the updated ChatMember entity.

func (*ChatMemberUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ChatMemberUpdateOne) Select

func (_u *ChatMemberUpdateOne) Select(field string, fields ...string) *ChatMemberUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChatMemberUpdateOne) SetChat

func (_u *ChatMemberUpdateOne) SetChat(v *Chat) *ChatMemberUpdateOne

SetChat sets the "chat" edge to the Chat entity.

func (*ChatMemberUpdateOne) SetChatID

SetChatID sets the "chat_id" field.

func (*ChatMemberUpdateOne) SetNillableChatID

func (_u *ChatMemberUpdateOne) SetNillableChatID(v *uuid.UUID) *ChatMemberUpdateOne

SetNillableChatID sets the "chat_id" field if the given value is not nil.

func (*ChatMemberUpdateOne) SetNillableRole

func (_u *ChatMemberUpdateOne) SetNillableRole(v *chatmember.Role) *ChatMemberUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*ChatMemberUpdateOne) SetNillableUserID

func (_u *ChatMemberUpdateOne) SetNillableUserID(v *uuid.UUID) *ChatMemberUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ChatMemberUpdateOne) SetRole

SetRole sets the "role" field.

func (*ChatMemberUpdateOne) SetUser

func (_u *ChatMemberUpdateOne) SetUser(v *User) *ChatMemberUpdateOne

SetUser sets the "user" edge to the User entity.

func (*ChatMemberUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*ChatMemberUpdateOne) Where

Where appends a list predicates to the ChatMemberUpdate builder.

type ChatMembers

type ChatMembers []*ChatMember

ChatMembers is a parsable slice of ChatMember.

type ChatMutation

type ChatMutation struct {
	// contains filtered or unexported fields
}

ChatMutation represents an operation that mutates the Chat nodes in the graph.

func (*ChatMutation) AddField

func (m *ChatMutation) 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 (*ChatMutation) AddMemberIDs

func (m *ChatMutation) AddMemberIDs(ids ...uuid.UUID)

AddMemberIDs adds the "members" edge to the ChatMember entity by ids.

func (*ChatMutation) AddMessageIDs

func (m *ChatMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*ChatMutation) AddedEdges

func (m *ChatMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChatMutation) AddedField

func (m *ChatMutation) 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 (*ChatMutation) AddedFields

func (m *ChatMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChatMutation) AddedIDs

func (m *ChatMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChatMutation) AgentCleared

func (m *ChatMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*ChatMutation) AgentID

func (m *ChatMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*ChatMutation) AgentIDCleared

func (m *ChatMutation) AgentIDCleared() bool

AgentIDCleared returns if the "agent_id" field was cleared in this mutation.

func (*ChatMutation) AgentIDs

func (m *ChatMutation) AgentIDs() (ids []uuid.UUID)

AgentIDs returns the "agent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AgentID instead. It exists only for internal usage by the builders.

func (*ChatMutation) ClearAgent

func (m *ChatMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*ChatMutation) ClearAgentID

func (m *ChatMutation) ClearAgentID()

ClearAgentID clears the value of the "agent_id" field.

func (*ChatMutation) ClearCreator

func (m *ChatMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*ChatMutation) ClearEdge

func (m *ChatMutation) 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 (*ChatMutation) ClearField

func (m *ChatMutation) 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 (*ChatMutation) ClearMembers

func (m *ChatMutation) ClearMembers()

ClearMembers clears the "members" edge to the ChatMember entity.

func (*ChatMutation) ClearMessages

func (m *ChatMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*ChatMutation) ClearName

func (m *ChatMutation) ClearName()

ClearName clears the value of the "name" field.

func (*ChatMutation) ClearedEdges

func (m *ChatMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChatMutation) ClearedFields

func (m *ChatMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChatMutation) Client

func (m ChatMutation) 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 (*ChatMutation) CreatedAt

func (m *ChatMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ChatMutation) CreatedBy

func (m *ChatMutation) CreatedBy() (r uuid.UUID, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*ChatMutation) CreatorCleared

func (m *ChatMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*ChatMutation) CreatorID

func (m *ChatMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*ChatMutation) CreatorIDs

func (m *ChatMutation) CreatorIDs() (ids []uuid.UUID)

CreatorIDs returns the "creator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatorID instead. It exists only for internal usage by the builders.

func (*ChatMutation) EdgeCleared

func (m *ChatMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChatMutation) ExecContext

func (c *ChatMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatMutation) Field

func (m *ChatMutation) 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 (*ChatMutation) FieldCleared

func (m *ChatMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChatMutation) Fields

func (m *ChatMutation) 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 (*ChatMutation) GetType

func (m *ChatMutation) GetType() (r chat.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ChatMutation) ID

func (m *ChatMutation) 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 (*ChatMutation) IDs

func (m *ChatMutation) 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 (*ChatMutation) MembersCleared

func (m *ChatMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the ChatMember entity was cleared.

func (*ChatMutation) MembersIDs

func (m *ChatMutation) MembersIDs() (ids []uuid.UUID)

MembersIDs returns the "members" edge IDs in the mutation.

func (*ChatMutation) MessagesCleared

func (m *ChatMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*ChatMutation) MessagesIDs

func (m *ChatMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*ChatMutation) Name

func (m *ChatMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ChatMutation) NameCleared

func (m *ChatMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*ChatMutation) OldAgentID

func (m *ChatMutation) OldAgentID(ctx context.Context) (v *uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldCreatedAt

func (m *ChatMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldCreatedBy

func (m *ChatMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)

OldCreatedBy returns the old "created_by" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldField

func (m *ChatMutation) 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 (*ChatMutation) OldName

func (m *ChatMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldType

func (m *ChatMutation) OldType(ctx context.Context) (v chat.Type, err error)

OldType returns the old "type" field's value of the Chat entity. If the Chat 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 (*ChatMutation) Op

func (m *ChatMutation) Op() Op

Op returns the operation name.

func (*ChatMutation) QueryContext

func (c *ChatMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatMutation) RemoveMemberIDs

func (m *ChatMutation) RemoveMemberIDs(ids ...uuid.UUID)

RemoveMemberIDs removes the "members" edge to the ChatMember entity by IDs.

func (*ChatMutation) RemoveMessageIDs

func (m *ChatMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*ChatMutation) RemovedEdges

func (m *ChatMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChatMutation) RemovedIDs

func (m *ChatMutation) 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 (*ChatMutation) RemovedMembersIDs

func (m *ChatMutation) RemovedMembersIDs() (ids []uuid.UUID)

RemovedMembers returns the removed IDs of the "members" edge to the ChatMember entity.

func (*ChatMutation) RemovedMessagesIDs

func (m *ChatMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*ChatMutation) ResetAgent

func (m *ChatMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*ChatMutation) ResetAgentID

func (m *ChatMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*ChatMutation) ResetCreatedAt

func (m *ChatMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatMutation) ResetCreatedBy

func (m *ChatMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*ChatMutation) ResetCreator

func (m *ChatMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*ChatMutation) ResetEdge

func (m *ChatMutation) 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 (*ChatMutation) ResetField

func (m *ChatMutation) 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 (*ChatMutation) ResetMembers

func (m *ChatMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*ChatMutation) ResetMessages

func (m *ChatMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*ChatMutation) ResetName

func (m *ChatMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ChatMutation) ResetType

func (m *ChatMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ChatMutation) SetAgentID

func (m *ChatMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*ChatMutation) SetCreatedAt

func (m *ChatMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ChatMutation) SetCreatedBy

func (m *ChatMutation) SetCreatedBy(u uuid.UUID)

SetCreatedBy sets the "created_by" field.

func (*ChatMutation) SetCreatorID

func (m *ChatMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*ChatMutation) SetField

func (m *ChatMutation) 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 (*ChatMutation) SetID

func (m *ChatMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Chat entities.

func (*ChatMutation) SetName

func (m *ChatMutation) SetName(s string)

SetName sets the "name" field.

func (*ChatMutation) SetOp

func (m *ChatMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMutation) SetType

func (m *ChatMutation) SetType(c chat.Type)

SetType sets the "type" field.

func (ChatMutation) Tx

func (m ChatMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChatMutation) Type

func (m *ChatMutation) Type() string

Type returns the node type of this mutation (Chat).

func (*ChatMutation) Where

func (m *ChatMutation) Where(ps ...predicate.Chat)

Where appends a list predicates to the ChatMutation builder.

func (*ChatMutation) WhereP

func (m *ChatMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChatMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChatQuery

type ChatQuery struct {
	// contains filtered or unexported fields
}

ChatQuery is the builder for querying Chat entities.

func (*ChatQuery) Aggregate

func (_q *ChatQuery) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate returns a ChatSelect configured with the given aggregations.

func (*ChatQuery) All

func (_q *ChatQuery) All(ctx context.Context) ([]*Chat, error)

All executes the query and returns a list of Chats.

func (*ChatQuery) AllX

func (_q *ChatQuery) AllX(ctx context.Context) []*Chat

AllX is like All, but panics if an error occurs.

func (*ChatQuery) Clone

func (_q *ChatQuery) Clone() *ChatQuery

Clone returns a duplicate of the ChatQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChatQuery) Count

func (_q *ChatQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatQuery) CountX

func (_q *ChatQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChatQuery) ExecContext

func (c *ChatQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatQuery) Exist

func (_q *ChatQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChatQuery) ExistX

func (_q *ChatQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChatQuery) First

func (_q *ChatQuery) First(ctx context.Context) (*Chat, error)

First returns the first Chat entity from the query. Returns a *NotFoundError when no Chat was found.

func (*ChatQuery) FirstID

func (_q *ChatQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Chat ID from the query. Returns a *NotFoundError when no Chat ID was found.

func (*ChatQuery) FirstIDX

func (_q *ChatQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChatQuery) FirstX

func (_q *ChatQuery) FirstX(ctx context.Context) *Chat

FirstX is like First, but panics if an error occurs.

func (*ChatQuery) GroupBy

func (_q *ChatQuery) GroupBy(field string, fields ...string) *ChatGroupBy

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 {
	Type chat.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Chat.Query().
	GroupBy(chat.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatQuery) IDs

func (_q *ChatQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Chat IDs.

func (*ChatQuery) IDsX

func (_q *ChatQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ChatQuery) Limit

func (_q *ChatQuery) Limit(limit int) *ChatQuery

Limit the number of records to be returned by this query.

func (*ChatQuery) Offset

func (_q *ChatQuery) Offset(offset int) *ChatQuery

Offset to start from.

func (*ChatQuery) Only

func (_q *ChatQuery) Only(ctx context.Context) (*Chat, error)

Only returns a single Chat entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Chat entity is found. Returns a *NotFoundError when no Chat entities are found.

func (*ChatQuery) OnlyID

func (_q *ChatQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Chat ID in the query. Returns a *NotSingularError when more than one Chat ID is found. Returns a *NotFoundError when no entities are found.

func (*ChatQuery) OnlyIDX

func (_q *ChatQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChatQuery) OnlyX

func (_q *ChatQuery) OnlyX(ctx context.Context) *Chat

OnlyX is like Only, but panics if an error occurs.

func (*ChatQuery) Order

func (_q *ChatQuery) Order(o ...chat.OrderOption) *ChatQuery

Order specifies how the records should be ordered.

func (*ChatQuery) QueryAgent

func (_q *ChatQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*ChatQuery) QueryContext

func (c *ChatQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatQuery) QueryCreator

func (_q *ChatQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*ChatQuery) QueryMembers

func (_q *ChatQuery) QueryMembers() *ChatMemberQuery

QueryMembers chains the current query on the "members" edge.

func (*ChatQuery) QueryMessages

func (_q *ChatQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*ChatQuery) Select

func (_q *ChatQuery) Select(fields ...string) *ChatSelect

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 {
	Type chat.Type `json:"type,omitempty"`
}

client.Chat.Query().
	Select(chat.FieldType).
	Scan(ctx, &v)

func (*ChatQuery) Unique

func (_q *ChatQuery) Unique(unique bool) *ChatQuery

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 (*ChatQuery) Where

func (_q *ChatQuery) Where(ps ...predicate.Chat) *ChatQuery

Where adds a new predicate for the ChatQuery builder.

func (*ChatQuery) WithAgent

func (_q *ChatQuery) WithAgent(opts ...func(*AgentQuery)) *ChatQuery

WithAgent tells the query-builder to eager-load the nodes that are connected to the "agent" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatQuery) WithCreator

func (_q *ChatQuery) WithCreator(opts ...func(*UserQuery)) *ChatQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatQuery) WithMembers

func (_q *ChatQuery) WithMembers(opts ...func(*ChatMemberQuery)) *ChatQuery

WithMembers tells the query-builder to eager-load the nodes that are connected to the "members" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChatQuery) WithMessages

func (_q *ChatQuery) WithMessages(opts ...func(*MessageQuery)) *ChatQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

type ChatSelect

type ChatSelect struct {
	*ChatQuery
	// contains filtered or unexported fields
}

ChatSelect is the builder for selecting fields of Chat entities.

func (*ChatSelect) Aggregate

func (_s *ChatSelect) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatSelect) Bool

func (s *ChatSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChatSelect) BoolX

func (s *ChatSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChatSelect) Bools

func (s *ChatSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChatSelect) BoolsX

func (s *ChatSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ChatSelect) ExecContext

func (c ChatSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatSelect) Float64

func (s *ChatSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChatSelect) Float64X

func (s *ChatSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChatSelect) Float64s

func (s *ChatSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChatSelect) Float64sX

func (s *ChatSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChatSelect) Int

func (s *ChatSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChatSelect) IntX

func (s *ChatSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChatSelect) Ints

func (s *ChatSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChatSelect) IntsX

func (s *ChatSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (ChatSelect) QueryContext

func (c ChatSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatSelect) Scan

func (_s *ChatSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChatSelect) ScanX

func (s *ChatSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChatSelect) String

func (s *ChatSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChatSelect) StringX

func (s *ChatSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChatSelect) Strings

func (s *ChatSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChatSelect) StringsX

func (s *ChatSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChatUpdate

type ChatUpdate struct {
	// contains filtered or unexported fields
}

ChatUpdate is the builder for updating Chat entities.

func (*ChatUpdate) AddMemberIDs

func (_u *ChatUpdate) AddMemberIDs(ids ...uuid.UUID) *ChatUpdate

AddMemberIDs adds the "members" edge to the ChatMember entity by IDs.

func (*ChatUpdate) AddMembers

func (_u *ChatUpdate) AddMembers(v ...*ChatMember) *ChatUpdate

AddMembers adds the "members" edges to the ChatMember entity.

func (*ChatUpdate) AddMessageIDs

func (_u *ChatUpdate) AddMessageIDs(ids ...uuid.UUID) *ChatUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatUpdate) AddMessages

func (_u *ChatUpdate) AddMessages(v ...*Message) *ChatUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*ChatUpdate) ClearAgent

func (_u *ChatUpdate) ClearAgent() *ChatUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*ChatUpdate) ClearAgentID

func (_u *ChatUpdate) ClearAgentID() *ChatUpdate

ClearAgentID clears the value of the "agent_id" field.

func (*ChatUpdate) ClearCreator

func (_u *ChatUpdate) ClearCreator() *ChatUpdate

ClearCreator clears the "creator" edge to the User entity.

func (*ChatUpdate) ClearMembers

func (_u *ChatUpdate) ClearMembers() *ChatUpdate

ClearMembers clears all "members" edges to the ChatMember entity.

func (*ChatUpdate) ClearMessages

func (_u *ChatUpdate) ClearMessages() *ChatUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*ChatUpdate) ClearName

func (_u *ChatUpdate) ClearName() *ChatUpdate

ClearName clears the value of the "name" field.

func (*ChatUpdate) Exec

func (_u *ChatUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatUpdate) ExecContext

func (c *ChatUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatUpdate) ExecX

func (_u *ChatUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatUpdate) Mutation

func (_u *ChatUpdate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdate) QueryContext

func (c *ChatUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatUpdate) RemoveMemberIDs

func (_u *ChatUpdate) RemoveMemberIDs(ids ...uuid.UUID) *ChatUpdate

RemoveMemberIDs removes the "members" edge to ChatMember entities by IDs.

func (*ChatUpdate) RemoveMembers

func (_u *ChatUpdate) RemoveMembers(v ...*ChatMember) *ChatUpdate

RemoveMembers removes "members" edges to ChatMember entities.

func (*ChatUpdate) RemoveMessageIDs

func (_u *ChatUpdate) RemoveMessageIDs(ids ...uuid.UUID) *ChatUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ChatUpdate) RemoveMessages

func (_u *ChatUpdate) RemoveMessages(v ...*Message) *ChatUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*ChatUpdate) Save

func (_u *ChatUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChatUpdate) SaveX

func (_u *ChatUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChatUpdate) SetAgent

func (_u *ChatUpdate) SetAgent(v *Agent) *ChatUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*ChatUpdate) SetAgentID

func (_u *ChatUpdate) SetAgentID(v uuid.UUID) *ChatUpdate

SetAgentID sets the "agent_id" field.

func (*ChatUpdate) SetCreatedBy

func (_u *ChatUpdate) SetCreatedBy(v uuid.UUID) *ChatUpdate

SetCreatedBy sets the "created_by" field.

func (*ChatUpdate) SetCreator

func (_u *ChatUpdate) SetCreator(v *User) *ChatUpdate

SetCreator sets the "creator" edge to the User entity.

func (*ChatUpdate) SetCreatorID

func (_u *ChatUpdate) SetCreatorID(id uuid.UUID) *ChatUpdate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ChatUpdate) SetName

func (_u *ChatUpdate) SetName(v string) *ChatUpdate

SetName sets the "name" field.

func (*ChatUpdate) SetNillableAgentID

func (_u *ChatUpdate) SetNillableAgentID(v *uuid.UUID) *ChatUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ChatUpdate) SetNillableCreatedBy

func (_u *ChatUpdate) SetNillableCreatedBy(v *uuid.UUID) *ChatUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ChatUpdate) SetNillableName

func (_u *ChatUpdate) SetNillableName(v *string) *ChatUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ChatUpdate) SetNillableType

func (_u *ChatUpdate) SetNillableType(v *chat.Type) *ChatUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ChatUpdate) SetType

func (_u *ChatUpdate) SetType(v chat.Type) *ChatUpdate

SetType sets the "type" field.

func (*ChatUpdate) Where

func (_u *ChatUpdate) Where(ps ...predicate.Chat) *ChatUpdate

Where appends a list predicates to the ChatUpdate builder.

type ChatUpdateOne

type ChatUpdateOne struct {
	// contains filtered or unexported fields
}

ChatUpdateOne is the builder for updating a single Chat entity.

func (*ChatUpdateOne) AddMemberIDs

func (_u *ChatUpdateOne) AddMemberIDs(ids ...uuid.UUID) *ChatUpdateOne

AddMemberIDs adds the "members" edge to the ChatMember entity by IDs.

func (*ChatUpdateOne) AddMembers

func (_u *ChatUpdateOne) AddMembers(v ...*ChatMember) *ChatUpdateOne

AddMembers adds the "members" edges to the ChatMember entity.

func (*ChatUpdateOne) AddMessageIDs

func (_u *ChatUpdateOne) AddMessageIDs(ids ...uuid.UUID) *ChatUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatUpdateOne) AddMessages

func (_u *ChatUpdateOne) AddMessages(v ...*Message) *ChatUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*ChatUpdateOne) ClearAgent

func (_u *ChatUpdateOne) ClearAgent() *ChatUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*ChatUpdateOne) ClearAgentID

func (_u *ChatUpdateOne) ClearAgentID() *ChatUpdateOne

ClearAgentID clears the value of the "agent_id" field.

func (*ChatUpdateOne) ClearCreator

func (_u *ChatUpdateOne) ClearCreator() *ChatUpdateOne

ClearCreator clears the "creator" edge to the User entity.

func (*ChatUpdateOne) ClearMembers

func (_u *ChatUpdateOne) ClearMembers() *ChatUpdateOne

ClearMembers clears all "members" edges to the ChatMember entity.

func (*ChatUpdateOne) ClearMessages

func (_u *ChatUpdateOne) ClearMessages() *ChatUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*ChatUpdateOne) ClearName

func (_u *ChatUpdateOne) ClearName() *ChatUpdateOne

ClearName clears the value of the "name" field.

func (*ChatUpdateOne) Exec

func (_u *ChatUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatUpdateOne) ExecContext

func (c *ChatUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ChatUpdateOne) ExecX

func (_u *ChatUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChatUpdateOne) Mutation

func (_u *ChatUpdateOne) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdateOne) QueryContext

func (c *ChatUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ChatUpdateOne) RemoveMemberIDs

func (_u *ChatUpdateOne) RemoveMemberIDs(ids ...uuid.UUID) *ChatUpdateOne

RemoveMemberIDs removes the "members" edge to ChatMember entities by IDs.

func (*ChatUpdateOne) RemoveMembers

func (_u *ChatUpdateOne) RemoveMembers(v ...*ChatMember) *ChatUpdateOne

RemoveMembers removes "members" edges to ChatMember entities.

func (*ChatUpdateOne) RemoveMessageIDs

func (_u *ChatUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *ChatUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ChatUpdateOne) RemoveMessages

func (_u *ChatUpdateOne) RemoveMessages(v ...*Message) *ChatUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*ChatUpdateOne) Save

func (_u *ChatUpdateOne) Save(ctx context.Context) (*Chat, error)

Save executes the query and returns the updated Chat entity.

func (*ChatUpdateOne) SaveX

func (_u *ChatUpdateOne) SaveX(ctx context.Context) *Chat

SaveX is like Save, but panics if an error occurs.

func (*ChatUpdateOne) Select

func (_u *ChatUpdateOne) Select(field string, fields ...string) *ChatUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChatUpdateOne) SetAgent

func (_u *ChatUpdateOne) SetAgent(v *Agent) *ChatUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*ChatUpdateOne) SetAgentID

func (_u *ChatUpdateOne) SetAgentID(v uuid.UUID) *ChatUpdateOne

SetAgentID sets the "agent_id" field.

func (*ChatUpdateOne) SetCreatedBy

func (_u *ChatUpdateOne) SetCreatedBy(v uuid.UUID) *ChatUpdateOne

SetCreatedBy sets the "created_by" field.

func (*ChatUpdateOne) SetCreator

func (_u *ChatUpdateOne) SetCreator(v *User) *ChatUpdateOne

SetCreator sets the "creator" edge to the User entity.

func (*ChatUpdateOne) SetCreatorID

func (_u *ChatUpdateOne) SetCreatorID(id uuid.UUID) *ChatUpdateOne

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ChatUpdateOne) SetName

func (_u *ChatUpdateOne) SetName(v string) *ChatUpdateOne

SetName sets the "name" field.

func (*ChatUpdateOne) SetNillableAgentID

func (_u *ChatUpdateOne) SetNillableAgentID(v *uuid.UUID) *ChatUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableCreatedBy

func (_u *ChatUpdateOne) SetNillableCreatedBy(v *uuid.UUID) *ChatUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableName

func (_u *ChatUpdateOne) SetNillableName(v *string) *ChatUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableType

func (_u *ChatUpdateOne) SetNillableType(v *chat.Type) *ChatUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ChatUpdateOne) SetType

func (_u *ChatUpdateOne) SetType(v chat.Type) *ChatUpdateOne

SetType sets the "type" field.

func (*ChatUpdateOne) Where

func (_u *ChatUpdateOne) Where(ps ...predicate.Chat) *ChatUpdateOne

Where appends a list predicates to the ChatUpdate builder.

type Chats

type Chats []*Chat

Chats is a parsable slice of Chat.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// AgentRole is the client for interacting with the AgentRole builders.
	AgentRole *AgentRoleClient
	// AgentSkill is the client for interacting with the AgentSkill builders.
	AgentSkill *AgentSkillClient
	// AllowlistEntry is the client for interacting with the AllowlistEntry builders.
	AllowlistEntry *AllowlistEntryClient
	// AuthSession is the client for interacting with the AuthSession builders.
	AuthSession *AuthSessionClient
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// ChatMember is the client for interacting with the ChatMember builders.
	ChatMember *ChatMemberClient
	// Identity is the client for interacting with the Identity builders.
	Identity *IdentityClient
	// MagicLinkToken is the client for interacting with the MagicLinkToken builders.
	MagicLinkToken *MagicLinkTokenClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Agent.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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 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 Identities

type Identities []*Identity

Identities is a parsable slice of Identity.

type Identity

type Identity struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider identity.Provider `json:"provider,omitempty"`
	// ProviderSubject holds the value of the "provider_subject" field.
	ProviderSubject string `json:"provider_subject,omitempty"`
	// VerifiedEmail holds the value of the "verified_email" field.
	VerifiedEmail string `json:"verified_email,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 IdentityQuery when eager-loading is set.
	Edges IdentityEdges `json:"edges"`
	// contains filtered or unexported fields
}

Identity is the model entity for the Identity schema.

func (*Identity) ExecContext

func (c *Identity) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Identity) QueryContext

func (c *Identity) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Identity) QueryUser

func (_m *Identity) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Identity entity.

func (*Identity) String

func (_m *Identity) String() string

String implements the fmt.Stringer.

func (*Identity) Unwrap

func (_m *Identity) Unwrap() *Identity

Unwrap unwraps the Identity 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 (*Identity) Update

func (_m *Identity) Update() *IdentityUpdateOne

Update returns a builder for updating this Identity. Note that you need to call Identity.Unwrap() before calling this method if this Identity was returned from a transaction, and the transaction was committed or rolled back.

func (*Identity) Value

func (_m *Identity) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Identity. This includes values selected through modifiers, order, etc.

type IdentityClient

type IdentityClient struct {
	// contains filtered or unexported fields
}

IdentityClient is a client for the Identity schema.

func NewIdentityClient

func NewIdentityClient(c config) *IdentityClient

NewIdentityClient returns a client for the Identity from the given config.

func (*IdentityClient) Create

func (c *IdentityClient) Create() *IdentityCreate

Create returns a builder for creating a Identity entity.

func (*IdentityClient) CreateBulk

func (c *IdentityClient) CreateBulk(builders ...*IdentityCreate) *IdentityCreateBulk

CreateBulk returns a builder for creating a bulk of Identity entities.

func (*IdentityClient) Delete

func (c *IdentityClient) Delete() *IdentityDelete

Delete returns a delete builder for Identity.

func (*IdentityClient) DeleteOne

func (c *IdentityClient) DeleteOne(_m *Identity) *IdentityDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IdentityClient) DeleteOneID

func (c *IdentityClient) DeleteOneID(id uuid.UUID) *IdentityDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*IdentityClient) ExecContext

func (c *IdentityClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityClient) Get

func (c *IdentityClient) Get(ctx context.Context, id uuid.UUID) (*Identity, error)

Get returns a Identity entity by its id.

func (*IdentityClient) GetX

func (c *IdentityClient) GetX(ctx context.Context, id uuid.UUID) *Identity

GetX is like Get, but panics if an error occurs.

func (*IdentityClient) Hooks

func (c *IdentityClient) Hooks() []Hook

Hooks returns the client hooks.

func (*IdentityClient) Intercept

func (c *IdentityClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `identity.Intercept(f(g(h())))`.

func (*IdentityClient) Interceptors

func (c *IdentityClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IdentityClient) MapCreateBulk

func (c *IdentityClient) MapCreateBulk(slice any, setFunc func(*IdentityCreate, int)) *IdentityCreateBulk

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 (*IdentityClient) Query

func (c *IdentityClient) Query() *IdentityQuery

Query returns a query builder for Identity.

func (*IdentityClient) QueryContext

func (c *IdentityClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityClient) QueryUser

func (c *IdentityClient) QueryUser(_m *Identity) *UserQuery

QueryUser queries the user edge of a Identity.

func (*IdentityClient) Update

func (c *IdentityClient) Update() *IdentityUpdate

Update returns an update builder for Identity.

func (*IdentityClient) UpdateOne

func (c *IdentityClient) UpdateOne(_m *Identity) *IdentityUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IdentityClient) UpdateOneID

func (c *IdentityClient) UpdateOneID(id uuid.UUID) *IdentityUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IdentityClient) Use

func (c *IdentityClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `identity.Hooks(f(g(h())))`.

type IdentityCreate

type IdentityCreate struct {
	// contains filtered or unexported fields
}

IdentityCreate is the builder for creating a Identity entity.

func (*IdentityCreate) Exec

func (_c *IdentityCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IdentityCreate) ExecContext

func (c *IdentityCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityCreate) ExecX

func (_c *IdentityCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentityCreate) Mutation

func (_c *IdentityCreate) Mutation() *IdentityMutation

Mutation returns the IdentityMutation object of the builder.

func (*IdentityCreate) QueryContext

func (c *IdentityCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityCreate) Save

func (_c *IdentityCreate) Save(ctx context.Context) (*Identity, error)

Save creates the Identity in the database.

func (*IdentityCreate) SaveX

func (_c *IdentityCreate) SaveX(ctx context.Context) *Identity

SaveX calls Save and panics if Save returns an error.

func (*IdentityCreate) SetCreatedAt

func (_c *IdentityCreate) SetCreatedAt(v time.Time) *IdentityCreate

SetCreatedAt sets the "created_at" field.

func (*IdentityCreate) SetID

func (_c *IdentityCreate) SetID(v uuid.UUID) *IdentityCreate

SetID sets the "id" field.

func (*IdentityCreate) SetNillableCreatedAt

func (_c *IdentityCreate) SetNillableCreatedAt(v *time.Time) *IdentityCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*IdentityCreate) SetNillableID

func (_c *IdentityCreate) SetNillableID(v *uuid.UUID) *IdentityCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IdentityCreate) SetProvider

func (_c *IdentityCreate) SetProvider(v identity.Provider) *IdentityCreate

SetProvider sets the "provider" field.

func (*IdentityCreate) SetProviderSubject

func (_c *IdentityCreate) SetProviderSubject(v string) *IdentityCreate

SetProviderSubject sets the "provider_subject" field.

func (*IdentityCreate) SetUser

func (_c *IdentityCreate) SetUser(v *User) *IdentityCreate

SetUser sets the "user" edge to the User entity.

func (*IdentityCreate) SetUserID

func (_c *IdentityCreate) SetUserID(v uuid.UUID) *IdentityCreate

SetUserID sets the "user_id" field.

func (*IdentityCreate) SetVerifiedEmail

func (_c *IdentityCreate) SetVerifiedEmail(v string) *IdentityCreate

SetVerifiedEmail sets the "verified_email" field.

type IdentityCreateBulk

type IdentityCreateBulk struct {
	// contains filtered or unexported fields
}

IdentityCreateBulk is the builder for creating many Identity entities in bulk.

func (*IdentityCreateBulk) Exec

func (_c *IdentityCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IdentityCreateBulk) ExecContext

func (c *IdentityCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityCreateBulk) ExecX

func (_c *IdentityCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentityCreateBulk) QueryContext

func (c *IdentityCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityCreateBulk) Save

func (_c *IdentityCreateBulk) Save(ctx context.Context) ([]*Identity, error)

Save creates the Identity entities in the database.

func (*IdentityCreateBulk) SaveX

func (_c *IdentityCreateBulk) SaveX(ctx context.Context) []*Identity

SaveX is like Save, but panics if an error occurs.

type IdentityDelete

type IdentityDelete struct {
	// contains filtered or unexported fields
}

IdentityDelete is the builder for deleting a Identity entity.

func (*IdentityDelete) Exec

func (_d *IdentityDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*IdentityDelete) ExecContext

func (c *IdentityDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityDelete) ExecX

func (_d *IdentityDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*IdentityDelete) QueryContext

func (c *IdentityDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityDelete) Where

func (_d *IdentityDelete) Where(ps ...predicate.Identity) *IdentityDelete

Where appends a list predicates to the IdentityDelete builder.

type IdentityDeleteOne

type IdentityDeleteOne struct {
	// contains filtered or unexported fields
}

IdentityDeleteOne is the builder for deleting a single Identity entity.

func (*IdentityDeleteOne) Exec

func (_d *IdentityDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IdentityDeleteOne) ExecX

func (_d *IdentityDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentityDeleteOne) Where

Where appends a list predicates to the IdentityDelete builder.

type IdentityEdges

type IdentityEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

IdentityEdges holds the relations/edges for other nodes in the graph.

func (IdentityEdges) UserOrErr

func (e IdentityEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type IdentityGroupBy

type IdentityGroupBy struct {
	// contains filtered or unexported fields
}

IdentityGroupBy is the group-by builder for Identity entities.

func (*IdentityGroupBy) Aggregate

func (_g *IdentityGroupBy) Aggregate(fns ...AggregateFunc) *IdentityGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*IdentityGroupBy) Bool

func (s *IdentityGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) BoolX

func (s *IdentityGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IdentityGroupBy) Bools

func (s *IdentityGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) BoolsX

func (s *IdentityGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IdentityGroupBy) Float64

func (s *IdentityGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) Float64X

func (s *IdentityGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IdentityGroupBy) Float64s

func (s *IdentityGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) Float64sX

func (s *IdentityGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IdentityGroupBy) Int

func (s *IdentityGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) IntX

func (s *IdentityGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IdentityGroupBy) Ints

func (s *IdentityGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) IntsX

func (s *IdentityGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IdentityGroupBy) Scan

func (_g *IdentityGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IdentityGroupBy) ScanX

func (s *IdentityGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IdentityGroupBy) String

func (s *IdentityGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) StringX

func (s *IdentityGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IdentityGroupBy) Strings

func (s *IdentityGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IdentityGroupBy) StringsX

func (s *IdentityGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IdentityMutation

type IdentityMutation struct {
	// contains filtered or unexported fields
}

IdentityMutation represents an operation that mutates the Identity nodes in the graph.

func (*IdentityMutation) AddField

func (m *IdentityMutation) 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 (*IdentityMutation) AddedEdges

func (m *IdentityMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*IdentityMutation) AddedField

func (m *IdentityMutation) 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 (*IdentityMutation) AddedFields

func (m *IdentityMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*IdentityMutation) AddedIDs

func (m *IdentityMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*IdentityMutation) ClearEdge

func (m *IdentityMutation) 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 (*IdentityMutation) ClearField

func (m *IdentityMutation) 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 (*IdentityMutation) ClearUser

func (m *IdentityMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*IdentityMutation) ClearedEdges

func (m *IdentityMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*IdentityMutation) ClearedFields

func (m *IdentityMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (IdentityMutation) Client

func (m IdentityMutation) 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 (*IdentityMutation) CreatedAt

func (m *IdentityMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*IdentityMutation) EdgeCleared

func (m *IdentityMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*IdentityMutation) ExecContext

func (c *IdentityMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityMutation) Field

func (m *IdentityMutation) 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 (*IdentityMutation) FieldCleared

func (m *IdentityMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*IdentityMutation) Fields

func (m *IdentityMutation) 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 (*IdentityMutation) ID

func (m *IdentityMutation) 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 (*IdentityMutation) IDs

func (m *IdentityMutation) 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 (*IdentityMutation) OldCreatedAt

func (m *IdentityMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Identity entity. If the Identity 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 (*IdentityMutation) OldField

func (m *IdentityMutation) 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 (*IdentityMutation) OldProvider

func (m *IdentityMutation) OldProvider(ctx context.Context) (v identity.Provider, err error)

OldProvider returns the old "provider" field's value of the Identity entity. If the Identity 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 (*IdentityMutation) OldProviderSubject

func (m *IdentityMutation) OldProviderSubject(ctx context.Context) (v string, err error)

OldProviderSubject returns the old "provider_subject" field's value of the Identity entity. If the Identity 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 (*IdentityMutation) OldUserID

func (m *IdentityMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the Identity entity. If the Identity 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 (*IdentityMutation) OldVerifiedEmail

func (m *IdentityMutation) OldVerifiedEmail(ctx context.Context) (v string, err error)

OldVerifiedEmail returns the old "verified_email" field's value of the Identity entity. If the Identity 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 (*IdentityMutation) Op

func (m *IdentityMutation) Op() Op

Op returns the operation name.

func (*IdentityMutation) Provider

func (m *IdentityMutation) Provider() (r identity.Provider, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*IdentityMutation) ProviderSubject

func (m *IdentityMutation) ProviderSubject() (r string, exists bool)

ProviderSubject returns the value of the "provider_subject" field in the mutation.

func (*IdentityMutation) QueryContext

func (c *IdentityMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityMutation) RemovedEdges

func (m *IdentityMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*IdentityMutation) RemovedIDs

func (m *IdentityMutation) 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 (*IdentityMutation) ResetCreatedAt

func (m *IdentityMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IdentityMutation) ResetEdge

func (m *IdentityMutation) 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 (*IdentityMutation) ResetField

func (m *IdentityMutation) 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 (*IdentityMutation) ResetProvider

func (m *IdentityMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*IdentityMutation) ResetProviderSubject

func (m *IdentityMutation) ResetProviderSubject()

ResetProviderSubject resets all changes to the "provider_subject" field.

func (*IdentityMutation) ResetUser

func (m *IdentityMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*IdentityMutation) ResetUserID

func (m *IdentityMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*IdentityMutation) ResetVerifiedEmail

func (m *IdentityMutation) ResetVerifiedEmail()

ResetVerifiedEmail resets all changes to the "verified_email" field.

func (*IdentityMutation) SetCreatedAt

func (m *IdentityMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*IdentityMutation) SetField

func (m *IdentityMutation) 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 (*IdentityMutation) SetID

func (m *IdentityMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Identity entities.

func (*IdentityMutation) SetOp

func (m *IdentityMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IdentityMutation) SetProvider

func (m *IdentityMutation) SetProvider(i identity.Provider)

SetProvider sets the "provider" field.

func (*IdentityMutation) SetProviderSubject

func (m *IdentityMutation) SetProviderSubject(s string)

SetProviderSubject sets the "provider_subject" field.

func (*IdentityMutation) SetUserID

func (m *IdentityMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (*IdentityMutation) SetVerifiedEmail

func (m *IdentityMutation) SetVerifiedEmail(s string)

SetVerifiedEmail sets the "verified_email" field.

func (IdentityMutation) Tx

func (m IdentityMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IdentityMutation) Type

func (m *IdentityMutation) Type() string

Type returns the node type of this mutation (Identity).

func (*IdentityMutation) UserCleared

func (m *IdentityMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*IdentityMutation) UserID

func (m *IdentityMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*IdentityMutation) UserIDs

func (m *IdentityMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*IdentityMutation) VerifiedEmail

func (m *IdentityMutation) VerifiedEmail() (r string, exists bool)

VerifiedEmail returns the value of the "verified_email" field in the mutation.

func (*IdentityMutation) Where

func (m *IdentityMutation) Where(ps ...predicate.Identity)

Where appends a list predicates to the IdentityMutation builder.

func (*IdentityMutation) WhereP

func (m *IdentityMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IdentityMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IdentityQuery

type IdentityQuery struct {
	// contains filtered or unexported fields
}

IdentityQuery is the builder for querying Identity entities.

func (*IdentityQuery) Aggregate

func (_q *IdentityQuery) Aggregate(fns ...AggregateFunc) *IdentitySelect

Aggregate returns a IdentitySelect configured with the given aggregations.

func (*IdentityQuery) All

func (_q *IdentityQuery) All(ctx context.Context) ([]*Identity, error)

All executes the query and returns a list of Identities.

func (*IdentityQuery) AllX

func (_q *IdentityQuery) AllX(ctx context.Context) []*Identity

AllX is like All, but panics if an error occurs.

func (*IdentityQuery) Clone

func (_q *IdentityQuery) Clone() *IdentityQuery

Clone returns a duplicate of the IdentityQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IdentityQuery) Count

func (_q *IdentityQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IdentityQuery) CountX

func (_q *IdentityQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IdentityQuery) ExecContext

func (c *IdentityQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityQuery) Exist

func (_q *IdentityQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IdentityQuery) ExistX

func (_q *IdentityQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IdentityQuery) First

func (_q *IdentityQuery) First(ctx context.Context) (*Identity, error)

First returns the first Identity entity from the query. Returns a *NotFoundError when no Identity was found.

func (*IdentityQuery) FirstID

func (_q *IdentityQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Identity ID from the query. Returns a *NotFoundError when no Identity ID was found.

func (*IdentityQuery) FirstIDX

func (_q *IdentityQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*IdentityQuery) FirstX

func (_q *IdentityQuery) FirstX(ctx context.Context) *Identity

FirstX is like First, but panics if an error occurs.

func (*IdentityQuery) GroupBy

func (_q *IdentityQuery) GroupBy(field string, fields ...string) *IdentityGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Identity.Query().
	GroupBy(identity.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IdentityQuery) IDs

func (_q *IdentityQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Identity IDs.

func (*IdentityQuery) IDsX

func (_q *IdentityQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*IdentityQuery) Limit

func (_q *IdentityQuery) Limit(limit int) *IdentityQuery

Limit the number of records to be returned by this query.

func (*IdentityQuery) Offset

func (_q *IdentityQuery) Offset(offset int) *IdentityQuery

Offset to start from.

func (*IdentityQuery) Only

func (_q *IdentityQuery) Only(ctx context.Context) (*Identity, error)

Only returns a single Identity entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Identity entity is found. Returns a *NotFoundError when no Identity entities are found.

func (*IdentityQuery) OnlyID

func (_q *IdentityQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Identity ID in the query. Returns a *NotSingularError when more than one Identity ID is found. Returns a *NotFoundError when no entities are found.

func (*IdentityQuery) OnlyIDX

func (_q *IdentityQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IdentityQuery) OnlyX

func (_q *IdentityQuery) OnlyX(ctx context.Context) *Identity

OnlyX is like Only, but panics if an error occurs.

func (*IdentityQuery) Order

Order specifies how the records should be ordered.

func (*IdentityQuery) QueryContext

func (c *IdentityQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityQuery) QueryUser

func (_q *IdentityQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*IdentityQuery) Select

func (_q *IdentityQuery) Select(fields ...string) *IdentitySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UserID uuid.UUID `json:"user_id,omitempty"`
}

client.Identity.Query().
	Select(identity.FieldUserID).
	Scan(ctx, &v)

func (*IdentityQuery) Unique

func (_q *IdentityQuery) Unique(unique bool) *IdentityQuery

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 (*IdentityQuery) Where

func (_q *IdentityQuery) Where(ps ...predicate.Identity) *IdentityQuery

Where adds a new predicate for the IdentityQuery builder.

func (*IdentityQuery) WithUser

func (_q *IdentityQuery) WithUser(opts ...func(*UserQuery)) *IdentityQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type IdentitySelect

type IdentitySelect struct {
	*IdentityQuery
	// contains filtered or unexported fields
}

IdentitySelect is the builder for selecting fields of Identity entities.

func (*IdentitySelect) Aggregate

func (_s *IdentitySelect) Aggregate(fns ...AggregateFunc) *IdentitySelect

Aggregate adds the given aggregation functions to the selector query.

func (*IdentitySelect) Bool

func (s *IdentitySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) BoolX

func (s *IdentitySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IdentitySelect) Bools

func (s *IdentitySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) BoolsX

func (s *IdentitySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (IdentitySelect) ExecContext

func (c IdentitySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentitySelect) Float64

func (s *IdentitySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) Float64X

func (s *IdentitySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IdentitySelect) Float64s

func (s *IdentitySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) Float64sX

func (s *IdentitySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IdentitySelect) Int

func (s *IdentitySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) IntX

func (s *IdentitySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IdentitySelect) Ints

func (s *IdentitySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) IntsX

func (s *IdentitySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (IdentitySelect) QueryContext

func (c IdentitySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentitySelect) Scan

func (_s *IdentitySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IdentitySelect) ScanX

func (s *IdentitySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IdentitySelect) String

func (s *IdentitySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) StringX

func (s *IdentitySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IdentitySelect) Strings

func (s *IdentitySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IdentitySelect) StringsX

func (s *IdentitySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IdentityUpdate

type IdentityUpdate struct {
	// contains filtered or unexported fields
}

IdentityUpdate is the builder for updating Identity entities.

func (*IdentityUpdate) ClearUser

func (_u *IdentityUpdate) ClearUser() *IdentityUpdate

ClearUser clears the "user" edge to the User entity.

func (*IdentityUpdate) Exec

func (_u *IdentityUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IdentityUpdate) ExecContext

func (c *IdentityUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityUpdate) ExecX

func (_u *IdentityUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentityUpdate) Mutation

func (_u *IdentityUpdate) Mutation() *IdentityMutation

Mutation returns the IdentityMutation object of the builder.

func (*IdentityUpdate) QueryContext

func (c *IdentityUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityUpdate) Save

func (_u *IdentityUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IdentityUpdate) SaveX

func (_u *IdentityUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IdentityUpdate) SetNillableProvider

func (_u *IdentityUpdate) SetNillableProvider(v *identity.Provider) *IdentityUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*IdentityUpdate) SetNillableProviderSubject

func (_u *IdentityUpdate) SetNillableProviderSubject(v *string) *IdentityUpdate

SetNillableProviderSubject sets the "provider_subject" field if the given value is not nil.

func (*IdentityUpdate) SetNillableUserID

func (_u *IdentityUpdate) SetNillableUserID(v *uuid.UUID) *IdentityUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IdentityUpdate) SetNillableVerifiedEmail

func (_u *IdentityUpdate) SetNillableVerifiedEmail(v *string) *IdentityUpdate

SetNillableVerifiedEmail sets the "verified_email" field if the given value is not nil.

func (*IdentityUpdate) SetProvider

func (_u *IdentityUpdate) SetProvider(v identity.Provider) *IdentityUpdate

SetProvider sets the "provider" field.

func (*IdentityUpdate) SetProviderSubject

func (_u *IdentityUpdate) SetProviderSubject(v string) *IdentityUpdate

SetProviderSubject sets the "provider_subject" field.

func (*IdentityUpdate) SetUser

func (_u *IdentityUpdate) SetUser(v *User) *IdentityUpdate

SetUser sets the "user" edge to the User entity.

func (*IdentityUpdate) SetUserID

func (_u *IdentityUpdate) SetUserID(v uuid.UUID) *IdentityUpdate

SetUserID sets the "user_id" field.

func (*IdentityUpdate) SetVerifiedEmail

func (_u *IdentityUpdate) SetVerifiedEmail(v string) *IdentityUpdate

SetVerifiedEmail sets the "verified_email" field.

func (*IdentityUpdate) Where

func (_u *IdentityUpdate) Where(ps ...predicate.Identity) *IdentityUpdate

Where appends a list predicates to the IdentityUpdate builder.

type IdentityUpdateOne

type IdentityUpdateOne struct {
	// contains filtered or unexported fields
}

IdentityUpdateOne is the builder for updating a single Identity entity.

func (*IdentityUpdateOne) ClearUser

func (_u *IdentityUpdateOne) ClearUser() *IdentityUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*IdentityUpdateOne) Exec

func (_u *IdentityUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IdentityUpdateOne) ExecContext

func (c *IdentityUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*IdentityUpdateOne) ExecX

func (_u *IdentityUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentityUpdateOne) Mutation

func (_u *IdentityUpdateOne) Mutation() *IdentityMutation

Mutation returns the IdentityMutation object of the builder.

func (*IdentityUpdateOne) QueryContext

func (c *IdentityUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*IdentityUpdateOne) Save

func (_u *IdentityUpdateOne) Save(ctx context.Context) (*Identity, error)

Save executes the query and returns the updated Identity entity.

func (*IdentityUpdateOne) SaveX

func (_u *IdentityUpdateOne) SaveX(ctx context.Context) *Identity

SaveX is like Save, but panics if an error occurs.

func (*IdentityUpdateOne) Select

func (_u *IdentityUpdateOne) Select(field string, fields ...string) *IdentityUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IdentityUpdateOne) SetNillableProvider

func (_u *IdentityUpdateOne) SetNillableProvider(v *identity.Provider) *IdentityUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*IdentityUpdateOne) SetNillableProviderSubject

func (_u *IdentityUpdateOne) SetNillableProviderSubject(v *string) *IdentityUpdateOne

SetNillableProviderSubject sets the "provider_subject" field if the given value is not nil.

func (*IdentityUpdateOne) SetNillableUserID

func (_u *IdentityUpdateOne) SetNillableUserID(v *uuid.UUID) *IdentityUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*IdentityUpdateOne) SetNillableVerifiedEmail

func (_u *IdentityUpdateOne) SetNillableVerifiedEmail(v *string) *IdentityUpdateOne

SetNillableVerifiedEmail sets the "verified_email" field if the given value is not nil.

func (*IdentityUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*IdentityUpdateOne) SetProviderSubject

func (_u *IdentityUpdateOne) SetProviderSubject(v string) *IdentityUpdateOne

SetProviderSubject sets the "provider_subject" field.

func (*IdentityUpdateOne) SetUser

func (_u *IdentityUpdateOne) SetUser(v *User) *IdentityUpdateOne

SetUser sets the "user" edge to the User entity.

func (*IdentityUpdateOne) SetUserID

func (_u *IdentityUpdateOne) SetUserID(v uuid.UUID) *IdentityUpdateOne

SetUserID sets the "user_id" field.

func (*IdentityUpdateOne) SetVerifiedEmail

func (_u *IdentityUpdateOne) SetVerifiedEmail(v string) *IdentityUpdateOne

SetVerifiedEmail sets the "verified_email" field.

func (*IdentityUpdateOne) Where

Where appends a list predicates to the IdentityUpdate builder.

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 MagicLinkToken

type MagicLinkToken struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// TokenHash holds the value of the "token_hash" field.
	TokenHash string `json:"token_hash,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// ConsumedAt holds the value of the "consumed_at" field.
	ConsumedAt *time.Time `json:"consumed_at,omitempty"`
	// CreatedIP holds the value of the "created_ip" field.
	CreatedIP string `json:"created_ip,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

MagicLinkToken is the model entity for the MagicLinkToken schema.

func (*MagicLinkToken) ExecContext

func (c *MagicLinkToken) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkToken) QueryContext

func (c *MagicLinkToken) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkToken) String

func (_m *MagicLinkToken) String() string

String implements the fmt.Stringer.

func (*MagicLinkToken) Unwrap

func (_m *MagicLinkToken) Unwrap() *MagicLinkToken

Unwrap unwraps the MagicLinkToken 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 (*MagicLinkToken) Update

Update returns a builder for updating this MagicLinkToken. Note that you need to call MagicLinkToken.Unwrap() before calling this method if this MagicLinkToken was returned from a transaction, and the transaction was committed or rolled back.

func (*MagicLinkToken) Value

func (_m *MagicLinkToken) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the MagicLinkToken. This includes values selected through modifiers, order, etc.

type MagicLinkTokenClient

type MagicLinkTokenClient struct {
	// contains filtered or unexported fields
}

MagicLinkTokenClient is a client for the MagicLinkToken schema.

func NewMagicLinkTokenClient

func NewMagicLinkTokenClient(c config) *MagicLinkTokenClient

NewMagicLinkTokenClient returns a client for the MagicLinkToken from the given config.

func (*MagicLinkTokenClient) Create

Create returns a builder for creating a MagicLinkToken entity.

func (*MagicLinkTokenClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MagicLinkToken entities.

func (*MagicLinkTokenClient) Delete

Delete returns a delete builder for MagicLinkToken.

func (*MagicLinkTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MagicLinkTokenClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MagicLinkTokenClient) ExecContext

func (c *MagicLinkTokenClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenClient) Get

Get returns a MagicLinkToken entity by its id.

func (*MagicLinkTokenClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MagicLinkTokenClient) Hooks

func (c *MagicLinkTokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MagicLinkTokenClient) Intercept

func (c *MagicLinkTokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `magiclinktoken.Intercept(f(g(h())))`.

func (*MagicLinkTokenClient) Interceptors

func (c *MagicLinkTokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MagicLinkTokenClient) MapCreateBulk

func (c *MagicLinkTokenClient) MapCreateBulk(slice any, setFunc func(*MagicLinkTokenCreate, int)) *MagicLinkTokenCreateBulk

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 (*MagicLinkTokenClient) Query

Query returns a query builder for MagicLinkToken.

func (*MagicLinkTokenClient) QueryContext

func (c *MagicLinkTokenClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenClient) Update

Update returns an update builder for MagicLinkToken.

func (*MagicLinkTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MagicLinkTokenClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MagicLinkTokenClient) Use

func (c *MagicLinkTokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `magiclinktoken.Hooks(f(g(h())))`.

type MagicLinkTokenCreate

type MagicLinkTokenCreate struct {
	// contains filtered or unexported fields
}

MagicLinkTokenCreate is the builder for creating a MagicLinkToken entity.

func (*MagicLinkTokenCreate) Exec

func (_c *MagicLinkTokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MagicLinkTokenCreate) ExecContext

func (c *MagicLinkTokenCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenCreate) ExecX

func (_c *MagicLinkTokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenCreate) Mutation

Mutation returns the MagicLinkTokenMutation object of the builder.

func (*MagicLinkTokenCreate) QueryContext

func (c *MagicLinkTokenCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenCreate) Save

Save creates the MagicLinkToken in the database.

func (*MagicLinkTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MagicLinkTokenCreate) SetConsumedAt

func (_c *MagicLinkTokenCreate) SetConsumedAt(v time.Time) *MagicLinkTokenCreate

SetConsumedAt sets the "consumed_at" field.

func (*MagicLinkTokenCreate) SetCreatedAt

func (_c *MagicLinkTokenCreate) SetCreatedAt(v time.Time) *MagicLinkTokenCreate

SetCreatedAt sets the "created_at" field.

func (*MagicLinkTokenCreate) SetCreatedIP

func (_c *MagicLinkTokenCreate) SetCreatedIP(v string) *MagicLinkTokenCreate

SetCreatedIP sets the "created_ip" field.

func (*MagicLinkTokenCreate) SetEmail

SetEmail sets the "email" field.

func (*MagicLinkTokenCreate) SetExpiresAt

func (_c *MagicLinkTokenCreate) SetExpiresAt(v time.Time) *MagicLinkTokenCreate

SetExpiresAt sets the "expires_at" field.

func (*MagicLinkTokenCreate) SetID

SetID sets the "id" field.

func (*MagicLinkTokenCreate) SetNillableConsumedAt

func (_c *MagicLinkTokenCreate) SetNillableConsumedAt(v *time.Time) *MagicLinkTokenCreate

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*MagicLinkTokenCreate) SetNillableCreatedAt

func (_c *MagicLinkTokenCreate) SetNillableCreatedAt(v *time.Time) *MagicLinkTokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MagicLinkTokenCreate) SetNillableCreatedIP

func (_c *MagicLinkTokenCreate) SetNillableCreatedIP(v *string) *MagicLinkTokenCreate

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*MagicLinkTokenCreate) SetNillableID

func (_c *MagicLinkTokenCreate) SetNillableID(v *uuid.UUID) *MagicLinkTokenCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MagicLinkTokenCreate) SetTokenHash

func (_c *MagicLinkTokenCreate) SetTokenHash(v string) *MagicLinkTokenCreate

SetTokenHash sets the "token_hash" field.

type MagicLinkTokenCreateBulk

type MagicLinkTokenCreateBulk struct {
	// contains filtered or unexported fields
}

MagicLinkTokenCreateBulk is the builder for creating many MagicLinkToken entities in bulk.

func (*MagicLinkTokenCreateBulk) Exec

Exec executes the query.

func (*MagicLinkTokenCreateBulk) ExecContext

func (c *MagicLinkTokenCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenCreateBulk) ExecX

func (_c *MagicLinkTokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenCreateBulk) QueryContext

func (c *MagicLinkTokenCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenCreateBulk) Save

Save creates the MagicLinkToken entities in the database.

func (*MagicLinkTokenCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MagicLinkTokenDelete

type MagicLinkTokenDelete struct {
	// contains filtered or unexported fields
}

MagicLinkTokenDelete is the builder for deleting a MagicLinkToken entity.

func (*MagicLinkTokenDelete) Exec

func (_d *MagicLinkTokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MagicLinkTokenDelete) ExecContext

func (c *MagicLinkTokenDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenDelete) ExecX

func (_d *MagicLinkTokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenDelete) QueryContext

func (c *MagicLinkTokenDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenDelete) Where

Where appends a list predicates to the MagicLinkTokenDelete builder.

type MagicLinkTokenDeleteOne

type MagicLinkTokenDeleteOne struct {
	// contains filtered or unexported fields
}

MagicLinkTokenDeleteOne is the builder for deleting a single MagicLinkToken entity.

func (*MagicLinkTokenDeleteOne) Exec

Exec executes the deletion query.

func (*MagicLinkTokenDeleteOne) ExecX

func (_d *MagicLinkTokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenDeleteOne) Where

Where appends a list predicates to the MagicLinkTokenDelete builder.

type MagicLinkTokenGroupBy

type MagicLinkTokenGroupBy struct {
	// contains filtered or unexported fields
}

MagicLinkTokenGroupBy is the group-by builder for MagicLinkToken entities.

func (*MagicLinkTokenGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MagicLinkTokenGroupBy) Bool

func (s *MagicLinkTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) BoolX

func (s *MagicLinkTokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Bools

func (s *MagicLinkTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) BoolsX

func (s *MagicLinkTokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Float64

func (s *MagicLinkTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) Float64X

func (s *MagicLinkTokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Float64s

func (s *MagicLinkTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) Float64sX

func (s *MagicLinkTokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Int

func (s *MagicLinkTokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) IntX

func (s *MagicLinkTokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Ints

func (s *MagicLinkTokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) IntsX

func (s *MagicLinkTokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Scan

func (_g *MagicLinkTokenGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MagicLinkTokenGroupBy) ScanX

func (s *MagicLinkTokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) String

func (s *MagicLinkTokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) StringX

func (s *MagicLinkTokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MagicLinkTokenGroupBy) Strings

func (s *MagicLinkTokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenGroupBy) StringsX

func (s *MagicLinkTokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MagicLinkTokenMutation

type MagicLinkTokenMutation struct {
	// contains filtered or unexported fields
}

MagicLinkTokenMutation represents an operation that mutates the MagicLinkToken nodes in the graph.

func (*MagicLinkTokenMutation) AddField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) AddedEdges

func (m *MagicLinkTokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MagicLinkTokenMutation) AddedField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) AddedFields

func (m *MagicLinkTokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MagicLinkTokenMutation) AddedIDs

func (m *MagicLinkTokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MagicLinkTokenMutation) ClearConsumedAt

func (m *MagicLinkTokenMutation) ClearConsumedAt()

ClearConsumedAt clears the value of the "consumed_at" field.

func (*MagicLinkTokenMutation) ClearCreatedIP

func (m *MagicLinkTokenMutation) ClearCreatedIP()

ClearCreatedIP clears the value of the "created_ip" field.

func (*MagicLinkTokenMutation) ClearEdge

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ClearField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ClearedEdges

func (m *MagicLinkTokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MagicLinkTokenMutation) ClearedFields

func (m *MagicLinkTokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MagicLinkTokenMutation) Client

func (m MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ConsumedAt

func (m *MagicLinkTokenMutation) ConsumedAt() (r time.Time, exists bool)

ConsumedAt returns the value of the "consumed_at" field in the mutation.

func (*MagicLinkTokenMutation) ConsumedAtCleared

func (m *MagicLinkTokenMutation) ConsumedAtCleared() bool

ConsumedAtCleared returns if the "consumed_at" field was cleared in this mutation.

func (*MagicLinkTokenMutation) CreatedAt

func (m *MagicLinkTokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MagicLinkTokenMutation) CreatedIP

func (m *MagicLinkTokenMutation) CreatedIP() (r string, exists bool)

CreatedIP returns the value of the "created_ip" field in the mutation.

func (*MagicLinkTokenMutation) CreatedIPCleared

func (m *MagicLinkTokenMutation) CreatedIPCleared() bool

CreatedIPCleared returns if the "created_ip" field was cleared in this mutation.

func (*MagicLinkTokenMutation) EdgeCleared

func (m *MagicLinkTokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MagicLinkTokenMutation) Email

func (m *MagicLinkTokenMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*MagicLinkTokenMutation) ExecContext

func (c *MagicLinkTokenMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenMutation) ExpiresAt

func (m *MagicLinkTokenMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*MagicLinkTokenMutation) Field

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) FieldCleared

func (m *MagicLinkTokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MagicLinkTokenMutation) Fields

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ID

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MagicLinkTokenMutation) OldConsumedAt

func (m *MagicLinkTokenMutation) OldConsumedAt(ctx context.Context) (v *time.Time, err error)

OldConsumedAt returns the old "consumed_at" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) OldCreatedAt

func (m *MagicLinkTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) OldCreatedIP

func (m *MagicLinkTokenMutation) OldCreatedIP(ctx context.Context) (v string, err error)

OldCreatedIP returns the old "created_ip" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) OldEmail

func (m *MagicLinkTokenMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) OldExpiresAt

func (m *MagicLinkTokenMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) OldField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) OldTokenHash

func (m *MagicLinkTokenMutation) OldTokenHash(ctx context.Context) (v string, err error)

OldTokenHash returns the old "token_hash" field's value of the MagicLinkToken entity. If the MagicLinkToken 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 (*MagicLinkTokenMutation) Op

func (m *MagicLinkTokenMutation) Op() Op

Op returns the operation name.

func (*MagicLinkTokenMutation) QueryContext

func (c *MagicLinkTokenMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenMutation) RemovedEdges

func (m *MagicLinkTokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MagicLinkTokenMutation) RemovedIDs

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ResetConsumedAt

func (m *MagicLinkTokenMutation) ResetConsumedAt()

ResetConsumedAt resets all changes to the "consumed_at" field.

func (*MagicLinkTokenMutation) ResetCreatedAt

func (m *MagicLinkTokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MagicLinkTokenMutation) ResetCreatedIP

func (m *MagicLinkTokenMutation) ResetCreatedIP()

ResetCreatedIP resets all changes to the "created_ip" field.

func (*MagicLinkTokenMutation) ResetEdge

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ResetEmail

func (m *MagicLinkTokenMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*MagicLinkTokenMutation) ResetExpiresAt

func (m *MagicLinkTokenMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*MagicLinkTokenMutation) ResetField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) ResetTokenHash

func (m *MagicLinkTokenMutation) ResetTokenHash()

ResetTokenHash resets all changes to the "token_hash" field.

func (*MagicLinkTokenMutation) SetConsumedAt

func (m *MagicLinkTokenMutation) SetConsumedAt(t time.Time)

SetConsumedAt sets the "consumed_at" field.

func (*MagicLinkTokenMutation) SetCreatedAt

func (m *MagicLinkTokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MagicLinkTokenMutation) SetCreatedIP

func (m *MagicLinkTokenMutation) SetCreatedIP(s string)

SetCreatedIP sets the "created_ip" field.

func (*MagicLinkTokenMutation) SetEmail

func (m *MagicLinkTokenMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*MagicLinkTokenMutation) SetExpiresAt

func (m *MagicLinkTokenMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*MagicLinkTokenMutation) SetField

func (m *MagicLinkTokenMutation) 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 (*MagicLinkTokenMutation) SetID

func (m *MagicLinkTokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of MagicLinkToken entities.

func (*MagicLinkTokenMutation) SetOp

func (m *MagicLinkTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MagicLinkTokenMutation) SetTokenHash

func (m *MagicLinkTokenMutation) SetTokenHash(s string)

SetTokenHash sets the "token_hash" field.

func (*MagicLinkTokenMutation) TokenHash

func (m *MagicLinkTokenMutation) TokenHash() (r string, exists bool)

TokenHash returns the value of the "token_hash" field in the mutation.

func (MagicLinkTokenMutation) Tx

func (m MagicLinkTokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MagicLinkTokenMutation) Type

func (m *MagicLinkTokenMutation) Type() string

Type returns the node type of this mutation (MagicLinkToken).

func (*MagicLinkTokenMutation) Where

Where appends a list predicates to the MagicLinkTokenMutation builder.

func (*MagicLinkTokenMutation) WhereP

func (m *MagicLinkTokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MagicLinkTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MagicLinkTokenQuery

type MagicLinkTokenQuery struct {
	// contains filtered or unexported fields
}

MagicLinkTokenQuery is the builder for querying MagicLinkToken entities.

func (*MagicLinkTokenQuery) Aggregate

Aggregate returns a MagicLinkTokenSelect configured with the given aggregations.

func (*MagicLinkTokenQuery) All

All executes the query and returns a list of MagicLinkTokens.

func (*MagicLinkTokenQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MagicLinkTokenQuery) Clone

Clone returns a duplicate of the MagicLinkTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MagicLinkTokenQuery) Count

func (_q *MagicLinkTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MagicLinkTokenQuery) CountX

func (_q *MagicLinkTokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MagicLinkTokenQuery) ExecContext

func (c *MagicLinkTokenQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenQuery) Exist

func (_q *MagicLinkTokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MagicLinkTokenQuery) ExistX

func (_q *MagicLinkTokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MagicLinkTokenQuery) First

First returns the first MagicLinkToken entity from the query. Returns a *NotFoundError when no MagicLinkToken was found.

func (*MagicLinkTokenQuery) FirstID

func (_q *MagicLinkTokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first MagicLinkToken ID from the query. Returns a *NotFoundError when no MagicLinkToken ID was found.

func (*MagicLinkTokenQuery) FirstIDX

func (_q *MagicLinkTokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*MagicLinkTokenQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MagicLinkTokenQuery) GroupBy

func (_q *MagicLinkTokenQuery) GroupBy(field string, fields ...string) *MagicLinkTokenGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MagicLinkToken.Query().
	GroupBy(magiclinktoken.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MagicLinkTokenQuery) IDs

func (_q *MagicLinkTokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of MagicLinkToken IDs.

func (*MagicLinkTokenQuery) IDsX

func (_q *MagicLinkTokenQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*MagicLinkTokenQuery) Limit

func (_q *MagicLinkTokenQuery) Limit(limit int) *MagicLinkTokenQuery

Limit the number of records to be returned by this query.

func (*MagicLinkTokenQuery) Offset

func (_q *MagicLinkTokenQuery) Offset(offset int) *MagicLinkTokenQuery

Offset to start from.

func (*MagicLinkTokenQuery) Only

Only returns a single MagicLinkToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MagicLinkToken entity is found. Returns a *NotFoundError when no MagicLinkToken entities are found.

func (*MagicLinkTokenQuery) OnlyID

func (_q *MagicLinkTokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only MagicLinkToken ID in the query. Returns a *NotSingularError when more than one MagicLinkToken ID is found. Returns a *NotFoundError when no entities are found.

func (*MagicLinkTokenQuery) OnlyIDX

func (_q *MagicLinkTokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MagicLinkTokenQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MagicLinkTokenQuery) Order

Order specifies how the records should be ordered.

func (*MagicLinkTokenQuery) QueryContext

func (c *MagicLinkTokenQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenQuery) Select

func (_q *MagicLinkTokenQuery) Select(fields ...string) *MagicLinkTokenSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
}

client.MagicLinkToken.Query().
	Select(magiclinktoken.FieldEmail).
	Scan(ctx, &v)

func (*MagicLinkTokenQuery) Unique

func (_q *MagicLinkTokenQuery) Unique(unique bool) *MagicLinkTokenQuery

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 (*MagicLinkTokenQuery) Where

Where adds a new predicate for the MagicLinkTokenQuery builder.

type MagicLinkTokenSelect

type MagicLinkTokenSelect struct {
	*MagicLinkTokenQuery
	// contains filtered or unexported fields
}

MagicLinkTokenSelect is the builder for selecting fields of MagicLinkToken entities.

func (*MagicLinkTokenSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MagicLinkTokenSelect) Bool

func (s *MagicLinkTokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) BoolX

func (s *MagicLinkTokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MagicLinkTokenSelect) Bools

func (s *MagicLinkTokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) BoolsX

func (s *MagicLinkTokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (MagicLinkTokenSelect) ExecContext

func (c MagicLinkTokenSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenSelect) Float64

func (s *MagicLinkTokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) Float64X

func (s *MagicLinkTokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MagicLinkTokenSelect) Float64s

func (s *MagicLinkTokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) Float64sX

func (s *MagicLinkTokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MagicLinkTokenSelect) Int

func (s *MagicLinkTokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) IntX

func (s *MagicLinkTokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MagicLinkTokenSelect) Ints

func (s *MagicLinkTokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) IntsX

func (s *MagicLinkTokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (MagicLinkTokenSelect) QueryContext

func (c MagicLinkTokenSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenSelect) Scan

func (_s *MagicLinkTokenSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MagicLinkTokenSelect) ScanX

func (s *MagicLinkTokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MagicLinkTokenSelect) String

func (s *MagicLinkTokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) StringX

func (s *MagicLinkTokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MagicLinkTokenSelect) Strings

func (s *MagicLinkTokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MagicLinkTokenSelect) StringsX

func (s *MagicLinkTokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MagicLinkTokenUpdate

type MagicLinkTokenUpdate struct {
	// contains filtered or unexported fields
}

MagicLinkTokenUpdate is the builder for updating MagicLinkToken entities.

func (*MagicLinkTokenUpdate) ClearConsumedAt

func (_u *MagicLinkTokenUpdate) ClearConsumedAt() *MagicLinkTokenUpdate

ClearConsumedAt clears the value of the "consumed_at" field.

func (*MagicLinkTokenUpdate) ClearCreatedIP

func (_u *MagicLinkTokenUpdate) ClearCreatedIP() *MagicLinkTokenUpdate

ClearCreatedIP clears the value of the "created_ip" field.

func (*MagicLinkTokenUpdate) Exec

func (_u *MagicLinkTokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MagicLinkTokenUpdate) ExecContext

func (c *MagicLinkTokenUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenUpdate) ExecX

func (_u *MagicLinkTokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenUpdate) Mutation

Mutation returns the MagicLinkTokenMutation object of the builder.

func (*MagicLinkTokenUpdate) QueryContext

func (c *MagicLinkTokenUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenUpdate) Save

func (_u *MagicLinkTokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MagicLinkTokenUpdate) SaveX

func (_u *MagicLinkTokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MagicLinkTokenUpdate) SetConsumedAt

func (_u *MagicLinkTokenUpdate) SetConsumedAt(v time.Time) *MagicLinkTokenUpdate

SetConsumedAt sets the "consumed_at" field.

func (*MagicLinkTokenUpdate) SetCreatedIP

func (_u *MagicLinkTokenUpdate) SetCreatedIP(v string) *MagicLinkTokenUpdate

SetCreatedIP sets the "created_ip" field.

func (*MagicLinkTokenUpdate) SetEmail

SetEmail sets the "email" field.

func (*MagicLinkTokenUpdate) SetExpiresAt

func (_u *MagicLinkTokenUpdate) SetExpiresAt(v time.Time) *MagicLinkTokenUpdate

SetExpiresAt sets the "expires_at" field.

func (*MagicLinkTokenUpdate) SetNillableConsumedAt

func (_u *MagicLinkTokenUpdate) SetNillableConsumedAt(v *time.Time) *MagicLinkTokenUpdate

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*MagicLinkTokenUpdate) SetNillableCreatedIP

func (_u *MagicLinkTokenUpdate) SetNillableCreatedIP(v *string) *MagicLinkTokenUpdate

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*MagicLinkTokenUpdate) SetNillableEmail

func (_u *MagicLinkTokenUpdate) SetNillableEmail(v *string) *MagicLinkTokenUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*MagicLinkTokenUpdate) SetNillableExpiresAt

func (_u *MagicLinkTokenUpdate) SetNillableExpiresAt(v *time.Time) *MagicLinkTokenUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*MagicLinkTokenUpdate) SetNillableTokenHash

func (_u *MagicLinkTokenUpdate) SetNillableTokenHash(v *string) *MagicLinkTokenUpdate

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*MagicLinkTokenUpdate) SetTokenHash

func (_u *MagicLinkTokenUpdate) SetTokenHash(v string) *MagicLinkTokenUpdate

SetTokenHash sets the "token_hash" field.

func (*MagicLinkTokenUpdate) Where

Where appends a list predicates to the MagicLinkTokenUpdate builder.

type MagicLinkTokenUpdateOne

type MagicLinkTokenUpdateOne struct {
	// contains filtered or unexported fields
}

MagicLinkTokenUpdateOne is the builder for updating a single MagicLinkToken entity.

func (*MagicLinkTokenUpdateOne) ClearConsumedAt

func (_u *MagicLinkTokenUpdateOne) ClearConsumedAt() *MagicLinkTokenUpdateOne

ClearConsumedAt clears the value of the "consumed_at" field.

func (*MagicLinkTokenUpdateOne) ClearCreatedIP

func (_u *MagicLinkTokenUpdateOne) ClearCreatedIP() *MagicLinkTokenUpdateOne

ClearCreatedIP clears the value of the "created_ip" field.

func (*MagicLinkTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*MagicLinkTokenUpdateOne) ExecContext

func (c *MagicLinkTokenUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MagicLinkTokenUpdateOne) ExecX

func (_u *MagicLinkTokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MagicLinkTokenUpdateOne) Mutation

Mutation returns the MagicLinkTokenMutation object of the builder.

func (*MagicLinkTokenUpdateOne) QueryContext

func (c *MagicLinkTokenUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*MagicLinkTokenUpdateOne) Save

Save executes the query and returns the updated MagicLinkToken entity.

func (*MagicLinkTokenUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MagicLinkTokenUpdateOne) Select

func (_u *MagicLinkTokenUpdateOne) Select(field string, fields ...string) *MagicLinkTokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MagicLinkTokenUpdateOne) SetConsumedAt

SetConsumedAt sets the "consumed_at" field.

func (*MagicLinkTokenUpdateOne) SetCreatedIP

SetCreatedIP sets the "created_ip" field.

func (*MagicLinkTokenUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*MagicLinkTokenUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*MagicLinkTokenUpdateOne) SetNillableConsumedAt

func (_u *MagicLinkTokenUpdateOne) SetNillableConsumedAt(v *time.Time) *MagicLinkTokenUpdateOne

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*MagicLinkTokenUpdateOne) SetNillableCreatedIP

func (_u *MagicLinkTokenUpdateOne) SetNillableCreatedIP(v *string) *MagicLinkTokenUpdateOne

SetNillableCreatedIP sets the "created_ip" field if the given value is not nil.

func (*MagicLinkTokenUpdateOne) SetNillableEmail

func (_u *MagicLinkTokenUpdateOne) SetNillableEmail(v *string) *MagicLinkTokenUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*MagicLinkTokenUpdateOne) SetNillableExpiresAt

func (_u *MagicLinkTokenUpdateOne) SetNillableExpiresAt(v *time.Time) *MagicLinkTokenUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*MagicLinkTokenUpdateOne) SetNillableTokenHash

func (_u *MagicLinkTokenUpdateOne) SetNillableTokenHash(v *string) *MagicLinkTokenUpdateOne

SetNillableTokenHash sets the "token_hash" field if the given value is not nil.

func (*MagicLinkTokenUpdateOne) SetTokenHash

SetTokenHash sets the "token_hash" field.

func (*MagicLinkTokenUpdateOne) Where

Where appends a list predicates to the MagicLinkTokenUpdate builder.

type MagicLinkTokens

type MagicLinkTokens []*MagicLinkToken

MagicLinkTokens is a parsable slice of MagicLinkToken.

type Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// ChatID holds the value of the "chat_id" field.
	ChatID uuid.UUID `json:"chat_id,omitempty"`
	// AuthorType holds the value of the "author_type" field.
	AuthorType message.AuthorType `json:"author_type,omitempty"`
	// AuthorUserID holds the value of the "author_user_id" field.
	AuthorUserID *uuid.UUID `json:"author_user_id,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,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) ExecContext

func (c *Message) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Message) QueryAuthor

func (_m *Message) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Message entity.

func (*Message) QueryChat

func (_m *Message) QueryChat() *ChatQuery

QueryChat queries the "chat" edge of the Message entity.

func (*Message) QueryContext

func (c *Message) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) ExecContext

func (c *MessageClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryAuthor

func (c *MessageClient) QueryAuthor(_m *Message) *UserQuery

QueryAuthor queries the author edge of a Message.

func (*MessageClient) QueryChat

func (c *MessageClient) QueryChat(_m *Message) *ChatQuery

QueryChat queries the chat edge of a Message.

func (*MessageClient) QueryContext

func (c *MessageClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) Exec

func (_c *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecContext

func (c *MessageCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c *MessageCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) SetAuthor

func (_c *MessageCreate) SetAuthor(v *User) *MessageCreate

SetAuthor sets the "author" edge to the User entity.

func (*MessageCreate) SetAuthorID

func (_c *MessageCreate) SetAuthorID(id uuid.UUID) *MessageCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*MessageCreate) SetAuthorType

func (_c *MessageCreate) SetAuthorType(v message.AuthorType) *MessageCreate

SetAuthorType sets the "author_type" field.

func (*MessageCreate) SetAuthorUserID

func (_c *MessageCreate) SetAuthorUserID(v uuid.UUID) *MessageCreate

SetAuthorUserID sets the "author_user_id" field.

func (*MessageCreate) SetChat

func (_c *MessageCreate) SetChat(v *Chat) *MessageCreate

SetChat sets the "chat" edge to the Chat entity.

func (*MessageCreate) SetChatID

func (_c *MessageCreate) SetChatID(v uuid.UUID) *MessageCreate

SetChatID sets the "chat_id" 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) SetNillableAuthorID

func (_c *MessageCreate) SetNillableAuthorID(id *uuid.UUID) *MessageCreate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*MessageCreate) SetNillableAuthorUserID

func (_c *MessageCreate) SetNillableAuthorUserID(v *uuid.UUID) *MessageCreate

SetNillableAuthorUserID sets the "author_user_id" field if the given value is not nil.

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.

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) ExecContext

func (c *MessageCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MessageCreateBulk) ExecX

func (_c *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) QueryContext

func (c *MessageCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) ExecContext

func (c *MessageDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*MessageDelete) ExecX

func (_d *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) QueryContext

func (c *MessageDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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 {
	// Chat holds the value of the chat edge.
	Chat *Chat `json:"chat,omitempty"`
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) AuthorOrErr

func (e MessageEdges) AuthorOrErr() (*User, error)

AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MessageEdges) ChatOrErr

func (e MessageEdges) ChatOrErr() (*Chat, error)

ChatOrErr returns the Chat value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

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) 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) 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) AuthorCleared

func (m *MessageMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*MessageMutation) AuthorID

func (m *MessageMutation) AuthorID() (id uuid.UUID, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*MessageMutation) AuthorIDs

func (m *MessageMutation) AuthorIDs() (ids []uuid.UUID)

AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.

func (*MessageMutation) AuthorType

func (m *MessageMutation) AuthorType() (r message.AuthorType, exists bool)

AuthorType returns the value of the "author_type" field in the mutation.

func (*MessageMutation) AuthorUserID

func (m *MessageMutation) AuthorUserID() (r uuid.UUID, exists bool)

AuthorUserID returns the value of the "author_user_id" field in the mutation.

func (*MessageMutation) AuthorUserIDCleared

func (m *MessageMutation) AuthorUserIDCleared() bool

AuthorUserIDCleared returns if the "author_user_id" field was cleared in this mutation.

func (*MessageMutation) ChatCleared

func (m *MessageMutation) ChatCleared() bool

ChatCleared reports if the "chat" edge to the Chat entity was cleared.

func (*MessageMutation) ChatID

func (m *MessageMutation) ChatID() (r uuid.UUID, exists bool)

ChatID returns the value of the "chat_id" field in the mutation.

func (*MessageMutation) ChatIDs

func (m *MessageMutation) ChatIDs() (ids []uuid.UUID)

ChatIDs returns the "chat" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ChatID instead. It exists only for internal usage by the builders.

func (*MessageMutation) ClearAuthor

func (m *MessageMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*MessageMutation) ClearAuthorUserID

func (m *MessageMutation) ClearAuthorUserID()

ClearAuthorUserID clears the value of the "author_user_id" field.

func (*MessageMutation) ClearChat

func (m *MessageMutation) ClearChat()

ClearChat clears the "chat" edge to the Chat 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) 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) ExecContext

func (c *MessageMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) OldAuthorType

func (m *MessageMutation) OldAuthorType(ctx context.Context) (v message.AuthorType, err error)

OldAuthorType returns the old "author_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) OldAuthorUserID

func (m *MessageMutation) OldAuthorUserID(ctx context.Context) (v *uuid.UUID, err error)

OldAuthorUserID returns the old "author_user_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) OldChatID

func (m *MessageMutation) OldChatID(ctx context.Context) (v uuid.UUID, err error)

OldChatID returns the old "chat_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) 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) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) QueryContext

func (c *MessageMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) ResetAuthor

func (m *MessageMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*MessageMutation) ResetAuthorType

func (m *MessageMutation) ResetAuthorType()

ResetAuthorType resets all changes to the "author_type" field.

func (*MessageMutation) ResetAuthorUserID

func (m *MessageMutation) ResetAuthorUserID()

ResetAuthorUserID resets all changes to the "author_user_id" field.

func (*MessageMutation) ResetChat

func (m *MessageMutation) ResetChat()

ResetChat resets all changes to the "chat" edge.

func (*MessageMutation) ResetChatID

func (m *MessageMutation) ResetChatID()

ResetChatID resets all changes to the "chat_id" 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) SetAuthorID

func (m *MessageMutation) SetAuthorID(id uuid.UUID)

SetAuthorID sets the "author" edge to the User entity by id.

func (*MessageMutation) SetAuthorType

func (m *MessageMutation) SetAuthorType(mt message.AuthorType)

SetAuthorType sets the "author_type" field.

func (*MessageMutation) SetAuthorUserID

func (m *MessageMutation) SetAuthorUserID(u uuid.UUID)

SetAuthorUserID sets the "author_user_id" field.

func (*MessageMutation) SetChatID

func (m *MessageMutation) SetChatID(u uuid.UUID)

SetChatID sets the "chat_id" 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) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

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) ExecContext

func (c *MessageQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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 {
	ChatID uuid.UUID `json:"chat_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldChatID).
	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) QueryAuthor

func (_q *MessageQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*MessageQuery) QueryChat

func (_q *MessageQuery) QueryChat() *ChatQuery

QueryChat chains the current query on the "chat" edge.

func (*MessageQuery) QueryContext

func (c *MessageQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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 {
	ChatID uuid.UUID `json:"chat_id,omitempty"`
}

client.Message.Query().
	Select(message.FieldChatID).
	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) WithAuthor

func (_q *MessageQuery) WithAuthor(opts ...func(*UserQuery)) *MessageQuery

WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithChat

func (_q *MessageQuery) WithChat(opts ...func(*ChatQuery)) *MessageQuery

WithChat tells the query-builder to eager-load the nodes that are connected to the "chat" 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) ExecContext

func (c MessageSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c MessageSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) ClearAuthor

func (_u *MessageUpdate) ClearAuthor() *MessageUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*MessageUpdate) ClearAuthorUserID

func (_u *MessageUpdate) ClearAuthorUserID() *MessageUpdate

ClearAuthorUserID clears the value of the "author_user_id" field.

func (*MessageUpdate) ClearChat

func (_u *MessageUpdate) ClearChat() *MessageUpdate

ClearChat clears the "chat" edge to the Chat entity.

func (*MessageUpdate) Exec

func (_u *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecContext

func (c *MessageUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c *MessageUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) SetAuthor

func (_u *MessageUpdate) SetAuthor(v *User) *MessageUpdate

SetAuthor sets the "author" edge to the User entity.

func (*MessageUpdate) SetAuthorID

func (_u *MessageUpdate) SetAuthorID(id uuid.UUID) *MessageUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*MessageUpdate) SetAuthorType

func (_u *MessageUpdate) SetAuthorType(v message.AuthorType) *MessageUpdate

SetAuthorType sets the "author_type" field.

func (*MessageUpdate) SetAuthorUserID

func (_u *MessageUpdate) SetAuthorUserID(v uuid.UUID) *MessageUpdate

SetAuthorUserID sets the "author_user_id" field.

func (*MessageUpdate) SetChat

func (_u *MessageUpdate) SetChat(v *Chat) *MessageUpdate

SetChat sets the "chat" edge to the Chat entity.

func (*MessageUpdate) SetChatID

func (_u *MessageUpdate) SetChatID(v uuid.UUID) *MessageUpdate

SetChatID sets the "chat_id" field.

func (*MessageUpdate) SetContent

func (_u *MessageUpdate) SetContent(v string) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetNillableAuthorID

func (_u *MessageUpdate) SetNillableAuthorID(id *uuid.UUID) *MessageUpdate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*MessageUpdate) SetNillableAuthorType

func (_u *MessageUpdate) SetNillableAuthorType(v *message.AuthorType) *MessageUpdate

SetNillableAuthorType sets the "author_type" field if the given value is not nil.

func (*MessageUpdate) SetNillableAuthorUserID

func (_u *MessageUpdate) SetNillableAuthorUserID(v *uuid.UUID) *MessageUpdate

SetNillableAuthorUserID sets the "author_user_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableChatID

func (_u *MessageUpdate) SetNillableChatID(v *uuid.UUID) *MessageUpdate

SetNillableChatID sets the "chat_id" 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) 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) ClearAuthor

func (_u *MessageUpdateOne) ClearAuthor() *MessageUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*MessageUpdateOne) ClearAuthorUserID

func (_u *MessageUpdateOne) ClearAuthorUserID() *MessageUpdateOne

ClearAuthorUserID clears the value of the "author_user_id" field.

func (*MessageUpdateOne) ClearChat

func (_u *MessageUpdateOne) ClearChat() *MessageUpdateOne

ClearChat clears the "chat" edge to the Chat entity.

func (*MessageUpdateOne) Exec

func (_u *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecContext

func (c *MessageUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c *MessageUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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) SetAuthor

func (_u *MessageUpdateOne) SetAuthor(v *User) *MessageUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*MessageUpdateOne) SetAuthorID

func (_u *MessageUpdateOne) SetAuthorID(id uuid.UUID) *MessageUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*MessageUpdateOne) SetAuthorType

func (_u *MessageUpdateOne) SetAuthorType(v message.AuthorType) *MessageUpdateOne

SetAuthorType sets the "author_type" field.

func (*MessageUpdateOne) SetAuthorUserID

func (_u *MessageUpdateOne) SetAuthorUserID(v uuid.UUID) *MessageUpdateOne

SetAuthorUserID sets the "author_user_id" field.

func (*MessageUpdateOne) SetChat

func (_u *MessageUpdateOne) SetChat(v *Chat) *MessageUpdateOne

SetChat sets the "chat" edge to the Chat entity.

func (*MessageUpdateOne) SetChatID

func (_u *MessageUpdateOne) SetChatID(v uuid.UUID) *MessageUpdateOne

SetChatID sets the "chat_id" field.

func (*MessageUpdateOne) SetContent

func (_u *MessageUpdateOne) SetContent(v string) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetNillableAuthorID

func (_u *MessageUpdateOne) SetNillableAuthorID(id *uuid.UUID) *MessageUpdateOne

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*MessageUpdateOne) SetNillableAuthorType

func (_u *MessageUpdateOne) SetNillableAuthorType(v *message.AuthorType) *MessageUpdateOne

SetNillableAuthorType sets the "author_type" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableAuthorUserID

func (_u *MessageUpdateOne) SetNillableAuthorUserID(v *uuid.UUID) *MessageUpdateOne

SetNillableAuthorUserID sets the "author_user_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableChatID

func (_u *MessageUpdateOne) SetNillableChatID(v *uuid.UUID) *MessageUpdateOne

SetNillableChatID sets the "chat_id" 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) 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 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 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 {

	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// AgentRole is the client for interacting with the AgentRole builders.
	AgentRole *AgentRoleClient
	// AgentSkill is the client for interacting with the AgentSkill builders.
	AgentSkill *AgentSkillClient
	// AllowlistEntry is the client for interacting with the AllowlistEntry builders.
	AllowlistEntry *AllowlistEntryClient
	// AuthSession is the client for interacting with the AuthSession builders.
	AuthSession *AuthSessionClient
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// ChatMember is the client for interacting with the ChatMember builders.
	ChatMember *ChatMemberClient
	// Identity is the client for interacting with the Identity builders.
	Identity *IdentityClient
	// MagicLinkToken is the client for interacting with the MagicLinkToken builders.
	MagicLinkToken *MagicLinkTokenClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*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) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"-"`
	// Role holds the value of the "role" field.
	Role user.Role `json:"role,omitempty"`
	// Status holds the value of the "status" field.
	Status user.Status `json:"status,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) ExecContext

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) QueryAgentRoles

func (_m *User) QueryAgentRoles() *AgentRoleQuery

QueryAgentRoles queries the "agent_roles" edge of the User entity.

func (*User) QueryAgentsCreated

func (_m *User) QueryAgentsCreated() *AgentQuery

QueryAgentsCreated queries the "agents_created" edge of the User entity.

func (*User) QueryAllowlistAdded

func (_m *User) QueryAllowlistAdded() *AllowlistEntryQuery

QueryAllowlistAdded queries the "allowlist_added" edge of the User entity.

func (*User) QueryAuthSessions

func (_m *User) QueryAuthSessions() *AuthSessionQuery

QueryAuthSessions queries the "auth_sessions" edge of the User entity.

func (*User) QueryChatsCreated

func (_m *User) QueryChatsCreated() *ChatQuery

QueryChatsCreated queries the "chats_created" edge of the User entity.

func (*User) QueryContext

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) QueryIdentities

func (_m *User) QueryIdentities() *IdentityQuery

QueryIdentities queries the "identities" edge of the User entity.

func (*User) QueryMemberships

func (_m *User) QueryMemberships() *ChatMemberQuery

QueryMemberships queries the "memberships" edge of the User entity.

func (*User) QueryMessages

func (_m *User) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the User entity.

func (*User) String

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (_m *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (_m *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (_m *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) ExecContext

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAgentRoles

func (c *UserClient) QueryAgentRoles(_m *User) *AgentRoleQuery

QueryAgentRoles queries the agent_roles edge of a User.

func (*UserClient) QueryAgentsCreated

func (c *UserClient) QueryAgentsCreated(_m *User) *AgentQuery

QueryAgentsCreated queries the agents_created edge of a User.

func (*UserClient) QueryAllowlistAdded

func (c *UserClient) QueryAllowlistAdded(_m *User) *AllowlistEntryQuery

QueryAllowlistAdded queries the allowlist_added edge of a User.

func (*UserClient) QueryAuthSessions

func (c *UserClient) QueryAuthSessions(_m *User) *AuthSessionQuery

QueryAuthSessions queries the auth_sessions edge of a User.

func (*UserClient) QueryChatsCreated

func (c *UserClient) QueryChatsCreated(_m *User) *ChatQuery

QueryChatsCreated queries the chats_created edge of a User.

func (*UserClient) QueryContext

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) QueryIdentities

func (c *UserClient) QueryIdentities(_m *User) *IdentityQuery

QueryIdentities queries the identities edge of a User.

func (*UserClient) QueryMemberships

func (c *UserClient) QueryMemberships(_m *User) *ChatMemberQuery

QueryMemberships queries the memberships edge of a User.

func (*UserClient) QueryMessages

func (c *UserClient) QueryMessages(_m *User) *MessageQuery

QueryMessages queries the messages edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAgentRoleIDs

func (_c *UserCreate) AddAgentRoleIDs(ids ...uuid.UUID) *UserCreate

AddAgentRoleIDs adds the "agent_roles" edge to the AgentRole entity by IDs.

func (*UserCreate) AddAgentRoles

func (_c *UserCreate) AddAgentRoles(v ...*AgentRole) *UserCreate

AddAgentRoles adds the "agent_roles" edges to the AgentRole entity.

func (*UserCreate) AddAgentsCreated

func (_c *UserCreate) AddAgentsCreated(v ...*Agent) *UserCreate

AddAgentsCreated adds the "agents_created" edges to the Agent entity.

func (*UserCreate) AddAgentsCreatedIDs

func (_c *UserCreate) AddAgentsCreatedIDs(ids ...uuid.UUID) *UserCreate

AddAgentsCreatedIDs adds the "agents_created" edge to the Agent entity by IDs.

func (*UserCreate) AddAllowlistAdded

func (_c *UserCreate) AddAllowlistAdded(v ...*AllowlistEntry) *UserCreate

AddAllowlistAdded adds the "allowlist_added" edges to the AllowlistEntry entity.

func (*UserCreate) AddAllowlistAddedIDs

func (_c *UserCreate) AddAllowlistAddedIDs(ids ...uuid.UUID) *UserCreate

AddAllowlistAddedIDs adds the "allowlist_added" edge to the AllowlistEntry entity by IDs.

func (*UserCreate) AddAuthSessionIDs

func (_c *UserCreate) AddAuthSessionIDs(ids ...uuid.UUID) *UserCreate

AddAuthSessionIDs adds the "auth_sessions" edge to the AuthSession entity by IDs.

func (*UserCreate) AddAuthSessions

func (_c *UserCreate) AddAuthSessions(v ...*AuthSession) *UserCreate

AddAuthSessions adds the "auth_sessions" edges to the AuthSession entity.

func (*UserCreate) AddChatsCreated

func (_c *UserCreate) AddChatsCreated(v ...*Chat) *UserCreate

AddChatsCreated adds the "chats_created" edges to the Chat entity.

func (*UserCreate) AddChatsCreatedIDs

func (_c *UserCreate) AddChatsCreatedIDs(ids ...uuid.UUID) *UserCreate

AddChatsCreatedIDs adds the "chats_created" edge to the Chat entity by IDs.

func (*UserCreate) AddIdentities

func (_c *UserCreate) AddIdentities(v ...*Identity) *UserCreate

AddIdentities adds the "identities" edges to the Identity entity.

func (*UserCreate) AddIdentityIDs

func (_c *UserCreate) AddIdentityIDs(ids ...uuid.UUID) *UserCreate

AddIdentityIDs adds the "identities" edge to the Identity entity by IDs.

func (*UserCreate) AddMembershipIDs

func (_c *UserCreate) AddMembershipIDs(ids ...uuid.UUID) *UserCreate

AddMembershipIDs adds the "memberships" edge to the ChatMember entity by IDs.

func (*UserCreate) AddMemberships

func (_c *UserCreate) AddMemberships(v ...*ChatMember) *UserCreate

AddMemberships adds the "memberships" edges to the ChatMember entity.

func (*UserCreate) AddMessageIDs

func (_c *UserCreate) AddMessageIDs(ids ...uuid.UUID) *UserCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserCreate) AddMessages

func (_c *UserCreate) AddMessages(v ...*Message) *UserCreate

AddMessages adds the "messages" edges to the Message entity.

func (*UserCreate) Exec

func (_c *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreate) ExecX

func (_c *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) QueryContext

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDisplayName

func (_c *UserCreate) SetDisplayName(v string) *UserCreate

SetDisplayName sets the "display_name" field.

func (*UserCreate) SetEmail

func (_c *UserCreate) SetEmail(v string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (_c *UserCreate) SetID(v uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetNillableCreatedAt

func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableDisplayName

func (_c *UserCreate) SetNillableDisplayName(v *string) *UserCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (_c *UserCreate) SetNillableID(v *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillablePasswordHash added in v0.18.0

func (_c *UserCreate) SetNillablePasswordHash(v *string) *UserCreate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserCreate) SetNillableRole

func (_c *UserCreate) SetNillableRole(v *user.Role) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableStatus

func (_c *UserCreate) SetNillableStatus(v *user.Status) *UserCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPasswordHash added in v0.18.0

func (_c *UserCreate) SetPasswordHash(v string) *UserCreate

SetPasswordHash sets the "password_hash" field.

func (*UserCreate) SetRole

func (_c *UserCreate) SetRole(v user.Role) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetStatus

func (_c *UserCreate) SetStatus(v user.Status) *UserCreate

SetStatus sets the "status" field.

func (*UserCreate) SetUpdatedAt

func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (_c *UserCreate) SetUsername(v string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (_c *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecContext

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (_c *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) QueryContext

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (_d *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecContext

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (_d *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserDelete) Where

func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (_d *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (_d *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Identities holds the value of the identities edge.
	Identities []*Identity `json:"identities,omitempty"`
	// AuthSessions holds the value of the auth_sessions edge.
	AuthSessions []*AuthSession `json:"auth_sessions,omitempty"`
	// AllowlistAdded holds the value of the allowlist_added edge.
	AllowlistAdded []*AllowlistEntry `json:"allowlist_added,omitempty"`
	// ChatsCreated holds the value of the chats_created edge.
	ChatsCreated []*Chat `json:"chats_created,omitempty"`
	// Memberships holds the value of the memberships edge.
	Memberships []*ChatMember `json:"memberships,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// AgentsCreated holds the value of the agents_created edge.
	AgentsCreated []*Agent `json:"agents_created,omitempty"`
	// AgentRoles holds the value of the agent_roles edge.
	AgentRoles []*AgentRole `json:"agent_roles,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AgentRolesOrErr

func (e UserEdges) AgentRolesOrErr() ([]*AgentRole, error)

AgentRolesOrErr returns the AgentRoles value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AgentsCreatedOrErr

func (e UserEdges) AgentsCreatedOrErr() ([]*Agent, error)

AgentsCreatedOrErr returns the AgentsCreated value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AllowlistAddedOrErr

func (e UserEdges) AllowlistAddedOrErr() ([]*AllowlistEntry, error)

AllowlistAddedOrErr returns the AllowlistAdded value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AuthSessionsOrErr

func (e UserEdges) AuthSessionsOrErr() ([]*AuthSession, error)

AuthSessionsOrErr returns the AuthSessions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ChatsCreatedOrErr

func (e UserEdges) ChatsCreatedOrErr() ([]*Chat, error)

ChatsCreatedOrErr returns the ChatsCreated value or an error if the edge was not loaded in eager-loading.

func (UserEdges) IdentitiesOrErr

func (e UserEdges) IdentitiesOrErr() ([]*Identity, error)

IdentitiesOrErr returns the Identities value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MembershipsOrErr

func (e UserEdges) MembershipsOrErr() ([]*ChatMember, error)

MembershipsOrErr returns the Memberships value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MessagesOrErr

func (e UserEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (_g *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddAgentRoleIDs

func (m *UserMutation) AddAgentRoleIDs(ids ...uuid.UUID)

AddAgentRoleIDs adds the "agent_roles" edge to the AgentRole entity by ids.

func (*UserMutation) AddAgentsCreatedIDs

func (m *UserMutation) AddAgentsCreatedIDs(ids ...uuid.UUID)

AddAgentsCreatedIDs adds the "agents_created" edge to the Agent entity by ids.

func (*UserMutation) AddAllowlistAddedIDs

func (m *UserMutation) AddAllowlistAddedIDs(ids ...uuid.UUID)

AddAllowlistAddedIDs adds the "allowlist_added" edge to the AllowlistEntry entity by ids.

func (*UserMutation) AddAuthSessionIDs

func (m *UserMutation) AddAuthSessionIDs(ids ...uuid.UUID)

AddAuthSessionIDs adds the "auth_sessions" edge to the AuthSession entity by ids.

func (*UserMutation) AddChatsCreatedIDs

func (m *UserMutation) AddChatsCreatedIDs(ids ...uuid.UUID)

AddChatsCreatedIDs adds the "chats_created" edge to the Chat entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddIdentityIDs

func (m *UserMutation) AddIdentityIDs(ids ...uuid.UUID)

AddIdentityIDs adds the "identities" edge to the Identity entity by ids.

func (*UserMutation) AddMembershipIDs

func (m *UserMutation) AddMembershipIDs(ids ...uuid.UUID)

AddMembershipIDs adds the "memberships" edge to the ChatMember entity by ids.

func (*UserMutation) AddMessageIDs

func (m *UserMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AgentRolesCleared

func (m *UserMutation) AgentRolesCleared() bool

AgentRolesCleared reports if the "agent_roles" edge to the AgentRole entity was cleared.

func (*UserMutation) AgentRolesIDs

func (m *UserMutation) AgentRolesIDs() (ids []uuid.UUID)

AgentRolesIDs returns the "agent_roles" edge IDs in the mutation.

func (*UserMutation) AgentsCreatedCleared

func (m *UserMutation) AgentsCreatedCleared() bool

AgentsCreatedCleared reports if the "agents_created" edge to the Agent entity was cleared.

func (*UserMutation) AgentsCreatedIDs

func (m *UserMutation) AgentsCreatedIDs() (ids []uuid.UUID)

AgentsCreatedIDs returns the "agents_created" edge IDs in the mutation.

func (*UserMutation) AllowlistAddedCleared

func (m *UserMutation) AllowlistAddedCleared() bool

AllowlistAddedCleared reports if the "allowlist_added" edge to the AllowlistEntry entity was cleared.

func (*UserMutation) AllowlistAddedIDs

func (m *UserMutation) AllowlistAddedIDs() (ids []uuid.UUID)

AllowlistAddedIDs returns the "allowlist_added" edge IDs in the mutation.

func (*UserMutation) AuthSessionsCleared

func (m *UserMutation) AuthSessionsCleared() bool

AuthSessionsCleared reports if the "auth_sessions" edge to the AuthSession entity was cleared.

func (*UserMutation) AuthSessionsIDs

func (m *UserMutation) AuthSessionsIDs() (ids []uuid.UUID)

AuthSessionsIDs returns the "auth_sessions" edge IDs in the mutation.

func (*UserMutation) ChatsCreatedCleared

func (m *UserMutation) ChatsCreatedCleared() bool

ChatsCreatedCleared reports if the "chats_created" edge to the Chat entity was cleared.

func (*UserMutation) ChatsCreatedIDs

func (m *UserMutation) ChatsCreatedIDs() (ids []uuid.UUID)

ChatsCreatedIDs returns the "chats_created" edge IDs in the mutation.

func (*UserMutation) ClearAgentRoles

func (m *UserMutation) ClearAgentRoles()

ClearAgentRoles clears the "agent_roles" edge to the AgentRole entity.

func (*UserMutation) ClearAgentsCreated

func (m *UserMutation) ClearAgentsCreated()

ClearAgentsCreated clears the "agents_created" edge to the Agent entity.

func (*UserMutation) ClearAllowlistAdded

func (m *UserMutation) ClearAllowlistAdded()

ClearAllowlistAdded clears the "allowlist_added" edge to the AllowlistEntry entity.

func (*UserMutation) ClearAuthSessions

func (m *UserMutation) ClearAuthSessions()

ClearAuthSessions clears the "auth_sessions" edge to the AuthSession entity.

func (*UserMutation) ClearChatsCreated

func (m *UserMutation) ClearChatsCreated()

ClearChatsCreated clears the "chats_created" edge to the Chat entity.

func (*UserMutation) ClearDisplayName

func (m *UserMutation) ClearDisplayName()

ClearDisplayName clears the value of the "display_name" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearIdentities

func (m *UserMutation) ClearIdentities()

ClearIdentities clears the "identities" edge to the Identity entity.

func (*UserMutation) ClearMemberships

func (m *UserMutation) ClearMemberships()

ClearMemberships clears the "memberships" edge to the ChatMember entity.

func (*UserMutation) ClearMessages

func (m *UserMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*UserMutation) ClearPasswordHash added in v0.18.0

func (m *UserMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "password_hash" field.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DisplayName

func (m *UserMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*UserMutation) DisplayNameCleared

func (m *UserMutation) DisplayNameCleared() bool

DisplayNameCleared returns if the "display_name" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) ExecContext

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) IdentitiesCleared

func (m *UserMutation) IdentitiesCleared() bool

IdentitiesCleared reports if the "identities" edge to the Identity entity was cleared.

func (*UserMutation) IdentitiesIDs

func (m *UserMutation) IdentitiesIDs() (ids []uuid.UUID)

IdentitiesIDs returns the "identities" edge IDs in the mutation.

func (*UserMutation) MembershipsCleared

func (m *UserMutation) MembershipsCleared() bool

MembershipsCleared reports if the "memberships" edge to the ChatMember entity was cleared.

func (*UserMutation) MembershipsIDs

func (m *UserMutation) MembershipsIDs() (ids []uuid.UUID)

MembershipsIDs returns the "memberships" edge IDs in the mutation.

func (*UserMutation) MessagesCleared

func (m *UserMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*UserMutation) MessagesIDs

func (m *UserMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldDisplayName

func (m *UserMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldPasswordHash added in v0.18.0

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)

OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldStatus

func (m *UserMutation) OldStatus(ctx context.Context) (v user.Status, err error)

OldStatus returns the old "status" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) PasswordHash added in v0.18.0

func (m *UserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*UserMutation) PasswordHashCleared added in v0.18.0

func (m *UserMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "password_hash" field was cleared in this mutation.

func (*UserMutation) QueryContext

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RemoveAgentRoleIDs

func (m *UserMutation) RemoveAgentRoleIDs(ids ...uuid.UUID)

RemoveAgentRoleIDs removes the "agent_roles" edge to the AgentRole entity by IDs.

func (*UserMutation) RemoveAgentsCreatedIDs

func (m *UserMutation) RemoveAgentsCreatedIDs(ids ...uuid.UUID)

RemoveAgentsCreatedIDs removes the "agents_created" edge to the Agent entity by IDs.

func (*UserMutation) RemoveAllowlistAddedIDs

func (m *UserMutation) RemoveAllowlistAddedIDs(ids ...uuid.UUID)

RemoveAllowlistAddedIDs removes the "allowlist_added" edge to the AllowlistEntry entity by IDs.

func (*UserMutation) RemoveAuthSessionIDs

func (m *UserMutation) RemoveAuthSessionIDs(ids ...uuid.UUID)

RemoveAuthSessionIDs removes the "auth_sessions" edge to the AuthSession entity by IDs.

func (*UserMutation) RemoveChatsCreatedIDs

func (m *UserMutation) RemoveChatsCreatedIDs(ids ...uuid.UUID)

RemoveChatsCreatedIDs removes the "chats_created" edge to the Chat entity by IDs.

func (*UserMutation) RemoveIdentityIDs

func (m *UserMutation) RemoveIdentityIDs(ids ...uuid.UUID)

RemoveIdentityIDs removes the "identities" edge to the Identity entity by IDs.

func (*UserMutation) RemoveMembershipIDs

func (m *UserMutation) RemoveMembershipIDs(ids ...uuid.UUID)

RemoveMembershipIDs removes the "memberships" edge to the ChatMember entity by IDs.

func (*UserMutation) RemoveMessageIDs

func (m *UserMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*UserMutation) RemovedAgentRolesIDs

func (m *UserMutation) RemovedAgentRolesIDs() (ids []uuid.UUID)

RemovedAgentRoles returns the removed IDs of the "agent_roles" edge to the AgentRole entity.

func (*UserMutation) RemovedAgentsCreatedIDs

func (m *UserMutation) RemovedAgentsCreatedIDs() (ids []uuid.UUID)

RemovedAgentsCreated returns the removed IDs of the "agents_created" edge to the Agent entity.

func (*UserMutation) RemovedAllowlistAddedIDs

func (m *UserMutation) RemovedAllowlistAddedIDs() (ids []uuid.UUID)

RemovedAllowlistAdded returns the removed IDs of the "allowlist_added" edge to the AllowlistEntry entity.

func (*UserMutation) RemovedAuthSessionsIDs

func (m *UserMutation) RemovedAuthSessionsIDs() (ids []uuid.UUID)

RemovedAuthSessions returns the removed IDs of the "auth_sessions" edge to the AuthSession entity.

func (*UserMutation) RemovedChatsCreatedIDs

func (m *UserMutation) RemovedChatsCreatedIDs() (ids []uuid.UUID)

RemovedChatsCreated returns the removed IDs of the "chats_created" edge to the Chat entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedIdentitiesIDs

func (m *UserMutation) RemovedIdentitiesIDs() (ids []uuid.UUID)

RemovedIdentities returns the removed IDs of the "identities" edge to the Identity entity.

func (*UserMutation) RemovedMembershipsIDs

func (m *UserMutation) RemovedMembershipsIDs() (ids []uuid.UUID)

RemovedMemberships returns the removed IDs of the "memberships" edge to the ChatMember entity.

func (*UserMutation) RemovedMessagesIDs

func (m *UserMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*UserMutation) ResetAgentRoles

func (m *UserMutation) ResetAgentRoles()

ResetAgentRoles resets all changes to the "agent_roles" edge.

func (*UserMutation) ResetAgentsCreated

func (m *UserMutation) ResetAgentsCreated()

ResetAgentsCreated resets all changes to the "agents_created" edge.

func (*UserMutation) ResetAllowlistAdded

func (m *UserMutation) ResetAllowlistAdded()

ResetAllowlistAdded resets all changes to the "allowlist_added" edge.

func (*UserMutation) ResetAuthSessions

func (m *UserMutation) ResetAuthSessions()

ResetAuthSessions resets all changes to the "auth_sessions" edge.

func (*UserMutation) ResetChatsCreated

func (m *UserMutation) ResetChatsCreated()

ResetChatsCreated resets all changes to the "chats_created" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDisplayName

func (m *UserMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetIdentities

func (m *UserMutation) ResetIdentities()

ResetIdentities resets all changes to the "identities" edge.

func (*UserMutation) ResetMemberships

func (m *UserMutation) ResetMemberships()

ResetMemberships resets all changes to the "memberships" edge.

func (*UserMutation) ResetMessages

func (m *UserMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*UserMutation) ResetPasswordHash added in v0.18.0

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetStatus

func (m *UserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r user.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDisplayName

func (m *UserMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPasswordHash added in v0.18.0

func (m *UserMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(u user.Role)

SetRole sets the "role" field.

func (*UserMutation) SetStatus

func (m *UserMutation) SetStatus(u user.Status)

SetStatus sets the "status" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) Status

func (m *UserMutation) Status() (r user.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (_q *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (_q *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) ExecContext

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserQuery) Exist

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (_q *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (_q *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (_q *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (_q *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (_q *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (_q *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (_q *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (_q *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (_q *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (_q *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryAgentRoles

func (_q *UserQuery) QueryAgentRoles() *AgentRoleQuery

QueryAgentRoles chains the current query on the "agent_roles" edge.

func (*UserQuery) QueryAgentsCreated

func (_q *UserQuery) QueryAgentsCreated() *AgentQuery

QueryAgentsCreated chains the current query on the "agents_created" edge.

func (*UserQuery) QueryAllowlistAdded

func (_q *UserQuery) QueryAllowlistAdded() *AllowlistEntryQuery

QueryAllowlistAdded chains the current query on the "allowlist_added" edge.

func (*UserQuery) QueryAuthSessions

func (_q *UserQuery) QueryAuthSessions() *AuthSessionQuery

QueryAuthSessions chains the current query on the "auth_sessions" edge.

func (*UserQuery) QueryChatsCreated

func (_q *UserQuery) QueryChatsCreated() *ChatQuery

QueryChatsCreated chains the current query on the "chats_created" edge.

func (*UserQuery) QueryContext

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) QueryIdentities

func (_q *UserQuery) QueryIdentities() *IdentityQuery

QueryIdentities chains the current query on the "identities" edge.

func (*UserQuery) QueryMemberships

func (_q *UserQuery) QueryMemberships() *ChatMemberQuery

QueryMemberships chains the current query on the "memberships" edge.

func (*UserQuery) QueryMessages

func (_q *UserQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*UserQuery) Select

func (_q *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
}

client.User.Query().
	Select(user.FieldEmail).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (_q *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAgentRoles

func (_q *UserQuery) WithAgentRoles(opts ...func(*AgentRoleQuery)) *UserQuery

WithAgentRoles tells the query-builder to eager-load the nodes that are connected to the "agent_roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAgentsCreated

func (_q *UserQuery) WithAgentsCreated(opts ...func(*AgentQuery)) *UserQuery

WithAgentsCreated tells the query-builder to eager-load the nodes that are connected to the "agents_created" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAllowlistAdded

func (_q *UserQuery) WithAllowlistAdded(opts ...func(*AllowlistEntryQuery)) *UserQuery

WithAllowlistAdded tells the query-builder to eager-load the nodes that are connected to the "allowlist_added" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAuthSessions

func (_q *UserQuery) WithAuthSessions(opts ...func(*AuthSessionQuery)) *UserQuery

WithAuthSessions tells the query-builder to eager-load the nodes that are connected to the "auth_sessions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithChatsCreated

func (_q *UserQuery) WithChatsCreated(opts ...func(*ChatQuery)) *UserQuery

WithChatsCreated tells the query-builder to eager-load the nodes that are connected to the "chats_created" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithIdentities

func (_q *UserQuery) WithIdentities(opts ...func(*IdentityQuery)) *UserQuery

WithIdentities tells the query-builder to eager-load the nodes that are connected to the "identities" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMemberships

func (_q *UserQuery) WithMemberships(opts ...func(*ChatMemberQuery)) *UserQuery

WithMemberships tells the query-builder to eager-load the nodes that are connected to the "memberships" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMessages

func (_q *UserQuery) WithMessages(opts ...func(*MessageQuery)) *UserQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserSelect) ExecContext

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (UserSelect) QueryContext

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserSelect) Scan

func (_s *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddAgentRoleIDs

func (_u *UserUpdate) AddAgentRoleIDs(ids ...uuid.UUID) *UserUpdate

AddAgentRoleIDs adds the "agent_roles" edge to the AgentRole entity by IDs.

func (*UserUpdate) AddAgentRoles

func (_u *UserUpdate) AddAgentRoles(v ...*AgentRole) *UserUpdate

AddAgentRoles adds the "agent_roles" edges to the AgentRole entity.

func (*UserUpdate) AddAgentsCreated

func (_u *UserUpdate) AddAgentsCreated(v ...*Agent) *UserUpdate

AddAgentsCreated adds the "agents_created" edges to the Agent entity.

func (*UserUpdate) AddAgentsCreatedIDs

func (_u *UserUpdate) AddAgentsCreatedIDs(ids ...uuid.UUID) *UserUpdate

AddAgentsCreatedIDs adds the "agents_created" edge to the Agent entity by IDs.

func (*UserUpdate) AddAllowlistAdded

func (_u *UserUpdate) AddAllowlistAdded(v ...*AllowlistEntry) *UserUpdate

AddAllowlistAdded adds the "allowlist_added" edges to the AllowlistEntry entity.

func (*UserUpdate) AddAllowlistAddedIDs

func (_u *UserUpdate) AddAllowlistAddedIDs(ids ...uuid.UUID) *UserUpdate

AddAllowlistAddedIDs adds the "allowlist_added" edge to the AllowlistEntry entity by IDs.

func (*UserUpdate) AddAuthSessionIDs

func (_u *UserUpdate) AddAuthSessionIDs(ids ...uuid.UUID) *UserUpdate

AddAuthSessionIDs adds the "auth_sessions" edge to the AuthSession entity by IDs.

func (*UserUpdate) AddAuthSessions

func (_u *UserUpdate) AddAuthSessions(v ...*AuthSession) *UserUpdate

AddAuthSessions adds the "auth_sessions" edges to the AuthSession entity.

func (*UserUpdate) AddChatsCreated

func (_u *UserUpdate) AddChatsCreated(v ...*Chat) *UserUpdate

AddChatsCreated adds the "chats_created" edges to the Chat entity.

func (*UserUpdate) AddChatsCreatedIDs

func (_u *UserUpdate) AddChatsCreatedIDs(ids ...uuid.UUID) *UserUpdate

AddChatsCreatedIDs adds the "chats_created" edge to the Chat entity by IDs.

func (*UserUpdate) AddIdentities

func (_u *UserUpdate) AddIdentities(v ...*Identity) *UserUpdate

AddIdentities adds the "identities" edges to the Identity entity.

func (*UserUpdate) AddIdentityIDs

func (_u *UserUpdate) AddIdentityIDs(ids ...uuid.UUID) *UserUpdate

AddIdentityIDs adds the "identities" edge to the Identity entity by IDs.

func (*UserUpdate) AddMembershipIDs

func (_u *UserUpdate) AddMembershipIDs(ids ...uuid.UUID) *UserUpdate

AddMembershipIDs adds the "memberships" edge to the ChatMember entity by IDs.

func (*UserUpdate) AddMemberships

func (_u *UserUpdate) AddMemberships(v ...*ChatMember) *UserUpdate

AddMemberships adds the "memberships" edges to the ChatMember entity.

func (*UserUpdate) AddMessageIDs

func (_u *UserUpdate) AddMessageIDs(ids ...uuid.UUID) *UserUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserUpdate) AddMessages

func (_u *UserUpdate) AddMessages(v ...*Message) *UserUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*UserUpdate) ClearAgentRoles

func (_u *UserUpdate) ClearAgentRoles() *UserUpdate

ClearAgentRoles clears all "agent_roles" edges to the AgentRole entity.

func (*UserUpdate) ClearAgentsCreated

func (_u *UserUpdate) ClearAgentsCreated() *UserUpdate

ClearAgentsCreated clears all "agents_created" edges to the Agent entity.

func (*UserUpdate) ClearAllowlistAdded

func (_u *UserUpdate) ClearAllowlistAdded() *UserUpdate

ClearAllowlistAdded clears all "allowlist_added" edges to the AllowlistEntry entity.

func (*UserUpdate) ClearAuthSessions

func (_u *UserUpdate) ClearAuthSessions() *UserUpdate

ClearAuthSessions clears all "auth_sessions" edges to the AuthSession entity.

func (*UserUpdate) ClearChatsCreated

func (_u *UserUpdate) ClearChatsCreated() *UserUpdate

ClearChatsCreated clears all "chats_created" edges to the Chat entity.

func (*UserUpdate) ClearDisplayName

func (_u *UserUpdate) ClearDisplayName() *UserUpdate

ClearDisplayName clears the value of the "display_name" field.

func (*UserUpdate) ClearIdentities

func (_u *UserUpdate) ClearIdentities() *UserUpdate

ClearIdentities clears all "identities" edges to the Identity entity.

func (*UserUpdate) ClearMemberships

func (_u *UserUpdate) ClearMemberships() *UserUpdate

ClearMemberships clears all "memberships" edges to the ChatMember entity.

func (*UserUpdate) ClearMessages

func (_u *UserUpdate) ClearMessages() *UserUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*UserUpdate) ClearPasswordHash added in v0.18.0

func (_u *UserUpdate) ClearPasswordHash() *UserUpdate

ClearPasswordHash clears the value of the "password_hash" field.

func (*UserUpdate) Exec

func (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdate) ExecX

func (_u *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) QueryContext

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) RemoveAgentRoleIDs

func (_u *UserUpdate) RemoveAgentRoleIDs(ids ...uuid.UUID) *UserUpdate

RemoveAgentRoleIDs removes the "agent_roles" edge to AgentRole entities by IDs.

func (*UserUpdate) RemoveAgentRoles

func (_u *UserUpdate) RemoveAgentRoles(v ...*AgentRole) *UserUpdate

RemoveAgentRoles removes "agent_roles" edges to AgentRole entities.

func (*UserUpdate) RemoveAgentsCreated

func (_u *UserUpdate) RemoveAgentsCreated(v ...*Agent) *UserUpdate

RemoveAgentsCreated removes "agents_created" edges to Agent entities.

func (*UserUpdate) RemoveAgentsCreatedIDs

func (_u *UserUpdate) RemoveAgentsCreatedIDs(ids ...uuid.UUID) *UserUpdate

RemoveAgentsCreatedIDs removes the "agents_created" edge to Agent entities by IDs.

func (*UserUpdate) RemoveAllowlistAdded

func (_u *UserUpdate) RemoveAllowlistAdded(v ...*AllowlistEntry) *UserUpdate

RemoveAllowlistAdded removes "allowlist_added" edges to AllowlistEntry entities.

func (*UserUpdate) RemoveAllowlistAddedIDs

func (_u *UserUpdate) RemoveAllowlistAddedIDs(ids ...uuid.UUID) *UserUpdate

RemoveAllowlistAddedIDs removes the "allowlist_added" edge to AllowlistEntry entities by IDs.

func (*UserUpdate) RemoveAuthSessionIDs

func (_u *UserUpdate) RemoveAuthSessionIDs(ids ...uuid.UUID) *UserUpdate

RemoveAuthSessionIDs removes the "auth_sessions" edge to AuthSession entities by IDs.

func (*UserUpdate) RemoveAuthSessions

func (_u *UserUpdate) RemoveAuthSessions(v ...*AuthSession) *UserUpdate

RemoveAuthSessions removes "auth_sessions" edges to AuthSession entities.

func (*UserUpdate) RemoveChatsCreated

func (_u *UserUpdate) RemoveChatsCreated(v ...*Chat) *UserUpdate

RemoveChatsCreated removes "chats_created" edges to Chat entities.

func (*UserUpdate) RemoveChatsCreatedIDs

func (_u *UserUpdate) RemoveChatsCreatedIDs(ids ...uuid.UUID) *UserUpdate

RemoveChatsCreatedIDs removes the "chats_created" edge to Chat entities by IDs.

func (*UserUpdate) RemoveIdentities

func (_u *UserUpdate) RemoveIdentities(v ...*Identity) *UserUpdate

RemoveIdentities removes "identities" edges to Identity entities.

func (*UserUpdate) RemoveIdentityIDs

func (_u *UserUpdate) RemoveIdentityIDs(ids ...uuid.UUID) *UserUpdate

RemoveIdentityIDs removes the "identities" edge to Identity entities by IDs.

func (*UserUpdate) RemoveMembershipIDs

func (_u *UserUpdate) RemoveMembershipIDs(ids ...uuid.UUID) *UserUpdate

RemoveMembershipIDs removes the "memberships" edge to ChatMember entities by IDs.

func (*UserUpdate) RemoveMemberships

func (_u *UserUpdate) RemoveMemberships(v ...*ChatMember) *UserUpdate

RemoveMemberships removes "memberships" edges to ChatMember entities.

func (*UserUpdate) RemoveMessageIDs

func (_u *UserUpdate) RemoveMessageIDs(ids ...uuid.UUID) *UserUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*UserUpdate) RemoveMessages

func (_u *UserUpdate) RemoveMessages(v ...*Message) *UserUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*UserUpdate) Save

func (_u *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (_u *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetDisplayName

func (_u *UserUpdate) SetDisplayName(v string) *UserUpdate

SetDisplayName sets the "display_name" field.

func (*UserUpdate) SetEmail

func (_u *UserUpdate) SetEmail(v string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableDisplayName

func (_u *UserUpdate) SetNillableDisplayName(v *string) *UserUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillablePasswordHash added in v0.18.0

func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdate) SetNillableRole

func (_u *UserUpdate) SetNillableRole(v *user.Role) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetNillableStatus

func (_u *UserUpdate) SetNillableStatus(v *user.Status) *UserUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPasswordHash added in v0.18.0

func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate

SetPasswordHash sets the "password_hash" field.

func (*UserUpdate) SetRole

func (_u *UserUpdate) SetRole(v user.Role) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetStatus

func (_u *UserUpdate) SetStatus(v user.Status) *UserUpdate

SetStatus sets the "status" field.

func (*UserUpdate) SetUpdatedAt

func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (_u *UserUpdate) SetUsername(v string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddAgentRoleIDs

func (_u *UserUpdateOne) AddAgentRoleIDs(ids ...uuid.UUID) *UserUpdateOne

AddAgentRoleIDs adds the "agent_roles" edge to the AgentRole entity by IDs.

func (*UserUpdateOne) AddAgentRoles

func (_u *UserUpdateOne) AddAgentRoles(v ...*AgentRole) *UserUpdateOne

AddAgentRoles adds the "agent_roles" edges to the AgentRole entity.

func (*UserUpdateOne) AddAgentsCreated

func (_u *UserUpdateOne) AddAgentsCreated(v ...*Agent) *UserUpdateOne

AddAgentsCreated adds the "agents_created" edges to the Agent entity.

func (*UserUpdateOne) AddAgentsCreatedIDs

func (_u *UserUpdateOne) AddAgentsCreatedIDs(ids ...uuid.UUID) *UserUpdateOne

AddAgentsCreatedIDs adds the "agents_created" edge to the Agent entity by IDs.

func (*UserUpdateOne) AddAllowlistAdded

func (_u *UserUpdateOne) AddAllowlistAdded(v ...*AllowlistEntry) *UserUpdateOne

AddAllowlistAdded adds the "allowlist_added" edges to the AllowlistEntry entity.

func (*UserUpdateOne) AddAllowlistAddedIDs

func (_u *UserUpdateOne) AddAllowlistAddedIDs(ids ...uuid.UUID) *UserUpdateOne

AddAllowlistAddedIDs adds the "allowlist_added" edge to the AllowlistEntry entity by IDs.

func (*UserUpdateOne) AddAuthSessionIDs

func (_u *UserUpdateOne) AddAuthSessionIDs(ids ...uuid.UUID) *UserUpdateOne

AddAuthSessionIDs adds the "auth_sessions" edge to the AuthSession entity by IDs.

func (*UserUpdateOne) AddAuthSessions

func (_u *UserUpdateOne) AddAuthSessions(v ...*AuthSession) *UserUpdateOne

AddAuthSessions adds the "auth_sessions" edges to the AuthSession entity.

func (*UserUpdateOne) AddChatsCreated

func (_u *UserUpdateOne) AddChatsCreated(v ...*Chat) *UserUpdateOne

AddChatsCreated adds the "chats_created" edges to the Chat entity.

func (*UserUpdateOne) AddChatsCreatedIDs

func (_u *UserUpdateOne) AddChatsCreatedIDs(ids ...uuid.UUID) *UserUpdateOne

AddChatsCreatedIDs adds the "chats_created" edge to the Chat entity by IDs.

func (*UserUpdateOne) AddIdentities

func (_u *UserUpdateOne) AddIdentities(v ...*Identity) *UserUpdateOne

AddIdentities adds the "identities" edges to the Identity entity.

func (*UserUpdateOne) AddIdentityIDs

func (_u *UserUpdateOne) AddIdentityIDs(ids ...uuid.UUID) *UserUpdateOne

AddIdentityIDs adds the "identities" edge to the Identity entity by IDs.

func (*UserUpdateOne) AddMembershipIDs

func (_u *UserUpdateOne) AddMembershipIDs(ids ...uuid.UUID) *UserUpdateOne

AddMembershipIDs adds the "memberships" edge to the ChatMember entity by IDs.

func (*UserUpdateOne) AddMemberships

func (_u *UserUpdateOne) AddMemberships(v ...*ChatMember) *UserUpdateOne

AddMemberships adds the "memberships" edges to the ChatMember entity.

func (*UserUpdateOne) AddMessageIDs

func (_u *UserUpdateOne) AddMessageIDs(ids ...uuid.UUID) *UserUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserUpdateOne) AddMessages

func (_u *UserUpdateOne) AddMessages(v ...*Message) *UserUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*UserUpdateOne) ClearAgentRoles

func (_u *UserUpdateOne) ClearAgentRoles() *UserUpdateOne

ClearAgentRoles clears all "agent_roles" edges to the AgentRole entity.

func (*UserUpdateOne) ClearAgentsCreated

func (_u *UserUpdateOne) ClearAgentsCreated() *UserUpdateOne

ClearAgentsCreated clears all "agents_created" edges to the Agent entity.

func (*UserUpdateOne) ClearAllowlistAdded

func (_u *UserUpdateOne) ClearAllowlistAdded() *UserUpdateOne

ClearAllowlistAdded clears all "allowlist_added" edges to the AllowlistEntry entity.

func (*UserUpdateOne) ClearAuthSessions

func (_u *UserUpdateOne) ClearAuthSessions() *UserUpdateOne

ClearAuthSessions clears all "auth_sessions" edges to the AuthSession entity.

func (*UserUpdateOne) ClearChatsCreated

func (_u *UserUpdateOne) ClearChatsCreated() *UserUpdateOne

ClearChatsCreated clears all "chats_created" edges to the Chat entity.

func (*UserUpdateOne) ClearDisplayName

func (_u *UserUpdateOne) ClearDisplayName() *UserUpdateOne

ClearDisplayName clears the value of the "display_name" field.

func (*UserUpdateOne) ClearIdentities

func (_u *UserUpdateOne) ClearIdentities() *UserUpdateOne

ClearIdentities clears all "identities" edges to the Identity entity.

func (*UserUpdateOne) ClearMemberships

func (_u *UserUpdateOne) ClearMemberships() *UserUpdateOne

ClearMemberships clears all "memberships" edges to the ChatMember entity.

func (*UserUpdateOne) ClearMessages

func (_u *UserUpdateOne) ClearMessages() *UserUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*UserUpdateOne) ClearPasswordHash added in v0.18.0

func (_u *UserUpdateOne) ClearPasswordHash() *UserUpdateOne

ClearPasswordHash clears the value of the "password_hash" field.

func (*UserUpdateOne) Exec

func (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdateOne) ExecX

func (_u *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) QueryContext

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) RemoveAgentRoleIDs

func (_u *UserUpdateOne) RemoveAgentRoleIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAgentRoleIDs removes the "agent_roles" edge to AgentRole entities by IDs.

func (*UserUpdateOne) RemoveAgentRoles

func (_u *UserUpdateOne) RemoveAgentRoles(v ...*AgentRole) *UserUpdateOne

RemoveAgentRoles removes "agent_roles" edges to AgentRole entities.

func (*UserUpdateOne) RemoveAgentsCreated

func (_u *UserUpdateOne) RemoveAgentsCreated(v ...*Agent) *UserUpdateOne

RemoveAgentsCreated removes "agents_created" edges to Agent entities.

func (*UserUpdateOne) RemoveAgentsCreatedIDs

func (_u *UserUpdateOne) RemoveAgentsCreatedIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAgentsCreatedIDs removes the "agents_created" edge to Agent entities by IDs.

func (*UserUpdateOne) RemoveAllowlistAdded

func (_u *UserUpdateOne) RemoveAllowlistAdded(v ...*AllowlistEntry) *UserUpdateOne

RemoveAllowlistAdded removes "allowlist_added" edges to AllowlistEntry entities.

func (*UserUpdateOne) RemoveAllowlistAddedIDs

func (_u *UserUpdateOne) RemoveAllowlistAddedIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAllowlistAddedIDs removes the "allowlist_added" edge to AllowlistEntry entities by IDs.

func (*UserUpdateOne) RemoveAuthSessionIDs

func (_u *UserUpdateOne) RemoveAuthSessionIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAuthSessionIDs removes the "auth_sessions" edge to AuthSession entities by IDs.

func (*UserUpdateOne) RemoveAuthSessions

func (_u *UserUpdateOne) RemoveAuthSessions(v ...*AuthSession) *UserUpdateOne

RemoveAuthSessions removes "auth_sessions" edges to AuthSession entities.

func (*UserUpdateOne) RemoveChatsCreated

func (_u *UserUpdateOne) RemoveChatsCreated(v ...*Chat) *UserUpdateOne

RemoveChatsCreated removes "chats_created" edges to Chat entities.

func (*UserUpdateOne) RemoveChatsCreatedIDs

func (_u *UserUpdateOne) RemoveChatsCreatedIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveChatsCreatedIDs removes the "chats_created" edge to Chat entities by IDs.

func (*UserUpdateOne) RemoveIdentities

func (_u *UserUpdateOne) RemoveIdentities(v ...*Identity) *UserUpdateOne

RemoveIdentities removes "identities" edges to Identity entities.

func (*UserUpdateOne) RemoveIdentityIDs

func (_u *UserUpdateOne) RemoveIdentityIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveIdentityIDs removes the "identities" edge to Identity entities by IDs.

func (*UserUpdateOne) RemoveMembershipIDs

func (_u *UserUpdateOne) RemoveMembershipIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMembershipIDs removes the "memberships" edge to ChatMember entities by IDs.

func (*UserUpdateOne) RemoveMemberships

func (_u *UserUpdateOne) RemoveMemberships(v ...*ChatMember) *UserUpdateOne

RemoveMemberships removes "memberships" edges to ChatMember entities.

func (*UserUpdateOne) RemoveMessageIDs

func (_u *UserUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*UserUpdateOne) RemoveMessages

func (_u *UserUpdateOne) RemoveMessages(v ...*Message) *UserUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetDisplayName

func (_u *UserUpdateOne) SetDisplayName(v string) *UserUpdateOne

SetDisplayName sets the "display_name" field.

func (*UserUpdateOne) SetEmail

func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableDisplayName

func (_u *UserUpdateOne) SetNillableDisplayName(v *string) *UserUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePasswordHash added in v0.18.0

func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRole

func (_u *UserUpdateOne) SetNillableRole(v *user.Role) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetNillableStatus

func (_u *UserUpdateOne) SetNillableStatus(v *user.Status) *UserUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPasswordHash added in v0.18.0

func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*UserUpdateOne) SetRole

func (_u *UserUpdateOne) SetRole(v user.Role) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetStatus

func (_u *UserUpdateOne) SetStatus(v user.Status) *UserUpdateOne

SetStatus sets the "status" field.

func (*UserUpdateOne) SetUpdatedAt

func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
Package schema defines the Ent schemas for the team (multi-user) system of record.
Package schema defines the Ent schemas for the team (multi-user) system of record.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL