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 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 int) *NodeDeleteOne
- func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)
- func (c *NodeClient) GetX(ctx context.Context, id int) *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) Update() *NodeUpdate
- func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne
- func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne
- func (c *NodeClient) Use(hooks ...Hook)
- type 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) SetID(v int) *NodeCreate
- type NodeCreateBulk
- type NodeDelete
- type NodeDeleteOne
- 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) AddField(name string, value ent.Value) error
- 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) ClearEdge(name string) error
- func (m *NodeMutation) ClearField(name string) error
- func (m *NodeMutation) ClearedEdges() []string
- func (m *NodeMutation) ClearedFields() []string
- func (m NodeMutation) Client() *Client
- 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) ID() (id int, exists bool)
- func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NodeMutation) Op() Op
- func (m *NodeMutation) RemovedEdges() []string
- func (m *NodeMutation) RemovedIDs(name string) []ent.Value
- func (m *NodeMutation) ResetEdge(name string) error
- func (m *NodeMutation) ResetField(name string) error
- func (m *NodeMutation) SetField(name string, value ent.Value) error
- func (m *NodeMutation) SetID(id int)
- func (m *NodeMutation) SetOp(op Op)
- func (m NodeMutation) Tx() (*Tx, error)
- func (m *NodeMutation) Type() string
- 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 int, err error)
- func (_q *NodeQuery) FirstIDX(ctx context.Context) int
- 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 []int, err error)
- func (_q *NodeQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (_q *NodeQuery) OnlyIDX(ctx context.Context) int
- func (_q *NodeQuery) OnlyX(ctx context.Context) *Node
- func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery
- func (_q *NodeQuery) Select(fields ...string) *NodeSelect
- func (_q *NodeQuery) Unique(unique bool) *NodeQuery
- func (_q *NodeQuery) Where(ps ...predicate.Node) *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) Exec(ctx context.Context) error
- func (_u *NodeUpdate) ExecX(ctx context.Context)
- func (_u *NodeUpdate) Mutation() *NodeMutation
- func (_u *NodeUpdate) Save(ctx context.Context) (int, error)
- func (_u *NodeUpdate) SaveX(ctx context.Context) int
- func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
- type NodeUpdateOne
- func (_u *NodeUpdateOne) Exec(ctx context.Context) error
- func (_u *NodeUpdateOne) ExecX(ctx context.Context)
- func (_u *NodeUpdateOne) Mutation() *NodeMutation
- 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) Where(ps ...predicate.Node) *NodeUpdateOne
- type Nodes
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Poll
- type PollClient
- func (c *PollClient) Create() *PollCreate
- func (c *PollClient) CreateBulk(builders ...*PollCreate) *PollCreateBulk
- func (c *PollClient) Delete() *PollDelete
- func (c *PollClient) DeleteOne(_m *Poll) *PollDeleteOne
- func (c *PollClient) DeleteOneID(id int) *PollDeleteOne
- func (c *PollClient) Get(ctx context.Context, id int) (*Poll, error)
- func (c *PollClient) GetX(ctx context.Context, id int) *Poll
- func (c *PollClient) Hooks() []Hook
- func (c *PollClient) Intercept(interceptors ...Interceptor)
- func (c *PollClient) Interceptors() []Interceptor
- func (c *PollClient) MapCreateBulk(slice any, setFunc func(*PollCreate, int)) *PollCreateBulk
- func (c *PollClient) Query() *PollQuery
- func (c *PollClient) QueryNodes(_m *Poll) *NodeQuery
- func (c *PollClient) QueryOptions(_m *Poll) *PollOptionQuery
- func (c *PollClient) QueryVotes(_m *Poll) *PollVoteQuery
- func (c *PollClient) Update() *PollUpdate
- func (c *PollClient) UpdateOne(_m *Poll) *PollUpdateOne
- func (c *PollClient) UpdateOneID(id int) *PollUpdateOne
- func (c *PollClient) Use(hooks ...Hook)
- type PollCreate
- func (_c *PollCreate) AddOptionIDs(ids ...int) *PollCreate
- func (_c *PollCreate) AddOptions(v ...*PollOption) *PollCreate
- func (_c *PollCreate) AddVoteIDs(ids ...int) *PollCreate
- func (_c *PollCreate) AddVotes(v ...*PollVote) *PollCreate
- func (_c *PollCreate) Exec(ctx context.Context) error
- func (_c *PollCreate) ExecX(ctx context.Context)
- func (_c *PollCreate) Mutation() *PollMutation
- func (_c *PollCreate) Save(ctx context.Context) (*Poll, error)
- func (_c *PollCreate) SaveX(ctx context.Context) *Poll
- func (_c *PollCreate) SetAllowRevote(v bool) *PollCreate
- func (_c *PollCreate) SetAvailableFrom(v time.Time) *PollCreate
- func (_c *PollCreate) SetAvailableTo(v time.Time) *PollCreate
- func (_c *PollCreate) SetDescription(v string) *PollCreate
- func (_c *PollCreate) SetID(v int) *PollCreate
- func (_c *PollCreate) SetMaxAnswers(v int) *PollCreate
- func (_c *PollCreate) SetNid(v int) *PollCreate
- func (_c *PollCreate) SetNillableAllowRevote(v *bool) *PollCreate
- func (_c *PollCreate) SetNillableAvailableFrom(v *time.Time) *PollCreate
- func (_c *PollCreate) SetNillableAvailableTo(v *time.Time) *PollCreate
- func (_c *PollCreate) SetNillableDescription(v *string) *PollCreate
- func (_c *PollCreate) SetNillableMaxAnswers(v *int) *PollCreate
- func (_c *PollCreate) SetNillableResultsOnly(v *bool) *PollCreate
- func (_c *PollCreate) SetNodes(v *Node) *PollCreate
- func (_c *PollCreate) SetNodesID(id int) *PollCreate
- func (_c *PollCreate) SetResultsOnly(v bool) *PollCreate
- type PollCreateBulk
- type PollDelete
- type PollDeleteOne
- type PollEdges
- type PollGroupBy
- func (_g *PollGroupBy) Aggregate(fns ...AggregateFunc) *PollGroupBy
- func (s *PollGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollGroupBy) BoolX(ctx context.Context) bool
- func (s *PollGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PollGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PollGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollGroupBy) Float64X(ctx context.Context) float64
- func (s *PollGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PollGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PollGroupBy) IntX(ctx context.Context) int
- func (s *PollGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PollGroupBy) IntsX(ctx context.Context) []int
- func (_g *PollGroupBy) Scan(ctx context.Context, v any) error
- func (s *PollGroupBy) ScanX(ctx context.Context, v any)
- func (s *PollGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PollGroupBy) StringX(ctx context.Context) string
- func (s *PollGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PollGroupBy) StringsX(ctx context.Context) []string
- type PollMutation
- func (m *PollMutation) AddField(name string, value ent.Value) error
- func (m *PollMutation) AddMaxAnswers(i int)
- func (m *PollMutation) AddOptionIDs(ids ...int)
- func (m *PollMutation) AddVoteIDs(ids ...int)
- func (m *PollMutation) AddedEdges() []string
- func (m *PollMutation) AddedField(name string) (ent.Value, bool)
- func (m *PollMutation) AddedFields() []string
- func (m *PollMutation) AddedIDs(name string) []ent.Value
- func (m *PollMutation) AddedMaxAnswers() (r int, exists bool)
- func (m *PollMutation) AllowRevote() (r bool, exists bool)
- func (m *PollMutation) AvailableFrom() (r time.Time, exists bool)
- func (m *PollMutation) AvailableFromCleared() bool
- func (m *PollMutation) AvailableTo() (r time.Time, exists bool)
- func (m *PollMutation) AvailableToCleared() bool
- func (m *PollMutation) ClearAvailableFrom()
- func (m *PollMutation) ClearAvailableTo()
- func (m *PollMutation) ClearDescription()
- func (m *PollMutation) ClearEdge(name string) error
- func (m *PollMutation) ClearField(name string) error
- func (m *PollMutation) ClearNodes()
- func (m *PollMutation) ClearOptions()
- func (m *PollMutation) ClearVotes()
- func (m *PollMutation) ClearedEdges() []string
- func (m *PollMutation) ClearedFields() []string
- func (m PollMutation) Client() *Client
- func (m *PollMutation) Description() (r string, exists bool)
- func (m *PollMutation) DescriptionCleared() bool
- func (m *PollMutation) EdgeCleared(name string) bool
- func (m *PollMutation) Field(name string) (ent.Value, bool)
- func (m *PollMutation) FieldCleared(name string) bool
- func (m *PollMutation) Fields() []string
- func (m *PollMutation) ID() (id int, exists bool)
- func (m *PollMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PollMutation) MaxAnswers() (r int, exists bool)
- func (m *PollMutation) Nid() (r int, exists bool)
- func (m *PollMutation) NodesCleared() bool
- func (m *PollMutation) NodesID() (id int, exists bool)
- func (m *PollMutation) NodesIDs() (ids []int)
- func (m *PollMutation) OldAllowRevote(ctx context.Context) (v bool, err error)
- func (m *PollMutation) OldAvailableFrom(ctx context.Context) (v *time.Time, err error)
- func (m *PollMutation) OldAvailableTo(ctx context.Context) (v *time.Time, err error)
- func (m *PollMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *PollMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PollMutation) OldMaxAnswers(ctx context.Context) (v int, err error)
- func (m *PollMutation) OldNid(ctx context.Context) (v int, err error)
- func (m *PollMutation) OldResultsOnly(ctx context.Context) (v bool, err error)
- func (m *PollMutation) Op() Op
- func (m *PollMutation) OptionsCleared() bool
- func (m *PollMutation) OptionsIDs() (ids []int)
- func (m *PollMutation) RemoveOptionIDs(ids ...int)
- func (m *PollMutation) RemoveVoteIDs(ids ...int)
- func (m *PollMutation) RemovedEdges() []string
- func (m *PollMutation) RemovedIDs(name string) []ent.Value
- func (m *PollMutation) RemovedOptionsIDs() (ids []int)
- func (m *PollMutation) RemovedVotesIDs() (ids []int)
- func (m *PollMutation) ResetAllowRevote()
- func (m *PollMutation) ResetAvailableFrom()
- func (m *PollMutation) ResetAvailableTo()
- func (m *PollMutation) ResetDescription()
- func (m *PollMutation) ResetEdge(name string) error
- func (m *PollMutation) ResetField(name string) error
- func (m *PollMutation) ResetMaxAnswers()
- func (m *PollMutation) ResetNid()
- func (m *PollMutation) ResetNodes()
- func (m *PollMutation) ResetOptions()
- func (m *PollMutation) ResetResultsOnly()
- func (m *PollMutation) ResetVotes()
- func (m *PollMutation) ResultsOnly() (r bool, exists bool)
- func (m *PollMutation) SetAllowRevote(b bool)
- func (m *PollMutation) SetAvailableFrom(t time.Time)
- func (m *PollMutation) SetAvailableTo(t time.Time)
- func (m *PollMutation) SetDescription(s string)
- func (m *PollMutation) SetField(name string, value ent.Value) error
- func (m *PollMutation) SetID(id int)
- func (m *PollMutation) SetMaxAnswers(i int)
- func (m *PollMutation) SetNid(i int)
- func (m *PollMutation) SetNodesID(id int)
- func (m *PollMutation) SetOp(op Op)
- func (m *PollMutation) SetResultsOnly(b bool)
- func (m PollMutation) Tx() (*Tx, error)
- func (m *PollMutation) Type() string
- func (m *PollMutation) VotesCleared() bool
- func (m *PollMutation) VotesIDs() (ids []int)
- func (m *PollMutation) Where(ps ...predicate.Poll)
- func (m *PollMutation) WhereP(ps ...func(*sql.Selector))
- type PollOption
- type PollOptionClient
- func (c *PollOptionClient) Create() *PollOptionCreate
- func (c *PollOptionClient) CreateBulk(builders ...*PollOptionCreate) *PollOptionCreateBulk
- func (c *PollOptionClient) Delete() *PollOptionDelete
- func (c *PollOptionClient) DeleteOne(_m *PollOption) *PollOptionDeleteOne
- func (c *PollOptionClient) DeleteOneID(id int) *PollOptionDeleteOne
- func (c *PollOptionClient) Get(ctx context.Context, id int) (*PollOption, error)
- func (c *PollOptionClient) GetX(ctx context.Context, id int) *PollOption
- func (c *PollOptionClient) Hooks() []Hook
- func (c *PollOptionClient) Intercept(interceptors ...Interceptor)
- func (c *PollOptionClient) Interceptors() []Interceptor
- func (c *PollOptionClient) MapCreateBulk(slice any, setFunc func(*PollOptionCreate, int)) *PollOptionCreateBulk
- func (c *PollOptionClient) Query() *PollOptionQuery
- func (c *PollOptionClient) QueryOptionVotes(_m *PollOption) *PollVoteQuery
- func (c *PollOptionClient) QueryPoll(_m *PollOption) *PollQuery
- func (c *PollOptionClient) Update() *PollOptionUpdate
- func (c *PollOptionClient) UpdateOne(_m *PollOption) *PollOptionUpdateOne
- func (c *PollOptionClient) UpdateOneID(id int) *PollOptionUpdateOne
- func (c *PollOptionClient) Use(hooks ...Hook)
- type PollOptionCreate
- func (_c *PollOptionCreate) AddOptionVoteIDs(ids ...int) *PollOptionCreate
- func (_c *PollOptionCreate) AddOptionVotes(v ...*PollVote) *PollOptionCreate
- func (_c *PollOptionCreate) Exec(ctx context.Context) error
- func (_c *PollOptionCreate) ExecX(ctx context.Context)
- func (_c *PollOptionCreate) Mutation() *PollOptionMutation
- func (_c *PollOptionCreate) Save(ctx context.Context) (*PollOption, error)
- func (_c *PollOptionCreate) SaveX(ctx context.Context) *PollOption
- func (_c *PollOptionCreate) SetID(v int) *PollOptionCreate
- func (_c *PollOptionCreate) SetLabel(v string) *PollOptionCreate
- func (_c *PollOptionCreate) SetNillableWeight(v *int) *PollOptionCreate
- func (_c *PollOptionCreate) SetPoll(v *Poll) *PollOptionCreate
- func (_c *PollOptionCreate) SetPollID(v int) *PollOptionCreate
- func (_c *PollOptionCreate) SetWeight(v int) *PollOptionCreate
- type PollOptionCreateBulk
- type PollOptionDelete
- type PollOptionDeleteOne
- type PollOptionEdges
- type PollOptionGroupBy
- func (_g *PollOptionGroupBy) Aggregate(fns ...AggregateFunc) *PollOptionGroupBy
- func (s *PollOptionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollOptionGroupBy) BoolX(ctx context.Context) bool
- func (s *PollOptionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PollOptionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PollOptionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollOptionGroupBy) Float64X(ctx context.Context) float64
- func (s *PollOptionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollOptionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PollOptionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PollOptionGroupBy) IntX(ctx context.Context) int
- func (s *PollOptionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PollOptionGroupBy) IntsX(ctx context.Context) []int
- func (_g *PollOptionGroupBy) Scan(ctx context.Context, v any) error
- func (s *PollOptionGroupBy) ScanX(ctx context.Context, v any)
- func (s *PollOptionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PollOptionGroupBy) StringX(ctx context.Context) string
- func (s *PollOptionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PollOptionGroupBy) StringsX(ctx context.Context) []string
- type PollOptionMutation
- func (m *PollOptionMutation) AddField(name string, value ent.Value) error
- func (m *PollOptionMutation) AddOptionVoteIDs(ids ...int)
- func (m *PollOptionMutation) AddWeight(i int)
- func (m *PollOptionMutation) AddedEdges() []string
- func (m *PollOptionMutation) AddedField(name string) (ent.Value, bool)
- func (m *PollOptionMutation) AddedFields() []string
- func (m *PollOptionMutation) AddedIDs(name string) []ent.Value
- func (m *PollOptionMutation) AddedWeight() (r int, exists bool)
- func (m *PollOptionMutation) ClearEdge(name string) error
- func (m *PollOptionMutation) ClearField(name string) error
- func (m *PollOptionMutation) ClearOptionVotes()
- func (m *PollOptionMutation) ClearPoll()
- func (m *PollOptionMutation) ClearedEdges() []string
- func (m *PollOptionMutation) ClearedFields() []string
- func (m PollOptionMutation) Client() *Client
- func (m *PollOptionMutation) EdgeCleared(name string) bool
- func (m *PollOptionMutation) Field(name string) (ent.Value, bool)
- func (m *PollOptionMutation) FieldCleared(name string) bool
- func (m *PollOptionMutation) Fields() []string
- func (m *PollOptionMutation) ID() (id int, exists bool)
- func (m *PollOptionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PollOptionMutation) Label() (r string, exists bool)
- func (m *PollOptionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PollOptionMutation) OldLabel(ctx context.Context) (v string, err error)
- func (m *PollOptionMutation) OldPollID(ctx context.Context) (v int, err error)
- func (m *PollOptionMutation) OldWeight(ctx context.Context) (v int, err error)
- func (m *PollOptionMutation) Op() Op
- func (m *PollOptionMutation) OptionVotesCleared() bool
- func (m *PollOptionMutation) OptionVotesIDs() (ids []int)
- func (m *PollOptionMutation) PollCleared() bool
- func (m *PollOptionMutation) PollID() (r int, exists bool)
- func (m *PollOptionMutation) PollIDs() (ids []int)
- func (m *PollOptionMutation) RemoveOptionVoteIDs(ids ...int)
- func (m *PollOptionMutation) RemovedEdges() []string
- func (m *PollOptionMutation) RemovedIDs(name string) []ent.Value
- func (m *PollOptionMutation) RemovedOptionVotesIDs() (ids []int)
- func (m *PollOptionMutation) ResetEdge(name string) error
- func (m *PollOptionMutation) ResetField(name string) error
- func (m *PollOptionMutation) ResetLabel()
- func (m *PollOptionMutation) ResetOptionVotes()
- func (m *PollOptionMutation) ResetPoll()
- func (m *PollOptionMutation) ResetPollID()
- func (m *PollOptionMutation) ResetWeight()
- func (m *PollOptionMutation) SetField(name string, value ent.Value) error
- func (m *PollOptionMutation) SetID(id int)
- func (m *PollOptionMutation) SetLabel(s string)
- func (m *PollOptionMutation) SetOp(op Op)
- func (m *PollOptionMutation) SetPollID(i int)
- func (m *PollOptionMutation) SetWeight(i int)
- func (m PollOptionMutation) Tx() (*Tx, error)
- func (m *PollOptionMutation) Type() string
- func (m *PollOptionMutation) Weight() (r int, exists bool)
- func (m *PollOptionMutation) Where(ps ...predicate.PollOption)
- func (m *PollOptionMutation) WhereP(ps ...func(*sql.Selector))
- type PollOptionQuery
- func (_q *PollOptionQuery) Aggregate(fns ...AggregateFunc) *PollOptionSelect
- func (_q *PollOptionQuery) All(ctx context.Context) ([]*PollOption, error)
- func (_q *PollOptionQuery) AllX(ctx context.Context) []*PollOption
- func (_q *PollOptionQuery) Clone() *PollOptionQuery
- func (_q *PollOptionQuery) Count(ctx context.Context) (int, error)
- func (_q *PollOptionQuery) CountX(ctx context.Context) int
- func (_q *PollOptionQuery) Exist(ctx context.Context) (bool, error)
- func (_q *PollOptionQuery) ExistX(ctx context.Context) bool
- func (_q *PollOptionQuery) First(ctx context.Context) (*PollOption, error)
- func (_q *PollOptionQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *PollOptionQuery) FirstIDX(ctx context.Context) int
- func (_q *PollOptionQuery) FirstX(ctx context.Context) *PollOption
- func (_q *PollOptionQuery) GroupBy(field string, fields ...string) *PollOptionGroupBy
- func (_q *PollOptionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *PollOptionQuery) IDsX(ctx context.Context) []int
- func (_q *PollOptionQuery) Limit(limit int) *PollOptionQuery
- func (_q *PollOptionQuery) Offset(offset int) *PollOptionQuery
- func (_q *PollOptionQuery) Only(ctx context.Context) (*PollOption, error)
- func (_q *PollOptionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *PollOptionQuery) OnlyIDX(ctx context.Context) int
- func (_q *PollOptionQuery) OnlyX(ctx context.Context) *PollOption
- func (_q *PollOptionQuery) Order(o ...polloption.OrderOption) *PollOptionQuery
- func (_q *PollOptionQuery) QueryOptionVotes() *PollVoteQuery
- func (_q *PollOptionQuery) QueryPoll() *PollQuery
- func (_q *PollOptionQuery) Select(fields ...string) *PollOptionSelect
- func (_q *PollOptionQuery) Unique(unique bool) *PollOptionQuery
- func (_q *PollOptionQuery) Where(ps ...predicate.PollOption) *PollOptionQuery
- func (_q *PollOptionQuery) WithOptionVotes(opts ...func(*PollVoteQuery)) *PollOptionQuery
- func (_q *PollOptionQuery) WithPoll(opts ...func(*PollQuery)) *PollOptionQuery
- type PollOptionSelect
- func (_s *PollOptionSelect) Aggregate(fns ...AggregateFunc) *PollOptionSelect
- func (s *PollOptionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollOptionSelect) BoolX(ctx context.Context) bool
- func (s *PollOptionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PollOptionSelect) BoolsX(ctx context.Context) []bool
- func (s *PollOptionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollOptionSelect) Float64X(ctx context.Context) float64
- func (s *PollOptionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollOptionSelect) Float64sX(ctx context.Context) []float64
- func (s *PollOptionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PollOptionSelect) IntX(ctx context.Context) int
- func (s *PollOptionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PollOptionSelect) IntsX(ctx context.Context) []int
- func (_s *PollOptionSelect) Scan(ctx context.Context, v any) error
- func (s *PollOptionSelect) ScanX(ctx context.Context, v any)
- func (s *PollOptionSelect) String(ctx context.Context) (_ string, err error)
- func (s *PollOptionSelect) StringX(ctx context.Context) string
- func (s *PollOptionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PollOptionSelect) StringsX(ctx context.Context) []string
- type PollOptionUpdate
- func (_u *PollOptionUpdate) AddOptionVoteIDs(ids ...int) *PollOptionUpdate
- func (_u *PollOptionUpdate) AddOptionVotes(v ...*PollVote) *PollOptionUpdate
- func (_u *PollOptionUpdate) AddWeight(v int) *PollOptionUpdate
- func (_u *PollOptionUpdate) ClearOptionVotes() *PollOptionUpdate
- func (_u *PollOptionUpdate) ClearPoll() *PollOptionUpdate
- func (_u *PollOptionUpdate) Exec(ctx context.Context) error
- func (_u *PollOptionUpdate) ExecX(ctx context.Context)
- func (_u *PollOptionUpdate) Mutation() *PollOptionMutation
- func (_u *PollOptionUpdate) RemoveOptionVoteIDs(ids ...int) *PollOptionUpdate
- func (_u *PollOptionUpdate) RemoveOptionVotes(v ...*PollVote) *PollOptionUpdate
- func (_u *PollOptionUpdate) Save(ctx context.Context) (int, error)
- func (_u *PollOptionUpdate) SaveX(ctx context.Context) int
- func (_u *PollOptionUpdate) SetLabel(v string) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetNillableLabel(v *string) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetNillablePollID(v *int) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetNillableWeight(v *int) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetPoll(v *Poll) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetPollID(v int) *PollOptionUpdate
- func (_u *PollOptionUpdate) SetWeight(v int) *PollOptionUpdate
- func (_u *PollOptionUpdate) Where(ps ...predicate.PollOption) *PollOptionUpdate
- type PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) AddOptionVoteIDs(ids ...int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) AddOptionVotes(v ...*PollVote) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) AddWeight(v int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) ClearOptionVotes() *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) ClearPoll() *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) Exec(ctx context.Context) error
- func (_u *PollOptionUpdateOne) ExecX(ctx context.Context)
- func (_u *PollOptionUpdateOne) Mutation() *PollOptionMutation
- func (_u *PollOptionUpdateOne) RemoveOptionVoteIDs(ids ...int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) RemoveOptionVotes(v ...*PollVote) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) Save(ctx context.Context) (*PollOption, error)
- func (_u *PollOptionUpdateOne) SaveX(ctx context.Context) *PollOption
- func (_u *PollOptionUpdateOne) Select(field string, fields ...string) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetLabel(v string) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetNillableLabel(v *string) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetNillablePollID(v *int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetNillableWeight(v *int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetPoll(v *Poll) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetPollID(v int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) SetWeight(v int) *PollOptionUpdateOne
- func (_u *PollOptionUpdateOne) Where(ps ...predicate.PollOption) *PollOptionUpdateOne
- type PollOptions
- type PollQuery
- func (_q *PollQuery) Aggregate(fns ...AggregateFunc) *PollSelect
- func (_q *PollQuery) All(ctx context.Context) ([]*Poll, error)
- func (_q *PollQuery) AllX(ctx context.Context) []*Poll
- func (_q *PollQuery) Clone() *PollQuery
- func (_q *PollQuery) Count(ctx context.Context) (int, error)
- func (_q *PollQuery) CountX(ctx context.Context) int
- func (_q *PollQuery) Exist(ctx context.Context) (bool, error)
- func (_q *PollQuery) ExistX(ctx context.Context) bool
- func (_q *PollQuery) First(ctx context.Context) (*Poll, error)
- func (_q *PollQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *PollQuery) FirstIDX(ctx context.Context) int
- func (_q *PollQuery) FirstX(ctx context.Context) *Poll
- func (_q *PollQuery) GroupBy(field string, fields ...string) *PollGroupBy
- func (_q *PollQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *PollQuery) IDsX(ctx context.Context) []int
- func (_q *PollQuery) Limit(limit int) *PollQuery
- func (_q *PollQuery) Offset(offset int) *PollQuery
- func (_q *PollQuery) Only(ctx context.Context) (*Poll, error)
- func (_q *PollQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *PollQuery) OnlyIDX(ctx context.Context) int
- func (_q *PollQuery) OnlyX(ctx context.Context) *Poll
- func (_q *PollQuery) Order(o ...poll.OrderOption) *PollQuery
- func (_q *PollQuery) QueryNodes() *NodeQuery
- func (_q *PollQuery) QueryOptions() *PollOptionQuery
- func (_q *PollQuery) QueryVotes() *PollVoteQuery
- func (_q *PollQuery) Select(fields ...string) *PollSelect
- func (_q *PollQuery) Unique(unique bool) *PollQuery
- func (_q *PollQuery) Where(ps ...predicate.Poll) *PollQuery
- func (_q *PollQuery) WithNodes(opts ...func(*NodeQuery)) *PollQuery
- func (_q *PollQuery) WithOptions(opts ...func(*PollOptionQuery)) *PollQuery
- func (_q *PollQuery) WithVotes(opts ...func(*PollVoteQuery)) *PollQuery
- type PollSelect
- func (_s *PollSelect) Aggregate(fns ...AggregateFunc) *PollSelect
- func (s *PollSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollSelect) BoolX(ctx context.Context) bool
- func (s *PollSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PollSelect) BoolsX(ctx context.Context) []bool
- func (s *PollSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollSelect) Float64X(ctx context.Context) float64
- func (s *PollSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollSelect) Float64sX(ctx context.Context) []float64
- func (s *PollSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PollSelect) IntX(ctx context.Context) int
- func (s *PollSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PollSelect) IntsX(ctx context.Context) []int
- func (_s *PollSelect) Scan(ctx context.Context, v any) error
- func (s *PollSelect) ScanX(ctx context.Context, v any)
- func (s *PollSelect) String(ctx context.Context) (_ string, err error)
- func (s *PollSelect) StringX(ctx context.Context) string
- func (s *PollSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PollSelect) StringsX(ctx context.Context) []string
- type PollUpdate
- func (_u *PollUpdate) AddMaxAnswers(v int) *PollUpdate
- func (_u *PollUpdate) AddOptionIDs(ids ...int) *PollUpdate
- func (_u *PollUpdate) AddOptions(v ...*PollOption) *PollUpdate
- func (_u *PollUpdate) AddVoteIDs(ids ...int) *PollUpdate
- func (_u *PollUpdate) AddVotes(v ...*PollVote) *PollUpdate
- func (_u *PollUpdate) ClearAvailableFrom() *PollUpdate
- func (_u *PollUpdate) ClearAvailableTo() *PollUpdate
- func (_u *PollUpdate) ClearDescription() *PollUpdate
- func (_u *PollUpdate) ClearNodes() *PollUpdate
- func (_u *PollUpdate) ClearOptions() *PollUpdate
- func (_u *PollUpdate) ClearVotes() *PollUpdate
- func (_u *PollUpdate) Exec(ctx context.Context) error
- func (_u *PollUpdate) ExecX(ctx context.Context)
- func (_u *PollUpdate) Mutation() *PollMutation
- func (_u *PollUpdate) RemoveOptionIDs(ids ...int) *PollUpdate
- func (_u *PollUpdate) RemoveOptions(v ...*PollOption) *PollUpdate
- func (_u *PollUpdate) RemoveVoteIDs(ids ...int) *PollUpdate
- func (_u *PollUpdate) RemoveVotes(v ...*PollVote) *PollUpdate
- func (_u *PollUpdate) Save(ctx context.Context) (int, error)
- func (_u *PollUpdate) SaveX(ctx context.Context) int
- func (_u *PollUpdate) SetAllowRevote(v bool) *PollUpdate
- func (_u *PollUpdate) SetAvailableFrom(v time.Time) *PollUpdate
- func (_u *PollUpdate) SetAvailableTo(v time.Time) *PollUpdate
- func (_u *PollUpdate) SetDescription(v string) *PollUpdate
- func (_u *PollUpdate) SetMaxAnswers(v int) *PollUpdate
- func (_u *PollUpdate) SetNid(v int) *PollUpdate
- func (_u *PollUpdate) SetNillableAllowRevote(v *bool) *PollUpdate
- func (_u *PollUpdate) SetNillableAvailableFrom(v *time.Time) *PollUpdate
- func (_u *PollUpdate) SetNillableAvailableTo(v *time.Time) *PollUpdate
- func (_u *PollUpdate) SetNillableDescription(v *string) *PollUpdate
- func (_u *PollUpdate) SetNillableMaxAnswers(v *int) *PollUpdate
- func (_u *PollUpdate) SetNillableNid(v *int) *PollUpdate
- func (_u *PollUpdate) SetNillableResultsOnly(v *bool) *PollUpdate
- func (_u *PollUpdate) SetNodes(v *Node) *PollUpdate
- func (_u *PollUpdate) SetNodesID(id int) *PollUpdate
- func (_u *PollUpdate) SetResultsOnly(v bool) *PollUpdate
- func (_u *PollUpdate) Where(ps ...predicate.Poll) *PollUpdate
- type PollUpdateOne
- func (_u *PollUpdateOne) AddMaxAnswers(v int) *PollUpdateOne
- func (_u *PollUpdateOne) AddOptionIDs(ids ...int) *PollUpdateOne
- func (_u *PollUpdateOne) AddOptions(v ...*PollOption) *PollUpdateOne
- func (_u *PollUpdateOne) AddVoteIDs(ids ...int) *PollUpdateOne
- func (_u *PollUpdateOne) AddVotes(v ...*PollVote) *PollUpdateOne
- func (_u *PollUpdateOne) ClearAvailableFrom() *PollUpdateOne
- func (_u *PollUpdateOne) ClearAvailableTo() *PollUpdateOne
- func (_u *PollUpdateOne) ClearDescription() *PollUpdateOne
- func (_u *PollUpdateOne) ClearNodes() *PollUpdateOne
- func (_u *PollUpdateOne) ClearOptions() *PollUpdateOne
- func (_u *PollUpdateOne) ClearVotes() *PollUpdateOne
- func (_u *PollUpdateOne) Exec(ctx context.Context) error
- func (_u *PollUpdateOne) ExecX(ctx context.Context)
- func (_u *PollUpdateOne) Mutation() *PollMutation
- func (_u *PollUpdateOne) RemoveOptionIDs(ids ...int) *PollUpdateOne
- func (_u *PollUpdateOne) RemoveOptions(v ...*PollOption) *PollUpdateOne
- func (_u *PollUpdateOne) RemoveVoteIDs(ids ...int) *PollUpdateOne
- func (_u *PollUpdateOne) RemoveVotes(v ...*PollVote) *PollUpdateOne
- func (_u *PollUpdateOne) Save(ctx context.Context) (*Poll, error)
- func (_u *PollUpdateOne) SaveX(ctx context.Context) *Poll
- func (_u *PollUpdateOne) Select(field string, fields ...string) *PollUpdateOne
- func (_u *PollUpdateOne) SetAllowRevote(v bool) *PollUpdateOne
- func (_u *PollUpdateOne) SetAvailableFrom(v time.Time) *PollUpdateOne
- func (_u *PollUpdateOne) SetAvailableTo(v time.Time) *PollUpdateOne
- func (_u *PollUpdateOne) SetDescription(v string) *PollUpdateOne
- func (_u *PollUpdateOne) SetMaxAnswers(v int) *PollUpdateOne
- func (_u *PollUpdateOne) SetNid(v int) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableAllowRevote(v *bool) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableAvailableFrom(v *time.Time) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableAvailableTo(v *time.Time) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableDescription(v *string) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableMaxAnswers(v *int) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableNid(v *int) *PollUpdateOne
- func (_u *PollUpdateOne) SetNillableResultsOnly(v *bool) *PollUpdateOne
- func (_u *PollUpdateOne) SetNodes(v *Node) *PollUpdateOne
- func (_u *PollUpdateOne) SetNodesID(id int) *PollUpdateOne
- func (_u *PollUpdateOne) SetResultsOnly(v bool) *PollUpdateOne
- func (_u *PollUpdateOne) Where(ps ...predicate.Poll) *PollUpdateOne
- type PollVote
- func (_m *PollVote) QueryPoll() *PollQuery
- func (_m *PollVote) QueryPollOption() *PollOptionQuery
- func (_m *PollVote) QueryUsers() *UserQuery
- func (_m *PollVote) String() string
- func (_m *PollVote) Unwrap() *PollVote
- func (_m *PollVote) Update() *PollVoteUpdateOne
- func (_m *PollVote) Value(name string) (ent.Value, error)
- type PollVoteClient
- func (c *PollVoteClient) Create() *PollVoteCreate
- func (c *PollVoteClient) CreateBulk(builders ...*PollVoteCreate) *PollVoteCreateBulk
- func (c *PollVoteClient) Delete() *PollVoteDelete
- func (c *PollVoteClient) DeleteOne(_m *PollVote) *PollVoteDeleteOne
- func (c *PollVoteClient) DeleteOneID(id int) *PollVoteDeleteOne
- func (c *PollVoteClient) Get(ctx context.Context, id int) (*PollVote, error)
- func (c *PollVoteClient) GetX(ctx context.Context, id int) *PollVote
- func (c *PollVoteClient) Hooks() []Hook
- func (c *PollVoteClient) Intercept(interceptors ...Interceptor)
- func (c *PollVoteClient) Interceptors() []Interceptor
- func (c *PollVoteClient) MapCreateBulk(slice any, setFunc func(*PollVoteCreate, int)) *PollVoteCreateBulk
- func (c *PollVoteClient) Query() *PollVoteQuery
- func (c *PollVoteClient) QueryPoll(_m *PollVote) *PollQuery
- func (c *PollVoteClient) QueryPollOption(_m *PollVote) *PollOptionQuery
- func (c *PollVoteClient) QueryUsers(_m *PollVote) *UserQuery
- func (c *PollVoteClient) Update() *PollVoteUpdate
- func (c *PollVoteClient) UpdateOne(_m *PollVote) *PollVoteUpdateOne
- func (c *PollVoteClient) UpdateOneID(id int) *PollVoteUpdateOne
- func (c *PollVoteClient) Use(hooks ...Hook)
- type PollVoteCreate
- func (_c *PollVoteCreate) Exec(ctx context.Context) error
- func (_c *PollVoteCreate) ExecX(ctx context.Context)
- func (_c *PollVoteCreate) Mutation() *PollVoteMutation
- func (_c *PollVoteCreate) Save(ctx context.Context) (*PollVote, error)
- func (_c *PollVoteCreate) SaveX(ctx context.Context) *PollVote
- func (_c *PollVoteCreate) SetCreatedAt(v time.Time) *PollVoteCreate
- func (_c *PollVoteCreate) SetID(v int) *PollVoteCreate
- func (_c *PollVoteCreate) SetNillableCreatedAt(v *time.Time) *PollVoteCreate
- func (_c *PollVoteCreate) SetOptionID(v int) *PollVoteCreate
- func (_c *PollVoteCreate) SetPoll(v *Poll) *PollVoteCreate
- func (_c *PollVoteCreate) SetPollID(v int) *PollVoteCreate
- func (_c *PollVoteCreate) SetPollOption(v *PollOption) *PollVoteCreate
- func (_c *PollVoteCreate) SetPollOptionID(id int) *PollVoteCreate
- func (_c *PollVoteCreate) SetUserID(v int) *PollVoteCreate
- func (_c *PollVoteCreate) SetUsers(v *User) *PollVoteCreate
- func (_c *PollVoteCreate) SetUsersID(id int) *PollVoteCreate
- type PollVoteCreateBulk
- type PollVoteDelete
- type PollVoteDeleteOne
- type PollVoteEdges
- type PollVoteGroupBy
- func (_g *PollVoteGroupBy) Aggregate(fns ...AggregateFunc) *PollVoteGroupBy
- func (s *PollVoteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollVoteGroupBy) BoolX(ctx context.Context) bool
- func (s *PollVoteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PollVoteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PollVoteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollVoteGroupBy) Float64X(ctx context.Context) float64
- func (s *PollVoteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollVoteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PollVoteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PollVoteGroupBy) IntX(ctx context.Context) int
- func (s *PollVoteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PollVoteGroupBy) IntsX(ctx context.Context) []int
- func (_g *PollVoteGroupBy) Scan(ctx context.Context, v any) error
- func (s *PollVoteGroupBy) ScanX(ctx context.Context, v any)
- func (s *PollVoteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PollVoteGroupBy) StringX(ctx context.Context) string
- func (s *PollVoteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PollVoteGroupBy) StringsX(ctx context.Context) []string
- type PollVoteMutation
- func (m *PollVoteMutation) AddField(name string, value ent.Value) error
- func (m *PollVoteMutation) AddedEdges() []string
- func (m *PollVoteMutation) AddedField(name string) (ent.Value, bool)
- func (m *PollVoteMutation) AddedFields() []string
- func (m *PollVoteMutation) AddedIDs(name string) []ent.Value
- func (m *PollVoteMutation) ClearEdge(name string) error
- func (m *PollVoteMutation) ClearField(name string) error
- func (m *PollVoteMutation) ClearPoll()
- func (m *PollVoteMutation) ClearPollOption()
- func (m *PollVoteMutation) ClearUsers()
- func (m *PollVoteMutation) ClearedEdges() []string
- func (m *PollVoteMutation) ClearedFields() []string
- func (m PollVoteMutation) Client() *Client
- func (m *PollVoteMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PollVoteMutation) EdgeCleared(name string) bool
- func (m *PollVoteMutation) Field(name string) (ent.Value, bool)
- func (m *PollVoteMutation) FieldCleared(name string) bool
- func (m *PollVoteMutation) Fields() []string
- func (m *PollVoteMutation) ID() (id int, exists bool)
- func (m *PollVoteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PollVoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PollVoteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PollVoteMutation) OldOptionID(ctx context.Context) (v int, err error)
- func (m *PollVoteMutation) OldPollID(ctx context.Context) (v int, err error)
- func (m *PollVoteMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *PollVoteMutation) Op() Op
- func (m *PollVoteMutation) OptionID() (r int, exists bool)
- func (m *PollVoteMutation) PollCleared() bool
- func (m *PollVoteMutation) PollID() (r int, exists bool)
- func (m *PollVoteMutation) PollIDs() (ids []int)
- func (m *PollVoteMutation) PollOptionCleared() bool
- func (m *PollVoteMutation) PollOptionID() (id int, exists bool)
- func (m *PollVoteMutation) PollOptionIDs() (ids []int)
- func (m *PollVoteMutation) RemovedEdges() []string
- func (m *PollVoteMutation) RemovedIDs(name string) []ent.Value
- func (m *PollVoteMutation) ResetCreatedAt()
- func (m *PollVoteMutation) ResetEdge(name string) error
- func (m *PollVoteMutation) ResetField(name string) error
- func (m *PollVoteMutation) ResetOptionID()
- func (m *PollVoteMutation) ResetPoll()
- func (m *PollVoteMutation) ResetPollID()
- func (m *PollVoteMutation) ResetPollOption()
- func (m *PollVoteMutation) ResetUserID()
- func (m *PollVoteMutation) ResetUsers()
- func (m *PollVoteMutation) SetCreatedAt(t time.Time)
- func (m *PollVoteMutation) SetField(name string, value ent.Value) error
- func (m *PollVoteMutation) SetID(id int)
- func (m *PollVoteMutation) SetOp(op Op)
- func (m *PollVoteMutation) SetOptionID(i int)
- func (m *PollVoteMutation) SetPollID(i int)
- func (m *PollVoteMutation) SetPollOptionID(id int)
- func (m *PollVoteMutation) SetUserID(i int)
- func (m *PollVoteMutation) SetUsersID(id int)
- func (m PollVoteMutation) Tx() (*Tx, error)
- func (m *PollVoteMutation) Type() string
- func (m *PollVoteMutation) UserID() (r int, exists bool)
- func (m *PollVoteMutation) UsersCleared() bool
- func (m *PollVoteMutation) UsersID() (id int, exists bool)
- func (m *PollVoteMutation) UsersIDs() (ids []int)
- func (m *PollVoteMutation) Where(ps ...predicate.PollVote)
- func (m *PollVoteMutation) WhereP(ps ...func(*sql.Selector))
- type PollVoteQuery
- func (_q *PollVoteQuery) Aggregate(fns ...AggregateFunc) *PollVoteSelect
- func (_q *PollVoteQuery) All(ctx context.Context) ([]*PollVote, error)
- func (_q *PollVoteQuery) AllX(ctx context.Context) []*PollVote
- func (_q *PollVoteQuery) Clone() *PollVoteQuery
- func (_q *PollVoteQuery) Count(ctx context.Context) (int, error)
- func (_q *PollVoteQuery) CountX(ctx context.Context) int
- func (_q *PollVoteQuery) Exist(ctx context.Context) (bool, error)
- func (_q *PollVoteQuery) ExistX(ctx context.Context) bool
- func (_q *PollVoteQuery) First(ctx context.Context) (*PollVote, error)
- func (_q *PollVoteQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *PollVoteQuery) FirstIDX(ctx context.Context) int
- func (_q *PollVoteQuery) FirstX(ctx context.Context) *PollVote
- func (_q *PollVoteQuery) GroupBy(field string, fields ...string) *PollVoteGroupBy
- func (_q *PollVoteQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *PollVoteQuery) IDsX(ctx context.Context) []int
- func (_q *PollVoteQuery) Limit(limit int) *PollVoteQuery
- func (_q *PollVoteQuery) Offset(offset int) *PollVoteQuery
- func (_q *PollVoteQuery) Only(ctx context.Context) (*PollVote, error)
- func (_q *PollVoteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *PollVoteQuery) OnlyIDX(ctx context.Context) int
- func (_q *PollVoteQuery) OnlyX(ctx context.Context) *PollVote
- func (_q *PollVoteQuery) Order(o ...pollvote.OrderOption) *PollVoteQuery
- func (_q *PollVoteQuery) QueryPoll() *PollQuery
- func (_q *PollVoteQuery) QueryPollOption() *PollOptionQuery
- func (_q *PollVoteQuery) QueryUsers() *UserQuery
- func (_q *PollVoteQuery) Select(fields ...string) *PollVoteSelect
- func (_q *PollVoteQuery) Unique(unique bool) *PollVoteQuery
- func (_q *PollVoteQuery) Where(ps ...predicate.PollVote) *PollVoteQuery
- func (_q *PollVoteQuery) WithPoll(opts ...func(*PollQuery)) *PollVoteQuery
- func (_q *PollVoteQuery) WithPollOption(opts ...func(*PollOptionQuery)) *PollVoteQuery
- func (_q *PollVoteQuery) WithUsers(opts ...func(*UserQuery)) *PollVoteQuery
- type PollVoteSelect
- func (_s *PollVoteSelect) Aggregate(fns ...AggregateFunc) *PollVoteSelect
- func (s *PollVoteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PollVoteSelect) BoolX(ctx context.Context) bool
- func (s *PollVoteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PollVoteSelect) BoolsX(ctx context.Context) []bool
- func (s *PollVoteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PollVoteSelect) Float64X(ctx context.Context) float64
- func (s *PollVoteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PollVoteSelect) Float64sX(ctx context.Context) []float64
- func (s *PollVoteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PollVoteSelect) IntX(ctx context.Context) int
- func (s *PollVoteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PollVoteSelect) IntsX(ctx context.Context) []int
- func (_s *PollVoteSelect) Scan(ctx context.Context, v any) error
- func (s *PollVoteSelect) ScanX(ctx context.Context, v any)
- func (s *PollVoteSelect) String(ctx context.Context) (_ string, err error)
- func (s *PollVoteSelect) StringX(ctx context.Context) string
- func (s *PollVoteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PollVoteSelect) StringsX(ctx context.Context) []string
- type PollVoteUpdate
- func (_u *PollVoteUpdate) ClearPoll() *PollVoteUpdate
- func (_u *PollVoteUpdate) ClearPollOption() *PollVoteUpdate
- func (_u *PollVoteUpdate) ClearUsers() *PollVoteUpdate
- func (_u *PollVoteUpdate) Exec(ctx context.Context) error
- func (_u *PollVoteUpdate) ExecX(ctx context.Context)
- func (_u *PollVoteUpdate) Mutation() *PollVoteMutation
- func (_u *PollVoteUpdate) Save(ctx context.Context) (int, error)
- func (_u *PollVoteUpdate) SaveX(ctx context.Context) int
- func (_u *PollVoteUpdate) SetCreatedAt(v time.Time) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetNillableCreatedAt(v *time.Time) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetNillableOptionID(v *int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetNillablePollID(v *int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetNillableUserID(v *int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetOptionID(v int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetPoll(v *Poll) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetPollID(v int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetPollOption(v *PollOption) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetPollOptionID(id int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetUserID(v int) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetUsers(v *User) *PollVoteUpdate
- func (_u *PollVoteUpdate) SetUsersID(id int) *PollVoteUpdate
- func (_u *PollVoteUpdate) Where(ps ...predicate.PollVote) *PollVoteUpdate
- type PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) ClearPoll() *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) ClearPollOption() *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) ClearUsers() *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) Exec(ctx context.Context) error
- func (_u *PollVoteUpdateOne) ExecX(ctx context.Context)
- func (_u *PollVoteUpdateOne) Mutation() *PollVoteMutation
- func (_u *PollVoteUpdateOne) Save(ctx context.Context) (*PollVote, error)
- func (_u *PollVoteUpdateOne) SaveX(ctx context.Context) *PollVote
- func (_u *PollVoteUpdateOne) Select(field string, fields ...string) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetCreatedAt(v time.Time) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetNillableCreatedAt(v *time.Time) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetNillableOptionID(v *int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetNillablePollID(v *int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetNillableUserID(v *int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetOptionID(v int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetPoll(v *Poll) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetPollID(v int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetPollOption(v *PollOption) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetPollOptionID(id int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetUserID(v int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetUsers(v *User) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) SetUsersID(id int) *PollVoteUpdateOne
- func (_u *PollVoteUpdateOne) Where(ps ...predicate.PollVote) *PollVoteUpdateOne
- type PollVotes
- type Polls
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryPollVotes(_m *User) *PollVoteQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (_c *UserCreate) AddPollVoteIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddPollVotes(v ...*PollVote) *UserCreate
- func (_c *UserCreate) Exec(ctx context.Context) error
- func (_c *UserCreate) ExecX(ctx context.Context)
- func (_c *UserCreate) Mutation() *UserMutation
- func (_c *UserCreate) Save(ctx context.Context) (*User, error)
- func (_c *UserCreate) SaveX(ctx context.Context) *User
- func (_c *UserCreate) SetID(v int) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (_g *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddPollVoteIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearPollVotes()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) PollVotesCleared() bool
- func (m *UserMutation) PollVotesIDs() (ids []int)
- func (m *UserMutation) RemovePollVoteIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedPollVotesIDs() (ids []int)
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetPollVotes()
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id int)
- func (m *UserMutation) SetOp(op Op)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (_q *UserQuery) All(ctx context.Context) ([]*User, error)
- func (_q *UserQuery) AllX(ctx context.Context) []*User
- func (_q *UserQuery) Clone() *UserQuery
- func (_q *UserQuery) Count(ctx context.Context) (int, error)
- func (_q *UserQuery) CountX(ctx context.Context) int
- func (_q *UserQuery) Exist(ctx context.Context) (bool, error)
- func (_q *UserQuery) ExistX(ctx context.Context) bool
- func (_q *UserQuery) First(ctx context.Context) (*User, error)
- func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) FirstIDX(ctx context.Context) int
- func (_q *UserQuery) FirstX(ctx context.Context) *User
- func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *UserQuery) IDsX(ctx context.Context) []int
- func (_q *UserQuery) Limit(limit int) *UserQuery
- func (_q *UserQuery) Offset(offset int) *UserQuery
- func (_q *UserQuery) Only(ctx context.Context) (*User, error)
- func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) OnlyIDX(ctx context.Context) int
- func (_q *UserQuery) OnlyX(ctx context.Context) *User
- func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (_q *UserQuery) QueryPollVotes() *PollVoteQuery
- func (_q *UserQuery) Select(fields ...string) *UserSelect
- func (_q *UserQuery) Unique(unique bool) *UserQuery
- func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (_q *UserQuery) WithPollVotes(opts ...func(*PollVoteQuery)) *UserQuery
- type UserSelect
- func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (_s *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (_u *UserUpdate) AddPollVoteIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddPollVotes(v ...*PollVote) *UserUpdate
- func (_u *UserUpdate) ClearPollVotes() *UserUpdate
- func (_u *UserUpdate) Exec(ctx context.Context) error
- func (_u *UserUpdate) ExecX(ctx context.Context)
- func (_u *UserUpdate) Mutation() *UserMutation
- func (_u *UserUpdate) RemovePollVoteIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemovePollVotes(v ...*PollVote) *UserUpdate
- func (_u *UserUpdate) Save(ctx context.Context) (int, error)
- func (_u *UserUpdate) SaveX(ctx context.Context) int
- func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (_u *UserUpdateOne) AddPollVoteIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddPollVotes(v ...*PollVote) *UserUpdateOne
- func (_u *UserUpdateOne) ClearPollVotes() *UserUpdateOne
- func (_u *UserUpdateOne) Exec(ctx context.Context) error
- func (_u *UserUpdateOne) ExecX(ctx context.Context)
- func (_u *UserUpdateOne) Mutation() *UserMutation
- func (_u *UserUpdateOne) RemovePollVoteIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemovePollVotes(v ...*PollVote) *UserUpdateOne
- func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
- func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- 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. TypeNode = "Node" TypePoll = "Poll" TypePollOption = "PollOption" TypePollVote = "PollVote" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("generated: 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
// Node is the client for interacting with the Node builders.
Node *NodeClient
// Poll is the client for interacting with the Poll builders.
Poll *PollClient
// PollOption is the client for interacting with the PollOption builders.
PollOption *PollOptionClient
// PollVote is the client for interacting with the PollVote builders.
PollVote *PollVoteClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Client is the client that holds all ent builders.
func FromContext ¶
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(). Node. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer {
return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Commit(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Node ¶
type Node struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// contains filtered or unexported fields
}
Node is the model entity for the Node schema.
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 int) *NodeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NodeClient) GetX ¶
func (c *NodeClient) GetX(ctx context.Context, id int) *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) 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 int) *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) 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) SetID ¶
func (_c *NodeCreate) SetID(v int) *NodeCreate
SetID sets the "id" 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 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) 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) 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) 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) 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) 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) ID ¶
func (m *NodeMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NodeMutation) IDs ¶
func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*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) 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) 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) 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 int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Node entities.
func (*NodeMutation) SetOp ¶
func (m *NodeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
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) 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.
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) 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.
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) 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) 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) 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) 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) 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) 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.
func (*NotFoundError) Is ¶
func (e *NotFoundError) Is(target error) bool
Is makes errors.Is(err, schemakit.ErrEntityNotFound) true for ent's not-found errors, so the engine recognizes the module's missing record as it does the core's (its handlers answer 404).
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 Poll ¶
type Poll struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Nid holds the value of the "nid" field.
Nid int `json:"nid,omitempty"`
// Description holds the value of the "description" field.
Description string `json:"description,omitempty"`
// MaxAnswers holds the value of the "max_answers" field.
MaxAnswers int `json:"max_answers,omitempty"`
// AvailableFrom holds the value of the "available_from" field.
AvailableFrom *time.Time `json:"available_from,omitempty"`
// AvailableTo holds the value of the "available_to" field.
AvailableTo *time.Time `json:"available_to,omitempty"`
// ResultsOnly holds the value of the "results_only" field.
ResultsOnly bool `json:"results_only,omitempty"`
// AllowRevote holds the value of the "allow_revote" field.
AllowRevote bool `json:"allow_revote,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PollQuery when eager-loading is set.
Edges PollEdges `json:"edges"`
// contains filtered or unexported fields
}
Poll is the model entity for the Poll schema.
func (*Poll) QueryNodes ¶
QueryNodes queries the "nodes" edge of the Poll entity.
func (*Poll) QueryOptions ¶
func (_m *Poll) QueryOptions() *PollOptionQuery
QueryOptions queries the "options" edge of the Poll entity.
func (*Poll) QueryVotes ¶
func (_m *Poll) QueryVotes() *PollVoteQuery
QueryVotes queries the "votes" edge of the Poll entity.
func (*Poll) Unwrap ¶
Unwrap unwraps the Poll 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 (*Poll) Update ¶
func (_m *Poll) Update() *PollUpdateOne
Update returns a builder for updating this Poll. Note that you need to call Poll.Unwrap() before calling this method if this Poll was returned from a transaction, and the transaction was committed or rolled back.
type PollClient ¶
type PollClient struct {
// contains filtered or unexported fields
}
PollClient is a client for the Poll schema.
func NewPollClient ¶
func NewPollClient(c config) *PollClient
NewPollClient returns a client for the Poll from the given config.
func (*PollClient) Create ¶
func (c *PollClient) Create() *PollCreate
Create returns a builder for creating a Poll entity.
func (*PollClient) CreateBulk ¶
func (c *PollClient) CreateBulk(builders ...*PollCreate) *PollCreateBulk
CreateBulk returns a builder for creating a bulk of Poll entities.
func (*PollClient) Delete ¶
func (c *PollClient) Delete() *PollDelete
Delete returns a delete builder for Poll.
func (*PollClient) DeleteOne ¶
func (c *PollClient) DeleteOne(_m *Poll) *PollDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PollClient) DeleteOneID ¶
func (c *PollClient) DeleteOneID(id int) *PollDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PollClient) GetX ¶
func (c *PollClient) GetX(ctx context.Context, id int) *Poll
GetX is like Get, but panics if an error occurs.
func (*PollClient) Intercept ¶
func (c *PollClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `poll.Intercept(f(g(h())))`.
func (*PollClient) Interceptors ¶
func (c *PollClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PollClient) MapCreateBulk ¶
func (c *PollClient) MapCreateBulk(slice any, setFunc func(*PollCreate, int)) *PollCreateBulk
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 (*PollClient) Query ¶
func (c *PollClient) Query() *PollQuery
Query returns a query builder for Poll.
func (*PollClient) QueryNodes ¶
func (c *PollClient) QueryNodes(_m *Poll) *NodeQuery
QueryNodes queries the nodes edge of a Poll.
func (*PollClient) QueryOptions ¶
func (c *PollClient) QueryOptions(_m *Poll) *PollOptionQuery
QueryOptions queries the options edge of a Poll.
func (*PollClient) QueryVotes ¶
func (c *PollClient) QueryVotes(_m *Poll) *PollVoteQuery
QueryVotes queries the votes edge of a Poll.
func (*PollClient) Update ¶
func (c *PollClient) Update() *PollUpdate
Update returns an update builder for Poll.
func (*PollClient) UpdateOne ¶
func (c *PollClient) UpdateOne(_m *Poll) *PollUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PollClient) UpdateOneID ¶
func (c *PollClient) UpdateOneID(id int) *PollUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PollClient) Use ¶
func (c *PollClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `poll.Hooks(f(g(h())))`.
type PollCreate ¶
type PollCreate struct {
// contains filtered or unexported fields
}
PollCreate is the builder for creating a Poll entity.
func (*PollCreate) AddOptionIDs ¶
func (_c *PollCreate) AddOptionIDs(ids ...int) *PollCreate
AddOptionIDs adds the "options" edge to the PollOption entity by IDs.
func (*PollCreate) AddOptions ¶
func (_c *PollCreate) AddOptions(v ...*PollOption) *PollCreate
AddOptions adds the "options" edges to the PollOption entity.
func (*PollCreate) AddVoteIDs ¶
func (_c *PollCreate) AddVoteIDs(ids ...int) *PollCreate
AddVoteIDs adds the "votes" edge to the PollVote entity by IDs.
func (*PollCreate) AddVotes ¶
func (_c *PollCreate) AddVotes(v ...*PollVote) *PollCreate
AddVotes adds the "votes" edges to the PollVote entity.
func (*PollCreate) Exec ¶
func (_c *PollCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollCreate) ExecX ¶
func (_c *PollCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollCreate) Mutation ¶
func (_c *PollCreate) Mutation() *PollMutation
Mutation returns the PollMutation object of the builder.
func (*PollCreate) Save ¶
func (_c *PollCreate) Save(ctx context.Context) (*Poll, error)
Save creates the Poll in the database.
func (*PollCreate) SaveX ¶
func (_c *PollCreate) SaveX(ctx context.Context) *Poll
SaveX calls Save and panics if Save returns an error.
func (*PollCreate) SetAllowRevote ¶
func (_c *PollCreate) SetAllowRevote(v bool) *PollCreate
SetAllowRevote sets the "allow_revote" field.
func (*PollCreate) SetAvailableFrom ¶
func (_c *PollCreate) SetAvailableFrom(v time.Time) *PollCreate
SetAvailableFrom sets the "available_from" field.
func (*PollCreate) SetAvailableTo ¶
func (_c *PollCreate) SetAvailableTo(v time.Time) *PollCreate
SetAvailableTo sets the "available_to" field.
func (*PollCreate) SetDescription ¶
func (_c *PollCreate) SetDescription(v string) *PollCreate
SetDescription sets the "description" field.
func (*PollCreate) SetID ¶
func (_c *PollCreate) SetID(v int) *PollCreate
SetID sets the "id" field.
func (*PollCreate) SetMaxAnswers ¶
func (_c *PollCreate) SetMaxAnswers(v int) *PollCreate
SetMaxAnswers sets the "max_answers" field.
func (*PollCreate) SetNid ¶
func (_c *PollCreate) SetNid(v int) *PollCreate
SetNid sets the "nid" field.
func (*PollCreate) SetNillableAllowRevote ¶
func (_c *PollCreate) SetNillableAllowRevote(v *bool) *PollCreate
SetNillableAllowRevote sets the "allow_revote" field if the given value is not nil.
func (*PollCreate) SetNillableAvailableFrom ¶
func (_c *PollCreate) SetNillableAvailableFrom(v *time.Time) *PollCreate
SetNillableAvailableFrom sets the "available_from" field if the given value is not nil.
func (*PollCreate) SetNillableAvailableTo ¶
func (_c *PollCreate) SetNillableAvailableTo(v *time.Time) *PollCreate
SetNillableAvailableTo sets the "available_to" field if the given value is not nil.
func (*PollCreate) SetNillableDescription ¶
func (_c *PollCreate) SetNillableDescription(v *string) *PollCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PollCreate) SetNillableMaxAnswers ¶
func (_c *PollCreate) SetNillableMaxAnswers(v *int) *PollCreate
SetNillableMaxAnswers sets the "max_answers" field if the given value is not nil.
func (*PollCreate) SetNillableResultsOnly ¶
func (_c *PollCreate) SetNillableResultsOnly(v *bool) *PollCreate
SetNillableResultsOnly sets the "results_only" field if the given value is not nil.
func (*PollCreate) SetNodes ¶
func (_c *PollCreate) SetNodes(v *Node) *PollCreate
SetNodes sets the "nodes" edge to the Node entity.
func (*PollCreate) SetNodesID ¶
func (_c *PollCreate) SetNodesID(id int) *PollCreate
SetNodesID sets the "nodes" edge to the Node entity by ID.
func (*PollCreate) SetResultsOnly ¶
func (_c *PollCreate) SetResultsOnly(v bool) *PollCreate
SetResultsOnly sets the "results_only" field.
type PollCreateBulk ¶
type PollCreateBulk struct {
// contains filtered or unexported fields
}
PollCreateBulk is the builder for creating many Poll entities in bulk.
func (*PollCreateBulk) Exec ¶
func (_c *PollCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PollCreateBulk) ExecX ¶
func (_c *PollCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PollDelete ¶
type PollDelete struct {
// contains filtered or unexported fields
}
PollDelete is the builder for deleting a Poll entity.
func (*PollDelete) Exec ¶
func (_d *PollDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PollDelete) ExecX ¶
func (_d *PollDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PollDelete) Where ¶
func (_d *PollDelete) Where(ps ...predicate.Poll) *PollDelete
Where appends a list predicates to the PollDelete builder.
type PollDeleteOne ¶
type PollDeleteOne struct {
// contains filtered or unexported fields
}
PollDeleteOne is the builder for deleting a single Poll entity.
func (*PollDeleteOne) Exec ¶
func (_d *PollDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PollDeleteOne) ExecX ¶
func (_d *PollDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollDeleteOne) Where ¶
func (_d *PollDeleteOne) Where(ps ...predicate.Poll) *PollDeleteOne
Where appends a list predicates to the PollDelete builder.
type PollEdges ¶
type PollEdges struct {
// Nodes holds the value of the nodes edge.
Nodes *Node `json:"nodes,omitempty"`
// Options holds the value of the options edge.
Options []*PollOption `json:"options,omitempty"`
// Votes holds the value of the votes edge.
Votes []*PollVote `json:"votes,omitempty"`
// contains filtered or unexported fields
}
PollEdges holds the relations/edges for other nodes in the graph.
func (PollEdges) NodesOrErr ¶
NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PollEdges) OptionsOrErr ¶
func (e PollEdges) OptionsOrErr() ([]*PollOption, error)
OptionsOrErr returns the Options value or an error if the edge was not loaded in eager-loading.
func (PollEdges) VotesOrErr ¶
VotesOrErr returns the Votes value or an error if the edge was not loaded in eager-loading.
type PollGroupBy ¶
type PollGroupBy struct {
// contains filtered or unexported fields
}
PollGroupBy is the group-by builder for Poll entities.
func (*PollGroupBy) Aggregate ¶
func (_g *PollGroupBy) Aggregate(fns ...AggregateFunc) *PollGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PollGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollGroupBy) Scan ¶
func (_g *PollGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollMutation ¶
type PollMutation struct {
// contains filtered or unexported fields
}
PollMutation represents an operation that mutates the Poll nodes in the graph.
func (*PollMutation) AddField ¶
func (m *PollMutation) 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 (*PollMutation) AddMaxAnswers ¶
func (m *PollMutation) AddMaxAnswers(i int)
AddMaxAnswers adds i to the "max_answers" field.
func (*PollMutation) AddOptionIDs ¶
func (m *PollMutation) AddOptionIDs(ids ...int)
AddOptionIDs adds the "options" edge to the PollOption entity by ids.
func (*PollMutation) AddVoteIDs ¶
func (m *PollMutation) AddVoteIDs(ids ...int)
AddVoteIDs adds the "votes" edge to the PollVote entity by ids.
func (*PollMutation) AddedEdges ¶
func (m *PollMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PollMutation) AddedField ¶
func (m *PollMutation) 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 (*PollMutation) AddedFields ¶
func (m *PollMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PollMutation) AddedIDs ¶
func (m *PollMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PollMutation) AddedMaxAnswers ¶
func (m *PollMutation) AddedMaxAnswers() (r int, exists bool)
AddedMaxAnswers returns the value that was added to the "max_answers" field in this mutation.
func (*PollMutation) AllowRevote ¶
func (m *PollMutation) AllowRevote() (r bool, exists bool)
AllowRevote returns the value of the "allow_revote" field in the mutation.
func (*PollMutation) AvailableFrom ¶
func (m *PollMutation) AvailableFrom() (r time.Time, exists bool)
AvailableFrom returns the value of the "available_from" field in the mutation.
func (*PollMutation) AvailableFromCleared ¶
func (m *PollMutation) AvailableFromCleared() bool
AvailableFromCleared returns if the "available_from" field was cleared in this mutation.
func (*PollMutation) AvailableTo ¶
func (m *PollMutation) AvailableTo() (r time.Time, exists bool)
AvailableTo returns the value of the "available_to" field in the mutation.
func (*PollMutation) AvailableToCleared ¶
func (m *PollMutation) AvailableToCleared() bool
AvailableToCleared returns if the "available_to" field was cleared in this mutation.
func (*PollMutation) ClearAvailableFrom ¶
func (m *PollMutation) ClearAvailableFrom()
ClearAvailableFrom clears the value of the "available_from" field.
func (*PollMutation) ClearAvailableTo ¶
func (m *PollMutation) ClearAvailableTo()
ClearAvailableTo clears the value of the "available_to" field.
func (*PollMutation) ClearDescription ¶
func (m *PollMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*PollMutation) ClearEdge ¶
func (m *PollMutation) 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 (*PollMutation) ClearField ¶
func (m *PollMutation) 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 (*PollMutation) ClearNodes ¶
func (m *PollMutation) ClearNodes()
ClearNodes clears the "nodes" edge to the Node entity.
func (*PollMutation) ClearOptions ¶
func (m *PollMutation) ClearOptions()
ClearOptions clears the "options" edge to the PollOption entity.
func (*PollMutation) ClearVotes ¶
func (m *PollMutation) ClearVotes()
ClearVotes clears the "votes" edge to the PollVote entity.
func (*PollMutation) ClearedEdges ¶
func (m *PollMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PollMutation) ClearedFields ¶
func (m *PollMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PollMutation) Client ¶
func (m PollMutation) 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 (*PollMutation) Description ¶
func (m *PollMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*PollMutation) DescriptionCleared ¶
func (m *PollMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*PollMutation) EdgeCleared ¶
func (m *PollMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PollMutation) Field ¶
func (m *PollMutation) 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 (*PollMutation) FieldCleared ¶
func (m *PollMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PollMutation) Fields ¶
func (m *PollMutation) 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 (*PollMutation) ID ¶
func (m *PollMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PollMutation) IDs ¶
func (m *PollMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PollMutation) MaxAnswers ¶
func (m *PollMutation) MaxAnswers() (r int, exists bool)
MaxAnswers returns the value of the "max_answers" field in the mutation.
func (*PollMutation) Nid ¶
func (m *PollMutation) Nid() (r int, exists bool)
Nid returns the value of the "nid" field in the mutation.
func (*PollMutation) NodesCleared ¶
func (m *PollMutation) NodesCleared() bool
NodesCleared reports if the "nodes" edge to the Node entity was cleared.
func (*PollMutation) NodesID ¶
func (m *PollMutation) NodesID() (id int, exists bool)
NodesID returns the "nodes" edge ID in the mutation.
func (*PollMutation) NodesIDs ¶
func (m *PollMutation) NodesIDs() (ids []int)
NodesIDs returns the "nodes" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodesID instead. It exists only for internal usage by the builders.
func (*PollMutation) OldAllowRevote ¶
func (m *PollMutation) OldAllowRevote(ctx context.Context) (v bool, err error)
OldAllowRevote returns the old "allow_revote" field's value of the Poll entity. If the Poll 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 (*PollMutation) OldAvailableFrom ¶
OldAvailableFrom returns the old "available_from" field's value of the Poll entity. If the Poll 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 (*PollMutation) OldAvailableTo ¶
OldAvailableTo returns the old "available_to" field's value of the Poll entity. If the Poll 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 (*PollMutation) OldDescription ¶
func (m *PollMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Poll entity. If the Poll 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 (*PollMutation) 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 (*PollMutation) OldMaxAnswers ¶
func (m *PollMutation) OldMaxAnswers(ctx context.Context) (v int, err error)
OldMaxAnswers returns the old "max_answers" field's value of the Poll entity. If the Poll 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 (*PollMutation) OldNid ¶
func (m *PollMutation) OldNid(ctx context.Context) (v int, err error)
OldNid returns the old "nid" field's value of the Poll entity. If the Poll 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 (*PollMutation) OldResultsOnly ¶
func (m *PollMutation) OldResultsOnly(ctx context.Context) (v bool, err error)
OldResultsOnly returns the old "results_only" field's value of the Poll entity. If the Poll 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 (*PollMutation) OptionsCleared ¶
func (m *PollMutation) OptionsCleared() bool
OptionsCleared reports if the "options" edge to the PollOption entity was cleared.
func (*PollMutation) OptionsIDs ¶
func (m *PollMutation) OptionsIDs() (ids []int)
OptionsIDs returns the "options" edge IDs in the mutation.
func (*PollMutation) RemoveOptionIDs ¶
func (m *PollMutation) RemoveOptionIDs(ids ...int)
RemoveOptionIDs removes the "options" edge to the PollOption entity by IDs.
func (*PollMutation) RemoveVoteIDs ¶
func (m *PollMutation) RemoveVoteIDs(ids ...int)
RemoveVoteIDs removes the "votes" edge to the PollVote entity by IDs.
func (*PollMutation) RemovedEdges ¶
func (m *PollMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PollMutation) RemovedIDs ¶
func (m *PollMutation) 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 (*PollMutation) RemovedOptionsIDs ¶
func (m *PollMutation) RemovedOptionsIDs() (ids []int)
RemovedOptions returns the removed IDs of the "options" edge to the PollOption entity.
func (*PollMutation) RemovedVotesIDs ¶
func (m *PollMutation) RemovedVotesIDs() (ids []int)
RemovedVotes returns the removed IDs of the "votes" edge to the PollVote entity.
func (*PollMutation) ResetAllowRevote ¶
func (m *PollMutation) ResetAllowRevote()
ResetAllowRevote resets all changes to the "allow_revote" field.
func (*PollMutation) ResetAvailableFrom ¶
func (m *PollMutation) ResetAvailableFrom()
ResetAvailableFrom resets all changes to the "available_from" field.
func (*PollMutation) ResetAvailableTo ¶
func (m *PollMutation) ResetAvailableTo()
ResetAvailableTo resets all changes to the "available_to" field.
func (*PollMutation) ResetDescription ¶
func (m *PollMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*PollMutation) ResetEdge ¶
func (m *PollMutation) 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 (*PollMutation) ResetField ¶
func (m *PollMutation) 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 (*PollMutation) ResetMaxAnswers ¶
func (m *PollMutation) ResetMaxAnswers()
ResetMaxAnswers resets all changes to the "max_answers" field.
func (*PollMutation) ResetNid ¶
func (m *PollMutation) ResetNid()
ResetNid resets all changes to the "nid" field.
func (*PollMutation) ResetNodes ¶
func (m *PollMutation) ResetNodes()
ResetNodes resets all changes to the "nodes" edge.
func (*PollMutation) ResetOptions ¶
func (m *PollMutation) ResetOptions()
ResetOptions resets all changes to the "options" edge.
func (*PollMutation) ResetResultsOnly ¶
func (m *PollMutation) ResetResultsOnly()
ResetResultsOnly resets all changes to the "results_only" field.
func (*PollMutation) ResetVotes ¶
func (m *PollMutation) ResetVotes()
ResetVotes resets all changes to the "votes" edge.
func (*PollMutation) ResultsOnly ¶
func (m *PollMutation) ResultsOnly() (r bool, exists bool)
ResultsOnly returns the value of the "results_only" field in the mutation.
func (*PollMutation) SetAllowRevote ¶
func (m *PollMutation) SetAllowRevote(b bool)
SetAllowRevote sets the "allow_revote" field.
func (*PollMutation) SetAvailableFrom ¶
func (m *PollMutation) SetAvailableFrom(t time.Time)
SetAvailableFrom sets the "available_from" field.
func (*PollMutation) SetAvailableTo ¶
func (m *PollMutation) SetAvailableTo(t time.Time)
SetAvailableTo sets the "available_to" field.
func (*PollMutation) SetDescription ¶
func (m *PollMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*PollMutation) SetField ¶
func (m *PollMutation) 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 (*PollMutation) SetID ¶
func (m *PollMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Poll entities.
func (*PollMutation) SetMaxAnswers ¶
func (m *PollMutation) SetMaxAnswers(i int)
SetMaxAnswers sets the "max_answers" field.
func (*PollMutation) SetNodesID ¶
func (m *PollMutation) SetNodesID(id int)
SetNodesID sets the "nodes" edge to the Node entity by id.
func (*PollMutation) SetOp ¶
func (m *PollMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PollMutation) SetResultsOnly ¶
func (m *PollMutation) SetResultsOnly(b bool)
SetResultsOnly sets the "results_only" field.
func (PollMutation) Tx ¶
func (m PollMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PollMutation) Type ¶
func (m *PollMutation) Type() string
Type returns the node type of this mutation (Poll).
func (*PollMutation) VotesCleared ¶
func (m *PollMutation) VotesCleared() bool
VotesCleared reports if the "votes" edge to the PollVote entity was cleared.
func (*PollMutation) VotesIDs ¶
func (m *PollMutation) VotesIDs() (ids []int)
VotesIDs returns the "votes" edge IDs in the mutation.
func (*PollMutation) Where ¶
func (m *PollMutation) Where(ps ...predicate.Poll)
Where appends a list predicates to the PollMutation builder.
func (*PollMutation) WhereP ¶
func (m *PollMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PollMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PollOption ¶
type PollOption struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// PollID holds the value of the "poll_id" field.
PollID int `json:"poll_id,omitempty"`
// Label holds the value of the "label" field.
Label string `json:"label,omitempty"`
// Weight holds the value of the "weight" field.
Weight int `json:"weight,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PollOptionQuery when eager-loading is set.
Edges PollOptionEdges `json:"edges"`
// contains filtered or unexported fields
}
PollOption is the model entity for the PollOption schema.
func (*PollOption) QueryOptionVotes ¶
func (_m *PollOption) QueryOptionVotes() *PollVoteQuery
QueryOptionVotes queries the "option_votes" edge of the PollOption entity.
func (*PollOption) QueryPoll ¶
func (_m *PollOption) QueryPoll() *PollQuery
QueryPoll queries the "poll" edge of the PollOption entity.
func (*PollOption) String ¶
func (_m *PollOption) String() string
String implements the fmt.Stringer.
func (*PollOption) Unwrap ¶
func (_m *PollOption) Unwrap() *PollOption
Unwrap unwraps the PollOption 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 (*PollOption) Update ¶
func (_m *PollOption) Update() *PollOptionUpdateOne
Update returns a builder for updating this PollOption. Note that you need to call PollOption.Unwrap() before calling this method if this PollOption was returned from a transaction, and the transaction was committed or rolled back.
type PollOptionClient ¶
type PollOptionClient struct {
// contains filtered or unexported fields
}
PollOptionClient is a client for the PollOption schema.
func NewPollOptionClient ¶
func NewPollOptionClient(c config) *PollOptionClient
NewPollOptionClient returns a client for the PollOption from the given config.
func (*PollOptionClient) Create ¶
func (c *PollOptionClient) Create() *PollOptionCreate
Create returns a builder for creating a PollOption entity.
func (*PollOptionClient) CreateBulk ¶
func (c *PollOptionClient) CreateBulk(builders ...*PollOptionCreate) *PollOptionCreateBulk
CreateBulk returns a builder for creating a bulk of PollOption entities.
func (*PollOptionClient) Delete ¶
func (c *PollOptionClient) Delete() *PollOptionDelete
Delete returns a delete builder for PollOption.
func (*PollOptionClient) DeleteOne ¶
func (c *PollOptionClient) DeleteOne(_m *PollOption) *PollOptionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PollOptionClient) DeleteOneID ¶
func (c *PollOptionClient) DeleteOneID(id int) *PollOptionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PollOptionClient) Get ¶
func (c *PollOptionClient) Get(ctx context.Context, id int) (*PollOption, error)
Get returns a PollOption entity by its id.
func (*PollOptionClient) GetX ¶
func (c *PollOptionClient) GetX(ctx context.Context, id int) *PollOption
GetX is like Get, but panics if an error occurs.
func (*PollOptionClient) Hooks ¶
func (c *PollOptionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PollOptionClient) Intercept ¶
func (c *PollOptionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `polloption.Intercept(f(g(h())))`.
func (*PollOptionClient) Interceptors ¶
func (c *PollOptionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PollOptionClient) MapCreateBulk ¶
func (c *PollOptionClient) MapCreateBulk(slice any, setFunc func(*PollOptionCreate, int)) *PollOptionCreateBulk
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 (*PollOptionClient) Query ¶
func (c *PollOptionClient) Query() *PollOptionQuery
Query returns a query builder for PollOption.
func (*PollOptionClient) QueryOptionVotes ¶
func (c *PollOptionClient) QueryOptionVotes(_m *PollOption) *PollVoteQuery
QueryOptionVotes queries the option_votes edge of a PollOption.
func (*PollOptionClient) QueryPoll ¶
func (c *PollOptionClient) QueryPoll(_m *PollOption) *PollQuery
QueryPoll queries the poll edge of a PollOption.
func (*PollOptionClient) Update ¶
func (c *PollOptionClient) Update() *PollOptionUpdate
Update returns an update builder for PollOption.
func (*PollOptionClient) UpdateOne ¶
func (c *PollOptionClient) UpdateOne(_m *PollOption) *PollOptionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PollOptionClient) UpdateOneID ¶
func (c *PollOptionClient) UpdateOneID(id int) *PollOptionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PollOptionClient) Use ¶
func (c *PollOptionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `polloption.Hooks(f(g(h())))`.
type PollOptionCreate ¶
type PollOptionCreate struct {
// contains filtered or unexported fields
}
PollOptionCreate is the builder for creating a PollOption entity.
func (*PollOptionCreate) AddOptionVoteIDs ¶
func (_c *PollOptionCreate) AddOptionVoteIDs(ids ...int) *PollOptionCreate
AddOptionVoteIDs adds the "option_votes" edge to the PollVote entity by IDs.
func (*PollOptionCreate) AddOptionVotes ¶
func (_c *PollOptionCreate) AddOptionVotes(v ...*PollVote) *PollOptionCreate
AddOptionVotes adds the "option_votes" edges to the PollVote entity.
func (*PollOptionCreate) Exec ¶
func (_c *PollOptionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollOptionCreate) ExecX ¶
func (_c *PollOptionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionCreate) Mutation ¶
func (_c *PollOptionCreate) Mutation() *PollOptionMutation
Mutation returns the PollOptionMutation object of the builder.
func (*PollOptionCreate) Save ¶
func (_c *PollOptionCreate) Save(ctx context.Context) (*PollOption, error)
Save creates the PollOption in the database.
func (*PollOptionCreate) SaveX ¶
func (_c *PollOptionCreate) SaveX(ctx context.Context) *PollOption
SaveX calls Save and panics if Save returns an error.
func (*PollOptionCreate) SetID ¶
func (_c *PollOptionCreate) SetID(v int) *PollOptionCreate
SetID sets the "id" field.
func (*PollOptionCreate) SetLabel ¶
func (_c *PollOptionCreate) SetLabel(v string) *PollOptionCreate
SetLabel sets the "label" field.
func (*PollOptionCreate) SetNillableWeight ¶
func (_c *PollOptionCreate) SetNillableWeight(v *int) *PollOptionCreate
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PollOptionCreate) SetPoll ¶
func (_c *PollOptionCreate) SetPoll(v *Poll) *PollOptionCreate
SetPoll sets the "poll" edge to the Poll entity.
func (*PollOptionCreate) SetPollID ¶
func (_c *PollOptionCreate) SetPollID(v int) *PollOptionCreate
SetPollID sets the "poll_id" field.
func (*PollOptionCreate) SetWeight ¶
func (_c *PollOptionCreate) SetWeight(v int) *PollOptionCreate
SetWeight sets the "weight" field.
type PollOptionCreateBulk ¶
type PollOptionCreateBulk struct {
// contains filtered or unexported fields
}
PollOptionCreateBulk is the builder for creating many PollOption entities in bulk.
func (*PollOptionCreateBulk) Exec ¶
func (_c *PollOptionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PollOptionCreateBulk) ExecX ¶
func (_c *PollOptionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionCreateBulk) Save ¶
func (_c *PollOptionCreateBulk) Save(ctx context.Context) ([]*PollOption, error)
Save creates the PollOption entities in the database.
func (*PollOptionCreateBulk) SaveX ¶
func (_c *PollOptionCreateBulk) SaveX(ctx context.Context) []*PollOption
SaveX is like Save, but panics if an error occurs.
type PollOptionDelete ¶
type PollOptionDelete struct {
// contains filtered or unexported fields
}
PollOptionDelete is the builder for deleting a PollOption entity.
func (*PollOptionDelete) Exec ¶
func (_d *PollOptionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PollOptionDelete) ExecX ¶
func (_d *PollOptionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionDelete) Where ¶
func (_d *PollOptionDelete) Where(ps ...predicate.PollOption) *PollOptionDelete
Where appends a list predicates to the PollOptionDelete builder.
type PollOptionDeleteOne ¶
type PollOptionDeleteOne struct {
// contains filtered or unexported fields
}
PollOptionDeleteOne is the builder for deleting a single PollOption entity.
func (*PollOptionDeleteOne) Exec ¶
func (_d *PollOptionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PollOptionDeleteOne) ExecX ¶
func (_d *PollOptionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionDeleteOne) Where ¶
func (_d *PollOptionDeleteOne) Where(ps ...predicate.PollOption) *PollOptionDeleteOne
Where appends a list predicates to the PollOptionDelete builder.
type PollOptionEdges ¶
type PollOptionEdges struct {
// Poll holds the value of the poll edge.
Poll *Poll `json:"poll,omitempty"`
// OptionVotes holds the value of the option_votes edge.
OptionVotes []*PollVote `json:"option_votes,omitempty"`
// contains filtered or unexported fields
}
PollOptionEdges holds the relations/edges for other nodes in the graph.
func (PollOptionEdges) OptionVotesOrErr ¶
func (e PollOptionEdges) OptionVotesOrErr() ([]*PollVote, error)
OptionVotesOrErr returns the OptionVotes value or an error if the edge was not loaded in eager-loading.
func (PollOptionEdges) PollOrErr ¶
func (e PollOptionEdges) PollOrErr() (*Poll, error)
PollOrErr returns the Poll value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PollOptionGroupBy ¶
type PollOptionGroupBy struct {
// contains filtered or unexported fields
}
PollOptionGroupBy is the group-by builder for PollOption entities.
func (*PollOptionGroupBy) Aggregate ¶
func (_g *PollOptionGroupBy) Aggregate(fns ...AggregateFunc) *PollOptionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PollOptionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollOptionGroupBy) Scan ¶
func (_g *PollOptionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollOptionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollOptionMutation ¶
type PollOptionMutation struct {
// contains filtered or unexported fields
}
PollOptionMutation represents an operation that mutates the PollOption nodes in the graph.
func (*PollOptionMutation) AddField ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) AddOptionVoteIDs ¶
func (m *PollOptionMutation) AddOptionVoteIDs(ids ...int)
AddOptionVoteIDs adds the "option_votes" edge to the PollVote entity by ids.
func (*PollOptionMutation) AddWeight ¶
func (m *PollOptionMutation) AddWeight(i int)
AddWeight adds i to the "weight" field.
func (*PollOptionMutation) AddedEdges ¶
func (m *PollOptionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PollOptionMutation) AddedField ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) AddedFields ¶
func (m *PollOptionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PollOptionMutation) AddedIDs ¶
func (m *PollOptionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PollOptionMutation) AddedWeight ¶
func (m *PollOptionMutation) AddedWeight() (r int, exists bool)
AddedWeight returns the value that was added to the "weight" field in this mutation.
func (*PollOptionMutation) ClearEdge ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) ClearField ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) ClearOptionVotes ¶
func (m *PollOptionMutation) ClearOptionVotes()
ClearOptionVotes clears the "option_votes" edge to the PollVote entity.
func (*PollOptionMutation) ClearPoll ¶
func (m *PollOptionMutation) ClearPoll()
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollOptionMutation) ClearedEdges ¶
func (m *PollOptionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PollOptionMutation) ClearedFields ¶
func (m *PollOptionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PollOptionMutation) Client ¶
func (m PollOptionMutation) 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 (*PollOptionMutation) EdgeCleared ¶
func (m *PollOptionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PollOptionMutation) Field ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) FieldCleared ¶
func (m *PollOptionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PollOptionMutation) Fields ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) ID ¶
func (m *PollOptionMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PollOptionMutation) IDs ¶
func (m *PollOptionMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PollOptionMutation) Label ¶
func (m *PollOptionMutation) Label() (r string, exists bool)
Label returns the value of the "label" field in the mutation.
func (*PollOptionMutation) 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 (*PollOptionMutation) OldLabel ¶
func (m *PollOptionMutation) OldLabel(ctx context.Context) (v string, err error)
OldLabel returns the old "label" field's value of the PollOption entity. If the PollOption 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 (*PollOptionMutation) OldPollID ¶
func (m *PollOptionMutation) OldPollID(ctx context.Context) (v int, err error)
OldPollID returns the old "poll_id" field's value of the PollOption entity. If the PollOption 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 (*PollOptionMutation) OldWeight ¶
func (m *PollOptionMutation) OldWeight(ctx context.Context) (v int, err error)
OldWeight returns the old "weight" field's value of the PollOption entity. If the PollOption 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 (*PollOptionMutation) OptionVotesCleared ¶
func (m *PollOptionMutation) OptionVotesCleared() bool
OptionVotesCleared reports if the "option_votes" edge to the PollVote entity was cleared.
func (*PollOptionMutation) OptionVotesIDs ¶
func (m *PollOptionMutation) OptionVotesIDs() (ids []int)
OptionVotesIDs returns the "option_votes" edge IDs in the mutation.
func (*PollOptionMutation) PollCleared ¶
func (m *PollOptionMutation) PollCleared() bool
PollCleared reports if the "poll" edge to the Poll entity was cleared.
func (*PollOptionMutation) PollID ¶
func (m *PollOptionMutation) PollID() (r int, exists bool)
PollID returns the value of the "poll_id" field in the mutation.
func (*PollOptionMutation) PollIDs ¶
func (m *PollOptionMutation) PollIDs() (ids []int)
PollIDs returns the "poll" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PollID instead. It exists only for internal usage by the builders.
func (*PollOptionMutation) RemoveOptionVoteIDs ¶
func (m *PollOptionMutation) RemoveOptionVoteIDs(ids ...int)
RemoveOptionVoteIDs removes the "option_votes" edge to the PollVote entity by IDs.
func (*PollOptionMutation) RemovedEdges ¶
func (m *PollOptionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PollOptionMutation) RemovedIDs ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) RemovedOptionVotesIDs ¶
func (m *PollOptionMutation) RemovedOptionVotesIDs() (ids []int)
RemovedOptionVotes returns the removed IDs of the "option_votes" edge to the PollVote entity.
func (*PollOptionMutation) ResetEdge ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) ResetField ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) ResetLabel ¶
func (m *PollOptionMutation) ResetLabel()
ResetLabel resets all changes to the "label" field.
func (*PollOptionMutation) ResetOptionVotes ¶
func (m *PollOptionMutation) ResetOptionVotes()
ResetOptionVotes resets all changes to the "option_votes" edge.
func (*PollOptionMutation) ResetPoll ¶
func (m *PollOptionMutation) ResetPoll()
ResetPoll resets all changes to the "poll" edge.
func (*PollOptionMutation) ResetPollID ¶
func (m *PollOptionMutation) ResetPollID()
ResetPollID resets all changes to the "poll_id" field.
func (*PollOptionMutation) ResetWeight ¶
func (m *PollOptionMutation) ResetWeight()
ResetWeight resets all changes to the "weight" field.
func (*PollOptionMutation) SetField ¶
func (m *PollOptionMutation) 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 (*PollOptionMutation) SetID ¶
func (m *PollOptionMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of PollOption entities.
func (*PollOptionMutation) SetLabel ¶
func (m *PollOptionMutation) SetLabel(s string)
SetLabel sets the "label" field.
func (*PollOptionMutation) SetOp ¶
func (m *PollOptionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PollOptionMutation) SetPollID ¶
func (m *PollOptionMutation) SetPollID(i int)
SetPollID sets the "poll_id" field.
func (*PollOptionMutation) SetWeight ¶
func (m *PollOptionMutation) SetWeight(i int)
SetWeight sets the "weight" field.
func (PollOptionMutation) Tx ¶
func (m PollOptionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PollOptionMutation) Type ¶
func (m *PollOptionMutation) Type() string
Type returns the node type of this mutation (PollOption).
func (*PollOptionMutation) Weight ¶
func (m *PollOptionMutation) Weight() (r int, exists bool)
Weight returns the value of the "weight" field in the mutation.
func (*PollOptionMutation) Where ¶
func (m *PollOptionMutation) Where(ps ...predicate.PollOption)
Where appends a list predicates to the PollOptionMutation builder.
func (*PollOptionMutation) WhereP ¶
func (m *PollOptionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PollOptionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PollOptionQuery ¶
type PollOptionQuery struct {
// contains filtered or unexported fields
}
PollOptionQuery is the builder for querying PollOption entities.
func (*PollOptionQuery) Aggregate ¶
func (_q *PollOptionQuery) Aggregate(fns ...AggregateFunc) *PollOptionSelect
Aggregate returns a PollOptionSelect configured with the given aggregations.
func (*PollOptionQuery) All ¶
func (_q *PollOptionQuery) All(ctx context.Context) ([]*PollOption, error)
All executes the query and returns a list of PollOptions.
func (*PollOptionQuery) AllX ¶
func (_q *PollOptionQuery) AllX(ctx context.Context) []*PollOption
AllX is like All, but panics if an error occurs.
func (*PollOptionQuery) Clone ¶
func (_q *PollOptionQuery) Clone() *PollOptionQuery
Clone returns a duplicate of the PollOptionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PollOptionQuery) Count ¶
func (_q *PollOptionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PollOptionQuery) CountX ¶
func (_q *PollOptionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PollOptionQuery) Exist ¶
func (_q *PollOptionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PollOptionQuery) ExistX ¶
func (_q *PollOptionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PollOptionQuery) First ¶
func (_q *PollOptionQuery) First(ctx context.Context) (*PollOption, error)
First returns the first PollOption entity from the query. Returns a *NotFoundError when no PollOption was found.
func (*PollOptionQuery) FirstID ¶
func (_q *PollOptionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PollOption ID from the query. Returns a *NotFoundError when no PollOption ID was found.
func (*PollOptionQuery) FirstIDX ¶
func (_q *PollOptionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PollOptionQuery) FirstX ¶
func (_q *PollOptionQuery) FirstX(ctx context.Context) *PollOption
FirstX is like First, but panics if an error occurs.
func (*PollOptionQuery) GroupBy ¶
func (_q *PollOptionQuery) GroupBy(field string, fields ...string) *PollOptionGroupBy
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 {
PollID int `json:"poll_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.PollOption.Query().
GroupBy(polloption.FieldPollID).
Aggregate(generated.Count()).
Scan(ctx, &v)
func (*PollOptionQuery) IDs ¶
func (_q *PollOptionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of PollOption IDs.
func (*PollOptionQuery) IDsX ¶
func (_q *PollOptionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PollOptionQuery) Limit ¶
func (_q *PollOptionQuery) Limit(limit int) *PollOptionQuery
Limit the number of records to be returned by this query.
func (*PollOptionQuery) Offset ¶
func (_q *PollOptionQuery) Offset(offset int) *PollOptionQuery
Offset to start from.
func (*PollOptionQuery) Only ¶
func (_q *PollOptionQuery) Only(ctx context.Context) (*PollOption, error)
Only returns a single PollOption entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PollOption entity is found. Returns a *NotFoundError when no PollOption entities are found.
func (*PollOptionQuery) OnlyID ¶
func (_q *PollOptionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PollOption ID in the query. Returns a *NotSingularError when more than one PollOption ID is found. Returns a *NotFoundError when no entities are found.
func (*PollOptionQuery) OnlyIDX ¶
func (_q *PollOptionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PollOptionQuery) OnlyX ¶
func (_q *PollOptionQuery) OnlyX(ctx context.Context) *PollOption
OnlyX is like Only, but panics if an error occurs.
func (*PollOptionQuery) Order ¶
func (_q *PollOptionQuery) Order(o ...polloption.OrderOption) *PollOptionQuery
Order specifies how the records should be ordered.
func (*PollOptionQuery) QueryOptionVotes ¶
func (_q *PollOptionQuery) QueryOptionVotes() *PollVoteQuery
QueryOptionVotes chains the current query on the "option_votes" edge.
func (*PollOptionQuery) QueryPoll ¶
func (_q *PollOptionQuery) QueryPoll() *PollQuery
QueryPoll chains the current query on the "poll" edge.
func (*PollOptionQuery) Select ¶
func (_q *PollOptionQuery) Select(fields ...string) *PollOptionSelect
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 {
PollID int `json:"poll_id,omitempty"`
}
client.PollOption.Query().
Select(polloption.FieldPollID).
Scan(ctx, &v)
func (*PollOptionQuery) Unique ¶
func (_q *PollOptionQuery) Unique(unique bool) *PollOptionQuery
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 (*PollOptionQuery) Where ¶
func (_q *PollOptionQuery) Where(ps ...predicate.PollOption) *PollOptionQuery
Where adds a new predicate for the PollOptionQuery builder.
func (*PollOptionQuery) WithOptionVotes ¶
func (_q *PollOptionQuery) WithOptionVotes(opts ...func(*PollVoteQuery)) *PollOptionQuery
WithOptionVotes tells the query-builder to eager-load the nodes that are connected to the "option_votes" edge. The optional arguments are used to configure the query builder of the edge.
func (*PollOptionQuery) WithPoll ¶
func (_q *PollOptionQuery) WithPoll(opts ...func(*PollQuery)) *PollOptionQuery
WithPoll tells the query-builder to eager-load the nodes that are connected to the "poll" edge. The optional arguments are used to configure the query builder of the edge.
type PollOptionSelect ¶
type PollOptionSelect struct {
*PollOptionQuery
// contains filtered or unexported fields
}
PollOptionSelect is the builder for selecting fields of PollOption entities.
func (*PollOptionSelect) Aggregate ¶
func (_s *PollOptionSelect) Aggregate(fns ...AggregateFunc) *PollOptionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PollOptionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollOptionSelect) Scan ¶
func (_s *PollOptionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollOptionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollOptionUpdate ¶
type PollOptionUpdate struct {
// contains filtered or unexported fields
}
PollOptionUpdate is the builder for updating PollOption entities.
func (*PollOptionUpdate) AddOptionVoteIDs ¶
func (_u *PollOptionUpdate) AddOptionVoteIDs(ids ...int) *PollOptionUpdate
AddOptionVoteIDs adds the "option_votes" edge to the PollVote entity by IDs.
func (*PollOptionUpdate) AddOptionVotes ¶
func (_u *PollOptionUpdate) AddOptionVotes(v ...*PollVote) *PollOptionUpdate
AddOptionVotes adds the "option_votes" edges to the PollVote entity.
func (*PollOptionUpdate) AddWeight ¶
func (_u *PollOptionUpdate) AddWeight(v int) *PollOptionUpdate
AddWeight adds value to the "weight" field.
func (*PollOptionUpdate) ClearOptionVotes ¶
func (_u *PollOptionUpdate) ClearOptionVotes() *PollOptionUpdate
ClearOptionVotes clears all "option_votes" edges to the PollVote entity.
func (*PollOptionUpdate) ClearPoll ¶
func (_u *PollOptionUpdate) ClearPoll() *PollOptionUpdate
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollOptionUpdate) Exec ¶
func (_u *PollOptionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollOptionUpdate) ExecX ¶
func (_u *PollOptionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionUpdate) Mutation ¶
func (_u *PollOptionUpdate) Mutation() *PollOptionMutation
Mutation returns the PollOptionMutation object of the builder.
func (*PollOptionUpdate) RemoveOptionVoteIDs ¶
func (_u *PollOptionUpdate) RemoveOptionVoteIDs(ids ...int) *PollOptionUpdate
RemoveOptionVoteIDs removes the "option_votes" edge to PollVote entities by IDs.
func (*PollOptionUpdate) RemoveOptionVotes ¶
func (_u *PollOptionUpdate) RemoveOptionVotes(v ...*PollVote) *PollOptionUpdate
RemoveOptionVotes removes "option_votes" edges to PollVote entities.
func (*PollOptionUpdate) Save ¶
func (_u *PollOptionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PollOptionUpdate) SaveX ¶
func (_u *PollOptionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PollOptionUpdate) SetLabel ¶
func (_u *PollOptionUpdate) SetLabel(v string) *PollOptionUpdate
SetLabel sets the "label" field.
func (*PollOptionUpdate) SetNillableLabel ¶
func (_u *PollOptionUpdate) SetNillableLabel(v *string) *PollOptionUpdate
SetNillableLabel sets the "label" field if the given value is not nil.
func (*PollOptionUpdate) SetNillablePollID ¶
func (_u *PollOptionUpdate) SetNillablePollID(v *int) *PollOptionUpdate
SetNillablePollID sets the "poll_id" field if the given value is not nil.
func (*PollOptionUpdate) SetNillableWeight ¶
func (_u *PollOptionUpdate) SetNillableWeight(v *int) *PollOptionUpdate
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PollOptionUpdate) SetPoll ¶
func (_u *PollOptionUpdate) SetPoll(v *Poll) *PollOptionUpdate
SetPoll sets the "poll" edge to the Poll entity.
func (*PollOptionUpdate) SetPollID ¶
func (_u *PollOptionUpdate) SetPollID(v int) *PollOptionUpdate
SetPollID sets the "poll_id" field.
func (*PollOptionUpdate) SetWeight ¶
func (_u *PollOptionUpdate) SetWeight(v int) *PollOptionUpdate
SetWeight sets the "weight" field.
func (*PollOptionUpdate) Where ¶
func (_u *PollOptionUpdate) Where(ps ...predicate.PollOption) *PollOptionUpdate
Where appends a list predicates to the PollOptionUpdate builder.
type PollOptionUpdateOne ¶
type PollOptionUpdateOne struct {
// contains filtered or unexported fields
}
PollOptionUpdateOne is the builder for updating a single PollOption entity.
func (*PollOptionUpdateOne) AddOptionVoteIDs ¶
func (_u *PollOptionUpdateOne) AddOptionVoteIDs(ids ...int) *PollOptionUpdateOne
AddOptionVoteIDs adds the "option_votes" edge to the PollVote entity by IDs.
func (*PollOptionUpdateOne) AddOptionVotes ¶
func (_u *PollOptionUpdateOne) AddOptionVotes(v ...*PollVote) *PollOptionUpdateOne
AddOptionVotes adds the "option_votes" edges to the PollVote entity.
func (*PollOptionUpdateOne) AddWeight ¶
func (_u *PollOptionUpdateOne) AddWeight(v int) *PollOptionUpdateOne
AddWeight adds value to the "weight" field.
func (*PollOptionUpdateOne) ClearOptionVotes ¶
func (_u *PollOptionUpdateOne) ClearOptionVotes() *PollOptionUpdateOne
ClearOptionVotes clears all "option_votes" edges to the PollVote entity.
func (*PollOptionUpdateOne) ClearPoll ¶
func (_u *PollOptionUpdateOne) ClearPoll() *PollOptionUpdateOne
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollOptionUpdateOne) Exec ¶
func (_u *PollOptionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PollOptionUpdateOne) ExecX ¶
func (_u *PollOptionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollOptionUpdateOne) Mutation ¶
func (_u *PollOptionUpdateOne) Mutation() *PollOptionMutation
Mutation returns the PollOptionMutation object of the builder.
func (*PollOptionUpdateOne) RemoveOptionVoteIDs ¶
func (_u *PollOptionUpdateOne) RemoveOptionVoteIDs(ids ...int) *PollOptionUpdateOne
RemoveOptionVoteIDs removes the "option_votes" edge to PollVote entities by IDs.
func (*PollOptionUpdateOne) RemoveOptionVotes ¶
func (_u *PollOptionUpdateOne) RemoveOptionVotes(v ...*PollVote) *PollOptionUpdateOne
RemoveOptionVotes removes "option_votes" edges to PollVote entities.
func (*PollOptionUpdateOne) Save ¶
func (_u *PollOptionUpdateOne) Save(ctx context.Context) (*PollOption, error)
Save executes the query and returns the updated PollOption entity.
func (*PollOptionUpdateOne) SaveX ¶
func (_u *PollOptionUpdateOne) SaveX(ctx context.Context) *PollOption
SaveX is like Save, but panics if an error occurs.
func (*PollOptionUpdateOne) Select ¶
func (_u *PollOptionUpdateOne) Select(field string, fields ...string) *PollOptionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PollOptionUpdateOne) SetLabel ¶
func (_u *PollOptionUpdateOne) SetLabel(v string) *PollOptionUpdateOne
SetLabel sets the "label" field.
func (*PollOptionUpdateOne) SetNillableLabel ¶
func (_u *PollOptionUpdateOne) SetNillableLabel(v *string) *PollOptionUpdateOne
SetNillableLabel sets the "label" field if the given value is not nil.
func (*PollOptionUpdateOne) SetNillablePollID ¶
func (_u *PollOptionUpdateOne) SetNillablePollID(v *int) *PollOptionUpdateOne
SetNillablePollID sets the "poll_id" field if the given value is not nil.
func (*PollOptionUpdateOne) SetNillableWeight ¶
func (_u *PollOptionUpdateOne) SetNillableWeight(v *int) *PollOptionUpdateOne
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PollOptionUpdateOne) SetPoll ¶
func (_u *PollOptionUpdateOne) SetPoll(v *Poll) *PollOptionUpdateOne
SetPoll sets the "poll" edge to the Poll entity.
func (*PollOptionUpdateOne) SetPollID ¶
func (_u *PollOptionUpdateOne) SetPollID(v int) *PollOptionUpdateOne
SetPollID sets the "poll_id" field.
func (*PollOptionUpdateOne) SetWeight ¶
func (_u *PollOptionUpdateOne) SetWeight(v int) *PollOptionUpdateOne
SetWeight sets the "weight" field.
func (*PollOptionUpdateOne) Where ¶
func (_u *PollOptionUpdateOne) Where(ps ...predicate.PollOption) *PollOptionUpdateOne
Where appends a list predicates to the PollOptionUpdate builder.
type PollQuery ¶
type PollQuery struct {
// contains filtered or unexported fields
}
PollQuery is the builder for querying Poll entities.
func (*PollQuery) Aggregate ¶
func (_q *PollQuery) Aggregate(fns ...AggregateFunc) *PollSelect
Aggregate returns a PollSelect configured with the given aggregations.
func (*PollQuery) Clone ¶
Clone returns a duplicate of the PollQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PollQuery) First ¶
First returns the first Poll entity from the query. Returns a *NotFoundError when no Poll was found.
func (*PollQuery) FirstID ¶
FirstID returns the first Poll ID from the query. Returns a *NotFoundError when no Poll ID was found.
func (*PollQuery) GroupBy ¶
func (_q *PollQuery) GroupBy(field string, fields ...string) *PollGroupBy
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 {
Nid int `json:"nid,omitempty"`
Count int `json:"count,omitempty"`
}
client.Poll.Query().
GroupBy(poll.FieldNid).
Aggregate(generated.Count()).
Scan(ctx, &v)
func (*PollQuery) Only ¶
Only returns a single Poll entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Poll entity is found. Returns a *NotFoundError when no Poll entities are found.
func (*PollQuery) OnlyID ¶
OnlyID is like Only, but returns the only Poll ID in the query. Returns a *NotSingularError when more than one Poll ID is found. Returns a *NotFoundError when no entities are found.
func (*PollQuery) Order ¶
func (_q *PollQuery) Order(o ...poll.OrderOption) *PollQuery
Order specifies how the records should be ordered.
func (*PollQuery) QueryNodes ¶
QueryNodes chains the current query on the "nodes" edge.
func (*PollQuery) QueryOptions ¶
func (_q *PollQuery) QueryOptions() *PollOptionQuery
QueryOptions chains the current query on the "options" edge.
func (*PollQuery) QueryVotes ¶
func (_q *PollQuery) QueryVotes() *PollVoteQuery
QueryVotes chains the current query on the "votes" edge.
func (*PollQuery) Select ¶
func (_q *PollQuery) Select(fields ...string) *PollSelect
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 {
Nid int `json:"nid,omitempty"`
}
client.Poll.Query().
Select(poll.FieldNid).
Scan(ctx, &v)
func (*PollQuery) 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 (*PollQuery) WithNodes ¶
WithNodes tells the query-builder to eager-load the nodes that are connected to the "nodes" edge. The optional arguments are used to configure the query builder of the edge.
func (*PollQuery) WithOptions ¶
func (_q *PollQuery) WithOptions(opts ...func(*PollOptionQuery)) *PollQuery
WithOptions tells the query-builder to eager-load the nodes that are connected to the "options" edge. The optional arguments are used to configure the query builder of the edge.
func (*PollQuery) WithVotes ¶
func (_q *PollQuery) WithVotes(opts ...func(*PollVoteQuery)) *PollQuery
WithVotes tells the query-builder to eager-load the nodes that are connected to the "votes" edge. The optional arguments are used to configure the query builder of the edge.
type PollSelect ¶
type PollSelect struct {
*PollQuery
// contains filtered or unexported fields
}
PollSelect is the builder for selecting fields of Poll entities.
func (*PollSelect) Aggregate ¶
func (_s *PollSelect) Aggregate(fns ...AggregateFunc) *PollSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PollSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollSelect) Scan ¶
func (_s *PollSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollUpdate ¶
type PollUpdate struct {
// contains filtered or unexported fields
}
PollUpdate is the builder for updating Poll entities.
func (*PollUpdate) AddMaxAnswers ¶
func (_u *PollUpdate) AddMaxAnswers(v int) *PollUpdate
AddMaxAnswers adds value to the "max_answers" field.
func (*PollUpdate) AddOptionIDs ¶
func (_u *PollUpdate) AddOptionIDs(ids ...int) *PollUpdate
AddOptionIDs adds the "options" edge to the PollOption entity by IDs.
func (*PollUpdate) AddOptions ¶
func (_u *PollUpdate) AddOptions(v ...*PollOption) *PollUpdate
AddOptions adds the "options" edges to the PollOption entity.
func (*PollUpdate) AddVoteIDs ¶
func (_u *PollUpdate) AddVoteIDs(ids ...int) *PollUpdate
AddVoteIDs adds the "votes" edge to the PollVote entity by IDs.
func (*PollUpdate) AddVotes ¶
func (_u *PollUpdate) AddVotes(v ...*PollVote) *PollUpdate
AddVotes adds the "votes" edges to the PollVote entity.
func (*PollUpdate) ClearAvailableFrom ¶
func (_u *PollUpdate) ClearAvailableFrom() *PollUpdate
ClearAvailableFrom clears the value of the "available_from" field.
func (*PollUpdate) ClearAvailableTo ¶
func (_u *PollUpdate) ClearAvailableTo() *PollUpdate
ClearAvailableTo clears the value of the "available_to" field.
func (*PollUpdate) ClearDescription ¶
func (_u *PollUpdate) ClearDescription() *PollUpdate
ClearDescription clears the value of the "description" field.
func (*PollUpdate) ClearNodes ¶
func (_u *PollUpdate) ClearNodes() *PollUpdate
ClearNodes clears the "nodes" edge to the Node entity.
func (*PollUpdate) ClearOptions ¶
func (_u *PollUpdate) ClearOptions() *PollUpdate
ClearOptions clears all "options" edges to the PollOption entity.
func (*PollUpdate) ClearVotes ¶
func (_u *PollUpdate) ClearVotes() *PollUpdate
ClearVotes clears all "votes" edges to the PollVote entity.
func (*PollUpdate) Exec ¶
func (_u *PollUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollUpdate) ExecX ¶
func (_u *PollUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollUpdate) Mutation ¶
func (_u *PollUpdate) Mutation() *PollMutation
Mutation returns the PollMutation object of the builder.
func (*PollUpdate) RemoveOptionIDs ¶
func (_u *PollUpdate) RemoveOptionIDs(ids ...int) *PollUpdate
RemoveOptionIDs removes the "options" edge to PollOption entities by IDs.
func (*PollUpdate) RemoveOptions ¶
func (_u *PollUpdate) RemoveOptions(v ...*PollOption) *PollUpdate
RemoveOptions removes "options" edges to PollOption entities.
func (*PollUpdate) RemoveVoteIDs ¶
func (_u *PollUpdate) RemoveVoteIDs(ids ...int) *PollUpdate
RemoveVoteIDs removes the "votes" edge to PollVote entities by IDs.
func (*PollUpdate) RemoveVotes ¶
func (_u *PollUpdate) RemoveVotes(v ...*PollVote) *PollUpdate
RemoveVotes removes "votes" edges to PollVote entities.
func (*PollUpdate) Save ¶
func (_u *PollUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PollUpdate) SaveX ¶
func (_u *PollUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PollUpdate) SetAllowRevote ¶
func (_u *PollUpdate) SetAllowRevote(v bool) *PollUpdate
SetAllowRevote sets the "allow_revote" field.
func (*PollUpdate) SetAvailableFrom ¶
func (_u *PollUpdate) SetAvailableFrom(v time.Time) *PollUpdate
SetAvailableFrom sets the "available_from" field.
func (*PollUpdate) SetAvailableTo ¶
func (_u *PollUpdate) SetAvailableTo(v time.Time) *PollUpdate
SetAvailableTo sets the "available_to" field.
func (*PollUpdate) SetDescription ¶
func (_u *PollUpdate) SetDescription(v string) *PollUpdate
SetDescription sets the "description" field.
func (*PollUpdate) SetMaxAnswers ¶
func (_u *PollUpdate) SetMaxAnswers(v int) *PollUpdate
SetMaxAnswers sets the "max_answers" field.
func (*PollUpdate) SetNid ¶
func (_u *PollUpdate) SetNid(v int) *PollUpdate
SetNid sets the "nid" field.
func (*PollUpdate) SetNillableAllowRevote ¶
func (_u *PollUpdate) SetNillableAllowRevote(v *bool) *PollUpdate
SetNillableAllowRevote sets the "allow_revote" field if the given value is not nil.
func (*PollUpdate) SetNillableAvailableFrom ¶
func (_u *PollUpdate) SetNillableAvailableFrom(v *time.Time) *PollUpdate
SetNillableAvailableFrom sets the "available_from" field if the given value is not nil.
func (*PollUpdate) SetNillableAvailableTo ¶
func (_u *PollUpdate) SetNillableAvailableTo(v *time.Time) *PollUpdate
SetNillableAvailableTo sets the "available_to" field if the given value is not nil.
func (*PollUpdate) SetNillableDescription ¶
func (_u *PollUpdate) SetNillableDescription(v *string) *PollUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PollUpdate) SetNillableMaxAnswers ¶
func (_u *PollUpdate) SetNillableMaxAnswers(v *int) *PollUpdate
SetNillableMaxAnswers sets the "max_answers" field if the given value is not nil.
func (*PollUpdate) SetNillableNid ¶
func (_u *PollUpdate) SetNillableNid(v *int) *PollUpdate
SetNillableNid sets the "nid" field if the given value is not nil.
func (*PollUpdate) SetNillableResultsOnly ¶
func (_u *PollUpdate) SetNillableResultsOnly(v *bool) *PollUpdate
SetNillableResultsOnly sets the "results_only" field if the given value is not nil.
func (*PollUpdate) SetNodes ¶
func (_u *PollUpdate) SetNodes(v *Node) *PollUpdate
SetNodes sets the "nodes" edge to the Node entity.
func (*PollUpdate) SetNodesID ¶
func (_u *PollUpdate) SetNodesID(id int) *PollUpdate
SetNodesID sets the "nodes" edge to the Node entity by ID.
func (*PollUpdate) SetResultsOnly ¶
func (_u *PollUpdate) SetResultsOnly(v bool) *PollUpdate
SetResultsOnly sets the "results_only" field.
func (*PollUpdate) Where ¶
func (_u *PollUpdate) Where(ps ...predicate.Poll) *PollUpdate
Where appends a list predicates to the PollUpdate builder.
type PollUpdateOne ¶
type PollUpdateOne struct {
// contains filtered or unexported fields
}
PollUpdateOne is the builder for updating a single Poll entity.
func (*PollUpdateOne) AddMaxAnswers ¶
func (_u *PollUpdateOne) AddMaxAnswers(v int) *PollUpdateOne
AddMaxAnswers adds value to the "max_answers" field.
func (*PollUpdateOne) AddOptionIDs ¶
func (_u *PollUpdateOne) AddOptionIDs(ids ...int) *PollUpdateOne
AddOptionIDs adds the "options" edge to the PollOption entity by IDs.
func (*PollUpdateOne) AddOptions ¶
func (_u *PollUpdateOne) AddOptions(v ...*PollOption) *PollUpdateOne
AddOptions adds the "options" edges to the PollOption entity.
func (*PollUpdateOne) AddVoteIDs ¶
func (_u *PollUpdateOne) AddVoteIDs(ids ...int) *PollUpdateOne
AddVoteIDs adds the "votes" edge to the PollVote entity by IDs.
func (*PollUpdateOne) AddVotes ¶
func (_u *PollUpdateOne) AddVotes(v ...*PollVote) *PollUpdateOne
AddVotes adds the "votes" edges to the PollVote entity.
func (*PollUpdateOne) ClearAvailableFrom ¶
func (_u *PollUpdateOne) ClearAvailableFrom() *PollUpdateOne
ClearAvailableFrom clears the value of the "available_from" field.
func (*PollUpdateOne) ClearAvailableTo ¶
func (_u *PollUpdateOne) ClearAvailableTo() *PollUpdateOne
ClearAvailableTo clears the value of the "available_to" field.
func (*PollUpdateOne) ClearDescription ¶
func (_u *PollUpdateOne) ClearDescription() *PollUpdateOne
ClearDescription clears the value of the "description" field.
func (*PollUpdateOne) ClearNodes ¶
func (_u *PollUpdateOne) ClearNodes() *PollUpdateOne
ClearNodes clears the "nodes" edge to the Node entity.
func (*PollUpdateOne) ClearOptions ¶
func (_u *PollUpdateOne) ClearOptions() *PollUpdateOne
ClearOptions clears all "options" edges to the PollOption entity.
func (*PollUpdateOne) ClearVotes ¶
func (_u *PollUpdateOne) ClearVotes() *PollUpdateOne
ClearVotes clears all "votes" edges to the PollVote entity.
func (*PollUpdateOne) Exec ¶
func (_u *PollUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PollUpdateOne) ExecX ¶
func (_u *PollUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollUpdateOne) Mutation ¶
func (_u *PollUpdateOne) Mutation() *PollMutation
Mutation returns the PollMutation object of the builder.
func (*PollUpdateOne) RemoveOptionIDs ¶
func (_u *PollUpdateOne) RemoveOptionIDs(ids ...int) *PollUpdateOne
RemoveOptionIDs removes the "options" edge to PollOption entities by IDs.
func (*PollUpdateOne) RemoveOptions ¶
func (_u *PollUpdateOne) RemoveOptions(v ...*PollOption) *PollUpdateOne
RemoveOptions removes "options" edges to PollOption entities.
func (*PollUpdateOne) RemoveVoteIDs ¶
func (_u *PollUpdateOne) RemoveVoteIDs(ids ...int) *PollUpdateOne
RemoveVoteIDs removes the "votes" edge to PollVote entities by IDs.
func (*PollUpdateOne) RemoveVotes ¶
func (_u *PollUpdateOne) RemoveVotes(v ...*PollVote) *PollUpdateOne
RemoveVotes removes "votes" edges to PollVote entities.
func (*PollUpdateOne) Save ¶
func (_u *PollUpdateOne) Save(ctx context.Context) (*Poll, error)
Save executes the query and returns the updated Poll entity.
func (*PollUpdateOne) SaveX ¶
func (_u *PollUpdateOne) SaveX(ctx context.Context) *Poll
SaveX is like Save, but panics if an error occurs.
func (*PollUpdateOne) Select ¶
func (_u *PollUpdateOne) Select(field string, fields ...string) *PollUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PollUpdateOne) SetAllowRevote ¶
func (_u *PollUpdateOne) SetAllowRevote(v bool) *PollUpdateOne
SetAllowRevote sets the "allow_revote" field.
func (*PollUpdateOne) SetAvailableFrom ¶
func (_u *PollUpdateOne) SetAvailableFrom(v time.Time) *PollUpdateOne
SetAvailableFrom sets the "available_from" field.
func (*PollUpdateOne) SetAvailableTo ¶
func (_u *PollUpdateOne) SetAvailableTo(v time.Time) *PollUpdateOne
SetAvailableTo sets the "available_to" field.
func (*PollUpdateOne) SetDescription ¶
func (_u *PollUpdateOne) SetDescription(v string) *PollUpdateOne
SetDescription sets the "description" field.
func (*PollUpdateOne) SetMaxAnswers ¶
func (_u *PollUpdateOne) SetMaxAnswers(v int) *PollUpdateOne
SetMaxAnswers sets the "max_answers" field.
func (*PollUpdateOne) SetNid ¶
func (_u *PollUpdateOne) SetNid(v int) *PollUpdateOne
SetNid sets the "nid" field.
func (*PollUpdateOne) SetNillableAllowRevote ¶
func (_u *PollUpdateOne) SetNillableAllowRevote(v *bool) *PollUpdateOne
SetNillableAllowRevote sets the "allow_revote" field if the given value is not nil.
func (*PollUpdateOne) SetNillableAvailableFrom ¶
func (_u *PollUpdateOne) SetNillableAvailableFrom(v *time.Time) *PollUpdateOne
SetNillableAvailableFrom sets the "available_from" field if the given value is not nil.
func (*PollUpdateOne) SetNillableAvailableTo ¶
func (_u *PollUpdateOne) SetNillableAvailableTo(v *time.Time) *PollUpdateOne
SetNillableAvailableTo sets the "available_to" field if the given value is not nil.
func (*PollUpdateOne) SetNillableDescription ¶
func (_u *PollUpdateOne) SetNillableDescription(v *string) *PollUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PollUpdateOne) SetNillableMaxAnswers ¶
func (_u *PollUpdateOne) SetNillableMaxAnswers(v *int) *PollUpdateOne
SetNillableMaxAnswers sets the "max_answers" field if the given value is not nil.
func (*PollUpdateOne) SetNillableNid ¶
func (_u *PollUpdateOne) SetNillableNid(v *int) *PollUpdateOne
SetNillableNid sets the "nid" field if the given value is not nil.
func (*PollUpdateOne) SetNillableResultsOnly ¶
func (_u *PollUpdateOne) SetNillableResultsOnly(v *bool) *PollUpdateOne
SetNillableResultsOnly sets the "results_only" field if the given value is not nil.
func (*PollUpdateOne) SetNodes ¶
func (_u *PollUpdateOne) SetNodes(v *Node) *PollUpdateOne
SetNodes sets the "nodes" edge to the Node entity.
func (*PollUpdateOne) SetNodesID ¶
func (_u *PollUpdateOne) SetNodesID(id int) *PollUpdateOne
SetNodesID sets the "nodes" edge to the Node entity by ID.
func (*PollUpdateOne) SetResultsOnly ¶
func (_u *PollUpdateOne) SetResultsOnly(v bool) *PollUpdateOne
SetResultsOnly sets the "results_only" field.
func (*PollUpdateOne) Where ¶
func (_u *PollUpdateOne) Where(ps ...predicate.Poll) *PollUpdateOne
Where appends a list predicates to the PollUpdate builder.
type PollVote ¶
type PollVote struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// PollID holds the value of the "poll_id" field.
PollID int `json:"poll_id,omitempty"`
// UserID holds the value of the "user_id" field.
UserID int `json:"user_id,omitempty"`
// OptionID holds the value of the "option_id" field.
OptionID int `json:"option_id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PollVoteQuery when eager-loading is set.
Edges PollVoteEdges `json:"edges"`
// contains filtered or unexported fields
}
PollVote is the model entity for the PollVote schema.
func (*PollVote) QueryPollOption ¶
func (_m *PollVote) QueryPollOption() *PollOptionQuery
QueryPollOption queries the "poll_option" edge of the PollVote entity.
func (*PollVote) QueryUsers ¶
QueryUsers queries the "users" edge of the PollVote entity.
func (*PollVote) Unwrap ¶
Unwrap unwraps the PollVote 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 (*PollVote) Update ¶
func (_m *PollVote) Update() *PollVoteUpdateOne
Update returns a builder for updating this PollVote. Note that you need to call PollVote.Unwrap() before calling this method if this PollVote was returned from a transaction, and the transaction was committed or rolled back.
type PollVoteClient ¶
type PollVoteClient struct {
// contains filtered or unexported fields
}
PollVoteClient is a client for the PollVote schema.
func NewPollVoteClient ¶
func NewPollVoteClient(c config) *PollVoteClient
NewPollVoteClient returns a client for the PollVote from the given config.
func (*PollVoteClient) Create ¶
func (c *PollVoteClient) Create() *PollVoteCreate
Create returns a builder for creating a PollVote entity.
func (*PollVoteClient) CreateBulk ¶
func (c *PollVoteClient) CreateBulk(builders ...*PollVoteCreate) *PollVoteCreateBulk
CreateBulk returns a builder for creating a bulk of PollVote entities.
func (*PollVoteClient) Delete ¶
func (c *PollVoteClient) Delete() *PollVoteDelete
Delete returns a delete builder for PollVote.
func (*PollVoteClient) DeleteOne ¶
func (c *PollVoteClient) DeleteOne(_m *PollVote) *PollVoteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PollVoteClient) DeleteOneID ¶
func (c *PollVoteClient) DeleteOneID(id int) *PollVoteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PollVoteClient) GetX ¶
func (c *PollVoteClient) GetX(ctx context.Context, id int) *PollVote
GetX is like Get, but panics if an error occurs.
func (*PollVoteClient) Hooks ¶
func (c *PollVoteClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PollVoteClient) Intercept ¶
func (c *PollVoteClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pollvote.Intercept(f(g(h())))`.
func (*PollVoteClient) Interceptors ¶
func (c *PollVoteClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PollVoteClient) MapCreateBulk ¶
func (c *PollVoteClient) MapCreateBulk(slice any, setFunc func(*PollVoteCreate, int)) *PollVoteCreateBulk
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 (*PollVoteClient) Query ¶
func (c *PollVoteClient) Query() *PollVoteQuery
Query returns a query builder for PollVote.
func (*PollVoteClient) QueryPoll ¶
func (c *PollVoteClient) QueryPoll(_m *PollVote) *PollQuery
QueryPoll queries the poll edge of a PollVote.
func (*PollVoteClient) QueryPollOption ¶
func (c *PollVoteClient) QueryPollOption(_m *PollVote) *PollOptionQuery
QueryPollOption queries the poll_option edge of a PollVote.
func (*PollVoteClient) QueryUsers ¶
func (c *PollVoteClient) QueryUsers(_m *PollVote) *UserQuery
QueryUsers queries the users edge of a PollVote.
func (*PollVoteClient) Update ¶
func (c *PollVoteClient) Update() *PollVoteUpdate
Update returns an update builder for PollVote.
func (*PollVoteClient) UpdateOne ¶
func (c *PollVoteClient) UpdateOne(_m *PollVote) *PollVoteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PollVoteClient) UpdateOneID ¶
func (c *PollVoteClient) UpdateOneID(id int) *PollVoteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PollVoteClient) Use ¶
func (c *PollVoteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pollvote.Hooks(f(g(h())))`.
type PollVoteCreate ¶
type PollVoteCreate struct {
// contains filtered or unexported fields
}
PollVoteCreate is the builder for creating a PollVote entity.
func (*PollVoteCreate) Exec ¶
func (_c *PollVoteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollVoteCreate) ExecX ¶
func (_c *PollVoteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollVoteCreate) Mutation ¶
func (_c *PollVoteCreate) Mutation() *PollVoteMutation
Mutation returns the PollVoteMutation object of the builder.
func (*PollVoteCreate) Save ¶
func (_c *PollVoteCreate) Save(ctx context.Context) (*PollVote, error)
Save creates the PollVote in the database.
func (*PollVoteCreate) SaveX ¶
func (_c *PollVoteCreate) SaveX(ctx context.Context) *PollVote
SaveX calls Save and panics if Save returns an error.
func (*PollVoteCreate) SetCreatedAt ¶
func (_c *PollVoteCreate) SetCreatedAt(v time.Time) *PollVoteCreate
SetCreatedAt sets the "created_at" field.
func (*PollVoteCreate) SetID ¶
func (_c *PollVoteCreate) SetID(v int) *PollVoteCreate
SetID sets the "id" field.
func (*PollVoteCreate) SetNillableCreatedAt ¶
func (_c *PollVoteCreate) SetNillableCreatedAt(v *time.Time) *PollVoteCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PollVoteCreate) SetOptionID ¶
func (_c *PollVoteCreate) SetOptionID(v int) *PollVoteCreate
SetOptionID sets the "option_id" field.
func (*PollVoteCreate) SetPoll ¶
func (_c *PollVoteCreate) SetPoll(v *Poll) *PollVoteCreate
SetPoll sets the "poll" edge to the Poll entity.
func (*PollVoteCreate) SetPollID ¶
func (_c *PollVoteCreate) SetPollID(v int) *PollVoteCreate
SetPollID sets the "poll_id" field.
func (*PollVoteCreate) SetPollOption ¶
func (_c *PollVoteCreate) SetPollOption(v *PollOption) *PollVoteCreate
SetPollOption sets the "poll_option" edge to the PollOption entity.
func (*PollVoteCreate) SetPollOptionID ¶
func (_c *PollVoteCreate) SetPollOptionID(id int) *PollVoteCreate
SetPollOptionID sets the "poll_option" edge to the PollOption entity by ID.
func (*PollVoteCreate) SetUserID ¶
func (_c *PollVoteCreate) SetUserID(v int) *PollVoteCreate
SetUserID sets the "user_id" field.
func (*PollVoteCreate) SetUsers ¶
func (_c *PollVoteCreate) SetUsers(v *User) *PollVoteCreate
SetUsers sets the "users" edge to the User entity.
func (*PollVoteCreate) SetUsersID ¶
func (_c *PollVoteCreate) SetUsersID(id int) *PollVoteCreate
SetUsersID sets the "users" edge to the User entity by ID.
type PollVoteCreateBulk ¶
type PollVoteCreateBulk struct {
// contains filtered or unexported fields
}
PollVoteCreateBulk is the builder for creating many PollVote entities in bulk.
func (*PollVoteCreateBulk) Exec ¶
func (_c *PollVoteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PollVoteCreateBulk) ExecX ¶
func (_c *PollVoteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PollVoteDelete ¶
type PollVoteDelete struct {
// contains filtered or unexported fields
}
PollVoteDelete is the builder for deleting a PollVote entity.
func (*PollVoteDelete) Exec ¶
func (_d *PollVoteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PollVoteDelete) ExecX ¶
func (_d *PollVoteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PollVoteDelete) Where ¶
func (_d *PollVoteDelete) Where(ps ...predicate.PollVote) *PollVoteDelete
Where appends a list predicates to the PollVoteDelete builder.
type PollVoteDeleteOne ¶
type PollVoteDeleteOne struct {
// contains filtered or unexported fields
}
PollVoteDeleteOne is the builder for deleting a single PollVote entity.
func (*PollVoteDeleteOne) Exec ¶
func (_d *PollVoteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PollVoteDeleteOne) ExecX ¶
func (_d *PollVoteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollVoteDeleteOne) Where ¶
func (_d *PollVoteDeleteOne) Where(ps ...predicate.PollVote) *PollVoteDeleteOne
Where appends a list predicates to the PollVoteDelete builder.
type PollVoteEdges ¶
type PollVoteEdges struct {
// Poll holds the value of the poll edge.
Poll *Poll `json:"poll,omitempty"`
// Users holds the value of the users edge.
Users *User `json:"users,omitempty"`
// PollOption holds the value of the poll_option edge.
PollOption *PollOption `json:"poll_option,omitempty"`
// contains filtered or unexported fields
}
PollVoteEdges holds the relations/edges for other nodes in the graph.
func (PollVoteEdges) PollOptionOrErr ¶
func (e PollVoteEdges) PollOptionOrErr() (*PollOption, error)
PollOptionOrErr returns the PollOption value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PollVoteEdges) PollOrErr ¶
func (e PollVoteEdges) PollOrErr() (*Poll, error)
PollOrErr returns the Poll value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PollVoteEdges) UsersOrErr ¶
func (e PollVoteEdges) UsersOrErr() (*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PollVoteGroupBy ¶
type PollVoteGroupBy struct {
// contains filtered or unexported fields
}
PollVoteGroupBy is the group-by builder for PollVote entities.
func (*PollVoteGroupBy) Aggregate ¶
func (_g *PollVoteGroupBy) Aggregate(fns ...AggregateFunc) *PollVoteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PollVoteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollVoteGroupBy) Scan ¶
func (_g *PollVoteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollVoteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollVoteMutation ¶
type PollVoteMutation struct {
// contains filtered or unexported fields
}
PollVoteMutation represents an operation that mutates the PollVote nodes in the graph.
func (*PollVoteMutation) AddField ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) AddedEdges ¶
func (m *PollVoteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PollVoteMutation) AddedField ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) AddedFields ¶
func (m *PollVoteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PollVoteMutation) AddedIDs ¶
func (m *PollVoteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PollVoteMutation) ClearEdge ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ClearField ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ClearPoll ¶
func (m *PollVoteMutation) ClearPoll()
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollVoteMutation) ClearPollOption ¶
func (m *PollVoteMutation) ClearPollOption()
ClearPollOption clears the "poll_option" edge to the PollOption entity.
func (*PollVoteMutation) ClearUsers ¶
func (m *PollVoteMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*PollVoteMutation) ClearedEdges ¶
func (m *PollVoteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PollVoteMutation) ClearedFields ¶
func (m *PollVoteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PollVoteMutation) Client ¶
func (m PollVoteMutation) 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 (*PollVoteMutation) CreatedAt ¶
func (m *PollVoteMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PollVoteMutation) EdgeCleared ¶
func (m *PollVoteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PollVoteMutation) Field ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) FieldCleared ¶
func (m *PollVoteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PollVoteMutation) Fields ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ID ¶
func (m *PollVoteMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PollVoteMutation) IDs ¶
func (m *PollVoteMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PollVoteMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the PollVote entity. If the PollVote 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 (*PollVoteMutation) 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 (*PollVoteMutation) OldOptionID ¶
func (m *PollVoteMutation) OldOptionID(ctx context.Context) (v int, err error)
OldOptionID returns the old "option_id" field's value of the PollVote entity. If the PollVote 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 (*PollVoteMutation) OldPollID ¶
func (m *PollVoteMutation) OldPollID(ctx context.Context) (v int, err error)
OldPollID returns the old "poll_id" field's value of the PollVote entity. If the PollVote 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 (*PollVoteMutation) OldUserID ¶
func (m *PollVoteMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the PollVote entity. If the PollVote 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 (*PollVoteMutation) OptionID ¶
func (m *PollVoteMutation) OptionID() (r int, exists bool)
OptionID returns the value of the "option_id" field in the mutation.
func (*PollVoteMutation) PollCleared ¶
func (m *PollVoteMutation) PollCleared() bool
PollCleared reports if the "poll" edge to the Poll entity was cleared.
func (*PollVoteMutation) PollID ¶
func (m *PollVoteMutation) PollID() (r int, exists bool)
PollID returns the value of the "poll_id" field in the mutation.
func (*PollVoteMutation) PollIDs ¶
func (m *PollVoteMutation) PollIDs() (ids []int)
PollIDs returns the "poll" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PollID instead. It exists only for internal usage by the builders.
func (*PollVoteMutation) PollOptionCleared ¶
func (m *PollVoteMutation) PollOptionCleared() bool
PollOptionCleared reports if the "poll_option" edge to the PollOption entity was cleared.
func (*PollVoteMutation) PollOptionID ¶
func (m *PollVoteMutation) PollOptionID() (id int, exists bool)
PollOptionID returns the "poll_option" edge ID in the mutation.
func (*PollVoteMutation) PollOptionIDs ¶
func (m *PollVoteMutation) PollOptionIDs() (ids []int)
PollOptionIDs returns the "poll_option" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PollOptionID instead. It exists only for internal usage by the builders.
func (*PollVoteMutation) RemovedEdges ¶
func (m *PollVoteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PollVoteMutation) RemovedIDs ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ResetCreatedAt ¶
func (m *PollVoteMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PollVoteMutation) ResetEdge ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ResetField ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) ResetOptionID ¶
func (m *PollVoteMutation) ResetOptionID()
ResetOptionID resets all changes to the "option_id" field.
func (*PollVoteMutation) ResetPoll ¶
func (m *PollVoteMutation) ResetPoll()
ResetPoll resets all changes to the "poll" edge.
func (*PollVoteMutation) ResetPollID ¶
func (m *PollVoteMutation) ResetPollID()
ResetPollID resets all changes to the "poll_id" field.
func (*PollVoteMutation) ResetPollOption ¶
func (m *PollVoteMutation) ResetPollOption()
ResetPollOption resets all changes to the "poll_option" edge.
func (*PollVoteMutation) ResetUserID ¶
func (m *PollVoteMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*PollVoteMutation) ResetUsers ¶
func (m *PollVoteMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*PollVoteMutation) SetCreatedAt ¶
func (m *PollVoteMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PollVoteMutation) SetField ¶
func (m *PollVoteMutation) 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 (*PollVoteMutation) SetID ¶
func (m *PollVoteMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of PollVote entities.
func (*PollVoteMutation) SetOp ¶
func (m *PollVoteMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PollVoteMutation) SetOptionID ¶
func (m *PollVoteMutation) SetOptionID(i int)
SetOptionID sets the "option_id" field.
func (*PollVoteMutation) SetPollID ¶
func (m *PollVoteMutation) SetPollID(i int)
SetPollID sets the "poll_id" field.
func (*PollVoteMutation) SetPollOptionID ¶
func (m *PollVoteMutation) SetPollOptionID(id int)
SetPollOptionID sets the "poll_option" edge to the PollOption entity by id.
func (*PollVoteMutation) SetUserID ¶
func (m *PollVoteMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (*PollVoteMutation) SetUsersID ¶
func (m *PollVoteMutation) SetUsersID(id int)
SetUsersID sets the "users" edge to the User entity by id.
func (PollVoteMutation) Tx ¶
func (m PollVoteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PollVoteMutation) Type ¶
func (m *PollVoteMutation) Type() string
Type returns the node type of this mutation (PollVote).
func (*PollVoteMutation) UserID ¶
func (m *PollVoteMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*PollVoteMutation) UsersCleared ¶
func (m *PollVoteMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*PollVoteMutation) UsersID ¶
func (m *PollVoteMutation) UsersID() (id int, exists bool)
UsersID returns the "users" edge ID in the mutation.
func (*PollVoteMutation) UsersIDs ¶
func (m *PollVoteMutation) UsersIDs() (ids []int)
UsersIDs returns the "users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UsersID instead. It exists only for internal usage by the builders.
func (*PollVoteMutation) Where ¶
func (m *PollVoteMutation) Where(ps ...predicate.PollVote)
Where appends a list predicates to the PollVoteMutation builder.
func (*PollVoteMutation) WhereP ¶
func (m *PollVoteMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PollVoteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PollVoteQuery ¶
type PollVoteQuery struct {
// contains filtered or unexported fields
}
PollVoteQuery is the builder for querying PollVote entities.
func (*PollVoteQuery) Aggregate ¶
func (_q *PollVoteQuery) Aggregate(fns ...AggregateFunc) *PollVoteSelect
Aggregate returns a PollVoteSelect configured with the given aggregations.
func (*PollVoteQuery) All ¶
func (_q *PollVoteQuery) All(ctx context.Context) ([]*PollVote, error)
All executes the query and returns a list of PollVotes.
func (*PollVoteQuery) AllX ¶
func (_q *PollVoteQuery) AllX(ctx context.Context) []*PollVote
AllX is like All, but panics if an error occurs.
func (*PollVoteQuery) Clone ¶
func (_q *PollVoteQuery) Clone() *PollVoteQuery
Clone returns a duplicate of the PollVoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PollVoteQuery) Count ¶
func (_q *PollVoteQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PollVoteQuery) CountX ¶
func (_q *PollVoteQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PollVoteQuery) Exist ¶
func (_q *PollVoteQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PollVoteQuery) ExistX ¶
func (_q *PollVoteQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PollVoteQuery) First ¶
func (_q *PollVoteQuery) First(ctx context.Context) (*PollVote, error)
First returns the first PollVote entity from the query. Returns a *NotFoundError when no PollVote was found.
func (*PollVoteQuery) FirstID ¶
func (_q *PollVoteQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PollVote ID from the query. Returns a *NotFoundError when no PollVote ID was found.
func (*PollVoteQuery) FirstIDX ¶
func (_q *PollVoteQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PollVoteQuery) FirstX ¶
func (_q *PollVoteQuery) FirstX(ctx context.Context) *PollVote
FirstX is like First, but panics if an error occurs.
func (*PollVoteQuery) GroupBy ¶
func (_q *PollVoteQuery) GroupBy(field string, fields ...string) *PollVoteGroupBy
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 {
PollID int `json:"poll_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.PollVote.Query().
GroupBy(pollvote.FieldPollID).
Aggregate(generated.Count()).
Scan(ctx, &v)
func (*PollVoteQuery) IDs ¶
func (_q *PollVoteQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of PollVote IDs.
func (*PollVoteQuery) IDsX ¶
func (_q *PollVoteQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PollVoteQuery) Limit ¶
func (_q *PollVoteQuery) Limit(limit int) *PollVoteQuery
Limit the number of records to be returned by this query.
func (*PollVoteQuery) Offset ¶
func (_q *PollVoteQuery) Offset(offset int) *PollVoteQuery
Offset to start from.
func (*PollVoteQuery) Only ¶
func (_q *PollVoteQuery) Only(ctx context.Context) (*PollVote, error)
Only returns a single PollVote entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PollVote entity is found. Returns a *NotFoundError when no PollVote entities are found.
func (*PollVoteQuery) OnlyID ¶
func (_q *PollVoteQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PollVote ID in the query. Returns a *NotSingularError when more than one PollVote ID is found. Returns a *NotFoundError when no entities are found.
func (*PollVoteQuery) OnlyIDX ¶
func (_q *PollVoteQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PollVoteQuery) OnlyX ¶
func (_q *PollVoteQuery) OnlyX(ctx context.Context) *PollVote
OnlyX is like Only, but panics if an error occurs.
func (*PollVoteQuery) Order ¶
func (_q *PollVoteQuery) Order(o ...pollvote.OrderOption) *PollVoteQuery
Order specifies how the records should be ordered.
func (*PollVoteQuery) QueryPoll ¶
func (_q *PollVoteQuery) QueryPoll() *PollQuery
QueryPoll chains the current query on the "poll" edge.
func (*PollVoteQuery) QueryPollOption ¶
func (_q *PollVoteQuery) QueryPollOption() *PollOptionQuery
QueryPollOption chains the current query on the "poll_option" edge.
func (*PollVoteQuery) QueryUsers ¶
func (_q *PollVoteQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*PollVoteQuery) Select ¶
func (_q *PollVoteQuery) Select(fields ...string) *PollVoteSelect
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 {
PollID int `json:"poll_id,omitempty"`
}
client.PollVote.Query().
Select(pollvote.FieldPollID).
Scan(ctx, &v)
func (*PollVoteQuery) Unique ¶
func (_q *PollVoteQuery) Unique(unique bool) *PollVoteQuery
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 (*PollVoteQuery) Where ¶
func (_q *PollVoteQuery) Where(ps ...predicate.PollVote) *PollVoteQuery
Where adds a new predicate for the PollVoteQuery builder.
func (*PollVoteQuery) WithPoll ¶
func (_q *PollVoteQuery) WithPoll(opts ...func(*PollQuery)) *PollVoteQuery
WithPoll tells the query-builder to eager-load the nodes that are connected to the "poll" edge. The optional arguments are used to configure the query builder of the edge.
func (*PollVoteQuery) WithPollOption ¶
func (_q *PollVoteQuery) WithPollOption(opts ...func(*PollOptionQuery)) *PollVoteQuery
WithPollOption tells the query-builder to eager-load the nodes that are connected to the "poll_option" edge. The optional arguments are used to configure the query builder of the edge.
func (*PollVoteQuery) WithUsers ¶
func (_q *PollVoteQuery) WithUsers(opts ...func(*UserQuery)) *PollVoteQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type PollVoteSelect ¶
type PollVoteSelect struct {
*PollVoteQuery
// contains filtered or unexported fields
}
PollVoteSelect is the builder for selecting fields of PollVote entities.
func (*PollVoteSelect) Aggregate ¶
func (_s *PollVoteSelect) Aggregate(fns ...AggregateFunc) *PollVoteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PollVoteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PollVoteSelect) Scan ¶
func (_s *PollVoteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PollVoteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PollVoteUpdate ¶
type PollVoteUpdate struct {
// contains filtered or unexported fields
}
PollVoteUpdate is the builder for updating PollVote entities.
func (*PollVoteUpdate) ClearPoll ¶
func (_u *PollVoteUpdate) ClearPoll() *PollVoteUpdate
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollVoteUpdate) ClearPollOption ¶
func (_u *PollVoteUpdate) ClearPollOption() *PollVoteUpdate
ClearPollOption clears the "poll_option" edge to the PollOption entity.
func (*PollVoteUpdate) ClearUsers ¶
func (_u *PollVoteUpdate) ClearUsers() *PollVoteUpdate
ClearUsers clears the "users" edge to the User entity.
func (*PollVoteUpdate) Exec ¶
func (_u *PollVoteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PollVoteUpdate) ExecX ¶
func (_u *PollVoteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollVoteUpdate) Mutation ¶
func (_u *PollVoteUpdate) Mutation() *PollVoteMutation
Mutation returns the PollVoteMutation object of the builder.
func (*PollVoteUpdate) Save ¶
func (_u *PollVoteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PollVoteUpdate) SaveX ¶
func (_u *PollVoteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PollVoteUpdate) SetCreatedAt ¶
func (_u *PollVoteUpdate) SetCreatedAt(v time.Time) *PollVoteUpdate
SetCreatedAt sets the "created_at" field.
func (*PollVoteUpdate) SetNillableCreatedAt ¶
func (_u *PollVoteUpdate) SetNillableCreatedAt(v *time.Time) *PollVoteUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PollVoteUpdate) SetNillableOptionID ¶
func (_u *PollVoteUpdate) SetNillableOptionID(v *int) *PollVoteUpdate
SetNillableOptionID sets the "option_id" field if the given value is not nil.
func (*PollVoteUpdate) SetNillablePollID ¶
func (_u *PollVoteUpdate) SetNillablePollID(v *int) *PollVoteUpdate
SetNillablePollID sets the "poll_id" field if the given value is not nil.
func (*PollVoteUpdate) SetNillableUserID ¶
func (_u *PollVoteUpdate) SetNillableUserID(v *int) *PollVoteUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*PollVoteUpdate) SetOptionID ¶
func (_u *PollVoteUpdate) SetOptionID(v int) *PollVoteUpdate
SetOptionID sets the "option_id" field.
func (*PollVoteUpdate) SetPoll ¶
func (_u *PollVoteUpdate) SetPoll(v *Poll) *PollVoteUpdate
SetPoll sets the "poll" edge to the Poll entity.
func (*PollVoteUpdate) SetPollID ¶
func (_u *PollVoteUpdate) SetPollID(v int) *PollVoteUpdate
SetPollID sets the "poll_id" field.
func (*PollVoteUpdate) SetPollOption ¶
func (_u *PollVoteUpdate) SetPollOption(v *PollOption) *PollVoteUpdate
SetPollOption sets the "poll_option" edge to the PollOption entity.
func (*PollVoteUpdate) SetPollOptionID ¶
func (_u *PollVoteUpdate) SetPollOptionID(id int) *PollVoteUpdate
SetPollOptionID sets the "poll_option" edge to the PollOption entity by ID.
func (*PollVoteUpdate) SetUserID ¶
func (_u *PollVoteUpdate) SetUserID(v int) *PollVoteUpdate
SetUserID sets the "user_id" field.
func (*PollVoteUpdate) SetUsers ¶
func (_u *PollVoteUpdate) SetUsers(v *User) *PollVoteUpdate
SetUsers sets the "users" edge to the User entity.
func (*PollVoteUpdate) SetUsersID ¶
func (_u *PollVoteUpdate) SetUsersID(id int) *PollVoteUpdate
SetUsersID sets the "users" edge to the User entity by ID.
func (*PollVoteUpdate) Where ¶
func (_u *PollVoteUpdate) Where(ps ...predicate.PollVote) *PollVoteUpdate
Where appends a list predicates to the PollVoteUpdate builder.
type PollVoteUpdateOne ¶
type PollVoteUpdateOne struct {
// contains filtered or unexported fields
}
PollVoteUpdateOne is the builder for updating a single PollVote entity.
func (*PollVoteUpdateOne) ClearPoll ¶
func (_u *PollVoteUpdateOne) ClearPoll() *PollVoteUpdateOne
ClearPoll clears the "poll" edge to the Poll entity.
func (*PollVoteUpdateOne) ClearPollOption ¶
func (_u *PollVoteUpdateOne) ClearPollOption() *PollVoteUpdateOne
ClearPollOption clears the "poll_option" edge to the PollOption entity.
func (*PollVoteUpdateOne) ClearUsers ¶
func (_u *PollVoteUpdateOne) ClearUsers() *PollVoteUpdateOne
ClearUsers clears the "users" edge to the User entity.
func (*PollVoteUpdateOne) Exec ¶
func (_u *PollVoteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PollVoteUpdateOne) ExecX ¶
func (_u *PollVoteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PollVoteUpdateOne) Mutation ¶
func (_u *PollVoteUpdateOne) Mutation() *PollVoteMutation
Mutation returns the PollVoteMutation object of the builder.
func (*PollVoteUpdateOne) Save ¶
func (_u *PollVoteUpdateOne) Save(ctx context.Context) (*PollVote, error)
Save executes the query and returns the updated PollVote entity.
func (*PollVoteUpdateOne) SaveX ¶
func (_u *PollVoteUpdateOne) SaveX(ctx context.Context) *PollVote
SaveX is like Save, but panics if an error occurs.
func (*PollVoteUpdateOne) Select ¶
func (_u *PollVoteUpdateOne) Select(field string, fields ...string) *PollVoteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PollVoteUpdateOne) SetCreatedAt ¶
func (_u *PollVoteUpdateOne) SetCreatedAt(v time.Time) *PollVoteUpdateOne
SetCreatedAt sets the "created_at" field.
func (*PollVoteUpdateOne) SetNillableCreatedAt ¶
func (_u *PollVoteUpdateOne) SetNillableCreatedAt(v *time.Time) *PollVoteUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PollVoteUpdateOne) SetNillableOptionID ¶
func (_u *PollVoteUpdateOne) SetNillableOptionID(v *int) *PollVoteUpdateOne
SetNillableOptionID sets the "option_id" field if the given value is not nil.
func (*PollVoteUpdateOne) SetNillablePollID ¶
func (_u *PollVoteUpdateOne) SetNillablePollID(v *int) *PollVoteUpdateOne
SetNillablePollID sets the "poll_id" field if the given value is not nil.
func (*PollVoteUpdateOne) SetNillableUserID ¶
func (_u *PollVoteUpdateOne) SetNillableUserID(v *int) *PollVoteUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*PollVoteUpdateOne) SetOptionID ¶
func (_u *PollVoteUpdateOne) SetOptionID(v int) *PollVoteUpdateOne
SetOptionID sets the "option_id" field.
func (*PollVoteUpdateOne) SetPoll ¶
func (_u *PollVoteUpdateOne) SetPoll(v *Poll) *PollVoteUpdateOne
SetPoll sets the "poll" edge to the Poll entity.
func (*PollVoteUpdateOne) SetPollID ¶
func (_u *PollVoteUpdateOne) SetPollID(v int) *PollVoteUpdateOne
SetPollID sets the "poll_id" field.
func (*PollVoteUpdateOne) SetPollOption ¶
func (_u *PollVoteUpdateOne) SetPollOption(v *PollOption) *PollVoteUpdateOne
SetPollOption sets the "poll_option" edge to the PollOption entity.
func (*PollVoteUpdateOne) SetPollOptionID ¶
func (_u *PollVoteUpdateOne) SetPollOptionID(id int) *PollVoteUpdateOne
SetPollOptionID sets the "poll_option" edge to the PollOption entity by ID.
func (*PollVoteUpdateOne) SetUserID ¶
func (_u *PollVoteUpdateOne) SetUserID(v int) *PollVoteUpdateOne
SetUserID sets the "user_id" field.
func (*PollVoteUpdateOne) SetUsers ¶
func (_u *PollVoteUpdateOne) SetUsers(v *User) *PollVoteUpdateOne
SetUsers sets the "users" edge to the User entity.
func (*PollVoteUpdateOne) SetUsersID ¶
func (_u *PollVoteUpdateOne) SetUsersID(id int) *PollVoteUpdateOne
SetUsersID sets the "users" edge to the User entity by ID.
func (*PollVoteUpdateOne) Where ¶
func (_u *PollVoteUpdateOne) Where(ps ...predicate.PollVote) *PollVoteUpdateOne
Where appends a list predicates to the PollVoteUpdate builder.
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 {
// Node is the client for interacting with the Node builders.
Node *NodeClient
// Poll is the client for interacting with the Poll builders.
Poll *PollClient
// PollOption is the client for interacting with the PollOption builders.
PollOption *PollOptionClient
// PollVote is the client for interacting with the PollVote builders.
PollVote *PollVoteClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
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 User ¶
type User struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the UserQuery when eager-loading is set.
Edges UserEdges `json:"edges"`
// contains filtered or unexported fields
}
User is the model entity for the User schema.
func (*User) QueryPollVotes ¶
func (_m *User) QueryPollVotes() *PollVoteQuery
QueryPollVotes queries the "poll_votes" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (_m *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryPollVotes ¶
func (c *UserClient) QueryPollVotes(_m *User) *PollVoteQuery
QueryPollVotes queries the poll_votes edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddPollVoteIDs ¶
func (_c *UserCreate) AddPollVoteIDs(ids ...int) *UserCreate
AddPollVoteIDs adds the "poll_votes" edge to the PollVote entity by IDs.
func (*UserCreate) AddPollVotes ¶
func (_c *UserCreate) AddPollVotes(v ...*PollVote) *UserCreate
AddPollVotes adds the "poll_votes" edges to the PollVote entity.
func (*UserCreate) Exec ¶
func (_c *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (_c *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (_c *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (_c *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (_c *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetID ¶
func (_c *UserCreate) SetID(v int) *UserCreate
SetID sets the "id" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (_c *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (_c *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (_d *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (_d *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (_d *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (_d *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct {
// PollVotes holds the value of the poll_votes edge.
PollVotes []*PollVote `json:"poll_votes,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) PollVotesOrErr ¶
PollVotesOrErr returns the PollVotes value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (_g *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddPollVoteIDs ¶
func (m *UserMutation) AddPollVoteIDs(ids ...int)
AddPollVoteIDs adds the "poll_votes" edge to the PollVote entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearPollVotes ¶
func (m *UserMutation) ClearPollVotes()
ClearPollVotes clears the "poll_votes" edge to the PollVote entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) 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 (*UserMutation) PollVotesCleared ¶
func (m *UserMutation) PollVotesCleared() bool
PollVotesCleared reports if the "poll_votes" edge to the PollVote entity was cleared.
func (*UserMutation) PollVotesIDs ¶
func (m *UserMutation) PollVotesIDs() (ids []int)
PollVotesIDs returns the "poll_votes" edge IDs in the mutation.
func (*UserMutation) RemovePollVoteIDs ¶
func (m *UserMutation) RemovePollVoteIDs(ids ...int)
RemovePollVoteIDs removes the "poll_votes" edge to the PollVote entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedPollVotesIDs ¶
func (m *UserMutation) RemovedPollVotesIDs() (ids []int)
RemovedPollVotes returns the removed IDs of the "poll_votes" edge to the PollVote entity.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetPollVotes ¶
func (m *UserMutation) ResetPollVotes()
ResetPollVotes resets all changes to the "poll_votes" edge.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryPollVotes ¶
func (_q *UserQuery) QueryPollVotes() *PollVoteQuery
QueryPollVotes chains the current query on the "poll_votes" edge.
func (*UserQuery) Select ¶
func (_q *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
func (*UserQuery) 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 (*UserQuery) WithPollVotes ¶
func (_q *UserQuery) WithPollVotes(opts ...func(*PollVoteQuery)) *UserQuery
WithPollVotes tells the query-builder to eager-load the nodes that are connected to the "poll_votes" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct {
*UserQuery
// contains filtered or unexported fields
}
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (_s *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddPollVoteIDs ¶
func (_u *UserUpdate) AddPollVoteIDs(ids ...int) *UserUpdate
AddPollVoteIDs adds the "poll_votes" edge to the PollVote entity by IDs.
func (*UserUpdate) AddPollVotes ¶
func (_u *UserUpdate) AddPollVotes(v ...*PollVote) *UserUpdate
AddPollVotes adds the "poll_votes" edges to the PollVote entity.
func (*UserUpdate) ClearPollVotes ¶
func (_u *UserUpdate) ClearPollVotes() *UserUpdate
ClearPollVotes clears all "poll_votes" edges to the PollVote entity.
func (*UserUpdate) Exec ¶
func (_u *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (_u *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (_u *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemovePollVoteIDs ¶
func (_u *UserUpdate) RemovePollVoteIDs(ids ...int) *UserUpdate
RemovePollVoteIDs removes the "poll_votes" edge to PollVote entities by IDs.
func (*UserUpdate) RemovePollVotes ¶
func (_u *UserUpdate) RemovePollVotes(v ...*PollVote) *UserUpdate
RemovePollVotes removes "poll_votes" edges to PollVote entities.
func (*UserUpdate) Save ¶
func (_u *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (_u *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) Where ¶
func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddPollVoteIDs ¶
func (_u *UserUpdateOne) AddPollVoteIDs(ids ...int) *UserUpdateOne
AddPollVoteIDs adds the "poll_votes" edge to the PollVote entity by IDs.
func (*UserUpdateOne) AddPollVotes ¶
func (_u *UserUpdateOne) AddPollVotes(v ...*PollVote) *UserUpdateOne
AddPollVotes adds the "poll_votes" edges to the PollVote entity.
func (*UserUpdateOne) ClearPollVotes ¶
func (_u *UserUpdateOne) ClearPollVotes() *UserUpdateOne
ClearPollVotes clears all "poll_votes" edges to the PollVote entity.
func (*UserUpdateOne) Exec ¶
func (_u *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (_u *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (_u *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemovePollVoteIDs ¶
func (_u *UserUpdateOne) RemovePollVoteIDs(ids ...int) *UserUpdateOne
RemovePollVoteIDs removes the "poll_votes" edge to PollVote entities by IDs.
func (*UserUpdateOne) RemovePollVotes ¶
func (_u *UserUpdateOne) RemovePollVotes(v ...*PollVote) *UserUpdateOne
RemovePollVotes removes "poll_votes" edges to PollVote entities.
func (*UserUpdateOne) Save ¶
func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) Where ¶
func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct {
Name string // Field or edge name.
// contains filtered or unexported fields
}
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- ent.go
- mutation.go
- node.go
- node_create.go
- node_delete.go
- node_query.go
- node_update.go
- not_found_entity.go
- poll.go
- poll_create.go
- poll_delete.go
- poll_query.go
- poll_update.go
- polloption.go
- polloption_create.go
- polloption_delete.go
- polloption_query.go
- polloption_update.go
- pollvote.go
- pollvote_create.go
- pollvote_delete.go
- pollvote_query.go
- pollvote_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go