Documentation ¶
Index ¶
- Constants
- 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 ChatConfig
- type ChatConfigClient
- func (c *ChatConfigClient) Create() *ChatConfigCreate
- func (c *ChatConfigClient) CreateBulk(builders ...*ChatConfigCreate) *ChatConfigCreateBulk
- func (c *ChatConfigClient) Delete() *ChatConfigDelete
- func (c *ChatConfigClient) DeleteOne(cc *ChatConfig) *ChatConfigDeleteOne
- func (c *ChatConfigClient) DeleteOneID(id int) *ChatConfigDeleteOne
- func (c *ChatConfigClient) Get(ctx context.Context, id int) (*ChatConfig, error)
- func (c *ChatConfigClient) GetX(ctx context.Context, id int) *ChatConfig
- func (c *ChatConfigClient) Hooks() []Hook
- func (c *ChatConfigClient) Intercept(interceptors ...Interceptor)
- func (c *ChatConfigClient) Interceptors() []Interceptor
- func (c *ChatConfigClient) Query() *ChatConfigQuery
- func (c *ChatConfigClient) Update() *ChatConfigUpdate
- func (c *ChatConfigClient) UpdateOne(cc *ChatConfig) *ChatConfigUpdateOne
- func (c *ChatConfigClient) UpdateOneID(id int) *ChatConfigUpdateOne
- func (c *ChatConfigClient) Use(hooks ...Hook)
- type ChatConfigCreate
- func (ccc *ChatConfigCreate) Exec(ctx context.Context) error
- func (ccc *ChatConfigCreate) ExecX(ctx context.Context)
- func (ccc *ChatConfigCreate) Mutation() *ChatConfigMutation
- func (ccc *ChatConfigCreate) Save(ctx context.Context) (*ChatConfig, error)
- func (ccc *ChatConfigCreate) SaveX(ctx context.Context) *ChatConfig
- func (ccc *ChatConfigCreate) SetChatID(i int64) *ChatConfigCreate
- func (ccc *ChatConfigCreate) SetJSON(s string) *ChatConfigCreate
- type ChatConfigCreateBulk
- type ChatConfigDelete
- type ChatConfigDeleteOne
- type ChatConfigGroupBy
- func (ccgb *ChatConfigGroupBy) Aggregate(fns ...AggregateFunc) *ChatConfigGroupBy
- func (s *ChatConfigGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatConfigGroupBy) BoolX(ctx context.Context) bool
- func (s *ChatConfigGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatConfigGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ChatConfigGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatConfigGroupBy) Float64X(ctx context.Context) float64
- func (s *ChatConfigGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatConfigGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ChatConfigGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ChatConfigGroupBy) IntX(ctx context.Context) int
- func (s *ChatConfigGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ChatConfigGroupBy) IntsX(ctx context.Context) []int
- func (ccgb *ChatConfigGroupBy) Scan(ctx context.Context, v any) error
- func (s *ChatConfigGroupBy) ScanX(ctx context.Context, v any)
- func (s *ChatConfigGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ChatConfigGroupBy) StringX(ctx context.Context) string
- func (s *ChatConfigGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ChatConfigGroupBy) StringsX(ctx context.Context) []string
- type ChatConfigMutation
- func (m *ChatConfigMutation) AddChatID(i int64)
- func (m *ChatConfigMutation) AddField(name string, value ent.Value) error
- func (m *ChatConfigMutation) AddedChatID() (r int64, exists bool)
- func (m *ChatConfigMutation) AddedEdges() []string
- func (m *ChatConfigMutation) AddedField(name string) (ent.Value, bool)
- func (m *ChatConfigMutation) AddedFields() []string
- func (m *ChatConfigMutation) AddedIDs(name string) []ent.Value
- func (m *ChatConfigMutation) ChatID() (r int64, exists bool)
- func (m *ChatConfigMutation) ClearEdge(name string) error
- func (m *ChatConfigMutation) ClearField(name string) error
- func (m *ChatConfigMutation) ClearedEdges() []string
- func (m *ChatConfigMutation) ClearedFields() []string
- func (m ChatConfigMutation) Client() *Client
- func (m *ChatConfigMutation) EdgeCleared(name string) bool
- func (m *ChatConfigMutation) Field(name string) (ent.Value, bool)
- func (m *ChatConfigMutation) FieldCleared(name string) bool
- func (m *ChatConfigMutation) Fields() []string
- func (m *ChatConfigMutation) ID() (id int, exists bool)
- func (m *ChatConfigMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ChatConfigMutation) JSON() (r string, exists bool)
- func (m *ChatConfigMutation) OldChatID(ctx context.Context) (v int64, err error)
- func (m *ChatConfigMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ChatConfigMutation) OldJSON(ctx context.Context) (v string, err error)
- func (m *ChatConfigMutation) Op() Op
- func (m *ChatConfigMutation) RemovedEdges() []string
- func (m *ChatConfigMutation) RemovedIDs(name string) []ent.Value
- func (m *ChatConfigMutation) ResetChatID()
- func (m *ChatConfigMutation) ResetEdge(name string) error
- func (m *ChatConfigMutation) ResetField(name string) error
- func (m *ChatConfigMutation) ResetJSON()
- func (m *ChatConfigMutation) SetChatID(i int64)
- func (m *ChatConfigMutation) SetField(name string, value ent.Value) error
- func (m *ChatConfigMutation) SetJSON(s string)
- func (m *ChatConfigMutation) SetOp(op Op)
- func (m ChatConfigMutation) Tx() (*Tx, error)
- func (m *ChatConfigMutation) Type() string
- func (m *ChatConfigMutation) Where(ps ...predicate.ChatConfig)
- func (m *ChatConfigMutation) WhereP(ps ...func(*sql.Selector))
- type ChatConfigQuery
- func (ccq *ChatConfigQuery) Aggregate(fns ...AggregateFunc) *ChatConfigSelect
- func (ccq *ChatConfigQuery) All(ctx context.Context) ([]*ChatConfig, error)
- func (ccq *ChatConfigQuery) AllX(ctx context.Context) []*ChatConfig
- func (ccq *ChatConfigQuery) Clone() *ChatConfigQuery
- func (ccq *ChatConfigQuery) Count(ctx context.Context) (int, error)
- func (ccq *ChatConfigQuery) CountX(ctx context.Context) int
- func (ccq *ChatConfigQuery) Exist(ctx context.Context) (bool, error)
- func (ccq *ChatConfigQuery) ExistX(ctx context.Context) bool
- func (ccq *ChatConfigQuery) First(ctx context.Context) (*ChatConfig, error)
- func (ccq *ChatConfigQuery) FirstID(ctx context.Context) (id int, err error)
- func (ccq *ChatConfigQuery) FirstIDX(ctx context.Context) int
- func (ccq *ChatConfigQuery) FirstX(ctx context.Context) *ChatConfig
- func (ccq *ChatConfigQuery) GroupBy(field string, fields ...string) *ChatConfigGroupBy
- func (ccq *ChatConfigQuery) IDs(ctx context.Context) (ids []int, err error)
- func (ccq *ChatConfigQuery) IDsX(ctx context.Context) []int
- func (ccq *ChatConfigQuery) Limit(limit int) *ChatConfigQuery
- func (ccq *ChatConfigQuery) Offset(offset int) *ChatConfigQuery
- func (ccq *ChatConfigQuery) Only(ctx context.Context) (*ChatConfig, error)
- func (ccq *ChatConfigQuery) OnlyID(ctx context.Context) (id int, err error)
- func (ccq *ChatConfigQuery) OnlyIDX(ctx context.Context) int
- func (ccq *ChatConfigQuery) OnlyX(ctx context.Context) *ChatConfig
- func (ccq *ChatConfigQuery) Order(o ...chatconfig.OrderOption) *ChatConfigQuery
- func (ccq *ChatConfigQuery) Select(fields ...string) *ChatConfigSelect
- func (ccq *ChatConfigQuery) Unique(unique bool) *ChatConfigQuery
- func (ccq *ChatConfigQuery) Where(ps ...predicate.ChatConfig) *ChatConfigQuery
- type ChatConfigSelect
- func (ccs *ChatConfigSelect) Aggregate(fns ...AggregateFunc) *ChatConfigSelect
- func (s *ChatConfigSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatConfigSelect) BoolX(ctx context.Context) bool
- func (s *ChatConfigSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatConfigSelect) BoolsX(ctx context.Context) []bool
- func (s *ChatConfigSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatConfigSelect) Float64X(ctx context.Context) float64
- func (s *ChatConfigSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatConfigSelect) Float64sX(ctx context.Context) []float64
- func (s *ChatConfigSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ChatConfigSelect) IntX(ctx context.Context) int
- func (s *ChatConfigSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ChatConfigSelect) IntsX(ctx context.Context) []int
- func (ccs *ChatConfigSelect) Scan(ctx context.Context, v any) error
- func (s *ChatConfigSelect) ScanX(ctx context.Context, v any)
- func (s *ChatConfigSelect) String(ctx context.Context) (_ string, err error)
- func (s *ChatConfigSelect) StringX(ctx context.Context) string
- func (s *ChatConfigSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ChatConfigSelect) StringsX(ctx context.Context) []string
- type ChatConfigUpdate
- func (ccu *ChatConfigUpdate) AddChatID(i int64) *ChatConfigUpdate
- func (ccu *ChatConfigUpdate) Exec(ctx context.Context) error
- func (ccu *ChatConfigUpdate) ExecX(ctx context.Context)
- func (ccu *ChatConfigUpdate) Mutation() *ChatConfigMutation
- func (ccu *ChatConfigUpdate) Save(ctx context.Context) (int, error)
- func (ccu *ChatConfigUpdate) SaveX(ctx context.Context) int
- func (ccu *ChatConfigUpdate) SetChatID(i int64) *ChatConfigUpdate
- func (ccu *ChatConfigUpdate) SetJSON(s string) *ChatConfigUpdate
- func (ccu *ChatConfigUpdate) Where(ps ...predicate.ChatConfig) *ChatConfigUpdate
- type ChatConfigUpdateOne
- func (ccuo *ChatConfigUpdateOne) AddChatID(i int64) *ChatConfigUpdateOne
- func (ccuo *ChatConfigUpdateOne) Exec(ctx context.Context) error
- func (ccuo *ChatConfigUpdateOne) ExecX(ctx context.Context)
- func (ccuo *ChatConfigUpdateOne) Mutation() *ChatConfigMutation
- func (ccuo *ChatConfigUpdateOne) Save(ctx context.Context) (*ChatConfig, error)
- func (ccuo *ChatConfigUpdateOne) SaveX(ctx context.Context) *ChatConfig
- func (ccuo *ChatConfigUpdateOne) Select(field string, fields ...string) *ChatConfigUpdateOne
- func (ccuo *ChatConfigUpdateOne) SetChatID(i int64) *ChatConfigUpdateOne
- func (ccuo *ChatConfigUpdateOne) SetJSON(s string) *ChatConfigUpdateOne
- func (ccuo *ChatConfigUpdateOne) Where(ps ...predicate.ChatConfig) *ChatConfigUpdateOne
- type ChatConfigs
- type ChatHistories
- type ChatHistory
- type ChatHistoryClient
- func (c *ChatHistoryClient) Create() *ChatHistoryCreate
- func (c *ChatHistoryClient) CreateBulk(builders ...*ChatHistoryCreate) *ChatHistoryCreateBulk
- func (c *ChatHistoryClient) Delete() *ChatHistoryDelete
- func (c *ChatHistoryClient) DeleteOne(ch *ChatHistory) *ChatHistoryDeleteOne
- func (c *ChatHistoryClient) DeleteOneID(id int) *ChatHistoryDeleteOne
- func (c *ChatHistoryClient) Get(ctx context.Context, id int) (*ChatHistory, error)
- func (c *ChatHistoryClient) GetX(ctx context.Context, id int) *ChatHistory
- func (c *ChatHistoryClient) Hooks() []Hook
- func (c *ChatHistoryClient) Intercept(interceptors ...Interceptor)
- func (c *ChatHistoryClient) Interceptors() []Interceptor
- func (c *ChatHistoryClient) Query() *ChatHistoryQuery
- func (c *ChatHistoryClient) Update() *ChatHistoryUpdate
- func (c *ChatHistoryClient) UpdateOne(ch *ChatHistory) *ChatHistoryUpdateOne
- func (c *ChatHistoryClient) UpdateOneID(id int) *ChatHistoryUpdateOne
- func (c *ChatHistoryClient) Use(hooks ...Hook)
- type ChatHistoryCreate
- func (chc *ChatHistoryCreate) Exec(ctx context.Context) error
- func (chc *ChatHistoryCreate) ExecX(ctx context.Context)
- func (chc *ChatHistoryCreate) Mutation() *ChatHistoryMutation
- func (chc *ChatHistoryCreate) Save(ctx context.Context) (*ChatHistory, error)
- func (chc *ChatHistoryCreate) SaveX(ctx context.Context) *ChatHistory
- func (chc *ChatHistoryCreate) SetChatID(i int64) *ChatHistoryCreate
- func (chc *ChatHistoryCreate) SetContent(s string) *ChatHistoryCreate
- type ChatHistoryCreateBulk
- type ChatHistoryDelete
- type ChatHistoryDeleteOne
- type ChatHistoryGroupBy
- func (chgb *ChatHistoryGroupBy) Aggregate(fns ...AggregateFunc) *ChatHistoryGroupBy
- func (s *ChatHistoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatHistoryGroupBy) BoolX(ctx context.Context) bool
- func (s *ChatHistoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatHistoryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ChatHistoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatHistoryGroupBy) Float64X(ctx context.Context) float64
- func (s *ChatHistoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatHistoryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ChatHistoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ChatHistoryGroupBy) IntX(ctx context.Context) int
- func (s *ChatHistoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ChatHistoryGroupBy) IntsX(ctx context.Context) []int
- func (chgb *ChatHistoryGroupBy) Scan(ctx context.Context, v any) error
- func (s *ChatHistoryGroupBy) ScanX(ctx context.Context, v any)
- func (s *ChatHistoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ChatHistoryGroupBy) StringX(ctx context.Context) string
- func (s *ChatHistoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ChatHistoryGroupBy) StringsX(ctx context.Context) []string
- type ChatHistoryMutation
- func (m *ChatHistoryMutation) AddChatID(i int64)
- func (m *ChatHistoryMutation) AddField(name string, value ent.Value) error
- func (m *ChatHistoryMutation) AddedChatID() (r int64, exists bool)
- func (m *ChatHistoryMutation) AddedEdges() []string
- func (m *ChatHistoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *ChatHistoryMutation) AddedFields() []string
- func (m *ChatHistoryMutation) AddedIDs(name string) []ent.Value
- func (m *ChatHistoryMutation) ChatID() (r int64, exists bool)
- func (m *ChatHistoryMutation) ClearEdge(name string) error
- func (m *ChatHistoryMutation) ClearField(name string) error
- func (m *ChatHistoryMutation) ClearedEdges() []string
- func (m *ChatHistoryMutation) ClearedFields() []string
- func (m ChatHistoryMutation) Client() *Client
- func (m *ChatHistoryMutation) Content() (r string, exists bool)
- func (m *ChatHistoryMutation) EdgeCleared(name string) bool
- func (m *ChatHistoryMutation) Field(name string) (ent.Value, bool)
- func (m *ChatHistoryMutation) FieldCleared(name string) bool
- func (m *ChatHistoryMutation) Fields() []string
- func (m *ChatHistoryMutation) ID() (id int, exists bool)
- func (m *ChatHistoryMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ChatHistoryMutation) OldChatID(ctx context.Context) (v int64, err error)
- func (m *ChatHistoryMutation) OldContent(ctx context.Context) (v string, err error)
- func (m *ChatHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ChatHistoryMutation) Op() Op
- func (m *ChatHistoryMutation) RemovedEdges() []string
- func (m *ChatHistoryMutation) RemovedIDs(name string) []ent.Value
- func (m *ChatHistoryMutation) ResetChatID()
- func (m *ChatHistoryMutation) ResetContent()
- func (m *ChatHistoryMutation) ResetEdge(name string) error
- func (m *ChatHistoryMutation) ResetField(name string) error
- func (m *ChatHistoryMutation) SetChatID(i int64)
- func (m *ChatHistoryMutation) SetContent(s string)
- func (m *ChatHistoryMutation) SetField(name string, value ent.Value) error
- func (m *ChatHistoryMutation) SetOp(op Op)
- func (m ChatHistoryMutation) Tx() (*Tx, error)
- func (m *ChatHistoryMutation) Type() string
- func (m *ChatHistoryMutation) Where(ps ...predicate.ChatHistory)
- func (m *ChatHistoryMutation) WhereP(ps ...func(*sql.Selector))
- type ChatHistoryQuery
- func (chq *ChatHistoryQuery) Aggregate(fns ...AggregateFunc) *ChatHistorySelect
- func (chq *ChatHistoryQuery) All(ctx context.Context) ([]*ChatHistory, error)
- func (chq *ChatHistoryQuery) AllX(ctx context.Context) []*ChatHistory
- func (chq *ChatHistoryQuery) Clone() *ChatHistoryQuery
- func (chq *ChatHistoryQuery) Count(ctx context.Context) (int, error)
- func (chq *ChatHistoryQuery) CountX(ctx context.Context) int
- func (chq *ChatHistoryQuery) Exist(ctx context.Context) (bool, error)
- func (chq *ChatHistoryQuery) ExistX(ctx context.Context) bool
- func (chq *ChatHistoryQuery) First(ctx context.Context) (*ChatHistory, error)
- func (chq *ChatHistoryQuery) FirstID(ctx context.Context) (id int, err error)
- func (chq *ChatHistoryQuery) FirstIDX(ctx context.Context) int
- func (chq *ChatHistoryQuery) FirstX(ctx context.Context) *ChatHistory
- func (chq *ChatHistoryQuery) GroupBy(field string, fields ...string) *ChatHistoryGroupBy
- func (chq *ChatHistoryQuery) IDs(ctx context.Context) (ids []int, err error)
- func (chq *ChatHistoryQuery) IDsX(ctx context.Context) []int
- func (chq *ChatHistoryQuery) Limit(limit int) *ChatHistoryQuery
- func (chq *ChatHistoryQuery) Offset(offset int) *ChatHistoryQuery
- func (chq *ChatHistoryQuery) Only(ctx context.Context) (*ChatHistory, error)
- func (chq *ChatHistoryQuery) OnlyID(ctx context.Context) (id int, err error)
- func (chq *ChatHistoryQuery) OnlyIDX(ctx context.Context) int
- func (chq *ChatHistoryQuery) OnlyX(ctx context.Context) *ChatHistory
- func (chq *ChatHistoryQuery) Order(o ...chathistory.OrderOption) *ChatHistoryQuery
- func (chq *ChatHistoryQuery) Select(fields ...string) *ChatHistorySelect
- func (chq *ChatHistoryQuery) Unique(unique bool) *ChatHistoryQuery
- func (chq *ChatHistoryQuery) Where(ps ...predicate.ChatHistory) *ChatHistoryQuery
- type ChatHistorySelect
- func (chs *ChatHistorySelect) Aggregate(fns ...AggregateFunc) *ChatHistorySelect
- func (s *ChatHistorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChatHistorySelect) BoolX(ctx context.Context) bool
- func (s *ChatHistorySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ChatHistorySelect) BoolsX(ctx context.Context) []bool
- func (s *ChatHistorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChatHistorySelect) Float64X(ctx context.Context) float64
- func (s *ChatHistorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChatHistorySelect) Float64sX(ctx context.Context) []float64
- func (s *ChatHistorySelect) Int(ctx context.Context) (_ int, err error)
- func (s *ChatHistorySelect) IntX(ctx context.Context) int
- func (s *ChatHistorySelect) Ints(ctx context.Context) ([]int, error)
- func (s *ChatHistorySelect) IntsX(ctx context.Context) []int
- func (chs *ChatHistorySelect) Scan(ctx context.Context, v any) error
- func (s *ChatHistorySelect) ScanX(ctx context.Context, v any)
- func (s *ChatHistorySelect) String(ctx context.Context) (_ string, err error)
- func (s *ChatHistorySelect) StringX(ctx context.Context) string
- func (s *ChatHistorySelect) Strings(ctx context.Context) ([]string, error)
- func (s *ChatHistorySelect) StringsX(ctx context.Context) []string
- type ChatHistoryUpdate
- func (chu *ChatHistoryUpdate) AddChatID(i int64) *ChatHistoryUpdate
- func (chu *ChatHistoryUpdate) Exec(ctx context.Context) error
- func (chu *ChatHistoryUpdate) ExecX(ctx context.Context)
- func (chu *ChatHistoryUpdate) Mutation() *ChatHistoryMutation
- func (chu *ChatHistoryUpdate) Save(ctx context.Context) (int, error)
- func (chu *ChatHistoryUpdate) SaveX(ctx context.Context) int
- func (chu *ChatHistoryUpdate) SetChatID(i int64) *ChatHistoryUpdate
- func (chu *ChatHistoryUpdate) SetContent(s string) *ChatHistoryUpdate
- func (chu *ChatHistoryUpdate) Where(ps ...predicate.ChatHistory) *ChatHistoryUpdate
- type ChatHistoryUpdateOne
- func (chuo *ChatHistoryUpdateOne) AddChatID(i int64) *ChatHistoryUpdateOne
- func (chuo *ChatHistoryUpdateOne) Exec(ctx context.Context) error
- func (chuo *ChatHistoryUpdateOne) ExecX(ctx context.Context)
- func (chuo *ChatHistoryUpdateOne) Mutation() *ChatHistoryMutation
- func (chuo *ChatHistoryUpdateOne) Save(ctx context.Context) (*ChatHistory, error)
- func (chuo *ChatHistoryUpdateOne) SaveX(ctx context.Context) *ChatHistory
- func (chuo *ChatHistoryUpdateOne) Select(field string, fields ...string) *ChatHistoryUpdateOne
- func (chuo *ChatHistoryUpdateOne) SetChatID(i int64) *ChatHistoryUpdateOne
- func (chuo *ChatHistoryUpdateOne) SetContent(s string) *ChatHistoryUpdateOne
- func (chuo *ChatHistoryUpdateOne) Where(ps ...predicate.ChatHistory) *ChatHistoryUpdateOne
- 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 Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type OpenAIToken
- type OpenAITokenClient
- func (c *OpenAITokenClient) Create() *OpenAITokenCreate
- func (c *OpenAITokenClient) CreateBulk(builders ...*OpenAITokenCreate) *OpenAITokenCreateBulk
- func (c *OpenAITokenClient) Delete() *OpenAITokenDelete
- func (c *OpenAITokenClient) DeleteOne(oat *OpenAIToken) *OpenAITokenDeleteOne
- func (c *OpenAITokenClient) DeleteOneID(id int) *OpenAITokenDeleteOne
- func (c *OpenAITokenClient) Get(ctx context.Context, id int) (*OpenAIToken, error)
- func (c *OpenAITokenClient) GetX(ctx context.Context, id int) *OpenAIToken
- func (c *OpenAITokenClient) Hooks() []Hook
- func (c *OpenAITokenClient) Intercept(interceptors ...Interceptor)
- func (c *OpenAITokenClient) Interceptors() []Interceptor
- func (c *OpenAITokenClient) Query() *OpenAITokenQuery
- func (c *OpenAITokenClient) Update() *OpenAITokenUpdate
- func (c *OpenAITokenClient) UpdateOne(oat *OpenAIToken) *OpenAITokenUpdateOne
- func (c *OpenAITokenClient) UpdateOneID(id int) *OpenAITokenUpdateOne
- func (c *OpenAITokenClient) Use(hooks ...Hook)
- type OpenAITokenCreate
- func (oatc *OpenAITokenCreate) Exec(ctx context.Context) error
- func (oatc *OpenAITokenCreate) ExecX(ctx context.Context)
- func (oatc *OpenAITokenCreate) Mutation() *OpenAITokenMutation
- func (oatc *OpenAITokenCreate) Save(ctx context.Context) (*OpenAIToken, error)
- func (oatc *OpenAITokenCreate) SaveX(ctx context.Context) *OpenAIToken
- func (oatc *OpenAITokenCreate) SetIsActive(b bool) *OpenAITokenCreate
- func (oatc *OpenAITokenCreate) SetNillableIsActive(b *bool) *OpenAITokenCreate
- func (oatc *OpenAITokenCreate) SetToken(s string) *OpenAITokenCreate
- type OpenAITokenCreateBulk
- type OpenAITokenDelete
- type OpenAITokenDeleteOne
- type OpenAITokenGroupBy
- func (oatgb *OpenAITokenGroupBy) Aggregate(fns ...AggregateFunc) *OpenAITokenGroupBy
- func (s *OpenAITokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OpenAITokenGroupBy) BoolX(ctx context.Context) bool
- func (s *OpenAITokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OpenAITokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OpenAITokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OpenAITokenGroupBy) Float64X(ctx context.Context) float64
- func (s *OpenAITokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OpenAITokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OpenAITokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OpenAITokenGroupBy) IntX(ctx context.Context) int
- func (s *OpenAITokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OpenAITokenGroupBy) IntsX(ctx context.Context) []int
- func (oatgb *OpenAITokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *OpenAITokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *OpenAITokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OpenAITokenGroupBy) StringX(ctx context.Context) string
- func (s *OpenAITokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OpenAITokenGroupBy) StringsX(ctx context.Context) []string
- type OpenAITokenMutation
- func (m *OpenAITokenMutation) AddField(name string, value ent.Value) error
- func (m *OpenAITokenMutation) AddedEdges() []string
- func (m *OpenAITokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *OpenAITokenMutation) AddedFields() []string
- func (m *OpenAITokenMutation) AddedIDs(name string) []ent.Value
- func (m *OpenAITokenMutation) ClearEdge(name string) error
- func (m *OpenAITokenMutation) ClearField(name string) error
- func (m *OpenAITokenMutation) ClearedEdges() []string
- func (m *OpenAITokenMutation) ClearedFields() []string
- func (m OpenAITokenMutation) Client() *Client
- func (m *OpenAITokenMutation) EdgeCleared(name string) bool
- func (m *OpenAITokenMutation) Field(name string) (ent.Value, bool)
- func (m *OpenAITokenMutation) FieldCleared(name string) bool
- func (m *OpenAITokenMutation) Fields() []string
- func (m *OpenAITokenMutation) ID() (id int, exists bool)
- func (m *OpenAITokenMutation) IDs(ctx context.Context) ([]int, error)
- func (m *OpenAITokenMutation) IsActive() (r bool, exists bool)
- func (m *OpenAITokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OpenAITokenMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *OpenAITokenMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *OpenAITokenMutation) Op() Op
- func (m *OpenAITokenMutation) RemovedEdges() []string
- func (m *OpenAITokenMutation) RemovedIDs(name string) []ent.Value
- func (m *OpenAITokenMutation) ResetEdge(name string) error
- func (m *OpenAITokenMutation) ResetField(name string) error
- func (m *OpenAITokenMutation) ResetIsActive()
- func (m *OpenAITokenMutation) ResetToken()
- func (m *OpenAITokenMutation) SetField(name string, value ent.Value) error
- func (m *OpenAITokenMutation) SetIsActive(b bool)
- func (m *OpenAITokenMutation) SetOp(op Op)
- func (m *OpenAITokenMutation) SetToken(s string)
- func (m *OpenAITokenMutation) Token() (r string, exists bool)
- func (m OpenAITokenMutation) Tx() (*Tx, error)
- func (m *OpenAITokenMutation) Type() string
- func (m *OpenAITokenMutation) Where(ps ...predicate.OpenAIToken)
- func (m *OpenAITokenMutation) WhereP(ps ...func(*sql.Selector))
- type OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Aggregate(fns ...AggregateFunc) *OpenAITokenSelect
- func (oatq *OpenAITokenQuery) All(ctx context.Context) ([]*OpenAIToken, error)
- func (oatq *OpenAITokenQuery) AllX(ctx context.Context) []*OpenAIToken
- func (oatq *OpenAITokenQuery) Clone() *OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Count(ctx context.Context) (int, error)
- func (oatq *OpenAITokenQuery) CountX(ctx context.Context) int
- func (oatq *OpenAITokenQuery) Exist(ctx context.Context) (bool, error)
- func (oatq *OpenAITokenQuery) ExistX(ctx context.Context) bool
- func (oatq *OpenAITokenQuery) First(ctx context.Context) (*OpenAIToken, error)
- func (oatq *OpenAITokenQuery) FirstID(ctx context.Context) (id int, err error)
- func (oatq *OpenAITokenQuery) FirstIDX(ctx context.Context) int
- func (oatq *OpenAITokenQuery) FirstX(ctx context.Context) *OpenAIToken
- func (oatq *OpenAITokenQuery) GroupBy(field string, fields ...string) *OpenAITokenGroupBy
- func (oatq *OpenAITokenQuery) IDs(ctx context.Context) (ids []int, err error)
- func (oatq *OpenAITokenQuery) IDsX(ctx context.Context) []int
- func (oatq *OpenAITokenQuery) Limit(limit int) *OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Offset(offset int) *OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Only(ctx context.Context) (*OpenAIToken, error)
- func (oatq *OpenAITokenQuery) OnlyID(ctx context.Context) (id int, err error)
- func (oatq *OpenAITokenQuery) OnlyIDX(ctx context.Context) int
- func (oatq *OpenAITokenQuery) OnlyX(ctx context.Context) *OpenAIToken
- func (oatq *OpenAITokenQuery) Order(o ...openaitoken.OrderOption) *OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Select(fields ...string) *OpenAITokenSelect
- func (oatq *OpenAITokenQuery) Unique(unique bool) *OpenAITokenQuery
- func (oatq *OpenAITokenQuery) Where(ps ...predicate.OpenAIToken) *OpenAITokenQuery
- type OpenAITokenSelect
- func (oats *OpenAITokenSelect) Aggregate(fns ...AggregateFunc) *OpenAITokenSelect
- func (s *OpenAITokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OpenAITokenSelect) BoolX(ctx context.Context) bool
- func (s *OpenAITokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OpenAITokenSelect) BoolsX(ctx context.Context) []bool
- func (s *OpenAITokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OpenAITokenSelect) Float64X(ctx context.Context) float64
- func (s *OpenAITokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OpenAITokenSelect) Float64sX(ctx context.Context) []float64
- func (s *OpenAITokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OpenAITokenSelect) IntX(ctx context.Context) int
- func (s *OpenAITokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OpenAITokenSelect) IntsX(ctx context.Context) []int
- func (oats *OpenAITokenSelect) Scan(ctx context.Context, v any) error
- func (s *OpenAITokenSelect) ScanX(ctx context.Context, v any)
- func (s *OpenAITokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *OpenAITokenSelect) StringX(ctx context.Context) string
- func (s *OpenAITokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OpenAITokenSelect) StringsX(ctx context.Context) []string
- type OpenAITokenUpdate
- func (oatu *OpenAITokenUpdate) Exec(ctx context.Context) error
- func (oatu *OpenAITokenUpdate) ExecX(ctx context.Context)
- func (oatu *OpenAITokenUpdate) Mutation() *OpenAITokenMutation
- func (oatu *OpenAITokenUpdate) Save(ctx context.Context) (int, error)
- func (oatu *OpenAITokenUpdate) SaveX(ctx context.Context) int
- func (oatu *OpenAITokenUpdate) SetIsActive(b bool) *OpenAITokenUpdate
- func (oatu *OpenAITokenUpdate) SetNillableIsActive(b *bool) *OpenAITokenUpdate
- func (oatu *OpenAITokenUpdate) SetToken(s string) *OpenAITokenUpdate
- func (oatu *OpenAITokenUpdate) Where(ps ...predicate.OpenAIToken) *OpenAITokenUpdate
- type OpenAITokenUpdateOne
- func (oatuo *OpenAITokenUpdateOne) Exec(ctx context.Context) error
- func (oatuo *OpenAITokenUpdateOne) ExecX(ctx context.Context)
- func (oatuo *OpenAITokenUpdateOne) Mutation() *OpenAITokenMutation
- func (oatuo *OpenAITokenUpdateOne) Save(ctx context.Context) (*OpenAIToken, error)
- func (oatuo *OpenAITokenUpdateOne) SaveX(ctx context.Context) *OpenAIToken
- func (oatuo *OpenAITokenUpdateOne) Select(field string, fields ...string) *OpenAITokenUpdateOne
- func (oatuo *OpenAITokenUpdateOne) SetIsActive(b bool) *OpenAITokenUpdateOne
- func (oatuo *OpenAITokenUpdateOne) SetNillableIsActive(b *bool) *OpenAITokenUpdateOne
- func (oatuo *OpenAITokenUpdateOne) SetToken(s string) *OpenAITokenUpdateOne
- func (oatuo *OpenAITokenUpdateOne) Where(ps ...predicate.OpenAIToken) *OpenAITokenUpdateOne
- type OpenAITokens
- 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. TypeChatConfig = "ChatConfig" TypeChatHistory = "ChatHistory" TypeOpenAIToken = "OpenAIToken" )
Variables ¶
This section is empty.
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 ChatConfig ¶
type ChatConfig struct { // ID of the ent. ID int `json:"id,omitempty"` // ChatID holds the value of the "chat_id" field. ChatID int64 `json:"chat_id,omitempty"` // JSON holds the value of the "json" field. JSON string `json:"json,omitempty"` // contains filtered or unexported fields }
ChatConfig is the model entity for the ChatConfig schema.
func (*ChatConfig) String ¶
func (cc *ChatConfig) String() string
String implements the fmt.Stringer.
func (*ChatConfig) Unwrap ¶
func (cc *ChatConfig) Unwrap() *ChatConfig
Unwrap unwraps the ChatConfig 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 (*ChatConfig) Update ¶
func (cc *ChatConfig) Update() *ChatConfigUpdateOne
Update returns a builder for updating this ChatConfig. Note that you need to call ChatConfig.Unwrap() before calling this method if this ChatConfig was returned from a transaction, and the transaction was committed or rolled back.
type ChatConfigClient ¶
type ChatConfigClient struct {
// contains filtered or unexported fields
}
ChatConfigClient is a client for the ChatConfig schema.
func NewChatConfigClient ¶
func NewChatConfigClient(c config) *ChatConfigClient
NewChatConfigClient returns a client for the ChatConfig from the given config.
func (*ChatConfigClient) Create ¶
func (c *ChatConfigClient) Create() *ChatConfigCreate
Create returns a builder for creating a ChatConfig entity.
func (*ChatConfigClient) CreateBulk ¶
func (c *ChatConfigClient) CreateBulk(builders ...*ChatConfigCreate) *ChatConfigCreateBulk
CreateBulk returns a builder for creating a bulk of ChatConfig entities.
func (*ChatConfigClient) Delete ¶
func (c *ChatConfigClient) Delete() *ChatConfigDelete
Delete returns a delete builder for ChatConfig.
func (*ChatConfigClient) DeleteOne ¶
func (c *ChatConfigClient) DeleteOne(cc *ChatConfig) *ChatConfigDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ChatConfigClient) DeleteOneID ¶
func (c *ChatConfigClient) DeleteOneID(id int) *ChatConfigDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ChatConfigClient) Get ¶
func (c *ChatConfigClient) Get(ctx context.Context, id int) (*ChatConfig, error)
Get returns a ChatConfig entity by its id.
func (*ChatConfigClient) GetX ¶
func (c *ChatConfigClient) GetX(ctx context.Context, id int) *ChatConfig
GetX is like Get, but panics if an error occurs.
func (*ChatConfigClient) Hooks ¶
func (c *ChatConfigClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ChatConfigClient) Intercept ¶
func (c *ChatConfigClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chatconfig.Intercept(f(g(h())))`.
func (*ChatConfigClient) Interceptors ¶
func (c *ChatConfigClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ChatConfigClient) Query ¶
func (c *ChatConfigClient) Query() *ChatConfigQuery
Query returns a query builder for ChatConfig.
func (*ChatConfigClient) Update ¶
func (c *ChatConfigClient) Update() *ChatConfigUpdate
Update returns an update builder for ChatConfig.
func (*ChatConfigClient) UpdateOne ¶
func (c *ChatConfigClient) UpdateOne(cc *ChatConfig) *ChatConfigUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ChatConfigClient) UpdateOneID ¶
func (c *ChatConfigClient) UpdateOneID(id int) *ChatConfigUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ChatConfigClient) Use ¶
func (c *ChatConfigClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chatconfig.Hooks(f(g(h())))`.
type ChatConfigCreate ¶
type ChatConfigCreate struct {
// contains filtered or unexported fields
}
ChatConfigCreate is the builder for creating a ChatConfig entity.
func (*ChatConfigCreate) Exec ¶
func (ccc *ChatConfigCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatConfigCreate) ExecX ¶
func (ccc *ChatConfigCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigCreate) Mutation ¶
func (ccc *ChatConfigCreate) Mutation() *ChatConfigMutation
Mutation returns the ChatConfigMutation object of the builder.
func (*ChatConfigCreate) Save ¶
func (ccc *ChatConfigCreate) Save(ctx context.Context) (*ChatConfig, error)
Save creates the ChatConfig in the database.
func (*ChatConfigCreate) SaveX ¶
func (ccc *ChatConfigCreate) SaveX(ctx context.Context) *ChatConfig
SaveX calls Save and panics if Save returns an error.
func (*ChatConfigCreate) SetChatID ¶
func (ccc *ChatConfigCreate) SetChatID(i int64) *ChatConfigCreate
SetChatID sets the "chat_id" field.
func (*ChatConfigCreate) SetJSON ¶
func (ccc *ChatConfigCreate) SetJSON(s string) *ChatConfigCreate
SetJSON sets the "json" field.
type ChatConfigCreateBulk ¶
type ChatConfigCreateBulk struct {
// contains filtered or unexported fields
}
ChatConfigCreateBulk is the builder for creating many ChatConfig entities in bulk.
func (*ChatConfigCreateBulk) Exec ¶
func (cccb *ChatConfigCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatConfigCreateBulk) ExecX ¶
func (cccb *ChatConfigCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigCreateBulk) Save ¶
func (cccb *ChatConfigCreateBulk) Save(ctx context.Context) ([]*ChatConfig, error)
Save creates the ChatConfig entities in the database.
func (*ChatConfigCreateBulk) SaveX ¶
func (cccb *ChatConfigCreateBulk) SaveX(ctx context.Context) []*ChatConfig
SaveX is like Save, but panics if an error occurs.
type ChatConfigDelete ¶
type ChatConfigDelete struct {
// contains filtered or unexported fields
}
ChatConfigDelete is the builder for deleting a ChatConfig entity.
func (*ChatConfigDelete) Exec ¶
func (ccd *ChatConfigDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ChatConfigDelete) ExecX ¶
func (ccd *ChatConfigDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigDelete) Where ¶
func (ccd *ChatConfigDelete) Where(ps ...predicate.ChatConfig) *ChatConfigDelete
Where appends a list predicates to the ChatConfigDelete builder.
type ChatConfigDeleteOne ¶
type ChatConfigDeleteOne struct {
// contains filtered or unexported fields
}
ChatConfigDeleteOne is the builder for deleting a single ChatConfig entity.
func (*ChatConfigDeleteOne) Exec ¶
func (ccdo *ChatConfigDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ChatConfigDeleteOne) ExecX ¶
func (ccdo *ChatConfigDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigDeleteOne) Where ¶
func (ccdo *ChatConfigDeleteOne) Where(ps ...predicate.ChatConfig) *ChatConfigDeleteOne
Where appends a list predicates to the ChatConfigDelete builder.
type ChatConfigGroupBy ¶
type ChatConfigGroupBy struct {
// contains filtered or unexported fields
}
ChatConfigGroupBy is the group-by builder for ChatConfig entities.
func (*ChatConfigGroupBy) Aggregate ¶
func (ccgb *ChatConfigGroupBy) Aggregate(fns ...AggregateFunc) *ChatConfigGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ChatConfigGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatConfigGroupBy) Scan ¶
func (ccgb *ChatConfigGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatConfigGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatConfigMutation ¶
type ChatConfigMutation struct {
// contains filtered or unexported fields
}
ChatConfigMutation represents an operation that mutates the ChatConfig nodes in the graph.
func (*ChatConfigMutation) AddChatID ¶
func (m *ChatConfigMutation) AddChatID(i int64)
AddChatID adds i to the "chat_id" field.
func (*ChatConfigMutation) AddField ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) AddedChatID ¶
func (m *ChatConfigMutation) AddedChatID() (r int64, exists bool)
AddedChatID returns the value that was added to the "chat_id" field in this mutation.
func (*ChatConfigMutation) AddedEdges ¶
func (m *ChatConfigMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ChatConfigMutation) AddedField ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) AddedFields ¶
func (m *ChatConfigMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ChatConfigMutation) AddedIDs ¶
func (m *ChatConfigMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ChatConfigMutation) ChatID ¶
func (m *ChatConfigMutation) ChatID() (r int64, exists bool)
ChatID returns the value of the "chat_id" field in the mutation.
func (*ChatConfigMutation) ClearEdge ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ClearField ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ClearedEdges ¶
func (m *ChatConfigMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ChatConfigMutation) ClearedFields ¶
func (m *ChatConfigMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ChatConfigMutation) Client ¶
func (m ChatConfigMutation) 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 (*ChatConfigMutation) EdgeCleared ¶
func (m *ChatConfigMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ChatConfigMutation) Field ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) FieldCleared ¶
func (m *ChatConfigMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ChatConfigMutation) Fields ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ID ¶
func (m *ChatConfigMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ChatConfigMutation) IDs ¶
func (m *ChatConfigMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ChatConfigMutation) JSON ¶
func (m *ChatConfigMutation) JSON() (r string, exists bool)
JSON returns the value of the "json" field in the mutation.
func (*ChatConfigMutation) OldChatID ¶
func (m *ChatConfigMutation) OldChatID(ctx context.Context) (v int64, err error)
OldChatID returns the old "chat_id" field's value of the ChatConfig entity. If the ChatConfig 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 (*ChatConfigMutation) 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 (*ChatConfigMutation) OldJSON ¶
func (m *ChatConfigMutation) OldJSON(ctx context.Context) (v string, err error)
OldJSON returns the old "json" field's value of the ChatConfig entity. If the ChatConfig 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 (*ChatConfigMutation) RemovedEdges ¶
func (m *ChatConfigMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ChatConfigMutation) RemovedIDs ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ResetChatID ¶
func (m *ChatConfigMutation) ResetChatID()
ResetChatID resets all changes to the "chat_id" field.
func (*ChatConfigMutation) ResetEdge ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ResetField ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) ResetJSON ¶
func (m *ChatConfigMutation) ResetJSON()
ResetJSON resets all changes to the "json" field.
func (*ChatConfigMutation) SetChatID ¶
func (m *ChatConfigMutation) SetChatID(i int64)
SetChatID sets the "chat_id" field.
func (*ChatConfigMutation) SetField ¶
func (m *ChatConfigMutation) 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 (*ChatConfigMutation) SetJSON ¶
func (m *ChatConfigMutation) SetJSON(s string)
SetJSON sets the "json" field.
func (*ChatConfigMutation) SetOp ¶
func (m *ChatConfigMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (ChatConfigMutation) Tx ¶
func (m ChatConfigMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ChatConfigMutation) Type ¶
func (m *ChatConfigMutation) Type() string
Type returns the node type of this mutation (ChatConfig).
func (*ChatConfigMutation) Where ¶
func (m *ChatConfigMutation) Where(ps ...predicate.ChatConfig)
Where appends a list predicates to the ChatConfigMutation builder.
func (*ChatConfigMutation) WhereP ¶
func (m *ChatConfigMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ChatConfigMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ChatConfigQuery ¶
type ChatConfigQuery struct {
// contains filtered or unexported fields
}
ChatConfigQuery is the builder for querying ChatConfig entities.
func (*ChatConfigQuery) Aggregate ¶
func (ccq *ChatConfigQuery) Aggregate(fns ...AggregateFunc) *ChatConfigSelect
Aggregate returns a ChatConfigSelect configured with the given aggregations.
func (*ChatConfigQuery) All ¶
func (ccq *ChatConfigQuery) All(ctx context.Context) ([]*ChatConfig, error)
All executes the query and returns a list of ChatConfigs.
func (*ChatConfigQuery) AllX ¶
func (ccq *ChatConfigQuery) AllX(ctx context.Context) []*ChatConfig
AllX is like All, but panics if an error occurs.
func (*ChatConfigQuery) Clone ¶
func (ccq *ChatConfigQuery) Clone() *ChatConfigQuery
Clone returns a duplicate of the ChatConfigQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ChatConfigQuery) Count ¶
func (ccq *ChatConfigQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ChatConfigQuery) CountX ¶
func (ccq *ChatConfigQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ChatConfigQuery) Exist ¶
func (ccq *ChatConfigQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ChatConfigQuery) ExistX ¶
func (ccq *ChatConfigQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ChatConfigQuery) First ¶
func (ccq *ChatConfigQuery) First(ctx context.Context) (*ChatConfig, error)
First returns the first ChatConfig entity from the query. Returns a *NotFoundError when no ChatConfig was found.
func (*ChatConfigQuery) FirstID ¶
func (ccq *ChatConfigQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ChatConfig ID from the query. Returns a *NotFoundError when no ChatConfig ID was found.
func (*ChatConfigQuery) FirstIDX ¶
func (ccq *ChatConfigQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ChatConfigQuery) FirstX ¶
func (ccq *ChatConfigQuery) FirstX(ctx context.Context) *ChatConfig
FirstX is like First, but panics if an error occurs.
func (*ChatConfigQuery) GroupBy ¶
func (ccq *ChatConfigQuery) GroupBy(field string, fields ...string) *ChatConfigGroupBy
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 int64 `json:"chat_id,omitempty"` Count int `json:"count,omitempty"` } client.ChatConfig.Query(). GroupBy(chatconfig.FieldChatID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ChatConfigQuery) IDs ¶
func (ccq *ChatConfigQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ChatConfig IDs.
func (*ChatConfigQuery) IDsX ¶
func (ccq *ChatConfigQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ChatConfigQuery) Limit ¶
func (ccq *ChatConfigQuery) Limit(limit int) *ChatConfigQuery
Limit the number of records to be returned by this query.
func (*ChatConfigQuery) Offset ¶
func (ccq *ChatConfigQuery) Offset(offset int) *ChatConfigQuery
Offset to start from.
func (*ChatConfigQuery) Only ¶
func (ccq *ChatConfigQuery) Only(ctx context.Context) (*ChatConfig, error)
Only returns a single ChatConfig entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatConfig entity is found. Returns a *NotFoundError when no ChatConfig entities are found.
func (*ChatConfigQuery) OnlyID ¶
func (ccq *ChatConfigQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ChatConfig ID in the query. Returns a *NotSingularError when more than one ChatConfig ID is found. Returns a *NotFoundError when no entities are found.
func (*ChatConfigQuery) OnlyIDX ¶
func (ccq *ChatConfigQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ChatConfigQuery) OnlyX ¶
func (ccq *ChatConfigQuery) OnlyX(ctx context.Context) *ChatConfig
OnlyX is like Only, but panics if an error occurs.
func (*ChatConfigQuery) Order ¶
func (ccq *ChatConfigQuery) Order(o ...chatconfig.OrderOption) *ChatConfigQuery
Order specifies how the records should be ordered.
func (*ChatConfigQuery) Select ¶
func (ccq *ChatConfigQuery) Select(fields ...string) *ChatConfigSelect
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 int64 `json:"chat_id,omitempty"` } client.ChatConfig.Query(). Select(chatconfig.FieldChatID). Scan(ctx, &v)
func (*ChatConfigQuery) Unique ¶
func (ccq *ChatConfigQuery) Unique(unique bool) *ChatConfigQuery
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 (*ChatConfigQuery) Where ¶
func (ccq *ChatConfigQuery) Where(ps ...predicate.ChatConfig) *ChatConfigQuery
Where adds a new predicate for the ChatConfigQuery builder.
type ChatConfigSelect ¶
type ChatConfigSelect struct { *ChatConfigQuery // contains filtered or unexported fields }
ChatConfigSelect is the builder for selecting fields of ChatConfig entities.
func (*ChatConfigSelect) Aggregate ¶
func (ccs *ChatConfigSelect) Aggregate(fns ...AggregateFunc) *ChatConfigSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ChatConfigSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatConfigSelect) Scan ¶
func (ccs *ChatConfigSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatConfigSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatConfigUpdate ¶
type ChatConfigUpdate struct {
// contains filtered or unexported fields
}
ChatConfigUpdate is the builder for updating ChatConfig entities.
func (*ChatConfigUpdate) AddChatID ¶
func (ccu *ChatConfigUpdate) AddChatID(i int64) *ChatConfigUpdate
AddChatID adds i to the "chat_id" field.
func (*ChatConfigUpdate) Exec ¶
func (ccu *ChatConfigUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatConfigUpdate) ExecX ¶
func (ccu *ChatConfigUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigUpdate) Mutation ¶
func (ccu *ChatConfigUpdate) Mutation() *ChatConfigMutation
Mutation returns the ChatConfigMutation object of the builder.
func (*ChatConfigUpdate) Save ¶
func (ccu *ChatConfigUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ChatConfigUpdate) SaveX ¶
func (ccu *ChatConfigUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ChatConfigUpdate) SetChatID ¶
func (ccu *ChatConfigUpdate) SetChatID(i int64) *ChatConfigUpdate
SetChatID sets the "chat_id" field.
func (*ChatConfigUpdate) SetJSON ¶
func (ccu *ChatConfigUpdate) SetJSON(s string) *ChatConfigUpdate
SetJSON sets the "json" field.
func (*ChatConfigUpdate) Where ¶
func (ccu *ChatConfigUpdate) Where(ps ...predicate.ChatConfig) *ChatConfigUpdate
Where appends a list predicates to the ChatConfigUpdate builder.
type ChatConfigUpdateOne ¶
type ChatConfigUpdateOne struct {
// contains filtered or unexported fields
}
ChatConfigUpdateOne is the builder for updating a single ChatConfig entity.
func (*ChatConfigUpdateOne) AddChatID ¶
func (ccuo *ChatConfigUpdateOne) AddChatID(i int64) *ChatConfigUpdateOne
AddChatID adds i to the "chat_id" field.
func (*ChatConfigUpdateOne) Exec ¶
func (ccuo *ChatConfigUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ChatConfigUpdateOne) ExecX ¶
func (ccuo *ChatConfigUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatConfigUpdateOne) Mutation ¶
func (ccuo *ChatConfigUpdateOne) Mutation() *ChatConfigMutation
Mutation returns the ChatConfigMutation object of the builder.
func (*ChatConfigUpdateOne) Save ¶
func (ccuo *ChatConfigUpdateOne) Save(ctx context.Context) (*ChatConfig, error)
Save executes the query and returns the updated ChatConfig entity.
func (*ChatConfigUpdateOne) SaveX ¶
func (ccuo *ChatConfigUpdateOne) SaveX(ctx context.Context) *ChatConfig
SaveX is like Save, but panics if an error occurs.
func (*ChatConfigUpdateOne) Select ¶
func (ccuo *ChatConfigUpdateOne) Select(field string, fields ...string) *ChatConfigUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ChatConfigUpdateOne) SetChatID ¶
func (ccuo *ChatConfigUpdateOne) SetChatID(i int64) *ChatConfigUpdateOne
SetChatID sets the "chat_id" field.
func (*ChatConfigUpdateOne) SetJSON ¶
func (ccuo *ChatConfigUpdateOne) SetJSON(s string) *ChatConfigUpdateOne
SetJSON sets the "json" field.
func (*ChatConfigUpdateOne) Where ¶
func (ccuo *ChatConfigUpdateOne) Where(ps ...predicate.ChatConfig) *ChatConfigUpdateOne
Where appends a list predicates to the ChatConfigUpdate builder.
type ChatHistories ¶
type ChatHistories []*ChatHistory
ChatHistories is a parsable slice of ChatHistory.
type ChatHistory ¶
type ChatHistory struct { // ID of the ent. ID int `json:"id,omitempty"` // ChatID holds the value of the "chat_id" field. ChatID int64 `json:"chat_id,omitempty"` // Content holds the value of the "content" field. Content string `json:"content,omitempty"` // contains filtered or unexported fields }
ChatHistory is the model entity for the ChatHistory schema.
func (*ChatHistory) String ¶
func (ch *ChatHistory) String() string
String implements the fmt.Stringer.
func (*ChatHistory) Unwrap ¶
func (ch *ChatHistory) Unwrap() *ChatHistory
Unwrap unwraps the ChatHistory 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 (*ChatHistory) Update ¶
func (ch *ChatHistory) Update() *ChatHistoryUpdateOne
Update returns a builder for updating this ChatHistory. Note that you need to call ChatHistory.Unwrap() before calling this method if this ChatHistory was returned from a transaction, and the transaction was committed or rolled back.
type ChatHistoryClient ¶
type ChatHistoryClient struct {
// contains filtered or unexported fields
}
ChatHistoryClient is a client for the ChatHistory schema.
func NewChatHistoryClient ¶
func NewChatHistoryClient(c config) *ChatHistoryClient
NewChatHistoryClient returns a client for the ChatHistory from the given config.
func (*ChatHistoryClient) Create ¶
func (c *ChatHistoryClient) Create() *ChatHistoryCreate
Create returns a builder for creating a ChatHistory entity.
func (*ChatHistoryClient) CreateBulk ¶
func (c *ChatHistoryClient) CreateBulk(builders ...*ChatHistoryCreate) *ChatHistoryCreateBulk
CreateBulk returns a builder for creating a bulk of ChatHistory entities.
func (*ChatHistoryClient) Delete ¶
func (c *ChatHistoryClient) Delete() *ChatHistoryDelete
Delete returns a delete builder for ChatHistory.
func (*ChatHistoryClient) DeleteOne ¶
func (c *ChatHistoryClient) DeleteOne(ch *ChatHistory) *ChatHistoryDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ChatHistoryClient) DeleteOneID ¶
func (c *ChatHistoryClient) DeleteOneID(id int) *ChatHistoryDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ChatHistoryClient) Get ¶
func (c *ChatHistoryClient) Get(ctx context.Context, id int) (*ChatHistory, error)
Get returns a ChatHistory entity by its id.
func (*ChatHistoryClient) GetX ¶
func (c *ChatHistoryClient) GetX(ctx context.Context, id int) *ChatHistory
GetX is like Get, but panics if an error occurs.
func (*ChatHistoryClient) Hooks ¶
func (c *ChatHistoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ChatHistoryClient) Intercept ¶
func (c *ChatHistoryClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chathistory.Intercept(f(g(h())))`.
func (*ChatHistoryClient) Interceptors ¶
func (c *ChatHistoryClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ChatHistoryClient) Query ¶
func (c *ChatHistoryClient) Query() *ChatHistoryQuery
Query returns a query builder for ChatHistory.
func (*ChatHistoryClient) Update ¶
func (c *ChatHistoryClient) Update() *ChatHistoryUpdate
Update returns an update builder for ChatHistory.
func (*ChatHistoryClient) UpdateOne ¶
func (c *ChatHistoryClient) UpdateOne(ch *ChatHistory) *ChatHistoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ChatHistoryClient) UpdateOneID ¶
func (c *ChatHistoryClient) UpdateOneID(id int) *ChatHistoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ChatHistoryClient) Use ¶
func (c *ChatHistoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chathistory.Hooks(f(g(h())))`.
type ChatHistoryCreate ¶
type ChatHistoryCreate struct {
// contains filtered or unexported fields
}
ChatHistoryCreate is the builder for creating a ChatHistory entity.
func (*ChatHistoryCreate) Exec ¶
func (chc *ChatHistoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatHistoryCreate) ExecX ¶
func (chc *ChatHistoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryCreate) Mutation ¶
func (chc *ChatHistoryCreate) Mutation() *ChatHistoryMutation
Mutation returns the ChatHistoryMutation object of the builder.
func (*ChatHistoryCreate) Save ¶
func (chc *ChatHistoryCreate) Save(ctx context.Context) (*ChatHistory, error)
Save creates the ChatHistory in the database.
func (*ChatHistoryCreate) SaveX ¶
func (chc *ChatHistoryCreate) SaveX(ctx context.Context) *ChatHistory
SaveX calls Save and panics if Save returns an error.
func (*ChatHistoryCreate) SetChatID ¶
func (chc *ChatHistoryCreate) SetChatID(i int64) *ChatHistoryCreate
SetChatID sets the "chat_id" field.
func (*ChatHistoryCreate) SetContent ¶
func (chc *ChatHistoryCreate) SetContent(s string) *ChatHistoryCreate
SetContent sets the "content" field.
type ChatHistoryCreateBulk ¶
type ChatHistoryCreateBulk struct {
// contains filtered or unexported fields
}
ChatHistoryCreateBulk is the builder for creating many ChatHistory entities in bulk.
func (*ChatHistoryCreateBulk) Exec ¶
func (chcb *ChatHistoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatHistoryCreateBulk) ExecX ¶
func (chcb *ChatHistoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryCreateBulk) Save ¶
func (chcb *ChatHistoryCreateBulk) Save(ctx context.Context) ([]*ChatHistory, error)
Save creates the ChatHistory entities in the database.
func (*ChatHistoryCreateBulk) SaveX ¶
func (chcb *ChatHistoryCreateBulk) SaveX(ctx context.Context) []*ChatHistory
SaveX is like Save, but panics if an error occurs.
type ChatHistoryDelete ¶
type ChatHistoryDelete struct {
// contains filtered or unexported fields
}
ChatHistoryDelete is the builder for deleting a ChatHistory entity.
func (*ChatHistoryDelete) Exec ¶
func (chd *ChatHistoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ChatHistoryDelete) ExecX ¶
func (chd *ChatHistoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryDelete) Where ¶
func (chd *ChatHistoryDelete) Where(ps ...predicate.ChatHistory) *ChatHistoryDelete
Where appends a list predicates to the ChatHistoryDelete builder.
type ChatHistoryDeleteOne ¶
type ChatHistoryDeleteOne struct {
// contains filtered or unexported fields
}
ChatHistoryDeleteOne is the builder for deleting a single ChatHistory entity.
func (*ChatHistoryDeleteOne) Exec ¶
func (chdo *ChatHistoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ChatHistoryDeleteOne) ExecX ¶
func (chdo *ChatHistoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryDeleteOne) Where ¶
func (chdo *ChatHistoryDeleteOne) Where(ps ...predicate.ChatHistory) *ChatHistoryDeleteOne
Where appends a list predicates to the ChatHistoryDelete builder.
type ChatHistoryGroupBy ¶
type ChatHistoryGroupBy struct {
// contains filtered or unexported fields
}
ChatHistoryGroupBy is the group-by builder for ChatHistory entities.
func (*ChatHistoryGroupBy) Aggregate ¶
func (chgb *ChatHistoryGroupBy) Aggregate(fns ...AggregateFunc) *ChatHistoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ChatHistoryGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatHistoryGroupBy) Scan ¶
func (chgb *ChatHistoryGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatHistoryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatHistoryMutation ¶
type ChatHistoryMutation struct {
// contains filtered or unexported fields
}
ChatHistoryMutation represents an operation that mutates the ChatHistory nodes in the graph.
func (*ChatHistoryMutation) AddChatID ¶
func (m *ChatHistoryMutation) AddChatID(i int64)
AddChatID adds i to the "chat_id" field.
func (*ChatHistoryMutation) AddField ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) AddedChatID ¶
func (m *ChatHistoryMutation) AddedChatID() (r int64, exists bool)
AddedChatID returns the value that was added to the "chat_id" field in this mutation.
func (*ChatHistoryMutation) AddedEdges ¶
func (m *ChatHistoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ChatHistoryMutation) AddedField ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) AddedFields ¶
func (m *ChatHistoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ChatHistoryMutation) AddedIDs ¶
func (m *ChatHistoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ChatHistoryMutation) ChatID ¶
func (m *ChatHistoryMutation) ChatID() (r int64, exists bool)
ChatID returns the value of the "chat_id" field in the mutation.
func (*ChatHistoryMutation) ClearEdge ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) ClearField ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) ClearedEdges ¶
func (m *ChatHistoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ChatHistoryMutation) ClearedFields ¶
func (m *ChatHistoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ChatHistoryMutation) Client ¶
func (m ChatHistoryMutation) 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 (*ChatHistoryMutation) Content ¶
func (m *ChatHistoryMutation) Content() (r string, exists bool)
Content returns the value of the "content" field in the mutation.
func (*ChatHistoryMutation) EdgeCleared ¶
func (m *ChatHistoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ChatHistoryMutation) Field ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) FieldCleared ¶
func (m *ChatHistoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ChatHistoryMutation) Fields ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) ID ¶
func (m *ChatHistoryMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ChatHistoryMutation) IDs ¶
func (m *ChatHistoryMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ChatHistoryMutation) OldChatID ¶
func (m *ChatHistoryMutation) OldChatID(ctx context.Context) (v int64, err error)
OldChatID returns the old "chat_id" field's value of the ChatHistory entity. If the ChatHistory 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 (*ChatHistoryMutation) OldContent ¶
func (m *ChatHistoryMutation) OldContent(ctx context.Context) (v string, err error)
OldContent returns the old "content" field's value of the ChatHistory entity. If the ChatHistory 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 (*ChatHistoryMutation) 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 (*ChatHistoryMutation) Op ¶
func (m *ChatHistoryMutation) Op() Op
Op returns the operation name.
func (*ChatHistoryMutation) RemovedEdges ¶
func (m *ChatHistoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ChatHistoryMutation) RemovedIDs ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) ResetChatID ¶
func (m *ChatHistoryMutation) ResetChatID()
ResetChatID resets all changes to the "chat_id" field.
func (*ChatHistoryMutation) ResetContent ¶
func (m *ChatHistoryMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*ChatHistoryMutation) ResetEdge ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) ResetField ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) SetChatID ¶
func (m *ChatHistoryMutation) SetChatID(i int64)
SetChatID sets the "chat_id" field.
func (*ChatHistoryMutation) SetContent ¶
func (m *ChatHistoryMutation) SetContent(s string)
SetContent sets the "content" field.
func (*ChatHistoryMutation) SetField ¶
func (m *ChatHistoryMutation) 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 (*ChatHistoryMutation) SetOp ¶
func (m *ChatHistoryMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (ChatHistoryMutation) Tx ¶
func (m ChatHistoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ChatHistoryMutation) Type ¶
func (m *ChatHistoryMutation) Type() string
Type returns the node type of this mutation (ChatHistory).
func (*ChatHistoryMutation) Where ¶
func (m *ChatHistoryMutation) Where(ps ...predicate.ChatHistory)
Where appends a list predicates to the ChatHistoryMutation builder.
func (*ChatHistoryMutation) WhereP ¶
func (m *ChatHistoryMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ChatHistoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ChatHistoryQuery ¶
type ChatHistoryQuery struct {
// contains filtered or unexported fields
}
ChatHistoryQuery is the builder for querying ChatHistory entities.
func (*ChatHistoryQuery) Aggregate ¶
func (chq *ChatHistoryQuery) Aggregate(fns ...AggregateFunc) *ChatHistorySelect
Aggregate returns a ChatHistorySelect configured with the given aggregations.
func (*ChatHistoryQuery) All ¶
func (chq *ChatHistoryQuery) All(ctx context.Context) ([]*ChatHistory, error)
All executes the query and returns a list of ChatHistories.
func (*ChatHistoryQuery) AllX ¶
func (chq *ChatHistoryQuery) AllX(ctx context.Context) []*ChatHistory
AllX is like All, but panics if an error occurs.
func (*ChatHistoryQuery) Clone ¶
func (chq *ChatHistoryQuery) Clone() *ChatHistoryQuery
Clone returns a duplicate of the ChatHistoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ChatHistoryQuery) Count ¶
func (chq *ChatHistoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ChatHistoryQuery) CountX ¶
func (chq *ChatHistoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ChatHistoryQuery) Exist ¶
func (chq *ChatHistoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ChatHistoryQuery) ExistX ¶
func (chq *ChatHistoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ChatHistoryQuery) First ¶
func (chq *ChatHistoryQuery) First(ctx context.Context) (*ChatHistory, error)
First returns the first ChatHistory entity from the query. Returns a *NotFoundError when no ChatHistory was found.
func (*ChatHistoryQuery) FirstID ¶
func (chq *ChatHistoryQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ChatHistory ID from the query. Returns a *NotFoundError when no ChatHistory ID was found.
func (*ChatHistoryQuery) FirstIDX ¶
func (chq *ChatHistoryQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ChatHistoryQuery) FirstX ¶
func (chq *ChatHistoryQuery) FirstX(ctx context.Context) *ChatHistory
FirstX is like First, but panics if an error occurs.
func (*ChatHistoryQuery) GroupBy ¶
func (chq *ChatHistoryQuery) GroupBy(field string, fields ...string) *ChatHistoryGroupBy
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 int64 `json:"chat_id,omitempty"` Count int `json:"count,omitempty"` } client.ChatHistory.Query(). GroupBy(chathistory.FieldChatID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ChatHistoryQuery) IDs ¶
func (chq *ChatHistoryQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ChatHistory IDs.
func (*ChatHistoryQuery) IDsX ¶
func (chq *ChatHistoryQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ChatHistoryQuery) Limit ¶
func (chq *ChatHistoryQuery) Limit(limit int) *ChatHistoryQuery
Limit the number of records to be returned by this query.
func (*ChatHistoryQuery) Offset ¶
func (chq *ChatHistoryQuery) Offset(offset int) *ChatHistoryQuery
Offset to start from.
func (*ChatHistoryQuery) Only ¶
func (chq *ChatHistoryQuery) Only(ctx context.Context) (*ChatHistory, error)
Only returns a single ChatHistory entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChatHistory entity is found. Returns a *NotFoundError when no ChatHistory entities are found.
func (*ChatHistoryQuery) OnlyID ¶
func (chq *ChatHistoryQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ChatHistory ID in the query. Returns a *NotSingularError when more than one ChatHistory ID is found. Returns a *NotFoundError when no entities are found.
func (*ChatHistoryQuery) OnlyIDX ¶
func (chq *ChatHistoryQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ChatHistoryQuery) OnlyX ¶
func (chq *ChatHistoryQuery) OnlyX(ctx context.Context) *ChatHistory
OnlyX is like Only, but panics if an error occurs.
func (*ChatHistoryQuery) Order ¶
func (chq *ChatHistoryQuery) Order(o ...chathistory.OrderOption) *ChatHistoryQuery
Order specifies how the records should be ordered.
func (*ChatHistoryQuery) Select ¶
func (chq *ChatHistoryQuery) Select(fields ...string) *ChatHistorySelect
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 int64 `json:"chat_id,omitempty"` } client.ChatHistory.Query(). Select(chathistory.FieldChatID). Scan(ctx, &v)
func (*ChatHistoryQuery) Unique ¶
func (chq *ChatHistoryQuery) Unique(unique bool) *ChatHistoryQuery
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 (*ChatHistoryQuery) Where ¶
func (chq *ChatHistoryQuery) Where(ps ...predicate.ChatHistory) *ChatHistoryQuery
Where adds a new predicate for the ChatHistoryQuery builder.
type ChatHistorySelect ¶
type ChatHistorySelect struct { *ChatHistoryQuery // contains filtered or unexported fields }
ChatHistorySelect is the builder for selecting fields of ChatHistory entities.
func (*ChatHistorySelect) Aggregate ¶
func (chs *ChatHistorySelect) Aggregate(fns ...AggregateFunc) *ChatHistorySelect
Aggregate adds the given aggregation functions to the selector query.
func (*ChatHistorySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChatHistorySelect) Scan ¶
func (chs *ChatHistorySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChatHistorySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChatHistoryUpdate ¶
type ChatHistoryUpdate struct {
// contains filtered or unexported fields
}
ChatHistoryUpdate is the builder for updating ChatHistory entities.
func (*ChatHistoryUpdate) AddChatID ¶
func (chu *ChatHistoryUpdate) AddChatID(i int64) *ChatHistoryUpdate
AddChatID adds i to the "chat_id" field.
func (*ChatHistoryUpdate) Exec ¶
func (chu *ChatHistoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChatHistoryUpdate) ExecX ¶
func (chu *ChatHistoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryUpdate) Mutation ¶
func (chu *ChatHistoryUpdate) Mutation() *ChatHistoryMutation
Mutation returns the ChatHistoryMutation object of the builder.
func (*ChatHistoryUpdate) Save ¶
func (chu *ChatHistoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ChatHistoryUpdate) SaveX ¶
func (chu *ChatHistoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ChatHistoryUpdate) SetChatID ¶
func (chu *ChatHistoryUpdate) SetChatID(i int64) *ChatHistoryUpdate
SetChatID sets the "chat_id" field.
func (*ChatHistoryUpdate) SetContent ¶
func (chu *ChatHistoryUpdate) SetContent(s string) *ChatHistoryUpdate
SetContent sets the "content" field.
func (*ChatHistoryUpdate) Where ¶
func (chu *ChatHistoryUpdate) Where(ps ...predicate.ChatHistory) *ChatHistoryUpdate
Where appends a list predicates to the ChatHistoryUpdate builder.
type ChatHistoryUpdateOne ¶
type ChatHistoryUpdateOne struct {
// contains filtered or unexported fields
}
ChatHistoryUpdateOne is the builder for updating a single ChatHistory entity.
func (*ChatHistoryUpdateOne) AddChatID ¶
func (chuo *ChatHistoryUpdateOne) AddChatID(i int64) *ChatHistoryUpdateOne
AddChatID adds i to the "chat_id" field.
func (*ChatHistoryUpdateOne) Exec ¶
func (chuo *ChatHistoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ChatHistoryUpdateOne) ExecX ¶
func (chuo *ChatHistoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChatHistoryUpdateOne) Mutation ¶
func (chuo *ChatHistoryUpdateOne) Mutation() *ChatHistoryMutation
Mutation returns the ChatHistoryMutation object of the builder.
func (*ChatHistoryUpdateOne) Save ¶
func (chuo *ChatHistoryUpdateOne) Save(ctx context.Context) (*ChatHistory, error)
Save executes the query and returns the updated ChatHistory entity.
func (*ChatHistoryUpdateOne) SaveX ¶
func (chuo *ChatHistoryUpdateOne) SaveX(ctx context.Context) *ChatHistory
SaveX is like Save, but panics if an error occurs.
func (*ChatHistoryUpdateOne) Select ¶
func (chuo *ChatHistoryUpdateOne) Select(field string, fields ...string) *ChatHistoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ChatHistoryUpdateOne) SetChatID ¶
func (chuo *ChatHistoryUpdateOne) SetChatID(i int64) *ChatHistoryUpdateOne
SetChatID sets the "chat_id" field.
func (*ChatHistoryUpdateOne) SetContent ¶
func (chuo *ChatHistoryUpdateOne) SetContent(s string) *ChatHistoryUpdateOne
SetContent sets the "content" field.
func (*ChatHistoryUpdateOne) Where ¶
func (chuo *ChatHistoryUpdateOne) Where(ps ...predicate.ChatHistory) *ChatHistoryUpdateOne
Where appends a list predicates to the ChatHistoryUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // ChatConfig is the client for interacting with the ChatConfig builders. ChatConfig *ChatConfigClient // ChatHistory is the client for interacting with the ChatHistory builders. ChatHistory *ChatHistoryClient // OpenAIToken is the client for interacting with the OpenAIToken builders. OpenAIToken *OpenAITokenClient // 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(). ChatConfig. 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 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 OpenAIToken ¶
type OpenAIToken struct { // ID of the ent. ID int `json:"id,omitempty"` // Token holds the value of the "token" field. Token string `json:"token,omitempty"` // IsActive holds the value of the "is_active" field. IsActive bool `json:"is_active,omitempty"` // contains filtered or unexported fields }
OpenAIToken is the model entity for the OpenAIToken schema.
func (*OpenAIToken) String ¶
func (oat *OpenAIToken) String() string
String implements the fmt.Stringer.
func (*OpenAIToken) Unwrap ¶
func (oat *OpenAIToken) Unwrap() *OpenAIToken
Unwrap unwraps the OpenAIToken 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 (*OpenAIToken) Update ¶
func (oat *OpenAIToken) Update() *OpenAITokenUpdateOne
Update returns a builder for updating this OpenAIToken. Note that you need to call OpenAIToken.Unwrap() before calling this method if this OpenAIToken was returned from a transaction, and the transaction was committed or rolled back.
type OpenAITokenClient ¶
type OpenAITokenClient struct {
// contains filtered or unexported fields
}
OpenAITokenClient is a client for the OpenAIToken schema.
func NewOpenAITokenClient ¶
func NewOpenAITokenClient(c config) *OpenAITokenClient
NewOpenAITokenClient returns a client for the OpenAIToken from the given config.
func (*OpenAITokenClient) Create ¶
func (c *OpenAITokenClient) Create() *OpenAITokenCreate
Create returns a builder for creating a OpenAIToken entity.
func (*OpenAITokenClient) CreateBulk ¶
func (c *OpenAITokenClient) CreateBulk(builders ...*OpenAITokenCreate) *OpenAITokenCreateBulk
CreateBulk returns a builder for creating a bulk of OpenAIToken entities.
func (*OpenAITokenClient) Delete ¶
func (c *OpenAITokenClient) Delete() *OpenAITokenDelete
Delete returns a delete builder for OpenAIToken.
func (*OpenAITokenClient) DeleteOne ¶
func (c *OpenAITokenClient) DeleteOne(oat *OpenAIToken) *OpenAITokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OpenAITokenClient) DeleteOneID ¶
func (c *OpenAITokenClient) DeleteOneID(id int) *OpenAITokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OpenAITokenClient) Get ¶
func (c *OpenAITokenClient) Get(ctx context.Context, id int) (*OpenAIToken, error)
Get returns a OpenAIToken entity by its id.
func (*OpenAITokenClient) GetX ¶
func (c *OpenAITokenClient) GetX(ctx context.Context, id int) *OpenAIToken
GetX is like Get, but panics if an error occurs.
func (*OpenAITokenClient) Hooks ¶
func (c *OpenAITokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*OpenAITokenClient) Intercept ¶
func (c *OpenAITokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `openaitoken.Intercept(f(g(h())))`.
func (*OpenAITokenClient) Interceptors ¶
func (c *OpenAITokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OpenAITokenClient) Query ¶
func (c *OpenAITokenClient) Query() *OpenAITokenQuery
Query returns a query builder for OpenAIToken.
func (*OpenAITokenClient) Update ¶
func (c *OpenAITokenClient) Update() *OpenAITokenUpdate
Update returns an update builder for OpenAIToken.
func (*OpenAITokenClient) UpdateOne ¶
func (c *OpenAITokenClient) UpdateOne(oat *OpenAIToken) *OpenAITokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OpenAITokenClient) UpdateOneID ¶
func (c *OpenAITokenClient) UpdateOneID(id int) *OpenAITokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OpenAITokenClient) Use ¶
func (c *OpenAITokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `openaitoken.Hooks(f(g(h())))`.
type OpenAITokenCreate ¶
type OpenAITokenCreate struct {
// contains filtered or unexported fields
}
OpenAITokenCreate is the builder for creating a OpenAIToken entity.
func (*OpenAITokenCreate) Exec ¶
func (oatc *OpenAITokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenAITokenCreate) ExecX ¶
func (oatc *OpenAITokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenCreate) Mutation ¶
func (oatc *OpenAITokenCreate) Mutation() *OpenAITokenMutation
Mutation returns the OpenAITokenMutation object of the builder.
func (*OpenAITokenCreate) Save ¶
func (oatc *OpenAITokenCreate) Save(ctx context.Context) (*OpenAIToken, error)
Save creates the OpenAIToken in the database.
func (*OpenAITokenCreate) SaveX ¶
func (oatc *OpenAITokenCreate) SaveX(ctx context.Context) *OpenAIToken
SaveX calls Save and panics if Save returns an error.
func (*OpenAITokenCreate) SetIsActive ¶
func (oatc *OpenAITokenCreate) SetIsActive(b bool) *OpenAITokenCreate
SetIsActive sets the "is_active" field.
func (*OpenAITokenCreate) SetNillableIsActive ¶
func (oatc *OpenAITokenCreate) SetNillableIsActive(b *bool) *OpenAITokenCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*OpenAITokenCreate) SetToken ¶
func (oatc *OpenAITokenCreate) SetToken(s string) *OpenAITokenCreate
SetToken sets the "token" field.
type OpenAITokenCreateBulk ¶
type OpenAITokenCreateBulk struct {
// contains filtered or unexported fields
}
OpenAITokenCreateBulk is the builder for creating many OpenAIToken entities in bulk.
func (*OpenAITokenCreateBulk) Exec ¶
func (oatcb *OpenAITokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenAITokenCreateBulk) ExecX ¶
func (oatcb *OpenAITokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenCreateBulk) Save ¶
func (oatcb *OpenAITokenCreateBulk) Save(ctx context.Context) ([]*OpenAIToken, error)
Save creates the OpenAIToken entities in the database.
func (*OpenAITokenCreateBulk) SaveX ¶
func (oatcb *OpenAITokenCreateBulk) SaveX(ctx context.Context) []*OpenAIToken
SaveX is like Save, but panics if an error occurs.
type OpenAITokenDelete ¶
type OpenAITokenDelete struct {
// contains filtered or unexported fields
}
OpenAITokenDelete is the builder for deleting a OpenAIToken entity.
func (*OpenAITokenDelete) Exec ¶
func (oatd *OpenAITokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OpenAITokenDelete) ExecX ¶
func (oatd *OpenAITokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenDelete) Where ¶
func (oatd *OpenAITokenDelete) Where(ps ...predicate.OpenAIToken) *OpenAITokenDelete
Where appends a list predicates to the OpenAITokenDelete builder.
type OpenAITokenDeleteOne ¶
type OpenAITokenDeleteOne struct {
// contains filtered or unexported fields
}
OpenAITokenDeleteOne is the builder for deleting a single OpenAIToken entity.
func (*OpenAITokenDeleteOne) Exec ¶
func (oatdo *OpenAITokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OpenAITokenDeleteOne) ExecX ¶
func (oatdo *OpenAITokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenDeleteOne) Where ¶
func (oatdo *OpenAITokenDeleteOne) Where(ps ...predicate.OpenAIToken) *OpenAITokenDeleteOne
Where appends a list predicates to the OpenAITokenDelete builder.
type OpenAITokenGroupBy ¶
type OpenAITokenGroupBy struct {
// contains filtered or unexported fields
}
OpenAITokenGroupBy is the group-by builder for OpenAIToken entities.
func (*OpenAITokenGroupBy) Aggregate ¶
func (oatgb *OpenAITokenGroupBy) Aggregate(fns ...AggregateFunc) *OpenAITokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OpenAITokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OpenAITokenGroupBy) Scan ¶
func (oatgb *OpenAITokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OpenAITokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OpenAITokenMutation ¶
type OpenAITokenMutation struct {
// contains filtered or unexported fields
}
OpenAITokenMutation represents an operation that mutates the OpenAIToken nodes in the graph.
func (*OpenAITokenMutation) AddField ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) AddedEdges ¶
func (m *OpenAITokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OpenAITokenMutation) AddedField ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) AddedFields ¶
func (m *OpenAITokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OpenAITokenMutation) AddedIDs ¶
func (m *OpenAITokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OpenAITokenMutation) ClearEdge ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ClearField ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ClearedEdges ¶
func (m *OpenAITokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OpenAITokenMutation) ClearedFields ¶
func (m *OpenAITokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OpenAITokenMutation) Client ¶
func (m OpenAITokenMutation) 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 (*OpenAITokenMutation) EdgeCleared ¶
func (m *OpenAITokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OpenAITokenMutation) Field ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) FieldCleared ¶
func (m *OpenAITokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OpenAITokenMutation) Fields ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ID ¶
func (m *OpenAITokenMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*OpenAITokenMutation) IDs ¶
func (m *OpenAITokenMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*OpenAITokenMutation) IsActive ¶
func (m *OpenAITokenMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*OpenAITokenMutation) 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 (*OpenAITokenMutation) OldIsActive ¶
func (m *OpenAITokenMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the OpenAIToken entity. If the OpenAIToken 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 (*OpenAITokenMutation) OldToken ¶
func (m *OpenAITokenMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the OpenAIToken entity. If the OpenAIToken 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 (*OpenAITokenMutation) Op ¶
func (m *OpenAITokenMutation) Op() Op
Op returns the operation name.
func (*OpenAITokenMutation) RemovedEdges ¶
func (m *OpenAITokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OpenAITokenMutation) RemovedIDs ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ResetEdge ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ResetField ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) ResetIsActive ¶
func (m *OpenAITokenMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*OpenAITokenMutation) ResetToken ¶
func (m *OpenAITokenMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*OpenAITokenMutation) SetField ¶
func (m *OpenAITokenMutation) 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 (*OpenAITokenMutation) SetIsActive ¶
func (m *OpenAITokenMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*OpenAITokenMutation) SetOp ¶
func (m *OpenAITokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OpenAITokenMutation) SetToken ¶
func (m *OpenAITokenMutation) SetToken(s string)
SetToken sets the "token" field.
func (*OpenAITokenMutation) Token ¶
func (m *OpenAITokenMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (OpenAITokenMutation) Tx ¶
func (m OpenAITokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OpenAITokenMutation) Type ¶
func (m *OpenAITokenMutation) Type() string
Type returns the node type of this mutation (OpenAIToken).
func (*OpenAITokenMutation) Where ¶
func (m *OpenAITokenMutation) Where(ps ...predicate.OpenAIToken)
Where appends a list predicates to the OpenAITokenMutation builder.
func (*OpenAITokenMutation) WhereP ¶
func (m *OpenAITokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OpenAITokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OpenAITokenQuery ¶
type OpenAITokenQuery struct {
// contains filtered or unexported fields
}
OpenAITokenQuery is the builder for querying OpenAIToken entities.
func (*OpenAITokenQuery) Aggregate ¶
func (oatq *OpenAITokenQuery) Aggregate(fns ...AggregateFunc) *OpenAITokenSelect
Aggregate returns a OpenAITokenSelect configured with the given aggregations.
func (*OpenAITokenQuery) All ¶
func (oatq *OpenAITokenQuery) All(ctx context.Context) ([]*OpenAIToken, error)
All executes the query and returns a list of OpenAITokens.
func (*OpenAITokenQuery) AllX ¶
func (oatq *OpenAITokenQuery) AllX(ctx context.Context) []*OpenAIToken
AllX is like All, but panics if an error occurs.
func (*OpenAITokenQuery) Clone ¶
func (oatq *OpenAITokenQuery) Clone() *OpenAITokenQuery
Clone returns a duplicate of the OpenAITokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OpenAITokenQuery) Count ¶
func (oatq *OpenAITokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OpenAITokenQuery) CountX ¶
func (oatq *OpenAITokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OpenAITokenQuery) Exist ¶
func (oatq *OpenAITokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OpenAITokenQuery) ExistX ¶
func (oatq *OpenAITokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OpenAITokenQuery) First ¶
func (oatq *OpenAITokenQuery) First(ctx context.Context) (*OpenAIToken, error)
First returns the first OpenAIToken entity from the query. Returns a *NotFoundError when no OpenAIToken was found.
func (*OpenAITokenQuery) FirstID ¶
func (oatq *OpenAITokenQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first OpenAIToken ID from the query. Returns a *NotFoundError when no OpenAIToken ID was found.
func (*OpenAITokenQuery) FirstIDX ¶
func (oatq *OpenAITokenQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*OpenAITokenQuery) FirstX ¶
func (oatq *OpenAITokenQuery) FirstX(ctx context.Context) *OpenAIToken
FirstX is like First, but panics if an error occurs.
func (*OpenAITokenQuery) GroupBy ¶
func (oatq *OpenAITokenQuery) GroupBy(field string, fields ...string) *OpenAITokenGroupBy
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 { Token string `json:"token,omitempty"` Count int `json:"count,omitempty"` } client.OpenAIToken.Query(). GroupBy(openaitoken.FieldToken). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OpenAITokenQuery) IDs ¶
func (oatq *OpenAITokenQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of OpenAIToken IDs.
func (*OpenAITokenQuery) IDsX ¶
func (oatq *OpenAITokenQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*OpenAITokenQuery) Limit ¶
func (oatq *OpenAITokenQuery) Limit(limit int) *OpenAITokenQuery
Limit the number of records to be returned by this query.
func (*OpenAITokenQuery) Offset ¶
func (oatq *OpenAITokenQuery) Offset(offset int) *OpenAITokenQuery
Offset to start from.
func (*OpenAITokenQuery) Only ¶
func (oatq *OpenAITokenQuery) Only(ctx context.Context) (*OpenAIToken, error)
Only returns a single OpenAIToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OpenAIToken entity is found. Returns a *NotFoundError when no OpenAIToken entities are found.
func (*OpenAITokenQuery) OnlyID ¶
func (oatq *OpenAITokenQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only OpenAIToken ID in the query. Returns a *NotSingularError when more than one OpenAIToken ID is found. Returns a *NotFoundError when no entities are found.
func (*OpenAITokenQuery) OnlyIDX ¶
func (oatq *OpenAITokenQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OpenAITokenQuery) OnlyX ¶
func (oatq *OpenAITokenQuery) OnlyX(ctx context.Context) *OpenAIToken
OnlyX is like Only, but panics if an error occurs.
func (*OpenAITokenQuery) Order ¶
func (oatq *OpenAITokenQuery) Order(o ...openaitoken.OrderOption) *OpenAITokenQuery
Order specifies how the records should be ordered.
func (*OpenAITokenQuery) Select ¶
func (oatq *OpenAITokenQuery) Select(fields ...string) *OpenAITokenSelect
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 { Token string `json:"token,omitempty"` } client.OpenAIToken.Query(). Select(openaitoken.FieldToken). Scan(ctx, &v)
func (*OpenAITokenQuery) Unique ¶
func (oatq *OpenAITokenQuery) Unique(unique bool) *OpenAITokenQuery
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 (*OpenAITokenQuery) Where ¶
func (oatq *OpenAITokenQuery) Where(ps ...predicate.OpenAIToken) *OpenAITokenQuery
Where adds a new predicate for the OpenAITokenQuery builder.
type OpenAITokenSelect ¶
type OpenAITokenSelect struct { *OpenAITokenQuery // contains filtered or unexported fields }
OpenAITokenSelect is the builder for selecting fields of OpenAIToken entities.
func (*OpenAITokenSelect) Aggregate ¶
func (oats *OpenAITokenSelect) Aggregate(fns ...AggregateFunc) *OpenAITokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OpenAITokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OpenAITokenSelect) Scan ¶
func (oats *OpenAITokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OpenAITokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OpenAITokenUpdate ¶
type OpenAITokenUpdate struct {
// contains filtered or unexported fields
}
OpenAITokenUpdate is the builder for updating OpenAIToken entities.
func (*OpenAITokenUpdate) Exec ¶
func (oatu *OpenAITokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenAITokenUpdate) ExecX ¶
func (oatu *OpenAITokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenUpdate) Mutation ¶
func (oatu *OpenAITokenUpdate) Mutation() *OpenAITokenMutation
Mutation returns the OpenAITokenMutation object of the builder.
func (*OpenAITokenUpdate) Save ¶
func (oatu *OpenAITokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OpenAITokenUpdate) SaveX ¶
func (oatu *OpenAITokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OpenAITokenUpdate) SetIsActive ¶
func (oatu *OpenAITokenUpdate) SetIsActive(b bool) *OpenAITokenUpdate
SetIsActive sets the "is_active" field.
func (*OpenAITokenUpdate) SetNillableIsActive ¶
func (oatu *OpenAITokenUpdate) SetNillableIsActive(b *bool) *OpenAITokenUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*OpenAITokenUpdate) SetToken ¶
func (oatu *OpenAITokenUpdate) SetToken(s string) *OpenAITokenUpdate
SetToken sets the "token" field.
func (*OpenAITokenUpdate) Where ¶
func (oatu *OpenAITokenUpdate) Where(ps ...predicate.OpenAIToken) *OpenAITokenUpdate
Where appends a list predicates to the OpenAITokenUpdate builder.
type OpenAITokenUpdateOne ¶
type OpenAITokenUpdateOne struct {
// contains filtered or unexported fields
}
OpenAITokenUpdateOne is the builder for updating a single OpenAIToken entity.
func (*OpenAITokenUpdateOne) Exec ¶
func (oatuo *OpenAITokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OpenAITokenUpdateOne) ExecX ¶
func (oatuo *OpenAITokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenAITokenUpdateOne) Mutation ¶
func (oatuo *OpenAITokenUpdateOne) Mutation() *OpenAITokenMutation
Mutation returns the OpenAITokenMutation object of the builder.
func (*OpenAITokenUpdateOne) Save ¶
func (oatuo *OpenAITokenUpdateOne) Save(ctx context.Context) (*OpenAIToken, error)
Save executes the query and returns the updated OpenAIToken entity.
func (*OpenAITokenUpdateOne) SaveX ¶
func (oatuo *OpenAITokenUpdateOne) SaveX(ctx context.Context) *OpenAIToken
SaveX is like Save, but panics if an error occurs.
func (*OpenAITokenUpdateOne) Select ¶
func (oatuo *OpenAITokenUpdateOne) Select(field string, fields ...string) *OpenAITokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OpenAITokenUpdateOne) SetIsActive ¶
func (oatuo *OpenAITokenUpdateOne) SetIsActive(b bool) *OpenAITokenUpdateOne
SetIsActive sets the "is_active" field.
func (*OpenAITokenUpdateOne) SetNillableIsActive ¶
func (oatuo *OpenAITokenUpdateOne) SetNillableIsActive(b *bool) *OpenAITokenUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*OpenAITokenUpdateOne) SetToken ¶
func (oatuo *OpenAITokenUpdateOne) SetToken(s string) *OpenAITokenUpdateOne
SetToken sets the "token" field.
func (*OpenAITokenUpdateOne) Where ¶
func (oatuo *OpenAITokenUpdateOne) Where(ps ...predicate.OpenAIToken) *OpenAITokenUpdateOne
Where appends a list predicates to the OpenAITokenUpdate builder.
type OpenAITokens ¶
type OpenAITokens []*OpenAIToken
OpenAITokens is a parsable slice of OpenAIToken.
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 { // ChatConfig is the client for interacting with the ChatConfig builders. ChatConfig *ChatConfigClient // ChatHistory is the client for interacting with the ChatHistory builders. ChatHistory *ChatHistoryClient // OpenAIToken is the client for interacting with the OpenAIToken builders. OpenAIToken *OpenAITokenClient // 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.
Source Files ¶
- chatconfig.go
- chatconfig_create.go
- chatconfig_delete.go
- chatconfig_query.go
- chatconfig_update.go
- chathistory.go
- chathistory_create.go
- chathistory_delete.go
- chathistory_query.go
- chathistory_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- openaitoken.go
- openaitoken_create.go
- openaitoken_delete.go
- openaitoken_query.go
- openaitoken_update.go
- runtime.go
- tx.go