Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type 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 Facet
- type FacetClient
- func (c *FacetClient) Create() *FacetCreate
- func (c *FacetClient) CreateBulk(builders ...*FacetCreate) *FacetCreateBulk
- func (c *FacetClient) Delete() *FacetDelete
- func (c *FacetClient) DeleteOne(_m *Facet) *FacetDeleteOne
- func (c *FacetClient) DeleteOneID(id string) *FacetDeleteOne
- func (c *FacetClient) Get(ctx context.Context, id string) (*Facet, error)
- func (c *FacetClient) GetX(ctx context.Context, id string) *Facet
- func (c *FacetClient) Hooks() []Hook
- func (c *FacetClient) Intercept(interceptors ...Interceptor)
- func (c *FacetClient) Interceptors() []Interceptor
- func (c *FacetClient) MapCreateBulk(slice any, setFunc func(*FacetCreate, int)) *FacetCreateBulk
- func (c *FacetClient) Query() *FacetQuery
- func (c *FacetClient) Update() *FacetUpdate
- func (c *FacetClient) UpdateOne(_m *Facet) *FacetUpdateOne
- func (c *FacetClient) UpdateOneID(id string) *FacetUpdateOne
- func (c *FacetClient) Use(hooks ...Hook)
- type FacetCreate
- func (_c *FacetCreate) Exec(ctx context.Context) error
- func (_c *FacetCreate) ExecX(ctx context.Context)
- func (_c *FacetCreate) Mutation() *FacetMutation
- func (_c *FacetCreate) Save(ctx context.Context) (*Facet, error)
- func (_c *FacetCreate) SaveX(ctx context.Context) *Facet
- func (_c *FacetCreate) SetCreatedAt(v time.Time) *FacetCreate
- func (_c *FacetCreate) SetFacets(v map[string]interface{}) *FacetCreate
- func (_c *FacetCreate) SetID(v string) *FacetCreate
- func (_c *FacetCreate) SetNillableCreatedAt(v *time.Time) *FacetCreate
- func (_c *FacetCreate) SetSessionID(v string) *FacetCreate
- type FacetCreateBulk
- type FacetDelete
- type FacetDeleteOne
- type FacetGroupBy
- func (_g *FacetGroupBy) Aggregate(fns ...AggregateFunc) *FacetGroupBy
- func (s *FacetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FacetGroupBy) BoolX(ctx context.Context) bool
- func (s *FacetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FacetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FacetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FacetGroupBy) Float64X(ctx context.Context) float64
- func (s *FacetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FacetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FacetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FacetGroupBy) IntX(ctx context.Context) int
- func (s *FacetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FacetGroupBy) IntsX(ctx context.Context) []int
- func (_g *FacetGroupBy) Scan(ctx context.Context, v any) error
- func (s *FacetGroupBy) ScanX(ctx context.Context, v any)
- func (s *FacetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FacetGroupBy) StringX(ctx context.Context) string
- func (s *FacetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FacetGroupBy) StringsX(ctx context.Context) []string
- type FacetMutation
- func (m *FacetMutation) AddField(name string, value ent.Value) error
- func (m *FacetMutation) AddedEdges() []string
- func (m *FacetMutation) AddedField(name string) (ent.Value, bool)
- func (m *FacetMutation) AddedFields() []string
- func (m *FacetMutation) AddedIDs(name string) []ent.Value
- func (m *FacetMutation) ClearEdge(name string) error
- func (m *FacetMutation) ClearFacets()
- func (m *FacetMutation) ClearField(name string) error
- func (m *FacetMutation) ClearedEdges() []string
- func (m *FacetMutation) ClearedFields() []string
- func (m FacetMutation) Client() *Client
- func (m *FacetMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FacetMutation) EdgeCleared(name string) bool
- func (m *FacetMutation) Facets() (r map[string]interface{}, exists bool)
- func (m *FacetMutation) FacetsCleared() bool
- func (m *FacetMutation) Field(name string) (ent.Value, bool)
- func (m *FacetMutation) FieldCleared(name string) bool
- func (m *FacetMutation) Fields() []string
- func (m *FacetMutation) ID() (id string, exists bool)
- func (m *FacetMutation) IDs(ctx context.Context) ([]string, error)
- func (m *FacetMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FacetMutation) OldFacets(ctx context.Context) (v map[string]interface{}, err error)
- func (m *FacetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FacetMutation) OldSessionID(ctx context.Context) (v string, err error)
- func (m *FacetMutation) Op() Op
- func (m *FacetMutation) RemovedEdges() []string
- func (m *FacetMutation) RemovedIDs(name string) []ent.Value
- func (m *FacetMutation) ResetCreatedAt()
- func (m *FacetMutation) ResetEdge(name string) error
- func (m *FacetMutation) ResetFacets()
- func (m *FacetMutation) ResetField(name string) error
- func (m *FacetMutation) ResetSessionID()
- func (m *FacetMutation) SessionID() (r string, exists bool)
- func (m *FacetMutation) SetCreatedAt(t time.Time)
- func (m *FacetMutation) SetFacets(value map[string]interface{})
- func (m *FacetMutation) SetField(name string, value ent.Value) error
- func (m *FacetMutation) SetID(id string)
- func (m *FacetMutation) SetOp(op Op)
- func (m *FacetMutation) SetSessionID(s string)
- func (m FacetMutation) Tx() (*Tx, error)
- func (m *FacetMutation) Type() string
- func (m *FacetMutation) Where(ps ...predicate.Facet)
- func (m *FacetMutation) WhereP(ps ...func(*sql.Selector))
- type FacetQuery
- func (_q *FacetQuery) Aggregate(fns ...AggregateFunc) *FacetSelect
- func (_q *FacetQuery) All(ctx context.Context) ([]*Facet, error)
- func (_q *FacetQuery) AllX(ctx context.Context) []*Facet
- func (_q *FacetQuery) Clone() *FacetQuery
- func (_q *FacetQuery) Count(ctx context.Context) (int, error)
- func (_q *FacetQuery) CountX(ctx context.Context) int
- func (_q *FacetQuery) Exist(ctx context.Context) (bool, error)
- func (_q *FacetQuery) ExistX(ctx context.Context) bool
- func (_q *FacetQuery) First(ctx context.Context) (*Facet, error)
- func (_q *FacetQuery) FirstID(ctx context.Context) (id string, err error)
- func (_q *FacetQuery) FirstIDX(ctx context.Context) string
- func (_q *FacetQuery) FirstX(ctx context.Context) *Facet
- func (_q *FacetQuery) GroupBy(field string, fields ...string) *FacetGroupBy
- func (_q *FacetQuery) IDs(ctx context.Context) (ids []string, err error)
- func (_q *FacetQuery) IDsX(ctx context.Context) []string
- func (_q *FacetQuery) Limit(limit int) *FacetQuery
- func (_q *FacetQuery) Offset(offset int) *FacetQuery
- func (_q *FacetQuery) Only(ctx context.Context) (*Facet, error)
- func (_q *FacetQuery) OnlyID(ctx context.Context) (id string, err error)
- func (_q *FacetQuery) OnlyIDX(ctx context.Context) string
- func (_q *FacetQuery) OnlyX(ctx context.Context) *Facet
- func (_q *FacetQuery) Order(o ...facet.OrderOption) *FacetQuery
- func (_q *FacetQuery) Select(fields ...string) *FacetSelect
- func (_q *FacetQuery) Unique(unique bool) *FacetQuery
- func (_q *FacetQuery) Where(ps ...predicate.Facet) *FacetQuery
- type FacetSelect
- func (_s *FacetSelect) Aggregate(fns ...AggregateFunc) *FacetSelect
- func (s *FacetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FacetSelect) BoolX(ctx context.Context) bool
- func (s *FacetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FacetSelect) BoolsX(ctx context.Context) []bool
- func (s *FacetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FacetSelect) Float64X(ctx context.Context) float64
- func (s *FacetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FacetSelect) Float64sX(ctx context.Context) []float64
- func (s *FacetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FacetSelect) IntX(ctx context.Context) int
- func (s *FacetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FacetSelect) IntsX(ctx context.Context) []int
- func (_s *FacetSelect) Scan(ctx context.Context, v any) error
- func (s *FacetSelect) ScanX(ctx context.Context, v any)
- func (s *FacetSelect) String(ctx context.Context) (_ string, err error)
- func (s *FacetSelect) StringX(ctx context.Context) string
- func (s *FacetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FacetSelect) StringsX(ctx context.Context) []string
- type FacetUpdate
- func (_u *FacetUpdate) ClearFacets() *FacetUpdate
- func (_u *FacetUpdate) Exec(ctx context.Context) error
- func (_u *FacetUpdate) ExecX(ctx context.Context)
- func (_u *FacetUpdate) Mutation() *FacetMutation
- func (_u *FacetUpdate) Save(ctx context.Context) (int, error)
- func (_u *FacetUpdate) SaveX(ctx context.Context) int
- func (_u *FacetUpdate) SetFacets(v map[string]interface{}) *FacetUpdate
- func (_u *FacetUpdate) SetNillableSessionID(v *string) *FacetUpdate
- func (_u *FacetUpdate) SetSessionID(v string) *FacetUpdate
- func (_u *FacetUpdate) Where(ps ...predicate.Facet) *FacetUpdate
- type FacetUpdateOne
- func (_u *FacetUpdateOne) ClearFacets() *FacetUpdateOne
- func (_u *FacetUpdateOne) Exec(ctx context.Context) error
- func (_u *FacetUpdateOne) ExecX(ctx context.Context)
- func (_u *FacetUpdateOne) Mutation() *FacetMutation
- func (_u *FacetUpdateOne) Save(ctx context.Context) (*Facet, error)
- func (_u *FacetUpdateOne) SaveX(ctx context.Context) *Facet
- func (_u *FacetUpdateOne) Select(field string, fields ...string) *FacetUpdateOne
- func (_u *FacetUpdateOne) SetFacets(v map[string]interface{}) *FacetUpdateOne
- func (_u *FacetUpdateOne) SetNillableSessionID(v *string) *FacetUpdateOne
- func (_u *FacetUpdateOne) SetSessionID(v string) *FacetUpdateOne
- func (_u *FacetUpdateOne) Where(ps ...predicate.Facet) *FacetUpdateOne
- type Facets
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeClient
- func (c *NodeClient) Create() *NodeCreate
- func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk
- func (c *NodeClient) Delete() *NodeDelete
- func (c *NodeClient) DeleteOne(_m *Node) *NodeDeleteOne
- func (c *NodeClient) DeleteOneID(id string) *NodeDeleteOne
- func (c *NodeClient) Get(ctx context.Context, id string) (*Node, error)
- func (c *NodeClient) GetX(ctx context.Context, id string) *Node
- func (c *NodeClient) Hooks() []Hook
- func (c *NodeClient) Intercept(interceptors ...Interceptor)
- func (c *NodeClient) Interceptors() []Interceptor
- func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk
- func (c *NodeClient) Query() *NodeQuery
- func (c *NodeClient) QueryChildren(_m *Node) *NodeQuery
- func (c *NodeClient) QueryParent(_m *Node) *NodeQuery
- func (c *NodeClient) Update() *NodeUpdate
- func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne
- func (c *NodeClient) UpdateOneID(id string) *NodeUpdateOne
- func (c *NodeClient) Use(hooks ...Hook)
- type NodeCreate
- func (_c *NodeCreate) AddChildIDs(ids ...string) *NodeCreate
- func (_c *NodeCreate) AddChildren(v ...*Node) *NodeCreate
- func (_c *NodeCreate) Exec(ctx context.Context) error
- func (_c *NodeCreate) ExecX(ctx context.Context)
- func (_c *NodeCreate) Mutation() *NodeMutation
- func (_c *NodeCreate) Save(ctx context.Context) (*Node, error)
- func (_c *NodeCreate) SaveX(ctx context.Context) *Node
- func (_c *NodeCreate) SetAgentName(v string) *NodeCreate
- func (_c *NodeCreate) SetBucket(v map[string]interface{}) *NodeCreate
- func (_c *NodeCreate) SetCacheCreationInputTokens(v int) *NodeCreate
- func (_c *NodeCreate) SetCacheReadInputTokens(v int) *NodeCreate
- func (_c *NodeCreate) SetCompletionTokens(v int) *NodeCreate
- func (_c *NodeCreate) SetContent(v []map[string]interface{}) *NodeCreate
- func (_c *NodeCreate) SetCreatedAt(v time.Time) *NodeCreate
- func (_c *NodeCreate) SetID(v string) *NodeCreate
- func (_c *NodeCreate) SetModel(v string) *NodeCreate
- func (_c *NodeCreate) SetNillableAgentName(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableCacheCreationInputTokens(v *int) *NodeCreate
- func (_c *NodeCreate) SetNillableCacheReadInputTokens(v *int) *NodeCreate
- func (_c *NodeCreate) SetNillableCompletionTokens(v *int) *NodeCreate
- func (_c *NodeCreate) SetNillableCreatedAt(v *time.Time) *NodeCreate
- func (_c *NodeCreate) SetNillableModel(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableParentHash(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableParentID(id *string) *NodeCreate
- func (_c *NodeCreate) SetNillableProject(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillablePromptDurationNs(v *int64) *NodeCreate
- func (_c *NodeCreate) SetNillablePromptTokens(v *int) *NodeCreate
- func (_c *NodeCreate) SetNillableProvider(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableRole(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableStopReason(v *string) *NodeCreate
- func (_c *NodeCreate) SetNillableTotalDurationNs(v *int64) *NodeCreate
- func (_c *NodeCreate) SetNillableTotalTokens(v *int) *NodeCreate
- func (_c *NodeCreate) SetNillableType(v *string) *NodeCreate
- func (_c *NodeCreate) SetParent(v *Node) *NodeCreate
- func (_c *NodeCreate) SetParentHash(v string) *NodeCreate
- func (_c *NodeCreate) SetParentID(id string) *NodeCreate
- func (_c *NodeCreate) SetProject(v string) *NodeCreate
- func (_c *NodeCreate) SetPromptDurationNs(v int64) *NodeCreate
- func (_c *NodeCreate) SetPromptTokens(v int) *NodeCreate
- func (_c *NodeCreate) SetProvider(v string) *NodeCreate
- func (_c *NodeCreate) SetRole(v string) *NodeCreate
- func (_c *NodeCreate) SetStopReason(v string) *NodeCreate
- func (_c *NodeCreate) SetTotalDurationNs(v int64) *NodeCreate
- func (_c *NodeCreate) SetTotalTokens(v int) *NodeCreate
- func (_c *NodeCreate) SetType(v string) *NodeCreate
- type NodeCreateBulk
- type NodeDelete
- type NodeDeleteOne
- type NodeEdges
- type NodeGroupBy
- func (_g *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy
- func (s *NodeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeGroupBy) BoolX(ctx context.Context) bool
- func (s *NodeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NodeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeGroupBy) Float64X(ctx context.Context) float64
- func (s *NodeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NodeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NodeGroupBy) IntX(ctx context.Context) int
- func (s *NodeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NodeGroupBy) IntsX(ctx context.Context) []int
- func (_g *NodeGroupBy) Scan(ctx context.Context, v any) error
- func (s *NodeGroupBy) ScanX(ctx context.Context, v any)
- func (s *NodeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NodeGroupBy) StringX(ctx context.Context) string
- func (s *NodeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NodeGroupBy) StringsX(ctx context.Context) []string
- type NodeMutation
- func (m *NodeMutation) AddCacheCreationInputTokens(i int)
- func (m *NodeMutation) AddCacheReadInputTokens(i int)
- func (m *NodeMutation) AddChildIDs(ids ...string)
- func (m *NodeMutation) AddCompletionTokens(i int)
- func (m *NodeMutation) AddField(name string, value ent.Value) error
- func (m *NodeMutation) AddPromptDurationNs(i int64)
- func (m *NodeMutation) AddPromptTokens(i int)
- func (m *NodeMutation) AddTotalDurationNs(i int64)
- func (m *NodeMutation) AddTotalTokens(i int)
- func (m *NodeMutation) AddedCacheCreationInputTokens() (r int, exists bool)
- func (m *NodeMutation) AddedCacheReadInputTokens() (r int, exists bool)
- func (m *NodeMutation) AddedCompletionTokens() (r int, exists bool)
- func (m *NodeMutation) AddedEdges() []string
- func (m *NodeMutation) AddedField(name string) (ent.Value, bool)
- func (m *NodeMutation) AddedFields() []string
- func (m *NodeMutation) AddedIDs(name string) []ent.Value
- func (m *NodeMutation) AddedPromptDurationNs() (r int64, exists bool)
- func (m *NodeMutation) AddedPromptTokens() (r int, exists bool)
- func (m *NodeMutation) AddedTotalDurationNs() (r int64, exists bool)
- func (m *NodeMutation) AddedTotalTokens() (r int, exists bool)
- func (m *NodeMutation) AgentName() (r string, exists bool)
- func (m *NodeMutation) AgentNameCleared() bool
- func (m *NodeMutation) AppendContent(value []map[string]interface{})
- func (m *NodeMutation) AppendedContent() ([]map[string]interface{}, bool)
- func (m *NodeMutation) Bucket() (r map[string]interface{}, exists bool)
- func (m *NodeMutation) BucketCleared() bool
- func (m *NodeMutation) CacheCreationInputTokens() (r int, exists bool)
- func (m *NodeMutation) CacheCreationInputTokensCleared() bool
- func (m *NodeMutation) CacheReadInputTokens() (r int, exists bool)
- func (m *NodeMutation) CacheReadInputTokensCleared() bool
- func (m *NodeMutation) ChildrenCleared() bool
- func (m *NodeMutation) ChildrenIDs() (ids []string)
- func (m *NodeMutation) ClearAgentName()
- func (m *NodeMutation) ClearBucket()
- func (m *NodeMutation) ClearCacheCreationInputTokens()
- func (m *NodeMutation) ClearCacheReadInputTokens()
- func (m *NodeMutation) ClearChildren()
- func (m *NodeMutation) ClearCompletionTokens()
- func (m *NodeMutation) ClearContent()
- func (m *NodeMutation) ClearEdge(name string) error
- func (m *NodeMutation) ClearField(name string) error
- func (m *NodeMutation) ClearModel()
- func (m *NodeMutation) ClearParent()
- func (m *NodeMutation) ClearParentHash()
- func (m *NodeMutation) ClearProject()
- func (m *NodeMutation) ClearPromptDurationNs()
- func (m *NodeMutation) ClearPromptTokens()
- func (m *NodeMutation) ClearProvider()
- func (m *NodeMutation) ClearRole()
- func (m *NodeMutation) ClearStopReason()
- func (m *NodeMutation) ClearTotalDurationNs()
- func (m *NodeMutation) ClearTotalTokens()
- func (m *NodeMutation) ClearType()
- func (m *NodeMutation) ClearedEdges() []string
- func (m *NodeMutation) ClearedFields() []string
- func (m NodeMutation) Client() *Client
- func (m *NodeMutation) CompletionTokens() (r int, exists bool)
- func (m *NodeMutation) CompletionTokensCleared() bool
- func (m *NodeMutation) Content() (r []map[string]interface{}, exists bool)
- func (m *NodeMutation) ContentCleared() bool
- func (m *NodeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NodeMutation) EdgeCleared(name string) bool
- func (m *NodeMutation) Field(name string) (ent.Value, bool)
- func (m *NodeMutation) FieldCleared(name string) bool
- func (m *NodeMutation) Fields() []string
- func (m *NodeMutation) GetType() (r string, exists bool)
- func (m *NodeMutation) ID() (id string, exists bool)
- func (m *NodeMutation) IDs(ctx context.Context) ([]string, error)
- func (m *NodeMutation) Model() (r string, exists bool)
- func (m *NodeMutation) ModelCleared() bool
- func (m *NodeMutation) OldAgentName(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldBucket(ctx context.Context) (v map[string]interface{}, err error)
- func (m *NodeMutation) OldCacheCreationInputTokens(ctx context.Context) (v *int, err error)
- func (m *NodeMutation) OldCacheReadInputTokens(ctx context.Context) (v *int, err error)
- func (m *NodeMutation) OldCompletionTokens(ctx context.Context) (v *int, err error)
- func (m *NodeMutation) OldContent(ctx context.Context) (v []map[string]interface{}, err error)
- func (m *NodeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NodeMutation) OldModel(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldParentHash(ctx context.Context) (v *string, err error)
- func (m *NodeMutation) OldProject(ctx context.Context) (v *string, err error)
- func (m *NodeMutation) OldPromptDurationNs(ctx context.Context) (v *int64, err error)
- func (m *NodeMutation) OldPromptTokens(ctx context.Context) (v *int, err error)
- func (m *NodeMutation) OldProvider(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldRole(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldStopReason(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldTotalDurationNs(ctx context.Context) (v *int64, err error)
- func (m *NodeMutation) OldTotalTokens(ctx context.Context) (v *int, err error)
- func (m *NodeMutation) OldType(ctx context.Context) (v string, err error)
- func (m *NodeMutation) Op() Op
- func (m *NodeMutation) ParentCleared() bool
- func (m *NodeMutation) ParentHash() (r string, exists bool)
- func (m *NodeMutation) ParentHashCleared() bool
- func (m *NodeMutation) ParentID() (id string, exists bool)
- func (m *NodeMutation) ParentIDs() (ids []string)
- func (m *NodeMutation) Project() (r string, exists bool)
- func (m *NodeMutation) ProjectCleared() bool
- func (m *NodeMutation) PromptDurationNs() (r int64, exists bool)
- func (m *NodeMutation) PromptDurationNsCleared() bool
- func (m *NodeMutation) PromptTokens() (r int, exists bool)
- func (m *NodeMutation) PromptTokensCleared() bool
- func (m *NodeMutation) Provider() (r string, exists bool)
- func (m *NodeMutation) ProviderCleared() bool
- func (m *NodeMutation) RemoveChildIDs(ids ...string)
- func (m *NodeMutation) RemovedChildrenIDs() (ids []string)
- func (m *NodeMutation) RemovedEdges() []string
- func (m *NodeMutation) RemovedIDs(name string) []ent.Value
- func (m *NodeMutation) ResetAgentName()
- func (m *NodeMutation) ResetBucket()
- func (m *NodeMutation) ResetCacheCreationInputTokens()
- func (m *NodeMutation) ResetCacheReadInputTokens()
- func (m *NodeMutation) ResetChildren()
- func (m *NodeMutation) ResetCompletionTokens()
- func (m *NodeMutation) ResetContent()
- func (m *NodeMutation) ResetCreatedAt()
- func (m *NodeMutation) ResetEdge(name string) error
- func (m *NodeMutation) ResetField(name string) error
- func (m *NodeMutation) ResetModel()
- func (m *NodeMutation) ResetParent()
- func (m *NodeMutation) ResetParentHash()
- func (m *NodeMutation) ResetProject()
- func (m *NodeMutation) ResetPromptDurationNs()
- func (m *NodeMutation) ResetPromptTokens()
- func (m *NodeMutation) ResetProvider()
- func (m *NodeMutation) ResetRole()
- func (m *NodeMutation) ResetStopReason()
- func (m *NodeMutation) ResetTotalDurationNs()
- func (m *NodeMutation) ResetTotalTokens()
- func (m *NodeMutation) ResetType()
- func (m *NodeMutation) Role() (r string, exists bool)
- func (m *NodeMutation) RoleCleared() bool
- func (m *NodeMutation) SetAgentName(s string)
- func (m *NodeMutation) SetBucket(value map[string]interface{})
- func (m *NodeMutation) SetCacheCreationInputTokens(i int)
- func (m *NodeMutation) SetCacheReadInputTokens(i int)
- func (m *NodeMutation) SetCompletionTokens(i int)
- func (m *NodeMutation) SetContent(value []map[string]interface{})
- func (m *NodeMutation) SetCreatedAt(t time.Time)
- func (m *NodeMutation) SetField(name string, value ent.Value) error
- func (m *NodeMutation) SetID(id string)
- func (m *NodeMutation) SetModel(s string)
- func (m *NodeMutation) SetOp(op Op)
- func (m *NodeMutation) SetParentHash(s string)
- func (m *NodeMutation) SetParentID(id string)
- func (m *NodeMutation) SetProject(s string)
- func (m *NodeMutation) SetPromptDurationNs(i int64)
- func (m *NodeMutation) SetPromptTokens(i int)
- func (m *NodeMutation) SetProvider(s string)
- func (m *NodeMutation) SetRole(s string)
- func (m *NodeMutation) SetStopReason(s string)
- func (m *NodeMutation) SetTotalDurationNs(i int64)
- func (m *NodeMutation) SetTotalTokens(i int)
- func (m *NodeMutation) SetType(s string)
- func (m *NodeMutation) StopReason() (r string, exists bool)
- func (m *NodeMutation) StopReasonCleared() bool
- func (m *NodeMutation) TotalDurationNs() (r int64, exists bool)
- func (m *NodeMutation) TotalDurationNsCleared() bool
- func (m *NodeMutation) TotalTokens() (r int, exists bool)
- func (m *NodeMutation) TotalTokensCleared() bool
- func (m NodeMutation) Tx() (*Tx, error)
- func (m *NodeMutation) Type() string
- func (m *NodeMutation) TypeCleared() bool
- func (m *NodeMutation) Where(ps ...predicate.Node)
- func (m *NodeMutation) WhereP(ps ...func(*sql.Selector))
- type NodeQuery
- func (_q *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect
- func (_q *NodeQuery) All(ctx context.Context) ([]*Node, error)
- func (_q *NodeQuery) AllX(ctx context.Context) []*Node
- func (_q *NodeQuery) Clone() *NodeQuery
- func (_q *NodeQuery) Count(ctx context.Context) (int, error)
- func (_q *NodeQuery) CountX(ctx context.Context) int
- func (_q *NodeQuery) Exist(ctx context.Context) (bool, error)
- func (_q *NodeQuery) ExistX(ctx context.Context) bool
- func (_q *NodeQuery) First(ctx context.Context) (*Node, error)
- func (_q *NodeQuery) FirstID(ctx context.Context) (id string, err error)
- func (_q *NodeQuery) FirstIDX(ctx context.Context) string
- func (_q *NodeQuery) FirstX(ctx context.Context) *Node
- func (_q *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy
- func (_q *NodeQuery) IDs(ctx context.Context) (ids []string, err error)
- func (_q *NodeQuery) IDsX(ctx context.Context) []string
- func (_q *NodeQuery) Limit(limit int) *NodeQuery
- func (_q *NodeQuery) Offset(offset int) *NodeQuery
- func (_q *NodeQuery) Only(ctx context.Context) (*Node, error)
- func (_q *NodeQuery) OnlyID(ctx context.Context) (id string, err error)
- func (_q *NodeQuery) OnlyIDX(ctx context.Context) string
- func (_q *NodeQuery) OnlyX(ctx context.Context) *Node
- func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery
- func (_q *NodeQuery) QueryChildren() *NodeQuery
- func (_q *NodeQuery) QueryParent() *NodeQuery
- func (_q *NodeQuery) Select(fields ...string) *NodeSelect
- func (_q *NodeQuery) Unique(unique bool) *NodeQuery
- func (_q *NodeQuery) Where(ps ...predicate.Node) *NodeQuery
- func (_q *NodeQuery) WithChildren(opts ...func(*NodeQuery)) *NodeQuery
- func (_q *NodeQuery) WithParent(opts ...func(*NodeQuery)) *NodeQuery
- type NodeSelect
- func (_s *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect
- func (s *NodeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeSelect) BoolX(ctx context.Context) bool
- func (s *NodeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeSelect) BoolsX(ctx context.Context) []bool
- func (s *NodeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeSelect) Float64X(ctx context.Context) float64
- func (s *NodeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeSelect) Float64sX(ctx context.Context) []float64
- func (s *NodeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NodeSelect) IntX(ctx context.Context) int
- func (s *NodeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NodeSelect) IntsX(ctx context.Context) []int
- func (_s *NodeSelect) Scan(ctx context.Context, v any) error
- func (s *NodeSelect) ScanX(ctx context.Context, v any)
- func (s *NodeSelect) String(ctx context.Context) (_ string, err error)
- func (s *NodeSelect) StringX(ctx context.Context) string
- func (s *NodeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NodeSelect) StringsX(ctx context.Context) []string
- type NodeUpdate
- func (_u *NodeUpdate) AddCacheCreationInputTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) AddCacheReadInputTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) AddChildIDs(ids ...string) *NodeUpdate
- func (_u *NodeUpdate) AddChildren(v ...*Node) *NodeUpdate
- func (_u *NodeUpdate) AddCompletionTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) AddPromptDurationNs(v int64) *NodeUpdate
- func (_u *NodeUpdate) AddPromptTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) AddTotalDurationNs(v int64) *NodeUpdate
- func (_u *NodeUpdate) AddTotalTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) AppendContent(v []map[string]interface{}) *NodeUpdate
- func (_u *NodeUpdate) ClearAgentName() *NodeUpdate
- func (_u *NodeUpdate) ClearBucket() *NodeUpdate
- func (_u *NodeUpdate) ClearCacheCreationInputTokens() *NodeUpdate
- func (_u *NodeUpdate) ClearCacheReadInputTokens() *NodeUpdate
- func (_u *NodeUpdate) ClearChildren() *NodeUpdate
- func (_u *NodeUpdate) ClearCompletionTokens() *NodeUpdate
- func (_u *NodeUpdate) ClearContent() *NodeUpdate
- func (_u *NodeUpdate) ClearModel() *NodeUpdate
- func (_u *NodeUpdate) ClearParent() *NodeUpdate
- func (_u *NodeUpdate) ClearParentHash() *NodeUpdate
- func (_u *NodeUpdate) ClearProject() *NodeUpdate
- func (_u *NodeUpdate) ClearPromptDurationNs() *NodeUpdate
- func (_u *NodeUpdate) ClearPromptTokens() *NodeUpdate
- func (_u *NodeUpdate) ClearProvider() *NodeUpdate
- func (_u *NodeUpdate) ClearRole() *NodeUpdate
- func (_u *NodeUpdate) ClearStopReason() *NodeUpdate
- func (_u *NodeUpdate) ClearTotalDurationNs() *NodeUpdate
- func (_u *NodeUpdate) ClearTotalTokens() *NodeUpdate
- func (_u *NodeUpdate) ClearType() *NodeUpdate
- func (_u *NodeUpdate) Exec(ctx context.Context) error
- func (_u *NodeUpdate) ExecX(ctx context.Context)
- func (_u *NodeUpdate) Mutation() *NodeMutation
- func (_u *NodeUpdate) RemoveChildIDs(ids ...string) *NodeUpdate
- func (_u *NodeUpdate) RemoveChildren(v ...*Node) *NodeUpdate
- func (_u *NodeUpdate) Save(ctx context.Context) (int, error)
- func (_u *NodeUpdate) SaveX(ctx context.Context) int
- func (_u *NodeUpdate) SetAgentName(v string) *NodeUpdate
- func (_u *NodeUpdate) SetBucket(v map[string]interface{}) *NodeUpdate
- func (_u *NodeUpdate) SetCacheCreationInputTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) SetCacheReadInputTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) SetCompletionTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) SetContent(v []map[string]interface{}) *NodeUpdate
- func (_u *NodeUpdate) SetModel(v string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableAgentName(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableCacheCreationInputTokens(v *int) *NodeUpdate
- func (_u *NodeUpdate) SetNillableCacheReadInputTokens(v *int) *NodeUpdate
- func (_u *NodeUpdate) SetNillableCompletionTokens(v *int) *NodeUpdate
- func (_u *NodeUpdate) SetNillableModel(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableParentHash(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableParentID(id *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableProject(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillablePromptDurationNs(v *int64) *NodeUpdate
- func (_u *NodeUpdate) SetNillablePromptTokens(v *int) *NodeUpdate
- func (_u *NodeUpdate) SetNillableProvider(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableRole(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableStopReason(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetNillableTotalDurationNs(v *int64) *NodeUpdate
- func (_u *NodeUpdate) SetNillableTotalTokens(v *int) *NodeUpdate
- func (_u *NodeUpdate) SetNillableType(v *string) *NodeUpdate
- func (_u *NodeUpdate) SetParent(v *Node) *NodeUpdate
- func (_u *NodeUpdate) SetParentHash(v string) *NodeUpdate
- func (_u *NodeUpdate) SetParentID(id string) *NodeUpdate
- func (_u *NodeUpdate) SetProject(v string) *NodeUpdate
- func (_u *NodeUpdate) SetPromptDurationNs(v int64) *NodeUpdate
- func (_u *NodeUpdate) SetPromptTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) SetProvider(v string) *NodeUpdate
- func (_u *NodeUpdate) SetRole(v string) *NodeUpdate
- func (_u *NodeUpdate) SetStopReason(v string) *NodeUpdate
- func (_u *NodeUpdate) SetTotalDurationNs(v int64) *NodeUpdate
- func (_u *NodeUpdate) SetTotalTokens(v int) *NodeUpdate
- func (_u *NodeUpdate) SetType(v string) *NodeUpdate
- func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
- type NodeUpdateOne
- func (_u *NodeUpdateOne) AddCacheCreationInputTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddCacheReadInputTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddChildIDs(ids ...string) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddChildren(v ...*Node) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddCompletionTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddPromptDurationNs(v int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddPromptTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddTotalDurationNs(v int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) AddTotalTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) AppendContent(v []map[string]interface{}) *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearAgentName() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearBucket() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearCacheCreationInputTokens() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearCacheReadInputTokens() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearChildren() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearCompletionTokens() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearContent() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearModel() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearParent() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearParentHash() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearProject() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearPromptDurationNs() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearPromptTokens() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearProvider() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearRole() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearStopReason() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearTotalDurationNs() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearTotalTokens() *NodeUpdateOne
- func (_u *NodeUpdateOne) ClearType() *NodeUpdateOne
- func (_u *NodeUpdateOne) Exec(ctx context.Context) error
- func (_u *NodeUpdateOne) ExecX(ctx context.Context)
- func (_u *NodeUpdateOne) Mutation() *NodeMutation
- func (_u *NodeUpdateOne) RemoveChildIDs(ids ...string) *NodeUpdateOne
- func (_u *NodeUpdateOne) RemoveChildren(v ...*Node) *NodeUpdateOne
- func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)
- func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node
- func (_u *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetAgentName(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetBucket(v map[string]interface{}) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetCacheCreationInputTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetCacheReadInputTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetCompletionTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetContent(v []map[string]interface{}) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetModel(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableAgentName(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableCacheCreationInputTokens(v *int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableCacheReadInputTokens(v *int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableCompletionTokens(v *int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableModel(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableParentHash(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableParentID(id *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableProject(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillablePromptDurationNs(v *int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillablePromptTokens(v *int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableProvider(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableRole(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableStopReason(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableTotalDurationNs(v *int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableTotalTokens(v *int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetNillableType(v *string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetParent(v *Node) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetParentHash(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetParentID(id string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetProject(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetPromptDurationNs(v int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetPromptTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetProvider(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetRole(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetStopReason(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetTotalDurationNs(v int64) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetTotalTokens(v int) *NodeUpdateOne
- func (_u *NodeUpdateOne) SetType(v string) *NodeUpdateOne
- func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne
- type Nodes
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeFacet = "Facet" TypeNode = "Node" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// Facet is the client for interacting with the Facet builders.
Facet *FacetClient
// Node is the client for interacting with the Node builders.
Node *NodeClient
// 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(). Facet. 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 Facet ¶
type Facet struct {
// ID of the ent.
ID string `json:"id,omitempty"`
// SessionID holds the value of the "session_id" field.
SessionID string `json:"session_id,omitempty"`
// Facets holds the value of the "facets" field.
Facets map[string]interface{} `json:"facets,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// contains filtered or unexported fields
}
Facet is the model entity for the Facet schema.
func (*Facet) Unwrap ¶
Unwrap unwraps the Facet 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 (*Facet) Update ¶
func (_m *Facet) Update() *FacetUpdateOne
Update returns a builder for updating this Facet. Note that you need to call Facet.Unwrap() before calling this method if this Facet was returned from a transaction, and the transaction was committed or rolled back.
type FacetClient ¶
type FacetClient struct {
// contains filtered or unexported fields
}
FacetClient is a client for the Facet schema.
func NewFacetClient ¶
func NewFacetClient(c config) *FacetClient
NewFacetClient returns a client for the Facet from the given config.
func (*FacetClient) Create ¶
func (c *FacetClient) Create() *FacetCreate
Create returns a builder for creating a Facet entity.
func (*FacetClient) CreateBulk ¶
func (c *FacetClient) CreateBulk(builders ...*FacetCreate) *FacetCreateBulk
CreateBulk returns a builder for creating a bulk of Facet entities.
func (*FacetClient) Delete ¶
func (c *FacetClient) Delete() *FacetDelete
Delete returns a delete builder for Facet.
func (*FacetClient) DeleteOne ¶
func (c *FacetClient) DeleteOne(_m *Facet) *FacetDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FacetClient) DeleteOneID ¶
func (c *FacetClient) DeleteOneID(id string) *FacetDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FacetClient) GetX ¶
func (c *FacetClient) GetX(ctx context.Context, id string) *Facet
GetX is like Get, but panics if an error occurs.
func (*FacetClient) Intercept ¶
func (c *FacetClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `facet.Intercept(f(g(h())))`.
func (*FacetClient) Interceptors ¶
func (c *FacetClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FacetClient) MapCreateBulk ¶
func (c *FacetClient) MapCreateBulk(slice any, setFunc func(*FacetCreate, int)) *FacetCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*FacetClient) Query ¶
func (c *FacetClient) Query() *FacetQuery
Query returns a query builder for Facet.
func (*FacetClient) Update ¶
func (c *FacetClient) Update() *FacetUpdate
Update returns an update builder for Facet.
func (*FacetClient) UpdateOne ¶
func (c *FacetClient) UpdateOne(_m *Facet) *FacetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FacetClient) UpdateOneID ¶
func (c *FacetClient) UpdateOneID(id string) *FacetUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FacetClient) Use ¶
func (c *FacetClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `facet.Hooks(f(g(h())))`.
type FacetCreate ¶
type FacetCreate struct {
// contains filtered or unexported fields
}
FacetCreate is the builder for creating a Facet entity.
func (*FacetCreate) Exec ¶
func (_c *FacetCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FacetCreate) ExecX ¶
func (_c *FacetCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FacetCreate) Mutation ¶
func (_c *FacetCreate) Mutation() *FacetMutation
Mutation returns the FacetMutation object of the builder.
func (*FacetCreate) Save ¶
func (_c *FacetCreate) Save(ctx context.Context) (*Facet, error)
Save creates the Facet in the database.
func (*FacetCreate) SaveX ¶
func (_c *FacetCreate) SaveX(ctx context.Context) *Facet
SaveX calls Save and panics if Save returns an error.
func (*FacetCreate) SetCreatedAt ¶
func (_c *FacetCreate) SetCreatedAt(v time.Time) *FacetCreate
SetCreatedAt sets the "created_at" field.
func (*FacetCreate) SetFacets ¶
func (_c *FacetCreate) SetFacets(v map[string]interface{}) *FacetCreate
SetFacets sets the "facets" field.
func (*FacetCreate) SetID ¶
func (_c *FacetCreate) SetID(v string) *FacetCreate
SetID sets the "id" field.
func (*FacetCreate) SetNillableCreatedAt ¶
func (_c *FacetCreate) SetNillableCreatedAt(v *time.Time) *FacetCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FacetCreate) SetSessionID ¶
func (_c *FacetCreate) SetSessionID(v string) *FacetCreate
SetSessionID sets the "session_id" field.
type FacetCreateBulk ¶
type FacetCreateBulk struct {
// contains filtered or unexported fields
}
FacetCreateBulk is the builder for creating many Facet entities in bulk.
func (*FacetCreateBulk) Exec ¶
func (_c *FacetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FacetCreateBulk) ExecX ¶
func (_c *FacetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FacetDelete ¶
type FacetDelete struct {
// contains filtered or unexported fields
}
FacetDelete is the builder for deleting a Facet entity.
func (*FacetDelete) Exec ¶
func (_d *FacetDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FacetDelete) ExecX ¶
func (_d *FacetDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FacetDelete) Where ¶
func (_d *FacetDelete) Where(ps ...predicate.Facet) *FacetDelete
Where appends a list predicates to the FacetDelete builder.
type FacetDeleteOne ¶
type FacetDeleteOne struct {
// contains filtered or unexported fields
}
FacetDeleteOne is the builder for deleting a single Facet entity.
func (*FacetDeleteOne) Exec ¶
func (_d *FacetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FacetDeleteOne) ExecX ¶
func (_d *FacetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FacetDeleteOne) Where ¶
func (_d *FacetDeleteOne) Where(ps ...predicate.Facet) *FacetDeleteOne
Where appends a list predicates to the FacetDelete builder.
type FacetGroupBy ¶
type FacetGroupBy struct {
// contains filtered or unexported fields
}
FacetGroupBy is the group-by builder for Facet entities.
func (*FacetGroupBy) Aggregate ¶
func (_g *FacetGroupBy) Aggregate(fns ...AggregateFunc) *FacetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FacetGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FacetGroupBy) Scan ¶
func (_g *FacetGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FacetGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FacetMutation ¶
type FacetMutation struct {
// contains filtered or unexported fields
}
FacetMutation represents an operation that mutates the Facet nodes in the graph.
func (*FacetMutation) AddField ¶
func (m *FacetMutation) 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 (*FacetMutation) AddedEdges ¶
func (m *FacetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FacetMutation) AddedField ¶
func (m *FacetMutation) 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 (*FacetMutation) AddedFields ¶
func (m *FacetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FacetMutation) AddedIDs ¶
func (m *FacetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FacetMutation) ClearEdge ¶
func (m *FacetMutation) 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 (*FacetMutation) ClearFacets ¶
func (m *FacetMutation) ClearFacets()
ClearFacets clears the value of the "facets" field.
func (*FacetMutation) ClearField ¶
func (m *FacetMutation) 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 (*FacetMutation) ClearedEdges ¶
func (m *FacetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FacetMutation) ClearedFields ¶
func (m *FacetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FacetMutation) Client ¶
func (m FacetMutation) 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 (*FacetMutation) CreatedAt ¶
func (m *FacetMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*FacetMutation) EdgeCleared ¶
func (m *FacetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FacetMutation) Facets ¶
func (m *FacetMutation) Facets() (r map[string]interface{}, exists bool)
Facets returns the value of the "facets" field in the mutation.
func (*FacetMutation) FacetsCleared ¶
func (m *FacetMutation) FacetsCleared() bool
FacetsCleared returns if the "facets" field was cleared in this mutation.
func (*FacetMutation) Field ¶
func (m *FacetMutation) 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 (*FacetMutation) FieldCleared ¶
func (m *FacetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FacetMutation) Fields ¶
func (m *FacetMutation) 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 (*FacetMutation) ID ¶
func (m *FacetMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*FacetMutation) IDs ¶
func (m *FacetMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FacetMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Facet entity. If the Facet 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 (*FacetMutation) OldFacets ¶
func (m *FacetMutation) OldFacets(ctx context.Context) (v map[string]interface{}, err error)
OldFacets returns the old "facets" field's value of the Facet entity. If the Facet 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 (*FacetMutation) 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 (*FacetMutation) OldSessionID ¶
func (m *FacetMutation) OldSessionID(ctx context.Context) (v string, err error)
OldSessionID returns the old "session_id" field's value of the Facet entity. If the Facet 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 (*FacetMutation) RemovedEdges ¶
func (m *FacetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FacetMutation) RemovedIDs ¶
func (m *FacetMutation) 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 (*FacetMutation) ResetCreatedAt ¶
func (m *FacetMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*FacetMutation) ResetEdge ¶
func (m *FacetMutation) 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 (*FacetMutation) ResetFacets ¶
func (m *FacetMutation) ResetFacets()
ResetFacets resets all changes to the "facets" field.
func (*FacetMutation) ResetField ¶
func (m *FacetMutation) 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 (*FacetMutation) ResetSessionID ¶
func (m *FacetMutation) ResetSessionID()
ResetSessionID resets all changes to the "session_id" field.
func (*FacetMutation) SessionID ¶
func (m *FacetMutation) SessionID() (r string, exists bool)
SessionID returns the value of the "session_id" field in the mutation.
func (*FacetMutation) SetCreatedAt ¶
func (m *FacetMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*FacetMutation) SetFacets ¶
func (m *FacetMutation) SetFacets(value map[string]interface{})
SetFacets sets the "facets" field.
func (*FacetMutation) SetField ¶
func (m *FacetMutation) 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 (*FacetMutation) SetID ¶
func (m *FacetMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Facet entities.
func (*FacetMutation) SetOp ¶
func (m *FacetMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FacetMutation) SetSessionID ¶
func (m *FacetMutation) SetSessionID(s string)
SetSessionID sets the "session_id" field.
func (FacetMutation) Tx ¶
func (m FacetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FacetMutation) Type ¶
func (m *FacetMutation) Type() string
Type returns the node type of this mutation (Facet).
func (*FacetMutation) Where ¶
func (m *FacetMutation) Where(ps ...predicate.Facet)
Where appends a list predicates to the FacetMutation builder.
func (*FacetMutation) WhereP ¶
func (m *FacetMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FacetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FacetQuery ¶
type FacetQuery struct {
// contains filtered or unexported fields
}
FacetQuery is the builder for querying Facet entities.
func (*FacetQuery) Aggregate ¶
func (_q *FacetQuery) Aggregate(fns ...AggregateFunc) *FacetSelect
Aggregate returns a FacetSelect configured with the given aggregations.
func (*FacetQuery) All ¶
func (_q *FacetQuery) All(ctx context.Context) ([]*Facet, error)
All executes the query and returns a list of Facets.
func (*FacetQuery) AllX ¶
func (_q *FacetQuery) AllX(ctx context.Context) []*Facet
AllX is like All, but panics if an error occurs.
func (*FacetQuery) Clone ¶
func (_q *FacetQuery) Clone() *FacetQuery
Clone returns a duplicate of the FacetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FacetQuery) Count ¶
func (_q *FacetQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FacetQuery) CountX ¶
func (_q *FacetQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FacetQuery) Exist ¶
func (_q *FacetQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FacetQuery) ExistX ¶
func (_q *FacetQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FacetQuery) First ¶
func (_q *FacetQuery) First(ctx context.Context) (*Facet, error)
First returns the first Facet entity from the query. Returns a *NotFoundError when no Facet was found.
func (*FacetQuery) FirstID ¶
func (_q *FacetQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Facet ID from the query. Returns a *NotFoundError when no Facet ID was found.
func (*FacetQuery) FirstIDX ¶
func (_q *FacetQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*FacetQuery) FirstX ¶
func (_q *FacetQuery) FirstX(ctx context.Context) *Facet
FirstX is like First, but panics if an error occurs.
func (*FacetQuery) GroupBy ¶
func (_q *FacetQuery) GroupBy(field string, fields ...string) *FacetGroupBy
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 {
SessionID string `json:"session_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Facet.Query().
GroupBy(facet.FieldSessionID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*FacetQuery) IDs ¶
func (_q *FacetQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Facet IDs.
func (*FacetQuery) IDsX ¶
func (_q *FacetQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*FacetQuery) Limit ¶
func (_q *FacetQuery) Limit(limit int) *FacetQuery
Limit the number of records to be returned by this query.
func (*FacetQuery) Offset ¶
func (_q *FacetQuery) Offset(offset int) *FacetQuery
Offset to start from.
func (*FacetQuery) Only ¶
func (_q *FacetQuery) Only(ctx context.Context) (*Facet, error)
Only returns a single Facet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Facet entity is found. Returns a *NotFoundError when no Facet entities are found.
func (*FacetQuery) OnlyID ¶
func (_q *FacetQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Facet ID in the query. Returns a *NotSingularError when more than one Facet ID is found. Returns a *NotFoundError when no entities are found.
func (*FacetQuery) OnlyIDX ¶
func (_q *FacetQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FacetQuery) OnlyX ¶
func (_q *FacetQuery) OnlyX(ctx context.Context) *Facet
OnlyX is like Only, but panics if an error occurs.
func (*FacetQuery) Order ¶
func (_q *FacetQuery) Order(o ...facet.OrderOption) *FacetQuery
Order specifies how the records should be ordered.
func (*FacetQuery) Select ¶
func (_q *FacetQuery) Select(fields ...string) *FacetSelect
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 {
SessionID string `json:"session_id,omitempty"`
}
client.Facet.Query().
Select(facet.FieldSessionID).
Scan(ctx, &v)
func (*FacetQuery) Unique ¶
func (_q *FacetQuery) Unique(unique bool) *FacetQuery
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 (*FacetQuery) Where ¶
func (_q *FacetQuery) Where(ps ...predicate.Facet) *FacetQuery
Where adds a new predicate for the FacetQuery builder.
type FacetSelect ¶
type FacetSelect struct {
*FacetQuery
// contains filtered or unexported fields
}
FacetSelect is the builder for selecting fields of Facet entities.
func (*FacetSelect) Aggregate ¶
func (_s *FacetSelect) Aggregate(fns ...AggregateFunc) *FacetSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FacetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FacetSelect) Scan ¶
func (_s *FacetSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FacetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FacetUpdate ¶
type FacetUpdate struct {
// contains filtered or unexported fields
}
FacetUpdate is the builder for updating Facet entities.
func (*FacetUpdate) ClearFacets ¶
func (_u *FacetUpdate) ClearFacets() *FacetUpdate
ClearFacets clears the value of the "facets" field.
func (*FacetUpdate) Exec ¶
func (_u *FacetUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FacetUpdate) ExecX ¶
func (_u *FacetUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FacetUpdate) Mutation ¶
func (_u *FacetUpdate) Mutation() *FacetMutation
Mutation returns the FacetMutation object of the builder.
func (*FacetUpdate) Save ¶
func (_u *FacetUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FacetUpdate) SaveX ¶
func (_u *FacetUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FacetUpdate) SetFacets ¶
func (_u *FacetUpdate) SetFacets(v map[string]interface{}) *FacetUpdate
SetFacets sets the "facets" field.
func (*FacetUpdate) SetNillableSessionID ¶
func (_u *FacetUpdate) SetNillableSessionID(v *string) *FacetUpdate
SetNillableSessionID sets the "session_id" field if the given value is not nil.
func (*FacetUpdate) SetSessionID ¶
func (_u *FacetUpdate) SetSessionID(v string) *FacetUpdate
SetSessionID sets the "session_id" field.
func (*FacetUpdate) Where ¶
func (_u *FacetUpdate) Where(ps ...predicate.Facet) *FacetUpdate
Where appends a list predicates to the FacetUpdate builder.
type FacetUpdateOne ¶
type FacetUpdateOne struct {
// contains filtered or unexported fields
}
FacetUpdateOne is the builder for updating a single Facet entity.
func (*FacetUpdateOne) ClearFacets ¶
func (_u *FacetUpdateOne) ClearFacets() *FacetUpdateOne
ClearFacets clears the value of the "facets" field.
func (*FacetUpdateOne) Exec ¶
func (_u *FacetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FacetUpdateOne) ExecX ¶
func (_u *FacetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FacetUpdateOne) Mutation ¶
func (_u *FacetUpdateOne) Mutation() *FacetMutation
Mutation returns the FacetMutation object of the builder.
func (*FacetUpdateOne) Save ¶
func (_u *FacetUpdateOne) Save(ctx context.Context) (*Facet, error)
Save executes the query and returns the updated Facet entity.
func (*FacetUpdateOne) SaveX ¶
func (_u *FacetUpdateOne) SaveX(ctx context.Context) *Facet
SaveX is like Save, but panics if an error occurs.
func (*FacetUpdateOne) Select ¶
func (_u *FacetUpdateOne) Select(field string, fields ...string) *FacetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FacetUpdateOne) SetFacets ¶
func (_u *FacetUpdateOne) SetFacets(v map[string]interface{}) *FacetUpdateOne
SetFacets sets the "facets" field.
func (*FacetUpdateOne) SetNillableSessionID ¶
func (_u *FacetUpdateOne) SetNillableSessionID(v *string) *FacetUpdateOne
SetNillableSessionID sets the "session_id" field if the given value is not nil.
func (*FacetUpdateOne) SetSessionID ¶
func (_u *FacetUpdateOne) SetSessionID(v string) *FacetUpdateOne
SetSessionID sets the "session_id" field.
func (*FacetUpdateOne) Where ¶
func (_u *FacetUpdateOne) Where(ps ...predicate.Facet) *FacetUpdateOne
Where appends a list predicates to the FacetUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Node ¶
type Node struct {
// ID of the ent.
ID string `json:"id,omitempty"`
// ParentHash holds the value of the "parent_hash" field.
ParentHash *string `json:"parent_hash,omitempty"`
// Bucket holds the value of the "bucket" field.
Bucket map[string]interface{} `json:"bucket,omitempty"`
// Type holds the value of the "type" field.
Type string `json:"type,omitempty"`
// Role holds the value of the "role" field.
Role string `json:"role,omitempty"`
// Content holds the value of the "content" field.
Content []map[string]interface{} `json:"content,omitempty"`
// Model holds the value of the "model" field.
Model string `json:"model,omitempty"`
// Provider holds the value of the "provider" field.
Provider string `json:"provider,omitempty"`
// AgentName holds the value of the "agent_name" field.
AgentName string `json:"agent_name,omitempty"`
// StopReason holds the value of the "stop_reason" field.
StopReason string `json:"stop_reason,omitempty"`
// PromptTokens holds the value of the "prompt_tokens" field.
PromptTokens *int `json:"prompt_tokens,omitempty"`
// CompletionTokens holds the value of the "completion_tokens" field.
CompletionTokens *int `json:"completion_tokens,omitempty"`
// TotalTokens holds the value of the "total_tokens" field.
TotalTokens *int `json:"total_tokens,omitempty"`
// CacheCreationInputTokens holds the value of the "cache_creation_input_tokens" field.
CacheCreationInputTokens *int `json:"cache_creation_input_tokens,omitempty"`
// CacheReadInputTokens holds the value of the "cache_read_input_tokens" field.
CacheReadInputTokens *int `json:"cache_read_input_tokens,omitempty"`
// TotalDurationNs holds the value of the "total_duration_ns" field.
TotalDurationNs *int64 `json:"total_duration_ns,omitempty"`
// PromptDurationNs holds the value of the "prompt_duration_ns" field.
PromptDurationNs *int64 `json:"prompt_duration_ns,omitempty"`
// Project holds the value of the "project" field.
Project *string `json:"project,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the NodeQuery when eager-loading is set.
Edges NodeEdges `json:"edges"`
// contains filtered or unexported fields
}
Node is the model entity for the Node schema.
func (*Node) QueryChildren ¶
QueryChildren queries the "children" edge of the Node entity.
func (*Node) QueryParent ¶
QueryParent queries the "parent" edge of the Node entity.
func (*Node) Unwrap ¶
Unwrap unwraps the Node 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 (*Node) Update ¶
func (_m *Node) Update() *NodeUpdateOne
Update returns a builder for updating this Node. Note that you need to call Node.Unwrap() before calling this method if this Node was returned from a transaction, and the transaction was committed or rolled back.
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
NodeClient is a client for the Node schema.
func NewNodeClient ¶
func NewNodeClient(c config) *NodeClient
NewNodeClient returns a client for the Node from the given config.
func (*NodeClient) Create ¶
func (c *NodeClient) Create() *NodeCreate
Create returns a builder for creating a Node entity.
func (*NodeClient) CreateBulk ¶
func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk
CreateBulk returns a builder for creating a bulk of Node entities.
func (*NodeClient) Delete ¶
func (c *NodeClient) Delete() *NodeDelete
Delete returns a delete builder for Node.
func (*NodeClient) DeleteOne ¶
func (c *NodeClient) DeleteOne(_m *Node) *NodeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*NodeClient) DeleteOneID ¶
func (c *NodeClient) DeleteOneID(id string) *NodeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NodeClient) GetX ¶
func (c *NodeClient) GetX(ctx context.Context, id string) *Node
GetX is like Get, but panics if an error occurs.
func (*NodeClient) Intercept ¶
func (c *NodeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `node.Intercept(f(g(h())))`.
func (*NodeClient) Interceptors ¶
func (c *NodeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*NodeClient) MapCreateBulk ¶
func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*NodeClient) Query ¶
func (c *NodeClient) Query() *NodeQuery
Query returns a query builder for Node.
func (*NodeClient) QueryChildren ¶
func (c *NodeClient) QueryChildren(_m *Node) *NodeQuery
QueryChildren queries the children edge of a Node.
func (*NodeClient) QueryParent ¶
func (c *NodeClient) QueryParent(_m *Node) *NodeQuery
QueryParent queries the parent edge of a Node.
func (*NodeClient) Update ¶
func (c *NodeClient) Update() *NodeUpdate
Update returns an update builder for Node.
func (*NodeClient) UpdateOne ¶
func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NodeClient) UpdateOneID ¶
func (c *NodeClient) UpdateOneID(id string) *NodeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NodeClient) Use ¶
func (c *NodeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `node.Hooks(f(g(h())))`.
type NodeCreate ¶
type NodeCreate struct {
// contains filtered or unexported fields
}
NodeCreate is the builder for creating a Node entity.
func (*NodeCreate) AddChildIDs ¶
func (_c *NodeCreate) AddChildIDs(ids ...string) *NodeCreate
AddChildIDs adds the "children" edge to the Node entity by IDs.
func (*NodeCreate) AddChildren ¶
func (_c *NodeCreate) AddChildren(v ...*Node) *NodeCreate
AddChildren adds the "children" edges to the Node entity.
func (*NodeCreate) Exec ¶
func (_c *NodeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeCreate) ExecX ¶
func (_c *NodeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeCreate) Mutation ¶
func (_c *NodeCreate) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeCreate) Save ¶
func (_c *NodeCreate) Save(ctx context.Context) (*Node, error)
Save creates the Node in the database.
func (*NodeCreate) SaveX ¶
func (_c *NodeCreate) SaveX(ctx context.Context) *Node
SaveX calls Save and panics if Save returns an error.
func (*NodeCreate) SetAgentName ¶
func (_c *NodeCreate) SetAgentName(v string) *NodeCreate
SetAgentName sets the "agent_name" field.
func (*NodeCreate) SetBucket ¶
func (_c *NodeCreate) SetBucket(v map[string]interface{}) *NodeCreate
SetBucket sets the "bucket" field.
func (*NodeCreate) SetCacheCreationInputTokens ¶
func (_c *NodeCreate) SetCacheCreationInputTokens(v int) *NodeCreate
SetCacheCreationInputTokens sets the "cache_creation_input_tokens" field.
func (*NodeCreate) SetCacheReadInputTokens ¶
func (_c *NodeCreate) SetCacheReadInputTokens(v int) *NodeCreate
SetCacheReadInputTokens sets the "cache_read_input_tokens" field.
func (*NodeCreate) SetCompletionTokens ¶
func (_c *NodeCreate) SetCompletionTokens(v int) *NodeCreate
SetCompletionTokens sets the "completion_tokens" field.
func (*NodeCreate) SetContent ¶
func (_c *NodeCreate) SetContent(v []map[string]interface{}) *NodeCreate
SetContent sets the "content" field.
func (*NodeCreate) SetCreatedAt ¶
func (_c *NodeCreate) SetCreatedAt(v time.Time) *NodeCreate
SetCreatedAt sets the "created_at" field.
func (*NodeCreate) SetID ¶
func (_c *NodeCreate) SetID(v string) *NodeCreate
SetID sets the "id" field.
func (*NodeCreate) SetModel ¶
func (_c *NodeCreate) SetModel(v string) *NodeCreate
SetModel sets the "model" field.
func (*NodeCreate) SetNillableAgentName ¶
func (_c *NodeCreate) SetNillableAgentName(v *string) *NodeCreate
SetNillableAgentName sets the "agent_name" field if the given value is not nil.
func (*NodeCreate) SetNillableCacheCreationInputTokens ¶
func (_c *NodeCreate) SetNillableCacheCreationInputTokens(v *int) *NodeCreate
SetNillableCacheCreationInputTokens sets the "cache_creation_input_tokens" field if the given value is not nil.
func (*NodeCreate) SetNillableCacheReadInputTokens ¶
func (_c *NodeCreate) SetNillableCacheReadInputTokens(v *int) *NodeCreate
SetNillableCacheReadInputTokens sets the "cache_read_input_tokens" field if the given value is not nil.
func (*NodeCreate) SetNillableCompletionTokens ¶
func (_c *NodeCreate) SetNillableCompletionTokens(v *int) *NodeCreate
SetNillableCompletionTokens sets the "completion_tokens" field if the given value is not nil.
func (*NodeCreate) SetNillableCreatedAt ¶
func (_c *NodeCreate) SetNillableCreatedAt(v *time.Time) *NodeCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NodeCreate) SetNillableModel ¶
func (_c *NodeCreate) SetNillableModel(v *string) *NodeCreate
SetNillableModel sets the "model" field if the given value is not nil.
func (*NodeCreate) SetNillableParentHash ¶
func (_c *NodeCreate) SetNillableParentHash(v *string) *NodeCreate
SetNillableParentHash sets the "parent_hash" field if the given value is not nil.
func (*NodeCreate) SetNillableParentID ¶
func (_c *NodeCreate) SetNillableParentID(id *string) *NodeCreate
SetNillableParentID sets the "parent" edge to the Node entity by ID if the given value is not nil.
func (*NodeCreate) SetNillableProject ¶
func (_c *NodeCreate) SetNillableProject(v *string) *NodeCreate
SetNillableProject sets the "project" field if the given value is not nil.
func (*NodeCreate) SetNillablePromptDurationNs ¶
func (_c *NodeCreate) SetNillablePromptDurationNs(v *int64) *NodeCreate
SetNillablePromptDurationNs sets the "prompt_duration_ns" field if the given value is not nil.
func (*NodeCreate) SetNillablePromptTokens ¶
func (_c *NodeCreate) SetNillablePromptTokens(v *int) *NodeCreate
SetNillablePromptTokens sets the "prompt_tokens" field if the given value is not nil.
func (*NodeCreate) SetNillableProvider ¶
func (_c *NodeCreate) SetNillableProvider(v *string) *NodeCreate
SetNillableProvider sets the "provider" field if the given value is not nil.
func (*NodeCreate) SetNillableRole ¶
func (_c *NodeCreate) SetNillableRole(v *string) *NodeCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*NodeCreate) SetNillableStopReason ¶
func (_c *NodeCreate) SetNillableStopReason(v *string) *NodeCreate
SetNillableStopReason sets the "stop_reason" field if the given value is not nil.
func (*NodeCreate) SetNillableTotalDurationNs ¶
func (_c *NodeCreate) SetNillableTotalDurationNs(v *int64) *NodeCreate
SetNillableTotalDurationNs sets the "total_duration_ns" field if the given value is not nil.
func (*NodeCreate) SetNillableTotalTokens ¶
func (_c *NodeCreate) SetNillableTotalTokens(v *int) *NodeCreate
SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.
func (*NodeCreate) SetNillableType ¶
func (_c *NodeCreate) SetNillableType(v *string) *NodeCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*NodeCreate) SetParent ¶
func (_c *NodeCreate) SetParent(v *Node) *NodeCreate
SetParent sets the "parent" edge to the Node entity.
func (*NodeCreate) SetParentHash ¶
func (_c *NodeCreate) SetParentHash(v string) *NodeCreate
SetParentHash sets the "parent_hash" field.
func (*NodeCreate) SetParentID ¶
func (_c *NodeCreate) SetParentID(id string) *NodeCreate
SetParentID sets the "parent" edge to the Node entity by ID.
func (*NodeCreate) SetProject ¶
func (_c *NodeCreate) SetProject(v string) *NodeCreate
SetProject sets the "project" field.
func (*NodeCreate) SetPromptDurationNs ¶
func (_c *NodeCreate) SetPromptDurationNs(v int64) *NodeCreate
SetPromptDurationNs sets the "prompt_duration_ns" field.
func (*NodeCreate) SetPromptTokens ¶
func (_c *NodeCreate) SetPromptTokens(v int) *NodeCreate
SetPromptTokens sets the "prompt_tokens" field.
func (*NodeCreate) SetProvider ¶
func (_c *NodeCreate) SetProvider(v string) *NodeCreate
SetProvider sets the "provider" field.
func (*NodeCreate) SetRole ¶
func (_c *NodeCreate) SetRole(v string) *NodeCreate
SetRole sets the "role" field.
func (*NodeCreate) SetStopReason ¶
func (_c *NodeCreate) SetStopReason(v string) *NodeCreate
SetStopReason sets the "stop_reason" field.
func (*NodeCreate) SetTotalDurationNs ¶
func (_c *NodeCreate) SetTotalDurationNs(v int64) *NodeCreate
SetTotalDurationNs sets the "total_duration_ns" field.
func (*NodeCreate) SetTotalTokens ¶
func (_c *NodeCreate) SetTotalTokens(v int) *NodeCreate
SetTotalTokens sets the "total_tokens" field.
func (*NodeCreate) SetType ¶
func (_c *NodeCreate) SetType(v string) *NodeCreate
SetType sets the "type" field.
type NodeCreateBulk ¶
type NodeCreateBulk struct {
// contains filtered or unexported fields
}
NodeCreateBulk is the builder for creating many Node entities in bulk.
func (*NodeCreateBulk) Exec ¶
func (_c *NodeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeCreateBulk) ExecX ¶
func (_c *NodeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NodeDelete ¶
type NodeDelete struct {
// contains filtered or unexported fields
}
NodeDelete is the builder for deleting a Node entity.
func (*NodeDelete) Exec ¶
func (_d *NodeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NodeDelete) ExecX ¶
func (_d *NodeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NodeDelete) Where ¶
func (_d *NodeDelete) Where(ps ...predicate.Node) *NodeDelete
Where appends a list predicates to the NodeDelete builder.
type NodeDeleteOne ¶
type NodeDeleteOne struct {
// contains filtered or unexported fields
}
NodeDeleteOne is the builder for deleting a single Node entity.
func (*NodeDeleteOne) Exec ¶
func (_d *NodeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NodeDeleteOne) ExecX ¶
func (_d *NodeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeDeleteOne) Where ¶
func (_d *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne
Where appends a list predicates to the NodeDelete builder.
type NodeEdges ¶
type NodeEdges struct {
// Parent holds the value of the parent edge.
Parent *Node `json:"parent,omitempty"`
// Children holds the value of the children edge.
Children []*Node `json:"children,omitempty"`
// contains filtered or unexported fields
}
NodeEdges holds the relations/edges for other nodes in the graph.
func (NodeEdges) ChildrenOrErr ¶
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (NodeEdges) ParentOrErr ¶
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type NodeGroupBy ¶
type NodeGroupBy struct {
// contains filtered or unexported fields
}
NodeGroupBy is the group-by builder for Node entities.
func (*NodeGroupBy) Aggregate ¶
func (_g *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NodeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Scan ¶
func (_g *NodeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NodeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeMutation ¶
type NodeMutation struct {
// contains filtered or unexported fields
}
NodeMutation represents an operation that mutates the Node nodes in the graph.
func (*NodeMutation) AddCacheCreationInputTokens ¶
func (m *NodeMutation) AddCacheCreationInputTokens(i int)
AddCacheCreationInputTokens adds i to the "cache_creation_input_tokens" field.
func (*NodeMutation) AddCacheReadInputTokens ¶
func (m *NodeMutation) AddCacheReadInputTokens(i int)
AddCacheReadInputTokens adds i to the "cache_read_input_tokens" field.
func (*NodeMutation) AddChildIDs ¶
func (m *NodeMutation) AddChildIDs(ids ...string)
AddChildIDs adds the "children" edge to the Node entity by ids.
func (*NodeMutation) AddCompletionTokens ¶
func (m *NodeMutation) AddCompletionTokens(i int)
AddCompletionTokens adds i to the "completion_tokens" field.
func (*NodeMutation) AddField ¶
func (m *NodeMutation) 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 (*NodeMutation) AddPromptDurationNs ¶
func (m *NodeMutation) AddPromptDurationNs(i int64)
AddPromptDurationNs adds i to the "prompt_duration_ns" field.
func (*NodeMutation) AddPromptTokens ¶
func (m *NodeMutation) AddPromptTokens(i int)
AddPromptTokens adds i to the "prompt_tokens" field.
func (*NodeMutation) AddTotalDurationNs ¶
func (m *NodeMutation) AddTotalDurationNs(i int64)
AddTotalDurationNs adds i to the "total_duration_ns" field.
func (*NodeMutation) AddTotalTokens ¶
func (m *NodeMutation) AddTotalTokens(i int)
AddTotalTokens adds i to the "total_tokens" field.
func (*NodeMutation) AddedCacheCreationInputTokens ¶
func (m *NodeMutation) AddedCacheCreationInputTokens() (r int, exists bool)
AddedCacheCreationInputTokens returns the value that was added to the "cache_creation_input_tokens" field in this mutation.
func (*NodeMutation) AddedCacheReadInputTokens ¶
func (m *NodeMutation) AddedCacheReadInputTokens() (r int, exists bool)
AddedCacheReadInputTokens returns the value that was added to the "cache_read_input_tokens" field in this mutation.
func (*NodeMutation) AddedCompletionTokens ¶
func (m *NodeMutation) AddedCompletionTokens() (r int, exists bool)
AddedCompletionTokens returns the value that was added to the "completion_tokens" field in this mutation.
func (*NodeMutation) AddedEdges ¶
func (m *NodeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NodeMutation) AddedField ¶
func (m *NodeMutation) 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 (*NodeMutation) AddedFields ¶
func (m *NodeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NodeMutation) AddedIDs ¶
func (m *NodeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NodeMutation) AddedPromptDurationNs ¶
func (m *NodeMutation) AddedPromptDurationNs() (r int64, exists bool)
AddedPromptDurationNs returns the value that was added to the "prompt_duration_ns" field in this mutation.
func (*NodeMutation) AddedPromptTokens ¶
func (m *NodeMutation) AddedPromptTokens() (r int, exists bool)
AddedPromptTokens returns the value that was added to the "prompt_tokens" field in this mutation.
func (*NodeMutation) AddedTotalDurationNs ¶
func (m *NodeMutation) AddedTotalDurationNs() (r int64, exists bool)
AddedTotalDurationNs returns the value that was added to the "total_duration_ns" field in this mutation.
func (*NodeMutation) AddedTotalTokens ¶
func (m *NodeMutation) AddedTotalTokens() (r int, exists bool)
AddedTotalTokens returns the value that was added to the "total_tokens" field in this mutation.
func (*NodeMutation) AgentName ¶
func (m *NodeMutation) AgentName() (r string, exists bool)
AgentName returns the value of the "agent_name" field in the mutation.
func (*NodeMutation) AgentNameCleared ¶
func (m *NodeMutation) AgentNameCleared() bool
AgentNameCleared returns if the "agent_name" field was cleared in this mutation.
func (*NodeMutation) AppendContent ¶
func (m *NodeMutation) AppendContent(value []map[string]interface{})
AppendContent adds value to the "content" field.
func (*NodeMutation) AppendedContent ¶
func (m *NodeMutation) AppendedContent() ([]map[string]interface{}, bool)
AppendedContent returns the list of values that were appended to the "content" field in this mutation.
func (*NodeMutation) Bucket ¶
func (m *NodeMutation) Bucket() (r map[string]interface{}, exists bool)
Bucket returns the value of the "bucket" field in the mutation.
func (*NodeMutation) BucketCleared ¶
func (m *NodeMutation) BucketCleared() bool
BucketCleared returns if the "bucket" field was cleared in this mutation.
func (*NodeMutation) CacheCreationInputTokens ¶
func (m *NodeMutation) CacheCreationInputTokens() (r int, exists bool)
CacheCreationInputTokens returns the value of the "cache_creation_input_tokens" field in the mutation.
func (*NodeMutation) CacheCreationInputTokensCleared ¶
func (m *NodeMutation) CacheCreationInputTokensCleared() bool
CacheCreationInputTokensCleared returns if the "cache_creation_input_tokens" field was cleared in this mutation.
func (*NodeMutation) CacheReadInputTokens ¶
func (m *NodeMutation) CacheReadInputTokens() (r int, exists bool)
CacheReadInputTokens returns the value of the "cache_read_input_tokens" field in the mutation.
func (*NodeMutation) CacheReadInputTokensCleared ¶
func (m *NodeMutation) CacheReadInputTokensCleared() bool
CacheReadInputTokensCleared returns if the "cache_read_input_tokens" field was cleared in this mutation.
func (*NodeMutation) ChildrenCleared ¶
func (m *NodeMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Node entity was cleared.
func (*NodeMutation) ChildrenIDs ¶
func (m *NodeMutation) ChildrenIDs() (ids []string)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*NodeMutation) ClearAgentName ¶
func (m *NodeMutation) ClearAgentName()
ClearAgentName clears the value of the "agent_name" field.
func (*NodeMutation) ClearBucket ¶
func (m *NodeMutation) ClearBucket()
ClearBucket clears the value of the "bucket" field.
func (*NodeMutation) ClearCacheCreationInputTokens ¶
func (m *NodeMutation) ClearCacheCreationInputTokens()
ClearCacheCreationInputTokens clears the value of the "cache_creation_input_tokens" field.
func (*NodeMutation) ClearCacheReadInputTokens ¶
func (m *NodeMutation) ClearCacheReadInputTokens()
ClearCacheReadInputTokens clears the value of the "cache_read_input_tokens" field.
func (*NodeMutation) ClearChildren ¶
func (m *NodeMutation) ClearChildren()
ClearChildren clears the "children" edge to the Node entity.
func (*NodeMutation) ClearCompletionTokens ¶
func (m *NodeMutation) ClearCompletionTokens()
ClearCompletionTokens clears the value of the "completion_tokens" field.
func (*NodeMutation) ClearContent ¶
func (m *NodeMutation) ClearContent()
ClearContent clears the value of the "content" field.
func (*NodeMutation) ClearEdge ¶
func (m *NodeMutation) 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 (*NodeMutation) ClearField ¶
func (m *NodeMutation) 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 (*NodeMutation) ClearModel ¶
func (m *NodeMutation) ClearModel()
ClearModel clears the value of the "model" field.
func (*NodeMutation) ClearParent ¶
func (m *NodeMutation) ClearParent()
ClearParent clears the "parent" edge to the Node entity.
func (*NodeMutation) ClearParentHash ¶
func (m *NodeMutation) ClearParentHash()
ClearParentHash clears the value of the "parent_hash" field.
func (*NodeMutation) ClearProject ¶
func (m *NodeMutation) ClearProject()
ClearProject clears the value of the "project" field.
func (*NodeMutation) ClearPromptDurationNs ¶
func (m *NodeMutation) ClearPromptDurationNs()
ClearPromptDurationNs clears the value of the "prompt_duration_ns" field.
func (*NodeMutation) ClearPromptTokens ¶
func (m *NodeMutation) ClearPromptTokens()
ClearPromptTokens clears the value of the "prompt_tokens" field.
func (*NodeMutation) ClearProvider ¶
func (m *NodeMutation) ClearProvider()
ClearProvider clears the value of the "provider" field.
func (*NodeMutation) ClearRole ¶
func (m *NodeMutation) ClearRole()
ClearRole clears the value of the "role" field.
func (*NodeMutation) ClearStopReason ¶
func (m *NodeMutation) ClearStopReason()
ClearStopReason clears the value of the "stop_reason" field.
func (*NodeMutation) ClearTotalDurationNs ¶
func (m *NodeMutation) ClearTotalDurationNs()
ClearTotalDurationNs clears the value of the "total_duration_ns" field.
func (*NodeMutation) ClearTotalTokens ¶
func (m *NodeMutation) ClearTotalTokens()
ClearTotalTokens clears the value of the "total_tokens" field.
func (*NodeMutation) ClearType ¶
func (m *NodeMutation) ClearType()
ClearType clears the value of the "type" field.
func (*NodeMutation) ClearedEdges ¶
func (m *NodeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NodeMutation) ClearedFields ¶
func (m *NodeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NodeMutation) Client ¶
func (m NodeMutation) 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 (*NodeMutation) CompletionTokens ¶
func (m *NodeMutation) CompletionTokens() (r int, exists bool)
CompletionTokens returns the value of the "completion_tokens" field in the mutation.
func (*NodeMutation) CompletionTokensCleared ¶
func (m *NodeMutation) CompletionTokensCleared() bool
CompletionTokensCleared returns if the "completion_tokens" field was cleared in this mutation.
func (*NodeMutation) Content ¶
func (m *NodeMutation) Content() (r []map[string]interface{}, exists bool)
Content returns the value of the "content" field in the mutation.
func (*NodeMutation) ContentCleared ¶
func (m *NodeMutation) ContentCleared() bool
ContentCleared returns if the "content" field was cleared in this mutation.
func (*NodeMutation) CreatedAt ¶
func (m *NodeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NodeMutation) EdgeCleared ¶
func (m *NodeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NodeMutation) Field ¶
func (m *NodeMutation) 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 (*NodeMutation) FieldCleared ¶
func (m *NodeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NodeMutation) Fields ¶
func (m *NodeMutation) 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 (*NodeMutation) GetType ¶
func (m *NodeMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*NodeMutation) ID ¶
func (m *NodeMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NodeMutation) IDs ¶
func (m *NodeMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*NodeMutation) Model ¶
func (m *NodeMutation) Model() (r string, exists bool)
Model returns the value of the "model" field in the mutation.
func (*NodeMutation) ModelCleared ¶
func (m *NodeMutation) ModelCleared() bool
ModelCleared returns if the "model" field was cleared in this mutation.
func (*NodeMutation) OldAgentName ¶
func (m *NodeMutation) OldAgentName(ctx context.Context) (v string, err error)
OldAgentName returns the old "agent_name" field's value of the Node entity. If the Node 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 (*NodeMutation) OldBucket ¶
func (m *NodeMutation) OldBucket(ctx context.Context) (v map[string]interface{}, err error)
OldBucket returns the old "bucket" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCacheCreationInputTokens ¶
func (m *NodeMutation) OldCacheCreationInputTokens(ctx context.Context) (v *int, err error)
OldCacheCreationInputTokens returns the old "cache_creation_input_tokens" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCacheReadInputTokens ¶
func (m *NodeMutation) OldCacheReadInputTokens(ctx context.Context) (v *int, err error)
OldCacheReadInputTokens returns the old "cache_read_input_tokens" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCompletionTokens ¶
func (m *NodeMutation) OldCompletionTokens(ctx context.Context) (v *int, err error)
OldCompletionTokens returns the old "completion_tokens" field's value of the Node entity. If the Node 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 (*NodeMutation) OldContent ¶
func (m *NodeMutation) OldContent(ctx context.Context) (v []map[string]interface{}, err error)
OldContent returns the old "content" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Node entity. If the Node 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 (*NodeMutation) 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 (*NodeMutation) OldModel ¶
func (m *NodeMutation) OldModel(ctx context.Context) (v string, err error)
OldModel returns the old "model" field's value of the Node entity. If the Node 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 (*NodeMutation) OldParentHash ¶
func (m *NodeMutation) OldParentHash(ctx context.Context) (v *string, err error)
OldParentHash returns the old "parent_hash" field's value of the Node entity. If the Node 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 (*NodeMutation) OldProject ¶
func (m *NodeMutation) OldProject(ctx context.Context) (v *string, err error)
OldProject returns the old "project" field's value of the Node entity. If the Node 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 (*NodeMutation) OldPromptDurationNs ¶
func (m *NodeMutation) OldPromptDurationNs(ctx context.Context) (v *int64, err error)
OldPromptDurationNs returns the old "prompt_duration_ns" field's value of the Node entity. If the Node 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 (*NodeMutation) OldPromptTokens ¶
func (m *NodeMutation) OldPromptTokens(ctx context.Context) (v *int, err error)
OldPromptTokens returns the old "prompt_tokens" field's value of the Node entity. If the Node 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 (*NodeMutation) OldProvider ¶
func (m *NodeMutation) OldProvider(ctx context.Context) (v string, err error)
OldProvider returns the old "provider" field's value of the Node entity. If the Node 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 (*NodeMutation) OldRole ¶
func (m *NodeMutation) OldRole(ctx context.Context) (v string, err error)
OldRole returns the old "role" field's value of the Node entity. If the Node 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 (*NodeMutation) OldStopReason ¶
func (m *NodeMutation) OldStopReason(ctx context.Context) (v string, err error)
OldStopReason returns the old "stop_reason" field's value of the Node entity. If the Node 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 (*NodeMutation) OldTotalDurationNs ¶
func (m *NodeMutation) OldTotalDurationNs(ctx context.Context) (v *int64, err error)
OldTotalDurationNs returns the old "total_duration_ns" field's value of the Node entity. If the Node 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 (*NodeMutation) OldTotalTokens ¶
func (m *NodeMutation) OldTotalTokens(ctx context.Context) (v *int, err error)
OldTotalTokens returns the old "total_tokens" field's value of the Node entity. If the Node 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 (*NodeMutation) OldType ¶
func (m *NodeMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Node entity. If the Node 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 (*NodeMutation) ParentCleared ¶
func (m *NodeMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Node entity was cleared.
func (*NodeMutation) ParentHash ¶
func (m *NodeMutation) ParentHash() (r string, exists bool)
ParentHash returns the value of the "parent_hash" field in the mutation.
func (*NodeMutation) ParentHashCleared ¶
func (m *NodeMutation) ParentHashCleared() bool
ParentHashCleared returns if the "parent_hash" field was cleared in this mutation.
func (*NodeMutation) ParentID ¶
func (m *NodeMutation) ParentID() (id string, exists bool)
ParentID returns the "parent" edge ID in the mutation.
func (*NodeMutation) ParentIDs ¶
func (m *NodeMutation) ParentIDs() (ids []string)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*NodeMutation) Project ¶
func (m *NodeMutation) Project() (r string, exists bool)
Project returns the value of the "project" field in the mutation.
func (*NodeMutation) ProjectCleared ¶
func (m *NodeMutation) ProjectCleared() bool
ProjectCleared returns if the "project" field was cleared in this mutation.
func (*NodeMutation) PromptDurationNs ¶
func (m *NodeMutation) PromptDurationNs() (r int64, exists bool)
PromptDurationNs returns the value of the "prompt_duration_ns" field in the mutation.
func (*NodeMutation) PromptDurationNsCleared ¶
func (m *NodeMutation) PromptDurationNsCleared() bool
PromptDurationNsCleared returns if the "prompt_duration_ns" field was cleared in this mutation.
func (*NodeMutation) PromptTokens ¶
func (m *NodeMutation) PromptTokens() (r int, exists bool)
PromptTokens returns the value of the "prompt_tokens" field in the mutation.
func (*NodeMutation) PromptTokensCleared ¶
func (m *NodeMutation) PromptTokensCleared() bool
PromptTokensCleared returns if the "prompt_tokens" field was cleared in this mutation.
func (*NodeMutation) Provider ¶
func (m *NodeMutation) Provider() (r string, exists bool)
Provider returns the value of the "provider" field in the mutation.
func (*NodeMutation) ProviderCleared ¶
func (m *NodeMutation) ProviderCleared() bool
ProviderCleared returns if the "provider" field was cleared in this mutation.
func (*NodeMutation) RemoveChildIDs ¶
func (m *NodeMutation) RemoveChildIDs(ids ...string)
RemoveChildIDs removes the "children" edge to the Node entity by IDs.
func (*NodeMutation) RemovedChildrenIDs ¶
func (m *NodeMutation) RemovedChildrenIDs() (ids []string)
RemovedChildren returns the removed IDs of the "children" edge to the Node entity.
func (*NodeMutation) RemovedEdges ¶
func (m *NodeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NodeMutation) RemovedIDs ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetAgentName ¶
func (m *NodeMutation) ResetAgentName()
ResetAgentName resets all changes to the "agent_name" field.
func (*NodeMutation) ResetBucket ¶
func (m *NodeMutation) ResetBucket()
ResetBucket resets all changes to the "bucket" field.
func (*NodeMutation) ResetCacheCreationInputTokens ¶
func (m *NodeMutation) ResetCacheCreationInputTokens()
ResetCacheCreationInputTokens resets all changes to the "cache_creation_input_tokens" field.
func (*NodeMutation) ResetCacheReadInputTokens ¶
func (m *NodeMutation) ResetCacheReadInputTokens()
ResetCacheReadInputTokens resets all changes to the "cache_read_input_tokens" field.
func (*NodeMutation) ResetChildren ¶
func (m *NodeMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*NodeMutation) ResetCompletionTokens ¶
func (m *NodeMutation) ResetCompletionTokens()
ResetCompletionTokens resets all changes to the "completion_tokens" field.
func (*NodeMutation) ResetContent ¶
func (m *NodeMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*NodeMutation) ResetCreatedAt ¶
func (m *NodeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NodeMutation) ResetEdge ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetField ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetModel ¶
func (m *NodeMutation) ResetModel()
ResetModel resets all changes to the "model" field.
func (*NodeMutation) ResetParent ¶
func (m *NodeMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*NodeMutation) ResetParentHash ¶
func (m *NodeMutation) ResetParentHash()
ResetParentHash resets all changes to the "parent_hash" field.
func (*NodeMutation) ResetProject ¶
func (m *NodeMutation) ResetProject()
ResetProject resets all changes to the "project" field.
func (*NodeMutation) ResetPromptDurationNs ¶
func (m *NodeMutation) ResetPromptDurationNs()
ResetPromptDurationNs resets all changes to the "prompt_duration_ns" field.
func (*NodeMutation) ResetPromptTokens ¶
func (m *NodeMutation) ResetPromptTokens()
ResetPromptTokens resets all changes to the "prompt_tokens" field.
func (*NodeMutation) ResetProvider ¶
func (m *NodeMutation) ResetProvider()
ResetProvider resets all changes to the "provider" field.
func (*NodeMutation) ResetRole ¶
func (m *NodeMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*NodeMutation) ResetStopReason ¶
func (m *NodeMutation) ResetStopReason()
ResetStopReason resets all changes to the "stop_reason" field.
func (*NodeMutation) ResetTotalDurationNs ¶
func (m *NodeMutation) ResetTotalDurationNs()
ResetTotalDurationNs resets all changes to the "total_duration_ns" field.
func (*NodeMutation) ResetTotalTokens ¶
func (m *NodeMutation) ResetTotalTokens()
ResetTotalTokens resets all changes to the "total_tokens" field.
func (*NodeMutation) ResetType ¶
func (m *NodeMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*NodeMutation) Role ¶
func (m *NodeMutation) Role() (r string, exists bool)
Role returns the value of the "role" field in the mutation.
func (*NodeMutation) RoleCleared ¶
func (m *NodeMutation) RoleCleared() bool
RoleCleared returns if the "role" field was cleared in this mutation.
func (*NodeMutation) SetAgentName ¶
func (m *NodeMutation) SetAgentName(s string)
SetAgentName sets the "agent_name" field.
func (*NodeMutation) SetBucket ¶
func (m *NodeMutation) SetBucket(value map[string]interface{})
SetBucket sets the "bucket" field.
func (*NodeMutation) SetCacheCreationInputTokens ¶
func (m *NodeMutation) SetCacheCreationInputTokens(i int)
SetCacheCreationInputTokens sets the "cache_creation_input_tokens" field.
func (*NodeMutation) SetCacheReadInputTokens ¶
func (m *NodeMutation) SetCacheReadInputTokens(i int)
SetCacheReadInputTokens sets the "cache_read_input_tokens" field.
func (*NodeMutation) SetCompletionTokens ¶
func (m *NodeMutation) SetCompletionTokens(i int)
SetCompletionTokens sets the "completion_tokens" field.
func (*NodeMutation) SetContent ¶
func (m *NodeMutation) SetContent(value []map[string]interface{})
SetContent sets the "content" field.
func (*NodeMutation) SetCreatedAt ¶
func (m *NodeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NodeMutation) SetField ¶
func (m *NodeMutation) 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 (*NodeMutation) SetID ¶
func (m *NodeMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Node entities.
func (*NodeMutation) SetModel ¶
func (m *NodeMutation) SetModel(s string)
SetModel sets the "model" field.
func (*NodeMutation) SetOp ¶
func (m *NodeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*NodeMutation) SetParentHash ¶
func (m *NodeMutation) SetParentHash(s string)
SetParentHash sets the "parent_hash" field.
func (*NodeMutation) SetParentID ¶
func (m *NodeMutation) SetParentID(id string)
SetParentID sets the "parent" edge to the Node entity by id.
func (*NodeMutation) SetProject ¶
func (m *NodeMutation) SetProject(s string)
SetProject sets the "project" field.
func (*NodeMutation) SetPromptDurationNs ¶
func (m *NodeMutation) SetPromptDurationNs(i int64)
SetPromptDurationNs sets the "prompt_duration_ns" field.
func (*NodeMutation) SetPromptTokens ¶
func (m *NodeMutation) SetPromptTokens(i int)
SetPromptTokens sets the "prompt_tokens" field.
func (*NodeMutation) SetProvider ¶
func (m *NodeMutation) SetProvider(s string)
SetProvider sets the "provider" field.
func (*NodeMutation) SetRole ¶
func (m *NodeMutation) SetRole(s string)
SetRole sets the "role" field.
func (*NodeMutation) SetStopReason ¶
func (m *NodeMutation) SetStopReason(s string)
SetStopReason sets the "stop_reason" field.
func (*NodeMutation) SetTotalDurationNs ¶
func (m *NodeMutation) SetTotalDurationNs(i int64)
SetTotalDurationNs sets the "total_duration_ns" field.
func (*NodeMutation) SetTotalTokens ¶
func (m *NodeMutation) SetTotalTokens(i int)
SetTotalTokens sets the "total_tokens" field.
func (*NodeMutation) SetType ¶
func (m *NodeMutation) SetType(s string)
SetType sets the "type" field.
func (*NodeMutation) StopReason ¶
func (m *NodeMutation) StopReason() (r string, exists bool)
StopReason returns the value of the "stop_reason" field in the mutation.
func (*NodeMutation) StopReasonCleared ¶
func (m *NodeMutation) StopReasonCleared() bool
StopReasonCleared returns if the "stop_reason" field was cleared in this mutation.
func (*NodeMutation) TotalDurationNs ¶
func (m *NodeMutation) TotalDurationNs() (r int64, exists bool)
TotalDurationNs returns the value of the "total_duration_ns" field in the mutation.
func (*NodeMutation) TotalDurationNsCleared ¶
func (m *NodeMutation) TotalDurationNsCleared() bool
TotalDurationNsCleared returns if the "total_duration_ns" field was cleared in this mutation.
func (*NodeMutation) TotalTokens ¶
func (m *NodeMutation) TotalTokens() (r int, exists bool)
TotalTokens returns the value of the "total_tokens" field in the mutation.
func (*NodeMutation) TotalTokensCleared ¶
func (m *NodeMutation) TotalTokensCleared() bool
TotalTokensCleared returns if the "total_tokens" field was cleared in this mutation.
func (NodeMutation) Tx ¶
func (m NodeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NodeMutation) Type ¶
func (m *NodeMutation) Type() string
Type returns the node type of this mutation (Node).
func (*NodeMutation) TypeCleared ¶
func (m *NodeMutation) TypeCleared() bool
TypeCleared returns if the "type" field was cleared in this mutation.
func (*NodeMutation) Where ¶
func (m *NodeMutation) Where(ps ...predicate.Node)
Where appends a list predicates to the NodeMutation builder.
func (*NodeMutation) WhereP ¶
func (m *NodeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the NodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type NodeQuery ¶
type NodeQuery struct {
// contains filtered or unexported fields
}
NodeQuery is the builder for querying Node entities.
func (*NodeQuery) Aggregate ¶
func (_q *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect
Aggregate returns a NodeSelect configured with the given aggregations.
func (*NodeQuery) Clone ¶
Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NodeQuery) First ¶
First returns the first Node entity from the query. Returns a *NotFoundError when no Node was found.
func (*NodeQuery) FirstID ¶
FirstID returns the first Node ID from the query. Returns a *NotFoundError when no Node ID was found.
func (*NodeQuery) GroupBy ¶
func (_q *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy
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 {
ParentHash string `json:"parent_hash,omitempty"`
Count int `json:"count,omitempty"`
}
client.Node.Query().
GroupBy(node.FieldParentHash).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*NodeQuery) Only ¶
Only returns a single Node entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Node entity is found. Returns a *NotFoundError when no Node entities are found.
func (*NodeQuery) OnlyID ¶
OnlyID is like Only, but returns the only Node ID in the query. Returns a *NotSingularError when more than one Node ID is found. Returns a *NotFoundError when no entities are found.
func (*NodeQuery) Order ¶
func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery
Order specifies how the records should be ordered.
func (*NodeQuery) QueryChildren ¶
QueryChildren chains the current query on the "children" edge.
func (*NodeQuery) QueryParent ¶
QueryParent chains the current query on the "parent" edge.
func (*NodeQuery) Select ¶
func (_q *NodeQuery) Select(fields ...string) *NodeSelect
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 {
ParentHash string `json:"parent_hash,omitempty"`
}
client.Node.Query().
Select(node.FieldParentHash).
Scan(ctx, &v)
func (*NodeQuery) Unique ¶
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 (*NodeQuery) WithChildren ¶
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*NodeQuery) WithParent ¶
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
type NodeSelect ¶
type NodeSelect struct {
*NodeQuery
// contains filtered or unexported fields
}
NodeSelect is the builder for selecting fields of Node entities.
func (*NodeSelect) Aggregate ¶
func (_s *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*NodeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Scan ¶
func (_s *NodeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NodeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeUpdate ¶
type NodeUpdate struct {
// contains filtered or unexported fields
}
NodeUpdate is the builder for updating Node entities.
func (*NodeUpdate) AddCacheCreationInputTokens ¶
func (_u *NodeUpdate) AddCacheCreationInputTokens(v int) *NodeUpdate
AddCacheCreationInputTokens adds value to the "cache_creation_input_tokens" field.
func (*NodeUpdate) AddCacheReadInputTokens ¶
func (_u *NodeUpdate) AddCacheReadInputTokens(v int) *NodeUpdate
AddCacheReadInputTokens adds value to the "cache_read_input_tokens" field.
func (*NodeUpdate) AddChildIDs ¶
func (_u *NodeUpdate) AddChildIDs(ids ...string) *NodeUpdate
AddChildIDs adds the "children" edge to the Node entity by IDs.
func (*NodeUpdate) AddChildren ¶
func (_u *NodeUpdate) AddChildren(v ...*Node) *NodeUpdate
AddChildren adds the "children" edges to the Node entity.
func (*NodeUpdate) AddCompletionTokens ¶
func (_u *NodeUpdate) AddCompletionTokens(v int) *NodeUpdate
AddCompletionTokens adds value to the "completion_tokens" field.
func (*NodeUpdate) AddPromptDurationNs ¶
func (_u *NodeUpdate) AddPromptDurationNs(v int64) *NodeUpdate
AddPromptDurationNs adds value to the "prompt_duration_ns" field.
func (*NodeUpdate) AddPromptTokens ¶
func (_u *NodeUpdate) AddPromptTokens(v int) *NodeUpdate
AddPromptTokens adds value to the "prompt_tokens" field.
func (*NodeUpdate) AddTotalDurationNs ¶
func (_u *NodeUpdate) AddTotalDurationNs(v int64) *NodeUpdate
AddTotalDurationNs adds value to the "total_duration_ns" field.
func (*NodeUpdate) AddTotalTokens ¶
func (_u *NodeUpdate) AddTotalTokens(v int) *NodeUpdate
AddTotalTokens adds value to the "total_tokens" field.
func (*NodeUpdate) AppendContent ¶
func (_u *NodeUpdate) AppendContent(v []map[string]interface{}) *NodeUpdate
AppendContent appends value to the "content" field.
func (*NodeUpdate) ClearAgentName ¶
func (_u *NodeUpdate) ClearAgentName() *NodeUpdate
ClearAgentName clears the value of the "agent_name" field.
func (*NodeUpdate) ClearBucket ¶
func (_u *NodeUpdate) ClearBucket() *NodeUpdate
ClearBucket clears the value of the "bucket" field.
func (*NodeUpdate) ClearCacheCreationInputTokens ¶
func (_u *NodeUpdate) ClearCacheCreationInputTokens() *NodeUpdate
ClearCacheCreationInputTokens clears the value of the "cache_creation_input_tokens" field.
func (*NodeUpdate) ClearCacheReadInputTokens ¶
func (_u *NodeUpdate) ClearCacheReadInputTokens() *NodeUpdate
ClearCacheReadInputTokens clears the value of the "cache_read_input_tokens" field.
func (*NodeUpdate) ClearChildren ¶
func (_u *NodeUpdate) ClearChildren() *NodeUpdate
ClearChildren clears all "children" edges to the Node entity.
func (*NodeUpdate) ClearCompletionTokens ¶
func (_u *NodeUpdate) ClearCompletionTokens() *NodeUpdate
ClearCompletionTokens clears the value of the "completion_tokens" field.
func (*NodeUpdate) ClearContent ¶
func (_u *NodeUpdate) ClearContent() *NodeUpdate
ClearContent clears the value of the "content" field.
func (*NodeUpdate) ClearModel ¶
func (_u *NodeUpdate) ClearModel() *NodeUpdate
ClearModel clears the value of the "model" field.
func (*NodeUpdate) ClearParent ¶
func (_u *NodeUpdate) ClearParent() *NodeUpdate
ClearParent clears the "parent" edge to the Node entity.
func (*NodeUpdate) ClearParentHash ¶
func (_u *NodeUpdate) ClearParentHash() *NodeUpdate
ClearParentHash clears the value of the "parent_hash" field.
func (*NodeUpdate) ClearProject ¶
func (_u *NodeUpdate) ClearProject() *NodeUpdate
ClearProject clears the value of the "project" field.
func (*NodeUpdate) ClearPromptDurationNs ¶
func (_u *NodeUpdate) ClearPromptDurationNs() *NodeUpdate
ClearPromptDurationNs clears the value of the "prompt_duration_ns" field.
func (*NodeUpdate) ClearPromptTokens ¶
func (_u *NodeUpdate) ClearPromptTokens() *NodeUpdate
ClearPromptTokens clears the value of the "prompt_tokens" field.
func (*NodeUpdate) ClearProvider ¶
func (_u *NodeUpdate) ClearProvider() *NodeUpdate
ClearProvider clears the value of the "provider" field.
func (*NodeUpdate) ClearRole ¶
func (_u *NodeUpdate) ClearRole() *NodeUpdate
ClearRole clears the value of the "role" field.
func (*NodeUpdate) ClearStopReason ¶
func (_u *NodeUpdate) ClearStopReason() *NodeUpdate
ClearStopReason clears the value of the "stop_reason" field.
func (*NodeUpdate) ClearTotalDurationNs ¶
func (_u *NodeUpdate) ClearTotalDurationNs() *NodeUpdate
ClearTotalDurationNs clears the value of the "total_duration_ns" field.
func (*NodeUpdate) ClearTotalTokens ¶
func (_u *NodeUpdate) ClearTotalTokens() *NodeUpdate
ClearTotalTokens clears the value of the "total_tokens" field.
func (*NodeUpdate) ClearType ¶
func (_u *NodeUpdate) ClearType() *NodeUpdate
ClearType clears the value of the "type" field.
func (*NodeUpdate) Exec ¶
func (_u *NodeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeUpdate) ExecX ¶
func (_u *NodeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeUpdate) Mutation ¶
func (_u *NodeUpdate) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeUpdate) RemoveChildIDs ¶
func (_u *NodeUpdate) RemoveChildIDs(ids ...string) *NodeUpdate
RemoveChildIDs removes the "children" edge to Node entities by IDs.
func (*NodeUpdate) RemoveChildren ¶
func (_u *NodeUpdate) RemoveChildren(v ...*Node) *NodeUpdate
RemoveChildren removes "children" edges to Node entities.
func (*NodeUpdate) Save ¶
func (_u *NodeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NodeUpdate) SaveX ¶
func (_u *NodeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NodeUpdate) SetAgentName ¶
func (_u *NodeUpdate) SetAgentName(v string) *NodeUpdate
SetAgentName sets the "agent_name" field.
func (*NodeUpdate) SetBucket ¶
func (_u *NodeUpdate) SetBucket(v map[string]interface{}) *NodeUpdate
SetBucket sets the "bucket" field.
func (*NodeUpdate) SetCacheCreationInputTokens ¶
func (_u *NodeUpdate) SetCacheCreationInputTokens(v int) *NodeUpdate
SetCacheCreationInputTokens sets the "cache_creation_input_tokens" field.
func (*NodeUpdate) SetCacheReadInputTokens ¶
func (_u *NodeUpdate) SetCacheReadInputTokens(v int) *NodeUpdate
SetCacheReadInputTokens sets the "cache_read_input_tokens" field.
func (*NodeUpdate) SetCompletionTokens ¶
func (_u *NodeUpdate) SetCompletionTokens(v int) *NodeUpdate
SetCompletionTokens sets the "completion_tokens" field.
func (*NodeUpdate) SetContent ¶
func (_u *NodeUpdate) SetContent(v []map[string]interface{}) *NodeUpdate
SetContent sets the "content" field.
func (*NodeUpdate) SetModel ¶
func (_u *NodeUpdate) SetModel(v string) *NodeUpdate
SetModel sets the "model" field.
func (*NodeUpdate) SetNillableAgentName ¶
func (_u *NodeUpdate) SetNillableAgentName(v *string) *NodeUpdate
SetNillableAgentName sets the "agent_name" field if the given value is not nil.
func (*NodeUpdate) SetNillableCacheCreationInputTokens ¶
func (_u *NodeUpdate) SetNillableCacheCreationInputTokens(v *int) *NodeUpdate
SetNillableCacheCreationInputTokens sets the "cache_creation_input_tokens" field if the given value is not nil.
func (*NodeUpdate) SetNillableCacheReadInputTokens ¶
func (_u *NodeUpdate) SetNillableCacheReadInputTokens(v *int) *NodeUpdate
SetNillableCacheReadInputTokens sets the "cache_read_input_tokens" field if the given value is not nil.
func (*NodeUpdate) SetNillableCompletionTokens ¶
func (_u *NodeUpdate) SetNillableCompletionTokens(v *int) *NodeUpdate
SetNillableCompletionTokens sets the "completion_tokens" field if the given value is not nil.
func (*NodeUpdate) SetNillableModel ¶
func (_u *NodeUpdate) SetNillableModel(v *string) *NodeUpdate
SetNillableModel sets the "model" field if the given value is not nil.
func (*NodeUpdate) SetNillableParentHash ¶
func (_u *NodeUpdate) SetNillableParentHash(v *string) *NodeUpdate
SetNillableParentHash sets the "parent_hash" field if the given value is not nil.
func (*NodeUpdate) SetNillableParentID ¶
func (_u *NodeUpdate) SetNillableParentID(id *string) *NodeUpdate
SetNillableParentID sets the "parent" edge to the Node entity by ID if the given value is not nil.
func (*NodeUpdate) SetNillableProject ¶
func (_u *NodeUpdate) SetNillableProject(v *string) *NodeUpdate
SetNillableProject sets the "project" field if the given value is not nil.
func (*NodeUpdate) SetNillablePromptDurationNs ¶
func (_u *NodeUpdate) SetNillablePromptDurationNs(v *int64) *NodeUpdate
SetNillablePromptDurationNs sets the "prompt_duration_ns" field if the given value is not nil.
func (*NodeUpdate) SetNillablePromptTokens ¶
func (_u *NodeUpdate) SetNillablePromptTokens(v *int) *NodeUpdate
SetNillablePromptTokens sets the "prompt_tokens" field if the given value is not nil.
func (*NodeUpdate) SetNillableProvider ¶
func (_u *NodeUpdate) SetNillableProvider(v *string) *NodeUpdate
SetNillableProvider sets the "provider" field if the given value is not nil.
func (*NodeUpdate) SetNillableRole ¶
func (_u *NodeUpdate) SetNillableRole(v *string) *NodeUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*NodeUpdate) SetNillableStopReason ¶
func (_u *NodeUpdate) SetNillableStopReason(v *string) *NodeUpdate
SetNillableStopReason sets the "stop_reason" field if the given value is not nil.
func (*NodeUpdate) SetNillableTotalDurationNs ¶
func (_u *NodeUpdate) SetNillableTotalDurationNs(v *int64) *NodeUpdate
SetNillableTotalDurationNs sets the "total_duration_ns" field if the given value is not nil.
func (*NodeUpdate) SetNillableTotalTokens ¶
func (_u *NodeUpdate) SetNillableTotalTokens(v *int) *NodeUpdate
SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.
func (*NodeUpdate) SetNillableType ¶
func (_u *NodeUpdate) SetNillableType(v *string) *NodeUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*NodeUpdate) SetParent ¶
func (_u *NodeUpdate) SetParent(v *Node) *NodeUpdate
SetParent sets the "parent" edge to the Node entity.
func (*NodeUpdate) SetParentHash ¶
func (_u *NodeUpdate) SetParentHash(v string) *NodeUpdate
SetParentHash sets the "parent_hash" field.
func (*NodeUpdate) SetParentID ¶
func (_u *NodeUpdate) SetParentID(id string) *NodeUpdate
SetParentID sets the "parent" edge to the Node entity by ID.
func (*NodeUpdate) SetProject ¶
func (_u *NodeUpdate) SetProject(v string) *NodeUpdate
SetProject sets the "project" field.
func (*NodeUpdate) SetPromptDurationNs ¶
func (_u *NodeUpdate) SetPromptDurationNs(v int64) *NodeUpdate
SetPromptDurationNs sets the "prompt_duration_ns" field.
func (*NodeUpdate) SetPromptTokens ¶
func (_u *NodeUpdate) SetPromptTokens(v int) *NodeUpdate
SetPromptTokens sets the "prompt_tokens" field.
func (*NodeUpdate) SetProvider ¶
func (_u *NodeUpdate) SetProvider(v string) *NodeUpdate
SetProvider sets the "provider" field.
func (*NodeUpdate) SetRole ¶
func (_u *NodeUpdate) SetRole(v string) *NodeUpdate
SetRole sets the "role" field.
func (*NodeUpdate) SetStopReason ¶
func (_u *NodeUpdate) SetStopReason(v string) *NodeUpdate
SetStopReason sets the "stop_reason" field.
func (*NodeUpdate) SetTotalDurationNs ¶
func (_u *NodeUpdate) SetTotalDurationNs(v int64) *NodeUpdate
SetTotalDurationNs sets the "total_duration_ns" field.
func (*NodeUpdate) SetTotalTokens ¶
func (_u *NodeUpdate) SetTotalTokens(v int) *NodeUpdate
SetTotalTokens sets the "total_tokens" field.
func (*NodeUpdate) SetType ¶
func (_u *NodeUpdate) SetType(v string) *NodeUpdate
SetType sets the "type" field.
func (*NodeUpdate) Where ¶
func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
Where appends a list predicates to the NodeUpdate builder.
type NodeUpdateOne ¶
type NodeUpdateOne struct {
// contains filtered or unexported fields
}
NodeUpdateOne is the builder for updating a single Node entity.
func (*NodeUpdateOne) AddCacheCreationInputTokens ¶
func (_u *NodeUpdateOne) AddCacheCreationInputTokens(v int) *NodeUpdateOne
AddCacheCreationInputTokens adds value to the "cache_creation_input_tokens" field.
func (*NodeUpdateOne) AddCacheReadInputTokens ¶
func (_u *NodeUpdateOne) AddCacheReadInputTokens(v int) *NodeUpdateOne
AddCacheReadInputTokens adds value to the "cache_read_input_tokens" field.
func (*NodeUpdateOne) AddChildIDs ¶
func (_u *NodeUpdateOne) AddChildIDs(ids ...string) *NodeUpdateOne
AddChildIDs adds the "children" edge to the Node entity by IDs.
func (*NodeUpdateOne) AddChildren ¶
func (_u *NodeUpdateOne) AddChildren(v ...*Node) *NodeUpdateOne
AddChildren adds the "children" edges to the Node entity.
func (*NodeUpdateOne) AddCompletionTokens ¶
func (_u *NodeUpdateOne) AddCompletionTokens(v int) *NodeUpdateOne
AddCompletionTokens adds value to the "completion_tokens" field.
func (*NodeUpdateOne) AddPromptDurationNs ¶
func (_u *NodeUpdateOne) AddPromptDurationNs(v int64) *NodeUpdateOne
AddPromptDurationNs adds value to the "prompt_duration_ns" field.
func (*NodeUpdateOne) AddPromptTokens ¶
func (_u *NodeUpdateOne) AddPromptTokens(v int) *NodeUpdateOne
AddPromptTokens adds value to the "prompt_tokens" field.
func (*NodeUpdateOne) AddTotalDurationNs ¶
func (_u *NodeUpdateOne) AddTotalDurationNs(v int64) *NodeUpdateOne
AddTotalDurationNs adds value to the "total_duration_ns" field.
func (*NodeUpdateOne) AddTotalTokens ¶
func (_u *NodeUpdateOne) AddTotalTokens(v int) *NodeUpdateOne
AddTotalTokens adds value to the "total_tokens" field.
func (*NodeUpdateOne) AppendContent ¶
func (_u *NodeUpdateOne) AppendContent(v []map[string]interface{}) *NodeUpdateOne
AppendContent appends value to the "content" field.
func (*NodeUpdateOne) ClearAgentName ¶
func (_u *NodeUpdateOne) ClearAgentName() *NodeUpdateOne
ClearAgentName clears the value of the "agent_name" field.
func (*NodeUpdateOne) ClearBucket ¶
func (_u *NodeUpdateOne) ClearBucket() *NodeUpdateOne
ClearBucket clears the value of the "bucket" field.
func (*NodeUpdateOne) ClearCacheCreationInputTokens ¶
func (_u *NodeUpdateOne) ClearCacheCreationInputTokens() *NodeUpdateOne
ClearCacheCreationInputTokens clears the value of the "cache_creation_input_tokens" field.
func (*NodeUpdateOne) ClearCacheReadInputTokens ¶
func (_u *NodeUpdateOne) ClearCacheReadInputTokens() *NodeUpdateOne
ClearCacheReadInputTokens clears the value of the "cache_read_input_tokens" field.
func (*NodeUpdateOne) ClearChildren ¶
func (_u *NodeUpdateOne) ClearChildren() *NodeUpdateOne
ClearChildren clears all "children" edges to the Node entity.
func (*NodeUpdateOne) ClearCompletionTokens ¶
func (_u *NodeUpdateOne) ClearCompletionTokens() *NodeUpdateOne
ClearCompletionTokens clears the value of the "completion_tokens" field.
func (*NodeUpdateOne) ClearContent ¶
func (_u *NodeUpdateOne) ClearContent() *NodeUpdateOne
ClearContent clears the value of the "content" field.
func (*NodeUpdateOne) ClearModel ¶
func (_u *NodeUpdateOne) ClearModel() *NodeUpdateOne
ClearModel clears the value of the "model" field.
func (*NodeUpdateOne) ClearParent ¶
func (_u *NodeUpdateOne) ClearParent() *NodeUpdateOne
ClearParent clears the "parent" edge to the Node entity.
func (*NodeUpdateOne) ClearParentHash ¶
func (_u *NodeUpdateOne) ClearParentHash() *NodeUpdateOne
ClearParentHash clears the value of the "parent_hash" field.
func (*NodeUpdateOne) ClearProject ¶
func (_u *NodeUpdateOne) ClearProject() *NodeUpdateOne
ClearProject clears the value of the "project" field.
func (*NodeUpdateOne) ClearPromptDurationNs ¶
func (_u *NodeUpdateOne) ClearPromptDurationNs() *NodeUpdateOne
ClearPromptDurationNs clears the value of the "prompt_duration_ns" field.
func (*NodeUpdateOne) ClearPromptTokens ¶
func (_u *NodeUpdateOne) ClearPromptTokens() *NodeUpdateOne
ClearPromptTokens clears the value of the "prompt_tokens" field.
func (*NodeUpdateOne) ClearProvider ¶
func (_u *NodeUpdateOne) ClearProvider() *NodeUpdateOne
ClearProvider clears the value of the "provider" field.
func (*NodeUpdateOne) ClearRole ¶
func (_u *NodeUpdateOne) ClearRole() *NodeUpdateOne
ClearRole clears the value of the "role" field.
func (*NodeUpdateOne) ClearStopReason ¶
func (_u *NodeUpdateOne) ClearStopReason() *NodeUpdateOne
ClearStopReason clears the value of the "stop_reason" field.
func (*NodeUpdateOne) ClearTotalDurationNs ¶
func (_u *NodeUpdateOne) ClearTotalDurationNs() *NodeUpdateOne
ClearTotalDurationNs clears the value of the "total_duration_ns" field.
func (*NodeUpdateOne) ClearTotalTokens ¶
func (_u *NodeUpdateOne) ClearTotalTokens() *NodeUpdateOne
ClearTotalTokens clears the value of the "total_tokens" field.
func (*NodeUpdateOne) ClearType ¶
func (_u *NodeUpdateOne) ClearType() *NodeUpdateOne
ClearType clears the value of the "type" field.
func (*NodeUpdateOne) Exec ¶
func (_u *NodeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NodeUpdateOne) ExecX ¶
func (_u *NodeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeUpdateOne) Mutation ¶
func (_u *NodeUpdateOne) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeUpdateOne) RemoveChildIDs ¶
func (_u *NodeUpdateOne) RemoveChildIDs(ids ...string) *NodeUpdateOne
RemoveChildIDs removes the "children" edge to Node entities by IDs.
func (*NodeUpdateOne) RemoveChildren ¶
func (_u *NodeUpdateOne) RemoveChildren(v ...*Node) *NodeUpdateOne
RemoveChildren removes "children" edges to Node entities.
func (*NodeUpdateOne) Save ¶
func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)
Save executes the query and returns the updated Node entity.
func (*NodeUpdateOne) SaveX ¶
func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node
SaveX is like Save, but panics if an error occurs.
func (*NodeUpdateOne) Select ¶
func (_u *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NodeUpdateOne) SetAgentName ¶
func (_u *NodeUpdateOne) SetAgentName(v string) *NodeUpdateOne
SetAgentName sets the "agent_name" field.
func (*NodeUpdateOne) SetBucket ¶
func (_u *NodeUpdateOne) SetBucket(v map[string]interface{}) *NodeUpdateOne
SetBucket sets the "bucket" field.
func (*NodeUpdateOne) SetCacheCreationInputTokens ¶
func (_u *NodeUpdateOne) SetCacheCreationInputTokens(v int) *NodeUpdateOne
SetCacheCreationInputTokens sets the "cache_creation_input_tokens" field.
func (*NodeUpdateOne) SetCacheReadInputTokens ¶
func (_u *NodeUpdateOne) SetCacheReadInputTokens(v int) *NodeUpdateOne
SetCacheReadInputTokens sets the "cache_read_input_tokens" field.
func (*NodeUpdateOne) SetCompletionTokens ¶
func (_u *NodeUpdateOne) SetCompletionTokens(v int) *NodeUpdateOne
SetCompletionTokens sets the "completion_tokens" field.
func (*NodeUpdateOne) SetContent ¶
func (_u *NodeUpdateOne) SetContent(v []map[string]interface{}) *NodeUpdateOne
SetContent sets the "content" field.
func (*NodeUpdateOne) SetModel ¶
func (_u *NodeUpdateOne) SetModel(v string) *NodeUpdateOne
SetModel sets the "model" field.
func (*NodeUpdateOne) SetNillableAgentName ¶
func (_u *NodeUpdateOne) SetNillableAgentName(v *string) *NodeUpdateOne
SetNillableAgentName sets the "agent_name" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableCacheCreationInputTokens ¶
func (_u *NodeUpdateOne) SetNillableCacheCreationInputTokens(v *int) *NodeUpdateOne
SetNillableCacheCreationInputTokens sets the "cache_creation_input_tokens" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableCacheReadInputTokens ¶
func (_u *NodeUpdateOne) SetNillableCacheReadInputTokens(v *int) *NodeUpdateOne
SetNillableCacheReadInputTokens sets the "cache_read_input_tokens" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableCompletionTokens ¶
func (_u *NodeUpdateOne) SetNillableCompletionTokens(v *int) *NodeUpdateOne
SetNillableCompletionTokens sets the "completion_tokens" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableModel ¶
func (_u *NodeUpdateOne) SetNillableModel(v *string) *NodeUpdateOne
SetNillableModel sets the "model" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableParentHash ¶
func (_u *NodeUpdateOne) SetNillableParentHash(v *string) *NodeUpdateOne
SetNillableParentHash sets the "parent_hash" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableParentID ¶
func (_u *NodeUpdateOne) SetNillableParentID(id *string) *NodeUpdateOne
SetNillableParentID sets the "parent" edge to the Node entity by ID if the given value is not nil.
func (*NodeUpdateOne) SetNillableProject ¶
func (_u *NodeUpdateOne) SetNillableProject(v *string) *NodeUpdateOne
SetNillableProject sets the "project" field if the given value is not nil.
func (*NodeUpdateOne) SetNillablePromptDurationNs ¶
func (_u *NodeUpdateOne) SetNillablePromptDurationNs(v *int64) *NodeUpdateOne
SetNillablePromptDurationNs sets the "prompt_duration_ns" field if the given value is not nil.
func (*NodeUpdateOne) SetNillablePromptTokens ¶
func (_u *NodeUpdateOne) SetNillablePromptTokens(v *int) *NodeUpdateOne
SetNillablePromptTokens sets the "prompt_tokens" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableProvider ¶
func (_u *NodeUpdateOne) SetNillableProvider(v *string) *NodeUpdateOne
SetNillableProvider sets the "provider" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableRole ¶
func (_u *NodeUpdateOne) SetNillableRole(v *string) *NodeUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableStopReason ¶
func (_u *NodeUpdateOne) SetNillableStopReason(v *string) *NodeUpdateOne
SetNillableStopReason sets the "stop_reason" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableTotalDurationNs ¶
func (_u *NodeUpdateOne) SetNillableTotalDurationNs(v *int64) *NodeUpdateOne
SetNillableTotalDurationNs sets the "total_duration_ns" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableTotalTokens ¶
func (_u *NodeUpdateOne) SetNillableTotalTokens(v *int) *NodeUpdateOne
SetNillableTotalTokens sets the "total_tokens" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableType ¶
func (_u *NodeUpdateOne) SetNillableType(v *string) *NodeUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*NodeUpdateOne) SetParent ¶
func (_u *NodeUpdateOne) SetParent(v *Node) *NodeUpdateOne
SetParent sets the "parent" edge to the Node entity.
func (*NodeUpdateOne) SetParentHash ¶
func (_u *NodeUpdateOne) SetParentHash(v string) *NodeUpdateOne
SetParentHash sets the "parent_hash" field.
func (*NodeUpdateOne) SetParentID ¶
func (_u *NodeUpdateOne) SetParentID(id string) *NodeUpdateOne
SetParentID sets the "parent" edge to the Node entity by ID.
func (*NodeUpdateOne) SetProject ¶
func (_u *NodeUpdateOne) SetProject(v string) *NodeUpdateOne
SetProject sets the "project" field.
func (*NodeUpdateOne) SetPromptDurationNs ¶
func (_u *NodeUpdateOne) SetPromptDurationNs(v int64) *NodeUpdateOne
SetPromptDurationNs sets the "prompt_duration_ns" field.
func (*NodeUpdateOne) SetPromptTokens ¶
func (_u *NodeUpdateOne) SetPromptTokens(v int) *NodeUpdateOne
SetPromptTokens sets the "prompt_tokens" field.
func (*NodeUpdateOne) SetProvider ¶
func (_u *NodeUpdateOne) SetProvider(v string) *NodeUpdateOne
SetProvider sets the "provider" field.
func (*NodeUpdateOne) SetRole ¶
func (_u *NodeUpdateOne) SetRole(v string) *NodeUpdateOne
SetRole sets the "role" field.
func (*NodeUpdateOne) SetStopReason ¶
func (_u *NodeUpdateOne) SetStopReason(v string) *NodeUpdateOne
SetStopReason sets the "stop_reason" field.
func (*NodeUpdateOne) SetTotalDurationNs ¶
func (_u *NodeUpdateOne) SetTotalDurationNs(v int64) *NodeUpdateOne
SetTotalDurationNs sets the "total_duration_ns" field.
func (*NodeUpdateOne) SetTotalTokens ¶
func (_u *NodeUpdateOne) SetTotalTokens(v int) *NodeUpdateOne
SetTotalTokens sets the "total_tokens" field.
func (*NodeUpdateOne) SetType ¶
func (_u *NodeUpdateOne) SetType(v string) *NodeUpdateOne
SetType sets the "type" field.
func (*NodeUpdateOne) Where ¶
func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne
Where appends a list predicates to the NodeUpdate builder.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker {
return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Rollback(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// Facet is the client for interacting with the Facet builders.
Facet *FacetClient
// Node is the client for interacting with the Node builders.
Node *NodeClient
// 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.