Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type ChatMessage
- type ChatMessageClient
- func (c *ChatMessageClient) Create() *ChatMessageCreate
- func (c *ChatMessageClient) CreateBulk(builders ...*ChatMessageCreate) *ChatMessageCreateBulk
- func (c *ChatMessageClient) Delete() *ChatMessageDelete
- func (c *ChatMessageClient) DeleteOne(cm *ChatMessage) *ChatMessageDeleteOne
- func (c *ChatMessageClient) DeleteOneID(id string) *ChatMessageDeleteOne
- func (c *ChatMessageClient) Get(ctx context.Context, id string) (*ChatMessage, error)
- func (c *ChatMessageClient) GetX(ctx context.Context, id string) *ChatMessage
- func (c *ChatMessageClient) Hooks() []Hook
- func (c *ChatMessageClient) Intercept(interceptors ...Interceptor)
- func (c *ChatMessageClient) Interceptors() []Interceptor
- func (c *ChatMessageClient) MapCreateBulk(slice any, setFunc func(*ChatMessageCreate, int)) *ChatMessageCreateBulk
- func (c *ChatMessageClient) Query() *ChatMessageQuery
- func (c *ChatMessageClient) Update() *ChatMessageUpdate
- func (c *ChatMessageClient) UpdateOne(cm *ChatMessage) *ChatMessageUpdateOne
- func (c *ChatMessageClient) UpdateOneID(id string) *ChatMessageUpdateOne
- func (c *ChatMessageClient) Use(hooks ...Hook)
- type ChatMessageCreate
- func (cmc *ChatMessageCreate) Exec(ctx context.Context) error
- func (cmc *ChatMessageCreate) ExecX(ctx context.Context)
- func (cmc *ChatMessageCreate) Mutation() *ChatMessageMutation
- func (cmc *ChatMessageCreate) Save(ctx context.Context) (*ChatMessage, error)
- func (cmc *ChatMessageCreate) SaveX(ctx context.Context) *ChatMessage
- func (cmc *ChatMessageCreate) SetContent(s string) *ChatMessageCreate
- func (cmc *ChatMessageCreate) SetConversationID(s string) *ChatMessageCreate
- func (cmc *ChatMessageCreate) SetID(s string) *ChatMessageCreate
- func (cmc *ChatMessageCreate) SetRole(s string) *ChatMessageCreate
- type ChatMessageCreateBulk
- type ChatMessageDelete
- type ChatMessageDeleteOne
- type ChatMessageGroupBy
- func (cmgb *ChatMessageGroupBy) Aggregate(fns ...AggregateFunc) *ChatMessageGroupBy
- func (s *ChatMessageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatMessageGroupBy) BoolX(ctx context.Context) bool
- func (s *ChatMessageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatMessageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ChatMessageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatMessageGroupBy) Float64X(ctx context.Context) float64
- func (s *ChatMessageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatMessageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ChatMessageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ChatMessageGroupBy) IntX(ctx context.Context) int
- func (s *ChatMessageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ChatMessageGroupBy) IntsX(ctx context.Context) []int
- func (cmgb *ChatMessageGroupBy) Scan(ctx context.Context, v any) error
- func (s *ChatMessageGroupBy) ScanX(ctx context.Context, v any)
- func (s *ChatMessageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ChatMessageGroupBy) StringX(ctx context.Context) string
- func (s *ChatMessageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ChatMessageGroupBy) StringsX(ctx context.Context) []string
- type ChatMessageMutation
- func (m *ChatMessageMutation) AddField(name string, value ent.Value) error
- func (m *ChatMessageMutation) AddedEdges() []string
- func (m *ChatMessageMutation) AddedField(name string) (ent.Value, bool)
- func (m *ChatMessageMutation) AddedFields() []string
- func (m *ChatMessageMutation) AddedIDs(name string) []ent.Value
- func (m *ChatMessageMutation) ClearEdge(name string) error
- func (m *ChatMessageMutation) ClearField(name string) error
- func (m *ChatMessageMutation) ClearedEdges() []string
- func (m *ChatMessageMutation) ClearedFields() []string
- func (m ChatMessageMutation) Client() *Client
- func (m *ChatMessageMutation) Content() (r string, exists bool)
- func (m *ChatMessageMutation) ConversationID() (r string, exists bool)
- func (m *ChatMessageMutation) EdgeCleared(name string) bool
- func (m *ChatMessageMutation) Field(name string) (ent.Value, bool)
- func (m *ChatMessageMutation) FieldCleared(name string) bool
- func (m *ChatMessageMutation) Fields() []string
- func (m *ChatMessageMutation) ID() (id string, exists bool)
- func (m *ChatMessageMutation) IDs(ctx context.Context) ([]string, error)
- func (m *ChatMessageMutation) OldContent(ctx context.Context) (v string, err error)
- func (m *ChatMessageMutation) OldConversationID(ctx context.Context) (v string, err error)
- func (m *ChatMessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ChatMessageMutation) OldRole(ctx context.Context) (v string, err error)
- func (m *ChatMessageMutation) Op() Op
- func (m *ChatMessageMutation) RemovedEdges() []string
- func (m *ChatMessageMutation) RemovedIDs(name string) []ent.Value
- func (m *ChatMessageMutation) ResetContent()
- func (m *ChatMessageMutation) ResetConversationID()
- func (m *ChatMessageMutation) ResetEdge(name string) error
- func (m *ChatMessageMutation) ResetField(name string) error
- func (m *ChatMessageMutation) ResetRole()
- func (m *ChatMessageMutation) Role() (r string, exists bool)
- func (m *ChatMessageMutation) SetContent(s string)
- func (m *ChatMessageMutation) SetConversationID(s string)
- func (m *ChatMessageMutation) SetField(name string, value ent.Value) error
- func (m *ChatMessageMutation) SetID(id string)
- func (m *ChatMessageMutation) SetOp(op Op)
- func (m *ChatMessageMutation) SetRole(s string)
- func (m ChatMessageMutation) Tx() (*Tx, error)
- func (m *ChatMessageMutation) Type() string
- func (m *ChatMessageMutation) Where(ps ...predicate.ChatMessage)
- func (m *ChatMessageMutation) WhereP(ps ...func(*sql.Selector))
- type ChatMessageQuery
- func (cmq *ChatMessageQuery) Aggregate(fns ...AggregateFunc) *ChatMessageSelect
- func (cmq *ChatMessageQuery) All(ctx context.Context) ([]*ChatMessage, error)
- func (cmq *ChatMessageQuery) AllX(ctx context.Context) []*ChatMessage
- func (cmq *ChatMessageQuery) Clone() *ChatMessageQuery
- func (cmq *ChatMessageQuery) Count(ctx context.Context) (int, error)
- func (cmq *ChatMessageQuery) CountX(ctx context.Context) int
- func (cmq *ChatMessageQuery) Exist(ctx context.Context) (bool, error)
- func (cmq *ChatMessageQuery) ExistX(ctx context.Context) bool
- func (cmq *ChatMessageQuery) First(ctx context.Context) (*ChatMessage, error)
- func (cmq *ChatMessageQuery) FirstID(ctx context.Context) (id string, err error)
- func (cmq *ChatMessageQuery) FirstIDX(ctx context.Context) string
- func (cmq *ChatMessageQuery) FirstX(ctx context.Context) *ChatMessage
- func (cmq *ChatMessageQuery) GroupBy(field string, fields ...string) *ChatMessageGroupBy
- func (cmq *ChatMessageQuery) IDs(ctx context.Context) (ids []string, err error)
- func (cmq *ChatMessageQuery) IDsX(ctx context.Context) []string
- func (cmq *ChatMessageQuery) Limit(limit int) *ChatMessageQuery
- func (cmq *ChatMessageQuery) Offset(offset int) *ChatMessageQuery
- func (cmq *ChatMessageQuery) Only(ctx context.Context) (*ChatMessage, error)
- func (cmq *ChatMessageQuery) OnlyID(ctx context.Context) (id string, err error)
- func (cmq *ChatMessageQuery) OnlyIDX(ctx context.Context) string
- func (cmq *ChatMessageQuery) OnlyX(ctx context.Context) *ChatMessage
- func (cmq *ChatMessageQuery) Order(o ...chatmessage.OrderOption) *ChatMessageQuery
- func (cmq *ChatMessageQuery) Select(fields ...string) *ChatMessageSelect
- func (cmq *ChatMessageQuery) Unique(unique bool) *ChatMessageQuery
- func (cmq *ChatMessageQuery) Where(ps ...predicate.ChatMessage) *ChatMessageQuery
- type ChatMessageSelect
- func (cms *ChatMessageSelect) Aggregate(fns ...AggregateFunc) *ChatMessageSelect
- func (s *ChatMessageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatMessageSelect) BoolX(ctx context.Context) bool
- func (s *ChatMessageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatMessageSelect) BoolsX(ctx context.Context) []bool
- func (s *ChatMessageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatMessageSelect) Float64X(ctx context.Context) float64
- func (s *ChatMessageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatMessageSelect) Float64sX(ctx context.Context) []float64
- func (s *ChatMessageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ChatMessageSelect) IntX(ctx context.Context) int
- func (s *ChatMessageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ChatMessageSelect) IntsX(ctx context.Context) []int
- func (cms *ChatMessageSelect) Scan(ctx context.Context, v any) error
- func (s *ChatMessageSelect) ScanX(ctx context.Context, v any)
- func (s *ChatMessageSelect) String(ctx context.Context) (_ string, err error)
- func (s *ChatMessageSelect) StringX(ctx context.Context) string
- func (s *ChatMessageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ChatMessageSelect) StringsX(ctx context.Context) []string
- type ChatMessageUpdate
- func (cmu *ChatMessageUpdate) Exec(ctx context.Context) error
- func (cmu *ChatMessageUpdate) ExecX(ctx context.Context)
- func (cmu *ChatMessageUpdate) Mutation() *ChatMessageMutation
- func (cmu *ChatMessageUpdate) Save(ctx context.Context) (int, error)
- func (cmu *ChatMessageUpdate) SaveX(ctx context.Context) int
- func (cmu *ChatMessageUpdate) SetContent(s string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) SetConversationID(s string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) SetNillableContent(s *string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) SetNillableConversationID(s *string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) SetNillableRole(s *string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) SetRole(s string) *ChatMessageUpdate
- func (cmu *ChatMessageUpdate) Where(ps ...predicate.ChatMessage) *ChatMessageUpdate
- type ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) Exec(ctx context.Context) error
- func (cmuo *ChatMessageUpdateOne) ExecX(ctx context.Context)
- func (cmuo *ChatMessageUpdateOne) Mutation() *ChatMessageMutation
- func (cmuo *ChatMessageUpdateOne) Save(ctx context.Context) (*ChatMessage, error)
- func (cmuo *ChatMessageUpdateOne) SaveX(ctx context.Context) *ChatMessage
- func (cmuo *ChatMessageUpdateOne) Select(field string, fields ...string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetContent(s string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetConversationID(s string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetNillableContent(s *string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetNillableConversationID(s *string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetNillableRole(s *string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) SetRole(s string) *ChatMessageUpdateOne
- func (cmuo *ChatMessageUpdateOne) Where(ps ...predicate.ChatMessage) *ChatMessageUpdateOne
- type ChatMessages
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Conversation
- type ConversationClient
- func (c *ConversationClient) Create() *ConversationCreate
- func (c *ConversationClient) CreateBulk(builders ...*ConversationCreate) *ConversationCreateBulk
- func (c *ConversationClient) Delete() *ConversationDelete
- func (c *ConversationClient) DeleteOne(co *Conversation) *ConversationDeleteOne
- func (c *ConversationClient) DeleteOneID(id string) *ConversationDeleteOne
- func (c *ConversationClient) Get(ctx context.Context, id string) (*Conversation, error)
- func (c *ConversationClient) GetX(ctx context.Context, id string) *Conversation
- func (c *ConversationClient) Hooks() []Hook
- func (c *ConversationClient) Intercept(interceptors ...Interceptor)
- func (c *ConversationClient) Interceptors() []Interceptor
- func (c *ConversationClient) MapCreateBulk(slice any, setFunc func(*ConversationCreate, int)) *ConversationCreateBulk
- func (c *ConversationClient) Query() *ConversationQuery
- func (c *ConversationClient) Update() *ConversationUpdate
- func (c *ConversationClient) UpdateOne(co *Conversation) *ConversationUpdateOne
- func (c *ConversationClient) UpdateOneID(id string) *ConversationUpdateOne
- func (c *ConversationClient) Use(hooks ...Hook)
- type ConversationCreate
- func (cc *ConversationCreate) Exec(ctx context.Context) error
- func (cc *ConversationCreate) ExecX(ctx context.Context)
- func (cc *ConversationCreate) Mutation() *ConversationMutation
- func (cc *ConversationCreate) Save(ctx context.Context) (*Conversation, error)
- func (cc *ConversationCreate) SaveX(ctx context.Context) *Conversation
- func (cc *ConversationCreate) SetID(s string) *ConversationCreate
- func (cc *ConversationCreate) SetPageURL(s string) *ConversationCreate
- type ConversationCreateBulk
- type ConversationDelete
- type ConversationDeleteOne
- type ConversationGroupBy
- func (cgb *ConversationGroupBy) Aggregate(fns ...AggregateFunc) *ConversationGroupBy
- func (s *ConversationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ConversationGroupBy) BoolX(ctx context.Context) bool
- func (s *ConversationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ConversationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ConversationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ConversationGroupBy) Float64X(ctx context.Context) float64
- func (s *ConversationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ConversationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ConversationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ConversationGroupBy) IntX(ctx context.Context) int
- func (s *ConversationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ConversationGroupBy) IntsX(ctx context.Context) []int
- func (cgb *ConversationGroupBy) Scan(ctx context.Context, v any) error
- func (s *ConversationGroupBy) ScanX(ctx context.Context, v any)
- func (s *ConversationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ConversationGroupBy) StringX(ctx context.Context) string
- func (s *ConversationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ConversationGroupBy) StringsX(ctx context.Context) []string
- type ConversationMutation
- func (m *ConversationMutation) AddField(name string, value ent.Value) error
- func (m *ConversationMutation) AddedEdges() []string
- func (m *ConversationMutation) AddedField(name string) (ent.Value, bool)
- func (m *ConversationMutation) AddedFields() []string
- func (m *ConversationMutation) AddedIDs(name string) []ent.Value
- func (m *ConversationMutation) ClearEdge(name string) error
- func (m *ConversationMutation) ClearField(name string) error
- func (m *ConversationMutation) ClearedEdges() []string
- func (m *ConversationMutation) ClearedFields() []string
- func (m ConversationMutation) Client() *Client
- func (m *ConversationMutation) EdgeCleared(name string) bool
- func (m *ConversationMutation) Field(name string) (ent.Value, bool)
- func (m *ConversationMutation) FieldCleared(name string) bool
- func (m *ConversationMutation) Fields() []string
- func (m *ConversationMutation) ID() (id string, exists bool)
- func (m *ConversationMutation) IDs(ctx context.Context) ([]string, error)
- func (m *ConversationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ConversationMutation) OldPageURL(ctx context.Context) (v string, err error)
- func (m *ConversationMutation) Op() Op
- func (m *ConversationMutation) PageURL() (r string, exists bool)
- func (m *ConversationMutation) RemovedEdges() []string
- func (m *ConversationMutation) RemovedIDs(name string) []ent.Value
- func (m *ConversationMutation) ResetEdge(name string) error
- func (m *ConversationMutation) ResetField(name string) error
- func (m *ConversationMutation) ResetPageURL()
- func (m *ConversationMutation) SetField(name string, value ent.Value) error
- func (m *ConversationMutation) SetID(id string)
- func (m *ConversationMutation) SetOp(op Op)
- func (m *ConversationMutation) SetPageURL(s string)
- func (m ConversationMutation) Tx() (*Tx, error)
- func (m *ConversationMutation) Type() string
- func (m *ConversationMutation) Where(ps ...predicate.Conversation)
- func (m *ConversationMutation) WhereP(ps ...func(*sql.Selector))
- type ConversationQuery
- func (cq *ConversationQuery) Aggregate(fns ...AggregateFunc) *ConversationSelect
- func (cq *ConversationQuery) All(ctx context.Context) ([]*Conversation, error)
- func (cq *ConversationQuery) AllX(ctx context.Context) []*Conversation
- func (cq *ConversationQuery) Clone() *ConversationQuery
- func (cq *ConversationQuery) Count(ctx context.Context) (int, error)
- func (cq *ConversationQuery) CountX(ctx context.Context) int
- func (cq *ConversationQuery) Exist(ctx context.Context) (bool, error)
- func (cq *ConversationQuery) ExistX(ctx context.Context) bool
- func (cq *ConversationQuery) First(ctx context.Context) (*Conversation, error)
- func (cq *ConversationQuery) FirstID(ctx context.Context) (id string, err error)
- func (cq *ConversationQuery) FirstIDX(ctx context.Context) string
- func (cq *ConversationQuery) FirstX(ctx context.Context) *Conversation
- func (cq *ConversationQuery) GroupBy(field string, fields ...string) *ConversationGroupBy
- func (cq *ConversationQuery) IDs(ctx context.Context) (ids []string, err error)
- func (cq *ConversationQuery) IDsX(ctx context.Context) []string
- func (cq *ConversationQuery) Limit(limit int) *ConversationQuery
- func (cq *ConversationQuery) Offset(offset int) *ConversationQuery
- func (cq *ConversationQuery) Only(ctx context.Context) (*Conversation, error)
- func (cq *ConversationQuery) OnlyID(ctx context.Context) (id string, err error)
- func (cq *ConversationQuery) OnlyIDX(ctx context.Context) string
- func (cq *ConversationQuery) OnlyX(ctx context.Context) *Conversation
- func (cq *ConversationQuery) Order(o ...conversation.OrderOption) *ConversationQuery
- func (cq *ConversationQuery) Select(fields ...string) *ConversationSelect
- func (cq *ConversationQuery) Unique(unique bool) *ConversationQuery
- func (cq *ConversationQuery) Where(ps ...predicate.Conversation) *ConversationQuery
- type ConversationSelect
- func (cs *ConversationSelect) Aggregate(fns ...AggregateFunc) *ConversationSelect
- func (s *ConversationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ConversationSelect) BoolX(ctx context.Context) bool
- func (s *ConversationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ConversationSelect) BoolsX(ctx context.Context) []bool
- func (s *ConversationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ConversationSelect) Float64X(ctx context.Context) float64
- func (s *ConversationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ConversationSelect) Float64sX(ctx context.Context) []float64
- func (s *ConversationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ConversationSelect) IntX(ctx context.Context) int
- func (s *ConversationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ConversationSelect) IntsX(ctx context.Context) []int
- func (cs *ConversationSelect) Scan(ctx context.Context, v any) error
- func (s *ConversationSelect) ScanX(ctx context.Context, v any)
- func (s *ConversationSelect) String(ctx context.Context) (_ string, err error)
- func (s *ConversationSelect) StringX(ctx context.Context) string
- func (s *ConversationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ConversationSelect) StringsX(ctx context.Context) []string
- type ConversationUpdate
- func (cu *ConversationUpdate) Exec(ctx context.Context) error
- func (cu *ConversationUpdate) ExecX(ctx context.Context)
- func (cu *ConversationUpdate) Mutation() *ConversationMutation
- func (cu *ConversationUpdate) Save(ctx context.Context) (int, error)
- func (cu *ConversationUpdate) SaveX(ctx context.Context) int
- func (cu *ConversationUpdate) SetNillablePageURL(s *string) *ConversationUpdate
- func (cu *ConversationUpdate) SetPageURL(s string) *ConversationUpdate
- func (cu *ConversationUpdate) Where(ps ...predicate.Conversation) *ConversationUpdate
- type ConversationUpdateOne
- func (cuo *ConversationUpdateOne) Exec(ctx context.Context) error
- func (cuo *ConversationUpdateOne) ExecX(ctx context.Context)
- func (cuo *ConversationUpdateOne) Mutation() *ConversationMutation
- func (cuo *ConversationUpdateOne) Save(ctx context.Context) (*Conversation, error)
- func (cuo *ConversationUpdateOne) SaveX(ctx context.Context) *Conversation
- func (cuo *ConversationUpdateOne) Select(field string, fields ...string) *ConversationUpdateOne
- func (cuo *ConversationUpdateOne) SetNillablePageURL(s *string) *ConversationUpdateOne
- func (cuo *ConversationUpdateOne) SetPageURL(s string) *ConversationUpdateOne
- func (cuo *ConversationUpdateOne) Where(ps ...predicate.Conversation) *ConversationUpdateOne
- type Conversations
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeChatMessage = "ChatMessage" TypeConversation = "Conversation" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type ChatMessage ¶
type ChatMessage struct { // ID of the ent. ID string `json:"id,omitempty"` // ConversationID holds the value of the "conversation_id" field. ConversationID string `json:"conversation_id,omitempty"` // Role holds the value of the "role" field. Role string `json:"role,omitempty"` // Content holds the value of the "content" field. Content string `json:"content,omitempty"` // contains filtered or unexported fields }
ChatMessage is the model entity for the ChatMessage schema.
func (*ChatMessage) String ¶
func (cm *ChatMessage) String() string
String implements the fmt.Stringer.
func (*ChatMessage) Unwrap ¶
func (cm *ChatMessage) Unwrap() *ChatMessage
Unwrap unwraps the ChatMessage 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 (*ChatMessage) Update ¶
func (cm *ChatMessage) Update() *ChatMessageUpdateOne
Update returns a builder for updating this ChatMessage. Note that you need to call ChatMessage.Unwrap() before calling this method if this ChatMessage was returned from a transaction, and the transaction was committed or rolled back.
type ChatMessageClient ¶
type ChatMessageClient struct {
// contains filtered or unexported fields
}
ChatMessageClient is a client for the ChatMessage schema.
func NewChatMessageClient ¶
func NewChatMessageClient(c config) *ChatMessageClient
NewChatMessageClient returns a client for the ChatMessage from the given config.
func (*ChatMessageClient) Create ¶
func (c *ChatMessageClient) Create() *ChatMessageCreate
Create returns a builder for creating a ChatMessage entity.
func (*ChatMessageClient) CreateBulk ¶
func (c *ChatMessageClient) CreateBulk(builders ...*ChatMessageCreate) *ChatMessageCreateBulk
CreateBulk returns a builder for creating a bulk of ChatMessage entities.
func (*ChatMessageClient) Delete ¶
func (c *ChatMessageClient) Delete() *ChatMessageDelete
Delete returns a delete builder for ChatMessage.
func (*ChatMessageClient) DeleteOne ¶
func (c *ChatMessageClient) DeleteOne(cm *ChatMessage) *ChatMessageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ChatMessageClient) DeleteOneID ¶
func (c *ChatMessageClient) DeleteOneID(id string) *ChatMessageDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ChatMessageClient) Get ¶
func (c *ChatMessageClient) Get(ctx context.Context, id string) (*ChatMessage, error)
Get returns a ChatMessage entity by its id.
func (*ChatMessageClient) GetX ¶
func (c *ChatMessageClient) GetX(ctx context.Context, id string) *ChatMessage
GetX is like Get, but panics if an error occurs.
func (*ChatMessageClient) Hooks ¶
func (c *ChatMessageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ChatMessageClient) Intercept ¶
func (c *ChatMessageClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatmessage.Intercept(f(g(h())))`.
func (*ChatMessageClient) Interceptors ¶
func (c *ChatMessageClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ChatMessageClient) MapCreateBulk ¶
func (c *ChatMessageClient) MapCreateBulk(slice any, setFunc func(*ChatMessageCreate, int)) *ChatMessageCreateBulk
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 (*ChatMessageClient) Query ¶
func (c *ChatMessageClient) Query() *ChatMessageQuery
Query returns a query builder for ChatMessage.
func (*ChatMessageClient) Update ¶
func (c *ChatMessageClient) Update() *ChatMessageUpdate
Update returns an update builder for ChatMessage.
func (*ChatMessageClient) UpdateOne ¶
func (c *ChatMessageClient) UpdateOne(cm *ChatMessage) *ChatMessageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ChatMessageClient) UpdateOneID ¶
func (c *ChatMessageClient) UpdateOneID(id string) *ChatMessageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ChatMessageClient) Use ¶
func (c *ChatMessageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatmessage.Hooks(f(g(h())))`.
type ChatMessageCreate ¶
type ChatMessageCreate struct {
// contains filtered or unexported fields
}
ChatMessageCreate is the builder for creating a ChatMessage entity.
func (*ChatMessageCreate) Exec ¶
func (cmc *ChatMessageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatMessageCreate) ExecX ¶
func (cmc *ChatMessageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageCreate) Mutation ¶
func (cmc *ChatMessageCreate) Mutation() *ChatMessageMutation
Mutation returns the ChatMessageMutation object of the builder.
func (*ChatMessageCreate) Save ¶
func (cmc *ChatMessageCreate) Save(ctx context.Context) (*ChatMessage, error)
Save creates the ChatMessage in the database.
func (*ChatMessageCreate) SaveX ¶
func (cmc *ChatMessageCreate) SaveX(ctx context.Context) *ChatMessage
SaveX calls Save and panics if Save returns an error.
func (*ChatMessageCreate) SetContent ¶
func (cmc *ChatMessageCreate) SetContent(s string) *ChatMessageCreate
SetContent sets the "content" field.
func (*ChatMessageCreate) SetConversationID ¶
func (cmc *ChatMessageCreate) SetConversationID(s string) *ChatMessageCreate
SetConversationID sets the "conversation_id" field.
func (*ChatMessageCreate) SetID ¶
func (cmc *ChatMessageCreate) SetID(s string) *ChatMessageCreate
SetID sets the "id" field.
func (*ChatMessageCreate) SetRole ¶
func (cmc *ChatMessageCreate) SetRole(s string) *ChatMessageCreate
SetRole sets the "role" field.
type ChatMessageCreateBulk ¶
type ChatMessageCreateBulk struct {
// contains filtered or unexported fields
}
ChatMessageCreateBulk is the builder for creating many ChatMessage entities in bulk.
func (*ChatMessageCreateBulk) Exec ¶
func (cmcb *ChatMessageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatMessageCreateBulk) ExecX ¶
func (cmcb *ChatMessageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageCreateBulk) Save ¶
func (cmcb *ChatMessageCreateBulk) Save(ctx context.Context) ([]*ChatMessage, error)
Save creates the ChatMessage entities in the database.
func (*ChatMessageCreateBulk) SaveX ¶
func (cmcb *ChatMessageCreateBulk) SaveX(ctx context.Context) []*ChatMessage
SaveX is like Save, but panics if an error occurs.
type ChatMessageDelete ¶
type ChatMessageDelete struct {
// contains filtered or unexported fields
}
ChatMessageDelete is the builder for deleting a ChatMessage entity.
func (*ChatMessageDelete) Exec ¶
func (cmd *ChatMessageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ChatMessageDelete) ExecX ¶
func (cmd *ChatMessageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageDelete) Where ¶
func (cmd *ChatMessageDelete) Where(ps ...predicate.ChatMessage) *ChatMessageDelete
Where appends a list predicates to the ChatMessageDelete builder.
type ChatMessageDeleteOne ¶
type ChatMessageDeleteOne struct {
// contains filtered or unexported fields
}
ChatMessageDeleteOne is the builder for deleting a single ChatMessage entity.
func (*ChatMessageDeleteOne) Exec ¶
func (cmdo *ChatMessageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ChatMessageDeleteOne) ExecX ¶
func (cmdo *ChatMessageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageDeleteOne) Where ¶
func (cmdo *ChatMessageDeleteOne) Where(ps ...predicate.ChatMessage) *ChatMessageDeleteOne
Where appends a list predicates to the ChatMessageDelete builder.
type ChatMessageGroupBy ¶
type ChatMessageGroupBy struct {
// contains filtered or unexported fields
}
ChatMessageGroupBy is the group-by builder for ChatMessage entities.
func (*ChatMessageGroupBy) Aggregate ¶
func (cmgb *ChatMessageGroupBy) Aggregate(fns ...AggregateFunc) *ChatMessageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ChatMessageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatMessageGroupBy) Scan ¶
func (cmgb *ChatMessageGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatMessageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatMessageMutation ¶
type ChatMessageMutation struct {
// contains filtered or unexported fields
}
ChatMessageMutation represents an operation that mutates the ChatMessage nodes in the graph.
func (*ChatMessageMutation) AddField ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) AddedEdges ¶
func (m *ChatMessageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ChatMessageMutation) AddedField ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) AddedFields ¶
func (m *ChatMessageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ChatMessageMutation) AddedIDs ¶
func (m *ChatMessageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ChatMessageMutation) ClearEdge ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ClearField ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ClearedEdges ¶
func (m *ChatMessageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ChatMessageMutation) ClearedFields ¶
func (m *ChatMessageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ChatMessageMutation) Client ¶
func (m ChatMessageMutation) 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 (*ChatMessageMutation) Content ¶
func (m *ChatMessageMutation) Content() (r string, exists bool)
Content returns the value of the "content" field in the mutation.
func (*ChatMessageMutation) ConversationID ¶
func (m *ChatMessageMutation) ConversationID() (r string, exists bool)
ConversationID returns the value of the "conversation_id" field in the mutation.
func (*ChatMessageMutation) EdgeCleared ¶
func (m *ChatMessageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ChatMessageMutation) Field ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) FieldCleared ¶
func (m *ChatMessageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ChatMessageMutation) Fields ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ID ¶
func (m *ChatMessageMutation) ID() (id string, 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 (*ChatMessageMutation) IDs ¶
func (m *ChatMessageMutation) IDs(ctx context.Context) ([]string, 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 (*ChatMessageMutation) OldContent ¶
func (m *ChatMessageMutation) OldContent(ctx context.Context) (v string, err error)
OldContent returns the old "content" field's value of the ChatMessage entity. If the ChatMessage 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 (*ChatMessageMutation) OldConversationID ¶
func (m *ChatMessageMutation) OldConversationID(ctx context.Context) (v string, err error)
OldConversationID returns the old "conversation_id" field's value of the ChatMessage entity. If the ChatMessage 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 (*ChatMessageMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*ChatMessageMutation) OldRole ¶
func (m *ChatMessageMutation) OldRole(ctx context.Context) (v string, err error)
OldRole returns the old "role" field's value of the ChatMessage entity. If the ChatMessage 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 (*ChatMessageMutation) Op ¶
func (m *ChatMessageMutation) Op() Op
Op returns the operation name.
func (*ChatMessageMutation) RemovedEdges ¶
func (m *ChatMessageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ChatMessageMutation) RemovedIDs ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ResetContent ¶
func (m *ChatMessageMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*ChatMessageMutation) ResetConversationID ¶
func (m *ChatMessageMutation) ResetConversationID()
ResetConversationID resets all changes to the "conversation_id" field.
func (*ChatMessageMutation) ResetEdge ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ResetField ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) ResetRole ¶
func (m *ChatMessageMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*ChatMessageMutation) Role ¶
func (m *ChatMessageMutation) Role() (r string, exists bool)
Role returns the value of the "role" field in the mutation.
func (*ChatMessageMutation) SetContent ¶
func (m *ChatMessageMutation) SetContent(s string)
SetContent sets the "content" field.
func (*ChatMessageMutation) SetConversationID ¶
func (m *ChatMessageMutation) SetConversationID(s string)
SetConversationID sets the "conversation_id" field.
func (*ChatMessageMutation) SetField ¶
func (m *ChatMessageMutation) 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 (*ChatMessageMutation) SetID ¶
func (m *ChatMessageMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of ChatMessage entities.
func (*ChatMessageMutation) SetOp ¶
func (m *ChatMessageMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ChatMessageMutation) SetRole ¶
func (m *ChatMessageMutation) SetRole(s string)
SetRole sets the "role" field.
func (ChatMessageMutation) Tx ¶
func (m ChatMessageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ChatMessageMutation) Type ¶
func (m *ChatMessageMutation) Type() string
Type returns the node type of this mutation (ChatMessage).
func (*ChatMessageMutation) Where ¶
func (m *ChatMessageMutation) Where(ps ...predicate.ChatMessage)
Where appends a list predicates to the ChatMessageMutation builder.
func (*ChatMessageMutation) WhereP ¶
func (m *ChatMessageMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ChatMessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ChatMessageQuery ¶
type ChatMessageQuery struct {
// contains filtered or unexported fields
}
ChatMessageQuery is the builder for querying ChatMessage entities.
func (*ChatMessageQuery) Aggregate ¶
func (cmq *ChatMessageQuery) Aggregate(fns ...AggregateFunc) *ChatMessageSelect
Aggregate returns a ChatMessageSelect configured with the given aggregations.
func (*ChatMessageQuery) All ¶
func (cmq *ChatMessageQuery) All(ctx context.Context) ([]*ChatMessage, error)
All executes the query and returns a list of ChatMessages.
func (*ChatMessageQuery) AllX ¶
func (cmq *ChatMessageQuery) AllX(ctx context.Context) []*ChatMessage
AllX is like All, but panics if an error occurs.
func (*ChatMessageQuery) Clone ¶
func (cmq *ChatMessageQuery) Clone() *ChatMessageQuery
Clone returns a duplicate of the ChatMessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ChatMessageQuery) Count ¶
func (cmq *ChatMessageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ChatMessageQuery) CountX ¶
func (cmq *ChatMessageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ChatMessageQuery) Exist ¶
func (cmq *ChatMessageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ChatMessageQuery) ExistX ¶
func (cmq *ChatMessageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ChatMessageQuery) First ¶
func (cmq *ChatMessageQuery) First(ctx context.Context) (*ChatMessage, error)
First returns the first ChatMessage entity from the query. Returns a *NotFoundError when no ChatMessage was found.
func (*ChatMessageQuery) FirstID ¶
func (cmq *ChatMessageQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first ChatMessage ID from the query. Returns a *NotFoundError when no ChatMessage ID was found.
func (*ChatMessageQuery) FirstIDX ¶
func (cmq *ChatMessageQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*ChatMessageQuery) FirstX ¶
func (cmq *ChatMessageQuery) FirstX(ctx context.Context) *ChatMessage
FirstX is like First, but panics if an error occurs.
func (*ChatMessageQuery) GroupBy ¶
func (cmq *ChatMessageQuery) GroupBy(field string, fields ...string) *ChatMessageGroupBy
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 { ConversationID string `json:"conversation_id,omitempty"` Count int `json:"count,omitempty"` } client.ChatMessage.Query(). GroupBy(chatmessage.FieldConversationID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ChatMessageQuery) IDs ¶
func (cmq *ChatMessageQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of ChatMessage IDs.
func (*ChatMessageQuery) IDsX ¶
func (cmq *ChatMessageQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*ChatMessageQuery) Limit ¶
func (cmq *ChatMessageQuery) Limit(limit int) *ChatMessageQuery
Limit the number of records to be returned by this query.
func (*ChatMessageQuery) Offset ¶
func (cmq *ChatMessageQuery) Offset(offset int) *ChatMessageQuery
Offset to start from.
func (*ChatMessageQuery) Only ¶
func (cmq *ChatMessageQuery) Only(ctx context.Context) (*ChatMessage, error)
Only returns a single ChatMessage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatMessage entity is found. Returns a *NotFoundError when no ChatMessage entities are found.
func (*ChatMessageQuery) OnlyID ¶
func (cmq *ChatMessageQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only ChatMessage ID in the query. Returns a *NotSingularError when more than one ChatMessage ID is found. Returns a *NotFoundError when no entities are found.
func (*ChatMessageQuery) OnlyIDX ¶
func (cmq *ChatMessageQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ChatMessageQuery) OnlyX ¶
func (cmq *ChatMessageQuery) OnlyX(ctx context.Context) *ChatMessage
OnlyX is like Only, but panics if an error occurs.
func (*ChatMessageQuery) Order ¶
func (cmq *ChatMessageQuery) Order(o ...chatmessage.OrderOption) *ChatMessageQuery
Order specifies how the records should be ordered.
func (*ChatMessageQuery) Select ¶
func (cmq *ChatMessageQuery) Select(fields ...string) *ChatMessageSelect
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 { ConversationID string `json:"conversation_id,omitempty"` } client.ChatMessage.Query(). Select(chatmessage.FieldConversationID). Scan(ctx, &v)
func (*ChatMessageQuery) Unique ¶
func (cmq *ChatMessageQuery) Unique(unique bool) *ChatMessageQuery
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 (*ChatMessageQuery) Where ¶
func (cmq *ChatMessageQuery) Where(ps ...predicate.ChatMessage) *ChatMessageQuery
Where adds a new predicate for the ChatMessageQuery builder.
type ChatMessageSelect ¶
type ChatMessageSelect struct { *ChatMessageQuery // contains filtered or unexported fields }
ChatMessageSelect is the builder for selecting fields of ChatMessage entities.
func (*ChatMessageSelect) Aggregate ¶
func (cms *ChatMessageSelect) Aggregate(fns ...AggregateFunc) *ChatMessageSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ChatMessageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatMessageSelect) Scan ¶
func (cms *ChatMessageSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatMessageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatMessageUpdate ¶
type ChatMessageUpdate struct {
// contains filtered or unexported fields
}
ChatMessageUpdate is the builder for updating ChatMessage entities.
func (*ChatMessageUpdate) Exec ¶
func (cmu *ChatMessageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatMessageUpdate) ExecX ¶
func (cmu *ChatMessageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageUpdate) Mutation ¶
func (cmu *ChatMessageUpdate) Mutation() *ChatMessageMutation
Mutation returns the ChatMessageMutation object of the builder.
func (*ChatMessageUpdate) Save ¶
func (cmu *ChatMessageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ChatMessageUpdate) SaveX ¶
func (cmu *ChatMessageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ChatMessageUpdate) SetContent ¶
func (cmu *ChatMessageUpdate) SetContent(s string) *ChatMessageUpdate
SetContent sets the "content" field.
func (*ChatMessageUpdate) SetConversationID ¶
func (cmu *ChatMessageUpdate) SetConversationID(s string) *ChatMessageUpdate
SetConversationID sets the "conversation_id" field.
func (*ChatMessageUpdate) SetNillableContent ¶
func (cmu *ChatMessageUpdate) SetNillableContent(s *string) *ChatMessageUpdate
SetNillableContent sets the "content" field if the given value is not nil.
func (*ChatMessageUpdate) SetNillableConversationID ¶
func (cmu *ChatMessageUpdate) SetNillableConversationID(s *string) *ChatMessageUpdate
SetNillableConversationID sets the "conversation_id" field if the given value is not nil.
func (*ChatMessageUpdate) SetNillableRole ¶
func (cmu *ChatMessageUpdate) SetNillableRole(s *string) *ChatMessageUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*ChatMessageUpdate) SetRole ¶
func (cmu *ChatMessageUpdate) SetRole(s string) *ChatMessageUpdate
SetRole sets the "role" field.
func (*ChatMessageUpdate) Where ¶
func (cmu *ChatMessageUpdate) Where(ps ...predicate.ChatMessage) *ChatMessageUpdate
Where appends a list predicates to the ChatMessageUpdate builder.
type ChatMessageUpdateOne ¶
type ChatMessageUpdateOne struct {
// contains filtered or unexported fields
}
ChatMessageUpdateOne is the builder for updating a single ChatMessage entity.
func (*ChatMessageUpdateOne) Exec ¶
func (cmuo *ChatMessageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ChatMessageUpdateOne) ExecX ¶
func (cmuo *ChatMessageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatMessageUpdateOne) Mutation ¶
func (cmuo *ChatMessageUpdateOne) Mutation() *ChatMessageMutation
Mutation returns the ChatMessageMutation object of the builder.
func (*ChatMessageUpdateOne) Save ¶
func (cmuo *ChatMessageUpdateOne) Save(ctx context.Context) (*ChatMessage, error)
Save executes the query and returns the updated ChatMessage entity.
func (*ChatMessageUpdateOne) SaveX ¶
func (cmuo *ChatMessageUpdateOne) SaveX(ctx context.Context) *ChatMessage
SaveX is like Save, but panics if an error occurs.
func (*ChatMessageUpdateOne) Select ¶
func (cmuo *ChatMessageUpdateOne) Select(field string, fields ...string) *ChatMessageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ChatMessageUpdateOne) SetContent ¶
func (cmuo *ChatMessageUpdateOne) SetContent(s string) *ChatMessageUpdateOne
SetContent sets the "content" field.
func (*ChatMessageUpdateOne) SetConversationID ¶
func (cmuo *ChatMessageUpdateOne) SetConversationID(s string) *ChatMessageUpdateOne
SetConversationID sets the "conversation_id" field.
func (*ChatMessageUpdateOne) SetNillableContent ¶
func (cmuo *ChatMessageUpdateOne) SetNillableContent(s *string) *ChatMessageUpdateOne
SetNillableContent sets the "content" field if the given value is not nil.
func (*ChatMessageUpdateOne) SetNillableConversationID ¶
func (cmuo *ChatMessageUpdateOne) SetNillableConversationID(s *string) *ChatMessageUpdateOne
SetNillableConversationID sets the "conversation_id" field if the given value is not nil.
func (*ChatMessageUpdateOne) SetNillableRole ¶
func (cmuo *ChatMessageUpdateOne) SetNillableRole(s *string) *ChatMessageUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*ChatMessageUpdateOne) SetRole ¶
func (cmuo *ChatMessageUpdateOne) SetRole(s string) *ChatMessageUpdateOne
SetRole sets the "role" field.
func (*ChatMessageUpdateOne) Where ¶
func (cmuo *ChatMessageUpdateOne) Where(ps ...predicate.ChatMessage) *ChatMessageUpdateOne
Where appends a list predicates to the ChatMessageUpdate builder.
type ChatMessages ¶
type ChatMessages []*ChatMessage
ChatMessages is a parsable slice of ChatMessage.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // ChatMessage is the client for interacting with the ChatMessage builders. ChatMessage *ChatMessageClient // Conversation is the client for interacting with the Conversation builders. Conversation *ConversationClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). ChatMessage. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Conversation ¶
type Conversation struct { // ID of the ent. ID string `json:"id,omitempty"` // PageURL holds the value of the "page_url" field. PageURL string `json:"page_url,omitempty"` // contains filtered or unexported fields }
Conversation is the model entity for the Conversation schema.
func (*Conversation) String ¶
func (c *Conversation) String() string
String implements the fmt.Stringer.
func (*Conversation) Unwrap ¶
func (c *Conversation) Unwrap() *Conversation
Unwrap unwraps the Conversation 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 (*Conversation) Update ¶
func (c *Conversation) Update() *ConversationUpdateOne
Update returns a builder for updating this Conversation. Note that you need to call Conversation.Unwrap() before calling this method if this Conversation was returned from a transaction, and the transaction was committed or rolled back.
type ConversationClient ¶
type ConversationClient struct {
// contains filtered or unexported fields
}
ConversationClient is a client for the Conversation schema.
func NewConversationClient ¶
func NewConversationClient(c config) *ConversationClient
NewConversationClient returns a client for the Conversation from the given config.
func (*ConversationClient) Create ¶
func (c *ConversationClient) Create() *ConversationCreate
Create returns a builder for creating a Conversation entity.
func (*ConversationClient) CreateBulk ¶
func (c *ConversationClient) CreateBulk(builders ...*ConversationCreate) *ConversationCreateBulk
CreateBulk returns a builder for creating a bulk of Conversation entities.
func (*ConversationClient) Delete ¶
func (c *ConversationClient) Delete() *ConversationDelete
Delete returns a delete builder for Conversation.
func (*ConversationClient) DeleteOne ¶
func (c *ConversationClient) DeleteOne(co *Conversation) *ConversationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ConversationClient) DeleteOneID ¶
func (c *ConversationClient) DeleteOneID(id string) *ConversationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ConversationClient) Get ¶
func (c *ConversationClient) Get(ctx context.Context, id string) (*Conversation, error)
Get returns a Conversation entity by its id.
func (*ConversationClient) GetX ¶
func (c *ConversationClient) GetX(ctx context.Context, id string) *Conversation
GetX is like Get, but panics if an error occurs.
func (*ConversationClient) Hooks ¶
func (c *ConversationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ConversationClient) Intercept ¶
func (c *ConversationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `conversation.Intercept(f(g(h())))`.
func (*ConversationClient) Interceptors ¶
func (c *ConversationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ConversationClient) MapCreateBulk ¶
func (c *ConversationClient) MapCreateBulk(slice any, setFunc func(*ConversationCreate, int)) *ConversationCreateBulk
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 (*ConversationClient) Query ¶
func (c *ConversationClient) Query() *ConversationQuery
Query returns a query builder for Conversation.
func (*ConversationClient) Update ¶
func (c *ConversationClient) Update() *ConversationUpdate
Update returns an update builder for Conversation.
func (*ConversationClient) UpdateOne ¶
func (c *ConversationClient) UpdateOne(co *Conversation) *ConversationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ConversationClient) UpdateOneID ¶
func (c *ConversationClient) UpdateOneID(id string) *ConversationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ConversationClient) Use ¶
func (c *ConversationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `conversation.Hooks(f(g(h())))`.
type ConversationCreate ¶
type ConversationCreate struct {
// contains filtered or unexported fields
}
ConversationCreate is the builder for creating a Conversation entity.
func (*ConversationCreate) Exec ¶
func (cc *ConversationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ConversationCreate) ExecX ¶
func (cc *ConversationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConversationCreate) Mutation ¶
func (cc *ConversationCreate) Mutation() *ConversationMutation
Mutation returns the ConversationMutation object of the builder.
func (*ConversationCreate) Save ¶
func (cc *ConversationCreate) Save(ctx context.Context) (*Conversation, error)
Save creates the Conversation in the database.
func (*ConversationCreate) SaveX ¶
func (cc *ConversationCreate) SaveX(ctx context.Context) *Conversation
SaveX calls Save and panics if Save returns an error.
func (*ConversationCreate) SetID ¶
func (cc *ConversationCreate) SetID(s string) *ConversationCreate
SetID sets the "id" field.
func (*ConversationCreate) SetPageURL ¶
func (cc *ConversationCreate) SetPageURL(s string) *ConversationCreate
SetPageURL sets the "page_url" field.
type ConversationCreateBulk ¶
type ConversationCreateBulk struct {
// contains filtered or unexported fields
}
ConversationCreateBulk is the builder for creating many Conversation entities in bulk.
func (*ConversationCreateBulk) Exec ¶
func (ccb *ConversationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ConversationCreateBulk) ExecX ¶
func (ccb *ConversationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConversationCreateBulk) Save ¶
func (ccb *ConversationCreateBulk) Save(ctx context.Context) ([]*Conversation, error)
Save creates the Conversation entities in the database.
func (*ConversationCreateBulk) SaveX ¶
func (ccb *ConversationCreateBulk) SaveX(ctx context.Context) []*Conversation
SaveX is like Save, but panics if an error occurs.
type ConversationDelete ¶
type ConversationDelete struct {
// contains filtered or unexported fields
}
ConversationDelete is the builder for deleting a Conversation entity.
func (*ConversationDelete) Exec ¶
func (cd *ConversationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ConversationDelete) ExecX ¶
func (cd *ConversationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ConversationDelete) Where ¶
func (cd *ConversationDelete) Where(ps ...predicate.Conversation) *ConversationDelete
Where appends a list predicates to the ConversationDelete builder.
type ConversationDeleteOne ¶
type ConversationDeleteOne struct {
// contains filtered or unexported fields
}
ConversationDeleteOne is the builder for deleting a single Conversation entity.
func (*ConversationDeleteOne) Exec ¶
func (cdo *ConversationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ConversationDeleteOne) ExecX ¶
func (cdo *ConversationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConversationDeleteOne) Where ¶
func (cdo *ConversationDeleteOne) Where(ps ...predicate.Conversation) *ConversationDeleteOne
Where appends a list predicates to the ConversationDelete builder.
type ConversationGroupBy ¶
type ConversationGroupBy struct {
// contains filtered or unexported fields
}
ConversationGroupBy is the group-by builder for Conversation entities.
func (*ConversationGroupBy) Aggregate ¶
func (cgb *ConversationGroupBy) Aggregate(fns ...AggregateFunc) *ConversationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ConversationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ConversationGroupBy) Scan ¶
func (cgb *ConversationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ConversationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ConversationMutation ¶
type ConversationMutation struct {
// contains filtered or unexported fields
}
ConversationMutation represents an operation that mutates the Conversation nodes in the graph.
func (*ConversationMutation) AddField ¶
func (m *ConversationMutation) 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 (*ConversationMutation) AddedEdges ¶
func (m *ConversationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ConversationMutation) AddedField ¶
func (m *ConversationMutation) 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 (*ConversationMutation) AddedFields ¶
func (m *ConversationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ConversationMutation) AddedIDs ¶
func (m *ConversationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ConversationMutation) ClearEdge ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ClearField ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ClearedEdges ¶
func (m *ConversationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ConversationMutation) ClearedFields ¶
func (m *ConversationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ConversationMutation) Client ¶
func (m ConversationMutation) 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 (*ConversationMutation) EdgeCleared ¶
func (m *ConversationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ConversationMutation) Field ¶
func (m *ConversationMutation) 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 (*ConversationMutation) FieldCleared ¶
func (m *ConversationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ConversationMutation) Fields ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ID ¶
func (m *ConversationMutation) ID() (id string, 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 (*ConversationMutation) IDs ¶
func (m *ConversationMutation) IDs(ctx context.Context) ([]string, 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 (*ConversationMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*ConversationMutation) OldPageURL ¶
func (m *ConversationMutation) OldPageURL(ctx context.Context) (v string, err error)
OldPageURL returns the old "page_url" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) Op ¶
func (m *ConversationMutation) Op() Op
Op returns the operation name.
func (*ConversationMutation) PageURL ¶
func (m *ConversationMutation) PageURL() (r string, exists bool)
PageURL returns the value of the "page_url" field in the mutation.
func (*ConversationMutation) RemovedEdges ¶
func (m *ConversationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ConversationMutation) RemovedIDs ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ResetEdge ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ResetField ¶
func (m *ConversationMutation) 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 (*ConversationMutation) ResetPageURL ¶
func (m *ConversationMutation) ResetPageURL()
ResetPageURL resets all changes to the "page_url" field.
func (*ConversationMutation) SetField ¶
func (m *ConversationMutation) 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 (*ConversationMutation) SetID ¶
func (m *ConversationMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Conversation entities.
func (*ConversationMutation) SetOp ¶
func (m *ConversationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ConversationMutation) SetPageURL ¶
func (m *ConversationMutation) SetPageURL(s string)
SetPageURL sets the "page_url" field.
func (ConversationMutation) Tx ¶
func (m ConversationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ConversationMutation) Type ¶
func (m *ConversationMutation) Type() string
Type returns the node type of this mutation (Conversation).
func (*ConversationMutation) Where ¶
func (m *ConversationMutation) Where(ps ...predicate.Conversation)
Where appends a list predicates to the ConversationMutation builder.
func (*ConversationMutation) WhereP ¶
func (m *ConversationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ConversationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ConversationQuery ¶
type ConversationQuery struct {
// contains filtered or unexported fields
}
ConversationQuery is the builder for querying Conversation entities.
func (*ConversationQuery) Aggregate ¶
func (cq *ConversationQuery) Aggregate(fns ...AggregateFunc) *ConversationSelect
Aggregate returns a ConversationSelect configured with the given aggregations.
func (*ConversationQuery) All ¶
func (cq *ConversationQuery) All(ctx context.Context) ([]*Conversation, error)
All executes the query and returns a list of Conversations.
func (*ConversationQuery) AllX ¶
func (cq *ConversationQuery) AllX(ctx context.Context) []*Conversation
AllX is like All, but panics if an error occurs.
func (*ConversationQuery) Clone ¶
func (cq *ConversationQuery) Clone() *ConversationQuery
Clone returns a duplicate of the ConversationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ConversationQuery) Count ¶
func (cq *ConversationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ConversationQuery) CountX ¶
func (cq *ConversationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ConversationQuery) Exist ¶
func (cq *ConversationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ConversationQuery) ExistX ¶
func (cq *ConversationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ConversationQuery) First ¶
func (cq *ConversationQuery) First(ctx context.Context) (*Conversation, error)
First returns the first Conversation entity from the query. Returns a *NotFoundError when no Conversation was found.
func (*ConversationQuery) FirstID ¶
func (cq *ConversationQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Conversation ID from the query. Returns a *NotFoundError when no Conversation ID was found.
func (*ConversationQuery) FirstIDX ¶
func (cq *ConversationQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*ConversationQuery) FirstX ¶
func (cq *ConversationQuery) FirstX(ctx context.Context) *Conversation
FirstX is like First, but panics if an error occurs.
func (*ConversationQuery) GroupBy ¶
func (cq *ConversationQuery) GroupBy(field string, fields ...string) *ConversationGroupBy
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 { PageURL string `json:"page_url,omitempty"` Count int `json:"count,omitempty"` } client.Conversation.Query(). GroupBy(conversation.FieldPageURL). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ConversationQuery) IDs ¶
func (cq *ConversationQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Conversation IDs.
func (*ConversationQuery) IDsX ¶
func (cq *ConversationQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*ConversationQuery) Limit ¶
func (cq *ConversationQuery) Limit(limit int) *ConversationQuery
Limit the number of records to be returned by this query.
func (*ConversationQuery) Offset ¶
func (cq *ConversationQuery) Offset(offset int) *ConversationQuery
Offset to start from.
func (*ConversationQuery) Only ¶
func (cq *ConversationQuery) Only(ctx context.Context) (*Conversation, error)
Only returns a single Conversation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Conversation entity is found. Returns a *NotFoundError when no Conversation entities are found.
func (*ConversationQuery) OnlyID ¶
func (cq *ConversationQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Conversation ID in the query. Returns a *NotSingularError when more than one Conversation ID is found. Returns a *NotFoundError when no entities are found.
func (*ConversationQuery) OnlyIDX ¶
func (cq *ConversationQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ConversationQuery) OnlyX ¶
func (cq *ConversationQuery) OnlyX(ctx context.Context) *Conversation
OnlyX is like Only, but panics if an error occurs.
func (*ConversationQuery) Order ¶
func (cq *ConversationQuery) Order(o ...conversation.OrderOption) *ConversationQuery
Order specifies how the records should be ordered.
func (*ConversationQuery) Select ¶
func (cq *ConversationQuery) Select(fields ...string) *ConversationSelect
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 { PageURL string `json:"page_url,omitempty"` } client.Conversation.Query(). Select(conversation.FieldPageURL). Scan(ctx, &v)
func (*ConversationQuery) Unique ¶
func (cq *ConversationQuery) Unique(unique bool) *ConversationQuery
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 (*ConversationQuery) Where ¶
func (cq *ConversationQuery) Where(ps ...predicate.Conversation) *ConversationQuery
Where adds a new predicate for the ConversationQuery builder.
type ConversationSelect ¶
type ConversationSelect struct { *ConversationQuery // contains filtered or unexported fields }
ConversationSelect is the builder for selecting fields of Conversation entities.
func (*ConversationSelect) Aggregate ¶
func (cs *ConversationSelect) Aggregate(fns ...AggregateFunc) *ConversationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ConversationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ConversationSelect) Scan ¶
func (cs *ConversationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ConversationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ConversationUpdate ¶
type ConversationUpdate struct {
// contains filtered or unexported fields
}
ConversationUpdate is the builder for updating Conversation entities.
func (*ConversationUpdate) Exec ¶
func (cu *ConversationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ConversationUpdate) ExecX ¶
func (cu *ConversationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConversationUpdate) Mutation ¶
func (cu *ConversationUpdate) Mutation() *ConversationMutation
Mutation returns the ConversationMutation object of the builder.
func (*ConversationUpdate) Save ¶
func (cu *ConversationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ConversationUpdate) SaveX ¶
func (cu *ConversationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ConversationUpdate) SetNillablePageURL ¶
func (cu *ConversationUpdate) SetNillablePageURL(s *string) *ConversationUpdate
SetNillablePageURL sets the "page_url" field if the given value is not nil.
func (*ConversationUpdate) SetPageURL ¶
func (cu *ConversationUpdate) SetPageURL(s string) *ConversationUpdate
SetPageURL sets the "page_url" field.
func (*ConversationUpdate) Where ¶
func (cu *ConversationUpdate) Where(ps ...predicate.Conversation) *ConversationUpdate
Where appends a list predicates to the ConversationUpdate builder.
type ConversationUpdateOne ¶
type ConversationUpdateOne struct {
// contains filtered or unexported fields
}
ConversationUpdateOne is the builder for updating a single Conversation entity.
func (*ConversationUpdateOne) Exec ¶
func (cuo *ConversationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ConversationUpdateOne) ExecX ¶
func (cuo *ConversationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConversationUpdateOne) Mutation ¶
func (cuo *ConversationUpdateOne) Mutation() *ConversationMutation
Mutation returns the ConversationMutation object of the builder.
func (*ConversationUpdateOne) Save ¶
func (cuo *ConversationUpdateOne) Save(ctx context.Context) (*Conversation, error)
Save executes the query and returns the updated Conversation entity.
func (*ConversationUpdateOne) SaveX ¶
func (cuo *ConversationUpdateOne) SaveX(ctx context.Context) *Conversation
SaveX is like Save, but panics if an error occurs.
func (*ConversationUpdateOne) Select ¶
func (cuo *ConversationUpdateOne) Select(field string, fields ...string) *ConversationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ConversationUpdateOne) SetNillablePageURL ¶
func (cuo *ConversationUpdateOne) SetNillablePageURL(s *string) *ConversationUpdateOne
SetNillablePageURL sets the "page_url" field if the given value is not nil.
func (*ConversationUpdateOne) SetPageURL ¶
func (cuo *ConversationUpdateOne) SetPageURL(s string) *ConversationUpdateOne
SetPageURL sets the "page_url" field.
func (*ConversationUpdateOne) Where ¶
func (cuo *ConversationUpdateOne) Where(ps ...predicate.Conversation) *ConversationUpdateOne
Where appends a list predicates to the ConversationUpdate builder.
type Conversations ¶
type Conversations []*Conversation
Conversations is a parsable slice of Conversation.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // ChatMessage is the client for interacting with the ChatMessage builders. ChatMessage *ChatMessageClient // Conversation is the client for interacting with the Conversation builders. Conversation *ConversationClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type 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.