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 Birthday
- type BirthdayClient
- func (c *BirthdayClient) Create() *BirthdayCreate
- func (c *BirthdayClient) CreateBulk(builders ...*BirthdayCreate) *BirthdayCreateBulk
- func (c *BirthdayClient) Delete() *BirthdayDelete
- func (c *BirthdayClient) DeleteOne(b *Birthday) *BirthdayDeleteOne
- func (c *BirthdayClient) DeleteOneID(id int) *BirthdayDeleteOne
- func (c *BirthdayClient) Get(ctx context.Context, id int) (*Birthday, error)
- func (c *BirthdayClient) GetX(ctx context.Context, id int) *Birthday
- func (c *BirthdayClient) Hooks() []Hook
- func (c *BirthdayClient) Intercept(interceptors ...Interceptor)
- func (c *BirthdayClient) Interceptors() []Interceptor
- func (c *BirthdayClient) MapCreateBulk(slice any, setFunc func(*BirthdayCreate, int)) *BirthdayCreateBulk
- func (c *BirthdayClient) Query() *BirthdayQuery
- func (c *BirthdayClient) QueryUser(b *Birthday) *UserQuery
- func (c *BirthdayClient) Update() *BirthdayUpdate
- func (c *BirthdayClient) UpdateOne(b *Birthday) *BirthdayUpdateOne
- func (c *BirthdayClient) UpdateOneID(id int) *BirthdayUpdateOne
- func (c *BirthdayClient) Use(hooks ...Hook)
- type BirthdayCreate
- func (bc *BirthdayCreate) Exec(ctx context.Context) error
- func (bc *BirthdayCreate) ExecX(ctx context.Context)
- func (bc *BirthdayCreate) Mutation() *BirthdayMutation
- func (bc *BirthdayCreate) Save(ctx context.Context) (*Birthday, error)
- func (bc *BirthdayCreate) SaveX(ctx context.Context) *Birthday
- func (bc *BirthdayCreate) SetDay(i int) *BirthdayCreate
- func (bc *BirthdayCreate) SetMonth(i int) *BirthdayCreate
- func (bc *BirthdayCreate) SetNillableUserID(id *string) *BirthdayCreate
- func (bc *BirthdayCreate) SetUser(u *User) *BirthdayCreate
- func (bc *BirthdayCreate) SetUserID(id string) *BirthdayCreate
- type BirthdayCreateBulk
- type BirthdayDelete
- type BirthdayDeleteOne
- type BirthdayEdges
- type BirthdayGroupBy
- func (bgb *BirthdayGroupBy) Aggregate(fns ...AggregateFunc) *BirthdayGroupBy
- func (s *BirthdayGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BirthdayGroupBy) BoolX(ctx context.Context) bool
- func (s *BirthdayGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BirthdayGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BirthdayGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BirthdayGroupBy) Float64X(ctx context.Context) float64
- func (s *BirthdayGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BirthdayGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BirthdayGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BirthdayGroupBy) IntX(ctx context.Context) int
- func (s *BirthdayGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BirthdayGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BirthdayGroupBy) Scan(ctx context.Context, v any) error
- func (s *BirthdayGroupBy) ScanX(ctx context.Context, v any)
- func (s *BirthdayGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BirthdayGroupBy) StringX(ctx context.Context) string
- func (s *BirthdayGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BirthdayGroupBy) StringsX(ctx context.Context) []string
- type BirthdayMutation
- func (m *BirthdayMutation) AddDay(i int)
- func (m *BirthdayMutation) AddField(name string, value ent.Value) error
- func (m *BirthdayMutation) AddMonth(i int)
- func (m *BirthdayMutation) AddedDay() (r int, exists bool)
- func (m *BirthdayMutation) AddedEdges() []string
- func (m *BirthdayMutation) AddedField(name string) (ent.Value, bool)
- func (m *BirthdayMutation) AddedFields() []string
- func (m *BirthdayMutation) AddedIDs(name string) []ent.Value
- func (m *BirthdayMutation) AddedMonth() (r int, exists bool)
- func (m *BirthdayMutation) ClearEdge(name string) error
- func (m *BirthdayMutation) ClearField(name string) error
- func (m *BirthdayMutation) ClearUser()
- func (m *BirthdayMutation) ClearedEdges() []string
- func (m *BirthdayMutation) ClearedFields() []string
- func (m BirthdayMutation) Client() *Client
- func (m *BirthdayMutation) Day() (r int, exists bool)
- func (m *BirthdayMutation) EdgeCleared(name string) bool
- func (m *BirthdayMutation) Field(name string) (ent.Value, bool)
- func (m *BirthdayMutation) FieldCleared(name string) bool
- func (m *BirthdayMutation) Fields() []string
- func (m *BirthdayMutation) ID() (id int, exists bool)
- func (m *BirthdayMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BirthdayMutation) Month() (r int, exists bool)
- func (m *BirthdayMutation) OldDay(ctx context.Context) (v int, err error)
- func (m *BirthdayMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BirthdayMutation) OldMonth(ctx context.Context) (v int, err error)
- func (m *BirthdayMutation) Op() Op
- func (m *BirthdayMutation) RemovedEdges() []string
- func (m *BirthdayMutation) RemovedIDs(name string) []ent.Value
- func (m *BirthdayMutation) ResetDay()
- func (m *BirthdayMutation) ResetEdge(name string) error
- func (m *BirthdayMutation) ResetField(name string) error
- func (m *BirthdayMutation) ResetMonth()
- func (m *BirthdayMutation) ResetUser()
- func (m *BirthdayMutation) SetDay(i int)
- func (m *BirthdayMutation) SetField(name string, value ent.Value) error
- func (m *BirthdayMutation) SetMonth(i int)
- func (m *BirthdayMutation) SetOp(op Op)
- func (m *BirthdayMutation) SetUserID(id string)
- func (m BirthdayMutation) Tx() (*Tx, error)
- func (m *BirthdayMutation) Type() string
- func (m *BirthdayMutation) UserCleared() bool
- func (m *BirthdayMutation) UserID() (id string, exists bool)
- func (m *BirthdayMutation) UserIDs() (ids []string)
- func (m *BirthdayMutation) Where(ps ...predicate.Birthday)
- func (m *BirthdayMutation) WhereP(ps ...func(*sql.Selector))
- type BirthdayQuery
- func (bq *BirthdayQuery) Aggregate(fns ...AggregateFunc) *BirthdaySelect
- func (bq *BirthdayQuery) All(ctx context.Context) ([]*Birthday, error)
- func (bq *BirthdayQuery) AllX(ctx context.Context) []*Birthday
- func (bq *BirthdayQuery) Clone() *BirthdayQuery
- func (bq *BirthdayQuery) Count(ctx context.Context) (int, error)
- func (bq *BirthdayQuery) CountX(ctx context.Context) int
- func (bq *BirthdayQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BirthdayQuery) ExistX(ctx context.Context) bool
- func (bq *BirthdayQuery) First(ctx context.Context) (*Birthday, error)
- func (bq *BirthdayQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BirthdayQuery) FirstIDX(ctx context.Context) int
- func (bq *BirthdayQuery) FirstX(ctx context.Context) *Birthday
- func (bq *BirthdayQuery) GroupBy(field string, fields ...string) *BirthdayGroupBy
- func (bq *BirthdayQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bq *BirthdayQuery) IDsX(ctx context.Context) []int
- func (bq *BirthdayQuery) Limit(limit int) *BirthdayQuery
- func (bq *BirthdayQuery) Offset(offset int) *BirthdayQuery
- func (bq *BirthdayQuery) Only(ctx context.Context) (*Birthday, error)
- func (bq *BirthdayQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BirthdayQuery) OnlyIDX(ctx context.Context) int
- func (bq *BirthdayQuery) OnlyX(ctx context.Context) *Birthday
- func (bq *BirthdayQuery) Order(o ...birthday.OrderOption) *BirthdayQuery
- func (bq *BirthdayQuery) QueryUser() *UserQuery
- func (bq *BirthdayQuery) Select(fields ...string) *BirthdaySelect
- func (bq *BirthdayQuery) Unique(unique bool) *BirthdayQuery
- func (bq *BirthdayQuery) Where(ps ...predicate.Birthday) *BirthdayQuery
- func (bq *BirthdayQuery) WithUser(opts ...func(*UserQuery)) *BirthdayQuery
- type BirthdaySelect
- func (bs *BirthdaySelect) Aggregate(fns ...AggregateFunc) *BirthdaySelect
- func (s *BirthdaySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BirthdaySelect) BoolX(ctx context.Context) bool
- func (s *BirthdaySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BirthdaySelect) BoolsX(ctx context.Context) []bool
- func (s *BirthdaySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BirthdaySelect) Float64X(ctx context.Context) float64
- func (s *BirthdaySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BirthdaySelect) Float64sX(ctx context.Context) []float64
- func (s *BirthdaySelect) Int(ctx context.Context) (_ int, err error)
- func (s *BirthdaySelect) IntX(ctx context.Context) int
- func (s *BirthdaySelect) Ints(ctx context.Context) ([]int, error)
- func (s *BirthdaySelect) IntsX(ctx context.Context) []int
- func (bs *BirthdaySelect) Scan(ctx context.Context, v any) error
- func (s *BirthdaySelect) ScanX(ctx context.Context, v any)
- func (s *BirthdaySelect) String(ctx context.Context) (_ string, err error)
- func (s *BirthdaySelect) StringX(ctx context.Context) string
- func (s *BirthdaySelect) Strings(ctx context.Context) ([]string, error)
- func (s *BirthdaySelect) StringsX(ctx context.Context) []string
- type BirthdayUpdate
- func (bu *BirthdayUpdate) AddDay(i int) *BirthdayUpdate
- func (bu *BirthdayUpdate) AddMonth(i int) *BirthdayUpdate
- func (bu *BirthdayUpdate) ClearUser() *BirthdayUpdate
- func (bu *BirthdayUpdate) Exec(ctx context.Context) error
- func (bu *BirthdayUpdate) ExecX(ctx context.Context)
- func (bu *BirthdayUpdate) Mutation() *BirthdayMutation
- func (bu *BirthdayUpdate) Save(ctx context.Context) (int, error)
- func (bu *BirthdayUpdate) SaveX(ctx context.Context) int
- func (bu *BirthdayUpdate) SetDay(i int) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetMonth(i int) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetNillableDay(i *int) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetNillableMonth(i *int) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetNillableUserID(id *string) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetUser(u *User) *BirthdayUpdate
- func (bu *BirthdayUpdate) SetUserID(id string) *BirthdayUpdate
- func (bu *BirthdayUpdate) Where(ps ...predicate.Birthday) *BirthdayUpdate
- type BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) AddDay(i int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) AddMonth(i int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) ClearUser() *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) Exec(ctx context.Context) error
- func (buo *BirthdayUpdateOne) ExecX(ctx context.Context)
- func (buo *BirthdayUpdateOne) Mutation() *BirthdayMutation
- func (buo *BirthdayUpdateOne) Save(ctx context.Context) (*Birthday, error)
- func (buo *BirthdayUpdateOne) SaveX(ctx context.Context) *Birthday
- func (buo *BirthdayUpdateOne) Select(field string, fields ...string) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetDay(i int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetMonth(i int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetNillableDay(i *int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetNillableMonth(i *int) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetNillableUserID(id *string) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetUser(u *User) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) SetUserID(id string) *BirthdayUpdateOne
- func (buo *BirthdayUpdateOne) Where(ps ...predicate.Birthday) *BirthdayUpdateOne
- type Birthdays
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Openstack
- type OpenstackClient
- func (c *OpenstackClient) Create() *OpenstackCreate
- func (c *OpenstackClient) CreateBulk(builders ...*OpenstackCreate) *OpenstackCreateBulk
- func (c *OpenstackClient) Delete() *OpenstackDelete
- func (c *OpenstackClient) DeleteOne(o *Openstack) *OpenstackDeleteOne
- func (c *OpenstackClient) DeleteOneID(id int) *OpenstackDeleteOne
- func (c *OpenstackClient) Get(ctx context.Context, id int) (*Openstack, error)
- func (c *OpenstackClient) GetX(ctx context.Context, id int) *Openstack
- func (c *OpenstackClient) Hooks() []Hook
- func (c *OpenstackClient) Intercept(interceptors ...Interceptor)
- func (c *OpenstackClient) Interceptors() []Interceptor
- func (c *OpenstackClient) MapCreateBulk(slice any, setFunc func(*OpenstackCreate, int)) *OpenstackCreateBulk
- func (c *OpenstackClient) Query() *OpenstackQuery
- func (c *OpenstackClient) QueryUser(o *Openstack) *UserQuery
- func (c *OpenstackClient) Update() *OpenstackUpdate
- func (c *OpenstackClient) UpdateOne(o *Openstack) *OpenstackUpdateOne
- func (c *OpenstackClient) UpdateOneID(id int) *OpenstackUpdateOne
- func (c *OpenstackClient) Use(hooks ...Hook)
- type OpenstackCreate
- func (oc *OpenstackCreate) Exec(ctx context.Context) error
- func (oc *OpenstackCreate) ExecX(ctx context.Context)
- func (oc *OpenstackCreate) Mutation() *OpenstackMutation
- func (oc *OpenstackCreate) Save(ctx context.Context) (*Openstack, error)
- func (oc *OpenstackCreate) SaveX(ctx context.Context) *Openstack
- func (oc *OpenstackCreate) SetNillableTimestamp(t *time.Time) *OpenstackCreate
- func (oc *OpenstackCreate) SetNillableUserID(id *string) *OpenstackCreate
- func (oc *OpenstackCreate) SetTimestamp(t time.Time) *OpenstackCreate
- func (oc *OpenstackCreate) SetUser(u *User) *OpenstackCreate
- func (oc *OpenstackCreate) SetUserID(id string) *OpenstackCreate
- type OpenstackCreateBulk
- type OpenstackDelete
- type OpenstackDeleteOne
- type OpenstackEdges
- type OpenstackGroupBy
- func (ogb *OpenstackGroupBy) Aggregate(fns ...AggregateFunc) *OpenstackGroupBy
- func (s *OpenstackGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OpenstackGroupBy) BoolX(ctx context.Context) bool
- func (s *OpenstackGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OpenstackGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OpenstackGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OpenstackGroupBy) Float64X(ctx context.Context) float64
- func (s *OpenstackGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OpenstackGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OpenstackGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OpenstackGroupBy) IntX(ctx context.Context) int
- func (s *OpenstackGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OpenstackGroupBy) IntsX(ctx context.Context) []int
- func (ogb *OpenstackGroupBy) Scan(ctx context.Context, v any) error
- func (s *OpenstackGroupBy) ScanX(ctx context.Context, v any)
- func (s *OpenstackGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OpenstackGroupBy) StringX(ctx context.Context) string
- func (s *OpenstackGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OpenstackGroupBy) StringsX(ctx context.Context) []string
- type OpenstackMutation
- func (m *OpenstackMutation) AddField(name string, value ent.Value) error
- func (m *OpenstackMutation) AddedEdges() []string
- func (m *OpenstackMutation) AddedField(name string) (ent.Value, bool)
- func (m *OpenstackMutation) AddedFields() []string
- func (m *OpenstackMutation) AddedIDs(name string) []ent.Value
- func (m *OpenstackMutation) ClearEdge(name string) error
- func (m *OpenstackMutation) ClearField(name string) error
- func (m *OpenstackMutation) ClearUser()
- func (m *OpenstackMutation) ClearedEdges() []string
- func (m *OpenstackMutation) ClearedFields() []string
- func (m OpenstackMutation) Client() *Client
- func (m *OpenstackMutation) EdgeCleared(name string) bool
- func (m *OpenstackMutation) Field(name string) (ent.Value, bool)
- func (m *OpenstackMutation) FieldCleared(name string) bool
- func (m *OpenstackMutation) Fields() []string
- func (m *OpenstackMutation) ID() (id int, exists bool)
- func (m *OpenstackMutation) IDs(ctx context.Context) ([]int, error)
- func (m *OpenstackMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OpenstackMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *OpenstackMutation) Op() Op
- func (m *OpenstackMutation) RemovedEdges() []string
- func (m *OpenstackMutation) RemovedIDs(name string) []ent.Value
- func (m *OpenstackMutation) ResetEdge(name string) error
- func (m *OpenstackMutation) ResetField(name string) error
- func (m *OpenstackMutation) ResetTimestamp()
- func (m *OpenstackMutation) ResetUser()
- func (m *OpenstackMutation) SetField(name string, value ent.Value) error
- func (m *OpenstackMutation) SetOp(op Op)
- func (m *OpenstackMutation) SetTimestamp(t time.Time)
- func (m *OpenstackMutation) SetUserID(id string)
- func (m *OpenstackMutation) Timestamp() (r time.Time, exists bool)
- func (m OpenstackMutation) Tx() (*Tx, error)
- func (m *OpenstackMutation) Type() string
- func (m *OpenstackMutation) UserCleared() bool
- func (m *OpenstackMutation) UserID() (id string, exists bool)
- func (m *OpenstackMutation) UserIDs() (ids []string)
- func (m *OpenstackMutation) Where(ps ...predicate.Openstack)
- func (m *OpenstackMutation) WhereP(ps ...func(*sql.Selector))
- type OpenstackQuery
- func (oq *OpenstackQuery) Aggregate(fns ...AggregateFunc) *OpenstackSelect
- func (oq *OpenstackQuery) All(ctx context.Context) ([]*Openstack, error)
- func (oq *OpenstackQuery) AllX(ctx context.Context) []*Openstack
- func (oq *OpenstackQuery) Clone() *OpenstackQuery
- func (oq *OpenstackQuery) Count(ctx context.Context) (int, error)
- func (oq *OpenstackQuery) CountX(ctx context.Context) int
- func (oq *OpenstackQuery) Exist(ctx context.Context) (bool, error)
- func (oq *OpenstackQuery) ExistX(ctx context.Context) bool
- func (oq *OpenstackQuery) First(ctx context.Context) (*Openstack, error)
- func (oq *OpenstackQuery) FirstID(ctx context.Context) (id int, err error)
- func (oq *OpenstackQuery) FirstIDX(ctx context.Context) int
- func (oq *OpenstackQuery) FirstX(ctx context.Context) *Openstack
- func (oq *OpenstackQuery) GroupBy(field string, fields ...string) *OpenstackGroupBy
- func (oq *OpenstackQuery) IDs(ctx context.Context) (ids []int, err error)
- func (oq *OpenstackQuery) IDsX(ctx context.Context) []int
- func (oq *OpenstackQuery) Limit(limit int) *OpenstackQuery
- func (oq *OpenstackQuery) Offset(offset int) *OpenstackQuery
- func (oq *OpenstackQuery) Only(ctx context.Context) (*Openstack, error)
- func (oq *OpenstackQuery) OnlyID(ctx context.Context) (id int, err error)
- func (oq *OpenstackQuery) OnlyIDX(ctx context.Context) int
- func (oq *OpenstackQuery) OnlyX(ctx context.Context) *Openstack
- func (oq *OpenstackQuery) Order(o ...openstack.OrderOption) *OpenstackQuery
- func (oq *OpenstackQuery) QueryUser() *UserQuery
- func (oq *OpenstackQuery) Select(fields ...string) *OpenstackSelect
- func (oq *OpenstackQuery) Unique(unique bool) *OpenstackQuery
- func (oq *OpenstackQuery) Where(ps ...predicate.Openstack) *OpenstackQuery
- func (oq *OpenstackQuery) WithUser(opts ...func(*UserQuery)) *OpenstackQuery
- type OpenstackSelect
- func (os *OpenstackSelect) Aggregate(fns ...AggregateFunc) *OpenstackSelect
- func (s *OpenstackSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OpenstackSelect) BoolX(ctx context.Context) bool
- func (s *OpenstackSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OpenstackSelect) BoolsX(ctx context.Context) []bool
- func (s *OpenstackSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OpenstackSelect) Float64X(ctx context.Context) float64
- func (s *OpenstackSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OpenstackSelect) Float64sX(ctx context.Context) []float64
- func (s *OpenstackSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OpenstackSelect) IntX(ctx context.Context) int
- func (s *OpenstackSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OpenstackSelect) IntsX(ctx context.Context) []int
- func (os *OpenstackSelect) Scan(ctx context.Context, v any) error
- func (s *OpenstackSelect) ScanX(ctx context.Context, v any)
- func (s *OpenstackSelect) String(ctx context.Context) (_ string, err error)
- func (s *OpenstackSelect) StringX(ctx context.Context) string
- func (s *OpenstackSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OpenstackSelect) StringsX(ctx context.Context) []string
- type OpenstackUpdate
- func (ou *OpenstackUpdate) ClearUser() *OpenstackUpdate
- func (ou *OpenstackUpdate) Exec(ctx context.Context) error
- func (ou *OpenstackUpdate) ExecX(ctx context.Context)
- func (ou *OpenstackUpdate) Mutation() *OpenstackMutation
- func (ou *OpenstackUpdate) Save(ctx context.Context) (int, error)
- func (ou *OpenstackUpdate) SaveX(ctx context.Context) int
- func (ou *OpenstackUpdate) SetNillableTimestamp(t *time.Time) *OpenstackUpdate
- func (ou *OpenstackUpdate) SetNillableUserID(id *string) *OpenstackUpdate
- func (ou *OpenstackUpdate) SetTimestamp(t time.Time) *OpenstackUpdate
- func (ou *OpenstackUpdate) SetUser(u *User) *OpenstackUpdate
- func (ou *OpenstackUpdate) SetUserID(id string) *OpenstackUpdate
- func (ou *OpenstackUpdate) Where(ps ...predicate.Openstack) *OpenstackUpdate
- type OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) ClearUser() *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) Exec(ctx context.Context) error
- func (ouo *OpenstackUpdateOne) ExecX(ctx context.Context)
- func (ouo *OpenstackUpdateOne) Mutation() *OpenstackMutation
- func (ouo *OpenstackUpdateOne) Save(ctx context.Context) (*Openstack, error)
- func (ouo *OpenstackUpdateOne) SaveX(ctx context.Context) *Openstack
- func (ouo *OpenstackUpdateOne) Select(field string, fields ...string) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) SetNillableTimestamp(t *time.Time) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) SetNillableUserID(id *string) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) SetTimestamp(t time.Time) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) SetUser(u *User) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) SetUserID(id string) *OpenstackUpdateOne
- func (ouo *OpenstackUpdateOne) Where(ps ...predicate.Openstack) *OpenstackUpdateOne
- type Openstacks
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Shitpost
- type ShitpostClient
- func (c *ShitpostClient) Create() *ShitpostCreate
- func (c *ShitpostClient) CreateBulk(builders ...*ShitpostCreate) *ShitpostCreateBulk
- func (c *ShitpostClient) Delete() *ShitpostDelete
- func (c *ShitpostClient) DeleteOne(s *Shitpost) *ShitpostDeleteOne
- func (c *ShitpostClient) DeleteOneID(id string) *ShitpostDeleteOne
- func (c *ShitpostClient) Get(ctx context.Context, id string) (*Shitpost, error)
- func (c *ShitpostClient) GetX(ctx context.Context, id string) *Shitpost
- func (c *ShitpostClient) Hooks() []Hook
- func (c *ShitpostClient) Intercept(interceptors ...Interceptor)
- func (c *ShitpostClient) Interceptors() []Interceptor
- func (c *ShitpostClient) MapCreateBulk(slice any, setFunc func(*ShitpostCreate, int)) *ShitpostCreateBulk
- func (c *ShitpostClient) Query() *ShitpostQuery
- func (c *ShitpostClient) QueryUser(s *Shitpost) *UserQuery
- func (c *ShitpostClient) Update() *ShitpostUpdate
- func (c *ShitpostClient) UpdateOne(s *Shitpost) *ShitpostUpdateOne
- func (c *ShitpostClient) UpdateOneID(id string) *ShitpostUpdateOne
- func (c *ShitpostClient) Use(hooks ...Hook)
- type ShitpostCreate
- func (sc *ShitpostCreate) Exec(ctx context.Context) error
- func (sc *ShitpostCreate) ExecX(ctx context.Context)
- func (sc *ShitpostCreate) Mutation() *ShitpostMutation
- func (sc *ShitpostCreate) Save(ctx context.Context) (*Shitpost, error)
- func (sc *ShitpostCreate) SaveX(ctx context.Context) *Shitpost
- func (sc *ShitpostCreate) SetChannelID(s string) *ShitpostCreate
- func (sc *ShitpostCreate) SetCount(i int) *ShitpostCreate
- func (sc *ShitpostCreate) SetID(s string) *ShitpostCreate
- func (sc *ShitpostCreate) SetNillableUserID(id *string) *ShitpostCreate
- func (sc *ShitpostCreate) SetUser(u *User) *ShitpostCreate
- func (sc *ShitpostCreate) SetUserID(id string) *ShitpostCreate
- type ShitpostCreateBulk
- type ShitpostDelete
- type ShitpostDeleteOne
- type ShitpostEdges
- type ShitpostGroupBy
- func (sgb *ShitpostGroupBy) Aggregate(fns ...AggregateFunc) *ShitpostGroupBy
- func (s *ShitpostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ShitpostGroupBy) BoolX(ctx context.Context) bool
- func (s *ShitpostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ShitpostGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ShitpostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ShitpostGroupBy) Float64X(ctx context.Context) float64
- func (s *ShitpostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ShitpostGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ShitpostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ShitpostGroupBy) IntX(ctx context.Context) int
- func (s *ShitpostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ShitpostGroupBy) IntsX(ctx context.Context) []int
- func (sgb *ShitpostGroupBy) Scan(ctx context.Context, v any) error
- func (s *ShitpostGroupBy) ScanX(ctx context.Context, v any)
- func (s *ShitpostGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ShitpostGroupBy) StringX(ctx context.Context) string
- func (s *ShitpostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ShitpostGroupBy) StringsX(ctx context.Context) []string
- type ShitpostMutation
- func (m *ShitpostMutation) AddCount(i int)
- func (m *ShitpostMutation) AddField(name string, value ent.Value) error
- func (m *ShitpostMutation) AddedCount() (r int, exists bool)
- func (m *ShitpostMutation) AddedEdges() []string
- func (m *ShitpostMutation) AddedField(name string) (ent.Value, bool)
- func (m *ShitpostMutation) AddedFields() []string
- func (m *ShitpostMutation) AddedIDs(name string) []ent.Value
- func (m *ShitpostMutation) ChannelID() (r string, exists bool)
- func (m *ShitpostMutation) ClearEdge(name string) error
- func (m *ShitpostMutation) ClearField(name string) error
- func (m *ShitpostMutation) ClearUser()
- func (m *ShitpostMutation) ClearedEdges() []string
- func (m *ShitpostMutation) ClearedFields() []string
- func (m ShitpostMutation) Client() *Client
- func (m *ShitpostMutation) Count() (r int, exists bool)
- func (m *ShitpostMutation) EdgeCleared(name string) bool
- func (m *ShitpostMutation) Field(name string) (ent.Value, bool)
- func (m *ShitpostMutation) FieldCleared(name string) bool
- func (m *ShitpostMutation) Fields() []string
- func (m *ShitpostMutation) ID() (id string, exists bool)
- func (m *ShitpostMutation) IDs(ctx context.Context) ([]string, error)
- func (m *ShitpostMutation) OldChannelID(ctx context.Context) (v string, err error)
- func (m *ShitpostMutation) OldCount(ctx context.Context) (v int, err error)
- func (m *ShitpostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ShitpostMutation) Op() Op
- func (m *ShitpostMutation) RemovedEdges() []string
- func (m *ShitpostMutation) RemovedIDs(name string) []ent.Value
- func (m *ShitpostMutation) ResetChannelID()
- func (m *ShitpostMutation) ResetCount()
- func (m *ShitpostMutation) ResetEdge(name string) error
- func (m *ShitpostMutation) ResetField(name string) error
- func (m *ShitpostMutation) ResetUser()
- func (m *ShitpostMutation) SetChannelID(s string)
- func (m *ShitpostMutation) SetCount(i int)
- func (m *ShitpostMutation) SetField(name string, value ent.Value) error
- func (m *ShitpostMutation) SetID(id string)
- func (m *ShitpostMutation) SetOp(op Op)
- func (m *ShitpostMutation) SetUserID(id string)
- func (m ShitpostMutation) Tx() (*Tx, error)
- func (m *ShitpostMutation) Type() string
- func (m *ShitpostMutation) UserCleared() bool
- func (m *ShitpostMutation) UserID() (id string, exists bool)
- func (m *ShitpostMutation) UserIDs() (ids []string)
- func (m *ShitpostMutation) Where(ps ...predicate.Shitpost)
- func (m *ShitpostMutation) WhereP(ps ...func(*sql.Selector))
- type ShitpostQuery
- func (sq *ShitpostQuery) Aggregate(fns ...AggregateFunc) *ShitpostSelect
- func (sq *ShitpostQuery) All(ctx context.Context) ([]*Shitpost, error)
- func (sq *ShitpostQuery) AllX(ctx context.Context) []*Shitpost
- func (sq *ShitpostQuery) Clone() *ShitpostQuery
- func (sq *ShitpostQuery) Count(ctx context.Context) (int, error)
- func (sq *ShitpostQuery) CountX(ctx context.Context) int
- func (sq *ShitpostQuery) Exist(ctx context.Context) (bool, error)
- func (sq *ShitpostQuery) ExistX(ctx context.Context) bool
- func (sq *ShitpostQuery) First(ctx context.Context) (*Shitpost, error)
- func (sq *ShitpostQuery) FirstID(ctx context.Context) (id string, err error)
- func (sq *ShitpostQuery) FirstIDX(ctx context.Context) string
- func (sq *ShitpostQuery) FirstX(ctx context.Context) *Shitpost
- func (sq *ShitpostQuery) GroupBy(field string, fields ...string) *ShitpostGroupBy
- func (sq *ShitpostQuery) IDs(ctx context.Context) (ids []string, err error)
- func (sq *ShitpostQuery) IDsX(ctx context.Context) []string
- func (sq *ShitpostQuery) Limit(limit int) *ShitpostQuery
- func (sq *ShitpostQuery) Offset(offset int) *ShitpostQuery
- func (sq *ShitpostQuery) Only(ctx context.Context) (*Shitpost, error)
- func (sq *ShitpostQuery) OnlyID(ctx context.Context) (id string, err error)
- func (sq *ShitpostQuery) OnlyIDX(ctx context.Context) string
- func (sq *ShitpostQuery) OnlyX(ctx context.Context) *Shitpost
- func (sq *ShitpostQuery) Order(o ...shitpost.OrderOption) *ShitpostQuery
- func (sq *ShitpostQuery) QueryUser() *UserQuery
- func (sq *ShitpostQuery) Select(fields ...string) *ShitpostSelect
- func (sq *ShitpostQuery) Unique(unique bool) *ShitpostQuery
- func (sq *ShitpostQuery) Where(ps ...predicate.Shitpost) *ShitpostQuery
- func (sq *ShitpostQuery) WithUser(opts ...func(*UserQuery)) *ShitpostQuery
- type ShitpostSelect
- func (ss *ShitpostSelect) Aggregate(fns ...AggregateFunc) *ShitpostSelect
- func (s *ShitpostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ShitpostSelect) BoolX(ctx context.Context) bool
- func (s *ShitpostSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ShitpostSelect) BoolsX(ctx context.Context) []bool
- func (s *ShitpostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ShitpostSelect) Float64X(ctx context.Context) float64
- func (s *ShitpostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ShitpostSelect) Float64sX(ctx context.Context) []float64
- func (s *ShitpostSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ShitpostSelect) IntX(ctx context.Context) int
- func (s *ShitpostSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ShitpostSelect) IntsX(ctx context.Context) []int
- func (ss *ShitpostSelect) Scan(ctx context.Context, v any) error
- func (s *ShitpostSelect) ScanX(ctx context.Context, v any)
- func (s *ShitpostSelect) String(ctx context.Context) (_ string, err error)
- func (s *ShitpostSelect) StringX(ctx context.Context) string
- func (s *ShitpostSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ShitpostSelect) StringsX(ctx context.Context) []string
- type ShitpostUpdate
- func (su *ShitpostUpdate) AddCount(i int) *ShitpostUpdate
- func (su *ShitpostUpdate) ClearUser() *ShitpostUpdate
- func (su *ShitpostUpdate) Exec(ctx context.Context) error
- func (su *ShitpostUpdate) ExecX(ctx context.Context)
- func (su *ShitpostUpdate) Mutation() *ShitpostMutation
- func (su *ShitpostUpdate) Save(ctx context.Context) (int, error)
- func (su *ShitpostUpdate) SaveX(ctx context.Context) int
- func (su *ShitpostUpdate) SetChannelID(s string) *ShitpostUpdate
- func (su *ShitpostUpdate) SetCount(i int) *ShitpostUpdate
- func (su *ShitpostUpdate) SetNillableChannelID(s *string) *ShitpostUpdate
- func (su *ShitpostUpdate) SetNillableCount(i *int) *ShitpostUpdate
- func (su *ShitpostUpdate) SetNillableUserID(id *string) *ShitpostUpdate
- func (su *ShitpostUpdate) SetUser(u *User) *ShitpostUpdate
- func (su *ShitpostUpdate) SetUserID(id string) *ShitpostUpdate
- func (su *ShitpostUpdate) Where(ps ...predicate.Shitpost) *ShitpostUpdate
- type ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) AddCount(i int) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) ClearUser() *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) Exec(ctx context.Context) error
- func (suo *ShitpostUpdateOne) ExecX(ctx context.Context)
- func (suo *ShitpostUpdateOne) Mutation() *ShitpostMutation
- func (suo *ShitpostUpdateOne) Save(ctx context.Context) (*Shitpost, error)
- func (suo *ShitpostUpdateOne) SaveX(ctx context.Context) *Shitpost
- func (suo *ShitpostUpdateOne) Select(field string, fields ...string) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetChannelID(s string) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetCount(i int) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetNillableChannelID(s *string) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetNillableCount(i *int) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetNillableUserID(id *string) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetUser(u *User) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) SetUserID(id string) *ShitpostUpdateOne
- func (suo *ShitpostUpdateOne) Where(ps ...predicate.Shitpost) *ShitpostUpdateOne
- type Shitposts
- type Signin
- type SigninClient
- func (c *SigninClient) Create() *SigninCreate
- func (c *SigninClient) CreateBulk(builders ...*SigninCreate) *SigninCreateBulk
- func (c *SigninClient) Delete() *SigninDelete
- func (c *SigninClient) DeleteOne(s *Signin) *SigninDeleteOne
- func (c *SigninClient) DeleteOneID(id int) *SigninDeleteOne
- func (c *SigninClient) Get(ctx context.Context, id int) (*Signin, error)
- func (c *SigninClient) GetX(ctx context.Context, id int) *Signin
- func (c *SigninClient) Hooks() []Hook
- func (c *SigninClient) Intercept(interceptors ...Interceptor)
- func (c *SigninClient) Interceptors() []Interceptor
- func (c *SigninClient) MapCreateBulk(slice any, setFunc func(*SigninCreate, int)) *SigninCreateBulk
- func (c *SigninClient) Query() *SigninQuery
- func (c *SigninClient) QueryUser(s *Signin) *UserQuery
- func (c *SigninClient) Update() *SigninUpdate
- func (c *SigninClient) UpdateOne(s *Signin) *SigninUpdateOne
- func (c *SigninClient) UpdateOneID(id int) *SigninUpdateOne
- func (c *SigninClient) Use(hooks ...Hook)
- type SigninCreate
- func (sc *SigninCreate) Exec(ctx context.Context) error
- func (sc *SigninCreate) ExecX(ctx context.Context)
- func (sc *SigninCreate) Mutation() *SigninMutation
- func (sc *SigninCreate) Save(ctx context.Context) (*Signin, error)
- func (sc *SigninCreate) SaveX(ctx context.Context) *Signin
- func (sc *SigninCreate) SetNillableTimestamp(t *time.Time) *SigninCreate
- func (sc *SigninCreate) SetTimestamp(t time.Time) *SigninCreate
- func (sc *SigninCreate) SetType(s signin.Type) *SigninCreate
- func (sc *SigninCreate) SetUser(u *User) *SigninCreate
- func (sc *SigninCreate) SetUserID(id string) *SigninCreate
- type SigninCreateBulk
- type SigninDelete
- type SigninDeleteOne
- type SigninEdges
- type SigninGroupBy
- func (sgb *SigninGroupBy) Aggregate(fns ...AggregateFunc) *SigninGroupBy
- func (s *SigninGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SigninGroupBy) BoolX(ctx context.Context) bool
- func (s *SigninGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SigninGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SigninGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SigninGroupBy) Float64X(ctx context.Context) float64
- func (s *SigninGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SigninGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SigninGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SigninGroupBy) IntX(ctx context.Context) int
- func (s *SigninGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SigninGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SigninGroupBy) Scan(ctx context.Context, v any) error
- func (s *SigninGroupBy) ScanX(ctx context.Context, v any)
- func (s *SigninGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SigninGroupBy) StringX(ctx context.Context) string
- func (s *SigninGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SigninGroupBy) StringsX(ctx context.Context) []string
- type SigninMutation
- func (m *SigninMutation) AddField(name string, value ent.Value) error
- func (m *SigninMutation) AddedEdges() []string
- func (m *SigninMutation) AddedField(name string) (ent.Value, bool)
- func (m *SigninMutation) AddedFields() []string
- func (m *SigninMutation) AddedIDs(name string) []ent.Value
- func (m *SigninMutation) ClearEdge(name string) error
- func (m *SigninMutation) ClearField(name string) error
- func (m *SigninMutation) ClearUser()
- func (m *SigninMutation) ClearedEdges() []string
- func (m *SigninMutation) ClearedFields() []string
- func (m SigninMutation) Client() *Client
- func (m *SigninMutation) EdgeCleared(name string) bool
- func (m *SigninMutation) Field(name string) (ent.Value, bool)
- func (m *SigninMutation) FieldCleared(name string) bool
- func (m *SigninMutation) Fields() []string
- func (m *SigninMutation) GetType() (r signin.Type, exists bool)
- func (m *SigninMutation) ID() (id int, exists bool)
- func (m *SigninMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SigninMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SigninMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *SigninMutation) OldType(ctx context.Context) (v signin.Type, err error)
- func (m *SigninMutation) Op() Op
- func (m *SigninMutation) RemovedEdges() []string
- func (m *SigninMutation) RemovedIDs(name string) []ent.Value
- func (m *SigninMutation) ResetEdge(name string) error
- func (m *SigninMutation) ResetField(name string) error
- func (m *SigninMutation) ResetTimestamp()
- func (m *SigninMutation) ResetType()
- func (m *SigninMutation) ResetUser()
- func (m *SigninMutation) SetField(name string, value ent.Value) error
- func (m *SigninMutation) SetOp(op Op)
- func (m *SigninMutation) SetTimestamp(t time.Time)
- func (m *SigninMutation) SetType(s signin.Type)
- func (m *SigninMutation) SetUserID(id string)
- func (m *SigninMutation) Timestamp() (r time.Time, exists bool)
- func (m SigninMutation) Tx() (*Tx, error)
- func (m *SigninMutation) Type() string
- func (m *SigninMutation) UserCleared() bool
- func (m *SigninMutation) UserID() (id string, exists bool)
- func (m *SigninMutation) UserIDs() (ids []string)
- func (m *SigninMutation) Where(ps ...predicate.Signin)
- func (m *SigninMutation) WhereP(ps ...func(*sql.Selector))
- type SigninQuery
- func (sq *SigninQuery) Aggregate(fns ...AggregateFunc) *SigninSelect
- func (sq *SigninQuery) All(ctx context.Context) ([]*Signin, error)
- func (sq *SigninQuery) AllX(ctx context.Context) []*Signin
- func (sq *SigninQuery) Clone() *SigninQuery
- func (sq *SigninQuery) Count(ctx context.Context) (int, error)
- func (sq *SigninQuery) CountX(ctx context.Context) int
- func (sq *SigninQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SigninQuery) ExistX(ctx context.Context) bool
- func (sq *SigninQuery) First(ctx context.Context) (*Signin, error)
- func (sq *SigninQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SigninQuery) FirstIDX(ctx context.Context) int
- func (sq *SigninQuery) FirstX(ctx context.Context) *Signin
- func (sq *SigninQuery) GroupBy(field string, fields ...string) *SigninGroupBy
- func (sq *SigninQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SigninQuery) IDsX(ctx context.Context) []int
- func (sq *SigninQuery) Limit(limit int) *SigninQuery
- func (sq *SigninQuery) Offset(offset int) *SigninQuery
- func (sq *SigninQuery) Only(ctx context.Context) (*Signin, error)
- func (sq *SigninQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SigninQuery) OnlyIDX(ctx context.Context) int
- func (sq *SigninQuery) OnlyX(ctx context.Context) *Signin
- func (sq *SigninQuery) Order(o ...signin.OrderOption) *SigninQuery
- func (sq *SigninQuery) QueryUser() *UserQuery
- func (sq *SigninQuery) Select(fields ...string) *SigninSelect
- func (sq *SigninQuery) Unique(unique bool) *SigninQuery
- func (sq *SigninQuery) Where(ps ...predicate.Signin) *SigninQuery
- func (sq *SigninQuery) WithUser(opts ...func(*UserQuery)) *SigninQuery
- type SigninSelect
- func (ss *SigninSelect) Aggregate(fns ...AggregateFunc) *SigninSelect
- func (s *SigninSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SigninSelect) BoolX(ctx context.Context) bool
- func (s *SigninSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SigninSelect) BoolsX(ctx context.Context) []bool
- func (s *SigninSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SigninSelect) Float64X(ctx context.Context) float64
- func (s *SigninSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SigninSelect) Float64sX(ctx context.Context) []float64
- func (s *SigninSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SigninSelect) IntX(ctx context.Context) int
- func (s *SigninSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SigninSelect) IntsX(ctx context.Context) []int
- func (ss *SigninSelect) Scan(ctx context.Context, v any) error
- func (s *SigninSelect) ScanX(ctx context.Context, v any)
- func (s *SigninSelect) String(ctx context.Context) (_ string, err error)
- func (s *SigninSelect) StringX(ctx context.Context) string
- func (s *SigninSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SigninSelect) StringsX(ctx context.Context) []string
- type SigninUpdate
- func (su *SigninUpdate) ClearUser() *SigninUpdate
- func (su *SigninUpdate) Exec(ctx context.Context) error
- func (su *SigninUpdate) ExecX(ctx context.Context)
- func (su *SigninUpdate) Mutation() *SigninMutation
- func (su *SigninUpdate) Save(ctx context.Context) (int, error)
- func (su *SigninUpdate) SaveX(ctx context.Context) int
- func (su *SigninUpdate) SetNillableTimestamp(t *time.Time) *SigninUpdate
- func (su *SigninUpdate) SetNillableType(s *signin.Type) *SigninUpdate
- func (su *SigninUpdate) SetTimestamp(t time.Time) *SigninUpdate
- func (su *SigninUpdate) SetType(s signin.Type) *SigninUpdate
- func (su *SigninUpdate) SetUser(u *User) *SigninUpdate
- func (su *SigninUpdate) SetUserID(id string) *SigninUpdate
- func (su *SigninUpdate) Where(ps ...predicate.Signin) *SigninUpdate
- type SigninUpdateOne
- func (suo *SigninUpdateOne) ClearUser() *SigninUpdateOne
- func (suo *SigninUpdateOne) Exec(ctx context.Context) error
- func (suo *SigninUpdateOne) ExecX(ctx context.Context)
- func (suo *SigninUpdateOne) Mutation() *SigninMutation
- func (suo *SigninUpdateOne) Save(ctx context.Context) (*Signin, error)
- func (suo *SigninUpdateOne) SaveX(ctx context.Context) *Signin
- func (suo *SigninUpdateOne) Select(field string, fields ...string) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetNillableTimestamp(t *time.Time) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetNillableType(s *signin.Type) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetTimestamp(t time.Time) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetType(s signin.Type) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetUser(u *User) *SigninUpdateOne
- func (suo *SigninUpdateOne) SetUserID(id string) *SigninUpdateOne
- func (suo *SigninUpdateOne) Where(ps ...predicate.Signin) *SigninUpdateOne
- type Signins
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryBirthday() *BirthdayQuery
- func (u *User) QueryOpenstack() *OpenstackQuery
- func (u *User) QueryShitposts() *ShitpostQuery
- func (u *User) QuerySignins() *SigninQuery
- func (u *User) QueryVotes() *VoteQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id string) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id string) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id string) *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) QueryBirthday(u *User) *BirthdayQuery
- func (c *UserClient) QueryOpenstack(u *User) *OpenstackQuery
- func (c *UserClient) QueryShitposts(u *User) *ShitpostQuery
- func (c *UserClient) QuerySignins(u *User) *SigninQuery
- func (c *UserClient) QueryVotes(u *User) *VoteQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id string) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddShitpostIDs(ids ...string) *UserCreate
- func (uc *UserCreate) AddShitposts(s ...*Shitpost) *UserCreate
- func (uc *UserCreate) AddSigninIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddSignins(s ...*Signin) *UserCreate
- func (uc *UserCreate) AddVoteIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddVotes(v ...*Vote) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetBirthday(b *Birthday) *UserCreate
- func (uc *UserCreate) SetBirthdayID(id int) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetID(s string) *UserCreate
- func (uc *UserCreate) SetNillableBirthdayID(id *int) *UserCreate
- func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
- func (uc *UserCreate) SetNillableOpenstackID(id *int) *UserCreate
- func (uc *UserCreate) SetNillableVerificationAttempts(i *int8) *UserCreate
- func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetOpenstack(o *Openstack) *UserCreate
- func (uc *UserCreate) SetOpenstackID(id int) *UserCreate
- func (uc *UserCreate) SetVerificationAttempts(i int8) *UserCreate
- func (uc *UserCreate) SetVerified(b bool) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *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 (ugb *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) AddShitpostIDs(ids ...string)
- func (m *UserMutation) AddSigninIDs(ids ...int)
- func (m *UserMutation) AddVerificationAttempts(i int8)
- func (m *UserMutation) AddVoteIDs(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) AddedVerificationAttempts() (r int8, exists bool)
- func (m *UserMutation) BirthdayCleared() bool
- func (m *UserMutation) BirthdayID() (id int, exists bool)
- func (m *UserMutation) BirthdayIDs() (ids []int)
- func (m *UserMutation) ClearBirthday()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearOpenstack()
- func (m *UserMutation) ClearShitposts()
- func (m *UserMutation) ClearSignins()
- func (m *UserMutation) ClearVotes()
- 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) Email() (r string, exists 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 string, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]string, error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldVerificationAttempts(ctx context.Context) (v int8, err error)
- func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OpenstackCleared() bool
- func (m *UserMutation) OpenstackID() (id int, exists bool)
- func (m *UserMutation) OpenstackIDs() (ids []int)
- func (m *UserMutation) RemoveShitpostIDs(ids ...string)
- func (m *UserMutation) RemoveSigninIDs(ids ...int)
- func (m *UserMutation) RemoveVoteIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedShitpostsIDs() (ids []string)
- func (m *UserMutation) RemovedSigninsIDs() (ids []int)
- func (m *UserMutation) RemovedVotesIDs() (ids []int)
- func (m *UserMutation) ResetBirthday()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetOpenstack()
- func (m *UserMutation) ResetShitposts()
- func (m *UserMutation) ResetSignins()
- func (m *UserMutation) ResetVerificationAttempts()
- func (m *UserMutation) ResetVerified()
- func (m *UserMutation) ResetVotes()
- func (m *UserMutation) SetBirthdayID(id int)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetOpenstackID(id int)
- func (m *UserMutation) SetVerificationAttempts(i int8)
- func (m *UserMutation) SetVerified(b bool)
- func (m *UserMutation) ShitpostsCleared() bool
- func (m *UserMutation) ShitpostsIDs() (ids []string)
- func (m *UserMutation) SigninsCleared() bool
- func (m *UserMutation) SigninsIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) VerificationAttempts() (r int8, exists bool)
- func (m *UserMutation) Verified() (r bool, exists bool)
- func (m *UserMutation) VotesCleared() bool
- func (m *UserMutation) VotesIDs() (ids []int)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id string, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) string
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []string, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []string
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id string, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) string
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryBirthday() *BirthdayQuery
- func (uq *UserQuery) QueryOpenstack() *OpenstackQuery
- func (uq *UserQuery) QueryShitposts() *ShitpostQuery
- func (uq *UserQuery) QuerySignins() *SigninQuery
- func (uq *UserQuery) QueryVotes() *VoteQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithBirthday(opts ...func(*BirthdayQuery)) *UserQuery
- func (uq *UserQuery) WithOpenstack(opts ...func(*OpenstackQuery)) *UserQuery
- func (uq *UserQuery) WithShitposts(opts ...func(*ShitpostQuery)) *UserQuery
- func (uq *UserQuery) WithSignins(opts ...func(*SigninQuery)) *UserQuery
- func (uq *UserQuery) WithVotes(opts ...func(*VoteQuery)) *UserQuery
- type UserSelect
- func (us *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 (us *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 (uu *UserUpdate) AddShitpostIDs(ids ...string) *UserUpdate
- func (uu *UserUpdate) AddShitposts(s ...*Shitpost) *UserUpdate
- func (uu *UserUpdate) AddSigninIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddSignins(s ...*Signin) *UserUpdate
- func (uu *UserUpdate) AddVerificationAttempts(i int8) *UserUpdate
- func (uu *UserUpdate) AddVoteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddVotes(v ...*Vote) *UserUpdate
- func (uu *UserUpdate) ClearBirthday() *UserUpdate
- func (uu *UserUpdate) ClearOpenstack() *UserUpdate
- func (uu *UserUpdate) ClearShitposts() *UserUpdate
- func (uu *UserUpdate) ClearSignins() *UserUpdate
- func (uu *UserUpdate) ClearVotes() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveShitpostIDs(ids ...string) *UserUpdate
- func (uu *UserUpdate) RemoveShitposts(s ...*Shitpost) *UserUpdate
- func (uu *UserUpdate) RemoveSigninIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveSignins(s ...*Signin) *UserUpdate
- func (uu *UserUpdate) RemoveVoteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveVotes(v ...*Vote) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetBirthday(b *Birthday) *UserUpdate
- func (uu *UserUpdate) SetBirthdayID(id int) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableBirthdayID(id *int) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableOpenstackID(id *int) *UserUpdate
- func (uu *UserUpdate) SetNillableVerificationAttempts(i *int8) *UserUpdate
- func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetOpenstack(o *Openstack) *UserUpdate
- func (uu *UserUpdate) SetOpenstackID(id int) *UserUpdate
- func (uu *UserUpdate) SetVerificationAttempts(i int8) *UserUpdate
- func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddShitpostIDs(ids ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) AddShitposts(s ...*Shitpost) *UserUpdateOne
- func (uuo *UserUpdateOne) AddSigninIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddSignins(s ...*Signin) *UserUpdateOne
- func (uuo *UserUpdateOne) AddVerificationAttempts(i int8) *UserUpdateOne
- func (uuo *UserUpdateOne) AddVoteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddVotes(v ...*Vote) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearBirthday() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearOpenstack() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearShitposts() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearSignins() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearVotes() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveShitpostIDs(ids ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveShitposts(s ...*Shitpost) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveSigninIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveSignins(s ...*Signin) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveVoteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveVotes(v ...*Vote) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetBirthday(b *Birthday) *UserUpdateOne
- func (uuo *UserUpdateOne) SetBirthdayID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableBirthdayID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableOpenstackID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableVerificationAttempts(i *int8) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetOpenstack(o *Openstack) *UserUpdateOne
- func (uuo *UserUpdateOne) SetOpenstackID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetVerificationAttempts(i int8) *UserUpdateOne
- func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
- type Vote
- type VoteClient
- func (c *VoteClient) Create() *VoteCreate
- func (c *VoteClient) CreateBulk(builders ...*VoteCreate) *VoteCreateBulk
- func (c *VoteClient) Delete() *VoteDelete
- func (c *VoteClient) DeleteOne(v *Vote) *VoteDeleteOne
- func (c *VoteClient) DeleteOneID(id int) *VoteDeleteOne
- func (c *VoteClient) Get(ctx context.Context, id int) (*Vote, error)
- func (c *VoteClient) GetX(ctx context.Context, id int) *Vote
- func (c *VoteClient) Hooks() []Hook
- func (c *VoteClient) Intercept(interceptors ...Interceptor)
- func (c *VoteClient) Interceptors() []Interceptor
- func (c *VoteClient) MapCreateBulk(slice any, setFunc func(*VoteCreate, int)) *VoteCreateBulk
- func (c *VoteClient) Query() *VoteQuery
- func (c *VoteClient) QueryUser(v *Vote) *UserQuery
- func (c *VoteClient) Update() *VoteUpdate
- func (c *VoteClient) UpdateOne(v *Vote) *VoteUpdateOne
- func (c *VoteClient) UpdateOneID(id int) *VoteUpdateOne
- func (c *VoteClient) Use(hooks ...Hook)
- type VoteCreate
- func (vc *VoteCreate) Exec(ctx context.Context) error
- func (vc *VoteCreate) ExecX(ctx context.Context)
- func (vc *VoteCreate) Mutation() *VoteMutation
- func (vc *VoteCreate) Save(ctx context.Context) (*Vote, error)
- func (vc *VoteCreate) SaveX(ctx context.Context) *Vote
- func (vc *VoteCreate) SetRank(i int) *VoteCreate
- func (vc *VoteCreate) SetSelection(s string) *VoteCreate
- func (vc *VoteCreate) SetUser(u *User) *VoteCreate
- func (vc *VoteCreate) SetUserID(id string) *VoteCreate
- func (vc *VoteCreate) SetVoteID(s string) *VoteCreate
- type VoteCreateBulk
- type VoteDelete
- type VoteDeleteOne
- type VoteEdges
- type VoteGroupBy
- func (vgb *VoteGroupBy) Aggregate(fns ...AggregateFunc) *VoteGroupBy
- func (s *VoteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoteGroupBy) BoolX(ctx context.Context) bool
- func (s *VoteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VoteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VoteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoteGroupBy) Float64X(ctx context.Context) float64
- func (s *VoteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VoteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VoteGroupBy) IntX(ctx context.Context) int
- func (s *VoteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VoteGroupBy) IntsX(ctx context.Context) []int
- func (vgb *VoteGroupBy) Scan(ctx context.Context, v any) error
- func (s *VoteGroupBy) ScanX(ctx context.Context, v any)
- func (s *VoteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VoteGroupBy) StringX(ctx context.Context) string
- func (s *VoteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VoteGroupBy) StringsX(ctx context.Context) []string
- type VoteMutation
- func (m *VoteMutation) AddField(name string, value ent.Value) error
- func (m *VoteMutation) AddRank(i int)
- func (m *VoteMutation) AddedEdges() []string
- func (m *VoteMutation) AddedField(name string) (ent.Value, bool)
- func (m *VoteMutation) AddedFields() []string
- func (m *VoteMutation) AddedIDs(name string) []ent.Value
- func (m *VoteMutation) AddedRank() (r int, exists bool)
- func (m *VoteMutation) ClearEdge(name string) error
- func (m *VoteMutation) ClearField(name string) error
- func (m *VoteMutation) ClearUser()
- func (m *VoteMutation) ClearedEdges() []string
- func (m *VoteMutation) ClearedFields() []string
- func (m VoteMutation) Client() *Client
- func (m *VoteMutation) EdgeCleared(name string) bool
- func (m *VoteMutation) Field(name string) (ent.Value, bool)
- func (m *VoteMutation) FieldCleared(name string) bool
- func (m *VoteMutation) Fields() []string
- func (m *VoteMutation) ID() (id int, exists bool)
- func (m *VoteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VoteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VoteMutation) OldRank(ctx context.Context) (v int, err error)
- func (m *VoteMutation) OldSelection(ctx context.Context) (v string, err error)
- func (m *VoteMutation) OldVoteID(ctx context.Context) (v string, err error)
- func (m *VoteMutation) Op() Op
- func (m *VoteMutation) Rank() (r int, exists bool)
- func (m *VoteMutation) RemovedEdges() []string
- func (m *VoteMutation) RemovedIDs(name string) []ent.Value
- func (m *VoteMutation) ResetEdge(name string) error
- func (m *VoteMutation) ResetField(name string) error
- func (m *VoteMutation) ResetRank()
- func (m *VoteMutation) ResetSelection()
- func (m *VoteMutation) ResetUser()
- func (m *VoteMutation) ResetVoteID()
- func (m *VoteMutation) Selection() (r string, exists bool)
- func (m *VoteMutation) SetField(name string, value ent.Value) error
- func (m *VoteMutation) SetOp(op Op)
- func (m *VoteMutation) SetRank(i int)
- func (m *VoteMutation) SetSelection(s string)
- func (m *VoteMutation) SetUserID(id string)
- func (m *VoteMutation) SetVoteID(s string)
- func (m VoteMutation) Tx() (*Tx, error)
- func (m *VoteMutation) Type() string
- func (m *VoteMutation) UserCleared() bool
- func (m *VoteMutation) UserID() (id string, exists bool)
- func (m *VoteMutation) UserIDs() (ids []string)
- func (m *VoteMutation) VoteID() (r string, exists bool)
- func (m *VoteMutation) Where(ps ...predicate.Vote)
- func (m *VoteMutation) WhereP(ps ...func(*sql.Selector))
- type VoteQuery
- func (vq *VoteQuery) Aggregate(fns ...AggregateFunc) *VoteSelect
- func (vq *VoteQuery) All(ctx context.Context) ([]*Vote, error)
- func (vq *VoteQuery) AllX(ctx context.Context) []*Vote
- func (vq *VoteQuery) Clone() *VoteQuery
- func (vq *VoteQuery) Count(ctx context.Context) (int, error)
- func (vq *VoteQuery) CountX(ctx context.Context) int
- func (vq *VoteQuery) Exist(ctx context.Context) (bool, error)
- func (vq *VoteQuery) ExistX(ctx context.Context) bool
- func (vq *VoteQuery) First(ctx context.Context) (*Vote, error)
- func (vq *VoteQuery) FirstID(ctx context.Context) (id int, err error)
- func (vq *VoteQuery) FirstIDX(ctx context.Context) int
- func (vq *VoteQuery) FirstX(ctx context.Context) *Vote
- func (vq *VoteQuery) GroupBy(field string, fields ...string) *VoteGroupBy
- func (vq *VoteQuery) IDs(ctx context.Context) (ids []int, err error)
- func (vq *VoteQuery) IDsX(ctx context.Context) []int
- func (vq *VoteQuery) Limit(limit int) *VoteQuery
- func (vq *VoteQuery) Offset(offset int) *VoteQuery
- func (vq *VoteQuery) Only(ctx context.Context) (*Vote, error)
- func (vq *VoteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vq *VoteQuery) OnlyIDX(ctx context.Context) int
- func (vq *VoteQuery) OnlyX(ctx context.Context) *Vote
- func (vq *VoteQuery) Order(o ...vote.OrderOption) *VoteQuery
- func (vq *VoteQuery) QueryUser() *UserQuery
- func (vq *VoteQuery) Select(fields ...string) *VoteSelect
- func (vq *VoteQuery) Unique(unique bool) *VoteQuery
- func (vq *VoteQuery) Where(ps ...predicate.Vote) *VoteQuery
- func (vq *VoteQuery) WithUser(opts ...func(*UserQuery)) *VoteQuery
- type VoteResult
- type VoteResultClient
- func (c *VoteResultClient) Create() *VoteResultCreate
- func (c *VoteResultClient) CreateBulk(builders ...*VoteResultCreate) *VoteResultCreateBulk
- func (c *VoteResultClient) Delete() *VoteResultDelete
- func (c *VoteResultClient) DeleteOne(vr *VoteResult) *VoteResultDeleteOne
- func (c *VoteResultClient) DeleteOneID(id int) *VoteResultDeleteOne
- func (c *VoteResultClient) Get(ctx context.Context, id int) (*VoteResult, error)
- func (c *VoteResultClient) GetX(ctx context.Context, id int) *VoteResult
- func (c *VoteResultClient) Hooks() []Hook
- func (c *VoteResultClient) Intercept(interceptors ...Interceptor)
- func (c *VoteResultClient) Interceptors() []Interceptor
- func (c *VoteResultClient) MapCreateBulk(slice any, setFunc func(*VoteResultCreate, int)) *VoteResultCreateBulk
- func (c *VoteResultClient) Query() *VoteResultQuery
- func (c *VoteResultClient) Update() *VoteResultUpdate
- func (c *VoteResultClient) UpdateOne(vr *VoteResult) *VoteResultUpdateOne
- func (c *VoteResultClient) UpdateOneID(id int) *VoteResultUpdateOne
- func (c *VoteResultClient) Use(hooks ...Hook)
- type VoteResultCreate
- func (vrc *VoteResultCreate) Exec(ctx context.Context) error
- func (vrc *VoteResultCreate) ExecX(ctx context.Context)
- func (vrc *VoteResultCreate) Mutation() *VoteResultMutation
- func (vrc *VoteResultCreate) Save(ctx context.Context) (*VoteResult, error)
- func (vrc *VoteResultCreate) SaveX(ctx context.Context) *VoteResult
- func (vrc *VoteResultCreate) SetHTML(s string) *VoteResultCreate
- func (vrc *VoteResultCreate) SetPlain(s string) *VoteResultCreate
- func (vrc *VoteResultCreate) SetVoteID(s string) *VoteResultCreate
- type VoteResultCreateBulk
- type VoteResultDelete
- type VoteResultDeleteOne
- type VoteResultGroupBy
- func (vrgb *VoteResultGroupBy) Aggregate(fns ...AggregateFunc) *VoteResultGroupBy
- func (s *VoteResultGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoteResultGroupBy) BoolX(ctx context.Context) bool
- func (s *VoteResultGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VoteResultGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VoteResultGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoteResultGroupBy) Float64X(ctx context.Context) float64
- func (s *VoteResultGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoteResultGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VoteResultGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VoteResultGroupBy) IntX(ctx context.Context) int
- func (s *VoteResultGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VoteResultGroupBy) IntsX(ctx context.Context) []int
- func (vrgb *VoteResultGroupBy) Scan(ctx context.Context, v any) error
- func (s *VoteResultGroupBy) ScanX(ctx context.Context, v any)
- func (s *VoteResultGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VoteResultGroupBy) StringX(ctx context.Context) string
- func (s *VoteResultGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VoteResultGroupBy) StringsX(ctx context.Context) []string
- type VoteResultMutation
- func (m *VoteResultMutation) AddField(name string, value ent.Value) error
- func (m *VoteResultMutation) AddedEdges() []string
- func (m *VoteResultMutation) AddedField(name string) (ent.Value, bool)
- func (m *VoteResultMutation) AddedFields() []string
- func (m *VoteResultMutation) AddedIDs(name string) []ent.Value
- func (m *VoteResultMutation) ClearEdge(name string) error
- func (m *VoteResultMutation) ClearField(name string) error
- func (m *VoteResultMutation) ClearedEdges() []string
- func (m *VoteResultMutation) ClearedFields() []string
- func (m VoteResultMutation) Client() *Client
- func (m *VoteResultMutation) EdgeCleared(name string) bool
- func (m *VoteResultMutation) Field(name string) (ent.Value, bool)
- func (m *VoteResultMutation) FieldCleared(name string) bool
- func (m *VoteResultMutation) Fields() []string
- func (m *VoteResultMutation) HTML() (r string, exists bool)
- func (m *VoteResultMutation) ID() (id int, exists bool)
- func (m *VoteResultMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VoteResultMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VoteResultMutation) OldHTML(ctx context.Context) (v string, err error)
- func (m *VoteResultMutation) OldPlain(ctx context.Context) (v string, err error)
- func (m *VoteResultMutation) OldVoteID(ctx context.Context) (v string, err error)
- func (m *VoteResultMutation) Op() Op
- func (m *VoteResultMutation) Plain() (r string, exists bool)
- func (m *VoteResultMutation) RemovedEdges() []string
- func (m *VoteResultMutation) RemovedIDs(name string) []ent.Value
- func (m *VoteResultMutation) ResetEdge(name string) error
- func (m *VoteResultMutation) ResetField(name string) error
- func (m *VoteResultMutation) ResetHTML()
- func (m *VoteResultMutation) ResetPlain()
- func (m *VoteResultMutation) ResetVoteID()
- func (m *VoteResultMutation) SetField(name string, value ent.Value) error
- func (m *VoteResultMutation) SetHTML(s string)
- func (m *VoteResultMutation) SetOp(op Op)
- func (m *VoteResultMutation) SetPlain(s string)
- func (m *VoteResultMutation) SetVoteID(s string)
- func (m VoteResultMutation) Tx() (*Tx, error)
- func (m *VoteResultMutation) Type() string
- func (m *VoteResultMutation) VoteID() (r string, exists bool)
- func (m *VoteResultMutation) Where(ps ...predicate.VoteResult)
- func (m *VoteResultMutation) WhereP(ps ...func(*sql.Selector))
- type VoteResultQuery
- func (vrq *VoteResultQuery) Aggregate(fns ...AggregateFunc) *VoteResultSelect
- func (vrq *VoteResultQuery) All(ctx context.Context) ([]*VoteResult, error)
- func (vrq *VoteResultQuery) AllX(ctx context.Context) []*VoteResult
- func (vrq *VoteResultQuery) Clone() *VoteResultQuery
- func (vrq *VoteResultQuery) Count(ctx context.Context) (int, error)
- func (vrq *VoteResultQuery) CountX(ctx context.Context) int
- func (vrq *VoteResultQuery) Exist(ctx context.Context) (bool, error)
- func (vrq *VoteResultQuery) ExistX(ctx context.Context) bool
- func (vrq *VoteResultQuery) First(ctx context.Context) (*VoteResult, error)
- func (vrq *VoteResultQuery) FirstID(ctx context.Context) (id int, err error)
- func (vrq *VoteResultQuery) FirstIDX(ctx context.Context) int
- func (vrq *VoteResultQuery) FirstX(ctx context.Context) *VoteResult
- func (vrq *VoteResultQuery) GroupBy(field string, fields ...string) *VoteResultGroupBy
- func (vrq *VoteResultQuery) IDs(ctx context.Context) (ids []int, err error)
- func (vrq *VoteResultQuery) IDsX(ctx context.Context) []int
- func (vrq *VoteResultQuery) Limit(limit int) *VoteResultQuery
- func (vrq *VoteResultQuery) Offset(offset int) *VoteResultQuery
- func (vrq *VoteResultQuery) Only(ctx context.Context) (*VoteResult, error)
- func (vrq *VoteResultQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vrq *VoteResultQuery) OnlyIDX(ctx context.Context) int
- func (vrq *VoteResultQuery) OnlyX(ctx context.Context) *VoteResult
- func (vrq *VoteResultQuery) Order(o ...voteresult.OrderOption) *VoteResultQuery
- func (vrq *VoteResultQuery) Select(fields ...string) *VoteResultSelect
- func (vrq *VoteResultQuery) Unique(unique bool) *VoteResultQuery
- func (vrq *VoteResultQuery) Where(ps ...predicate.VoteResult) *VoteResultQuery
- type VoteResultSelect
- func (vrs *VoteResultSelect) Aggregate(fns ...AggregateFunc) *VoteResultSelect
- func (s *VoteResultSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoteResultSelect) BoolX(ctx context.Context) bool
- func (s *VoteResultSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VoteResultSelect) BoolsX(ctx context.Context) []bool
- func (s *VoteResultSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoteResultSelect) Float64X(ctx context.Context) float64
- func (s *VoteResultSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoteResultSelect) Float64sX(ctx context.Context) []float64
- func (s *VoteResultSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VoteResultSelect) IntX(ctx context.Context) int
- func (s *VoteResultSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VoteResultSelect) IntsX(ctx context.Context) []int
- func (vrs *VoteResultSelect) Scan(ctx context.Context, v any) error
- func (s *VoteResultSelect) ScanX(ctx context.Context, v any)
- func (s *VoteResultSelect) String(ctx context.Context) (_ string, err error)
- func (s *VoteResultSelect) StringX(ctx context.Context) string
- func (s *VoteResultSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VoteResultSelect) StringsX(ctx context.Context) []string
- type VoteResultUpdate
- func (vru *VoteResultUpdate) Exec(ctx context.Context) error
- func (vru *VoteResultUpdate) ExecX(ctx context.Context)
- func (vru *VoteResultUpdate) Mutation() *VoteResultMutation
- func (vru *VoteResultUpdate) Save(ctx context.Context) (int, error)
- func (vru *VoteResultUpdate) SaveX(ctx context.Context) int
- func (vru *VoteResultUpdate) SetHTML(s string) *VoteResultUpdate
- func (vru *VoteResultUpdate) SetNillableHTML(s *string) *VoteResultUpdate
- func (vru *VoteResultUpdate) SetNillablePlain(s *string) *VoteResultUpdate
- func (vru *VoteResultUpdate) SetNillableVoteID(s *string) *VoteResultUpdate
- func (vru *VoteResultUpdate) SetPlain(s string) *VoteResultUpdate
- func (vru *VoteResultUpdate) SetVoteID(s string) *VoteResultUpdate
- func (vru *VoteResultUpdate) Where(ps ...predicate.VoteResult) *VoteResultUpdate
- type VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) Exec(ctx context.Context) error
- func (vruo *VoteResultUpdateOne) ExecX(ctx context.Context)
- func (vruo *VoteResultUpdateOne) Mutation() *VoteResultMutation
- func (vruo *VoteResultUpdateOne) Save(ctx context.Context) (*VoteResult, error)
- func (vruo *VoteResultUpdateOne) SaveX(ctx context.Context) *VoteResult
- func (vruo *VoteResultUpdateOne) Select(field string, fields ...string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetHTML(s string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetNillableHTML(s *string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetNillablePlain(s *string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetNillableVoteID(s *string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetPlain(s string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) SetVoteID(s string) *VoteResultUpdateOne
- func (vruo *VoteResultUpdateOne) Where(ps ...predicate.VoteResult) *VoteResultUpdateOne
- type VoteResults
- type VoteSelect
- func (vs *VoteSelect) Aggregate(fns ...AggregateFunc) *VoteSelect
- func (s *VoteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoteSelect) BoolX(ctx context.Context) bool
- func (s *VoteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VoteSelect) BoolsX(ctx context.Context) []bool
- func (s *VoteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoteSelect) Float64X(ctx context.Context) float64
- func (s *VoteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoteSelect) Float64sX(ctx context.Context) []float64
- func (s *VoteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VoteSelect) IntX(ctx context.Context) int
- func (s *VoteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VoteSelect) IntsX(ctx context.Context) []int
- func (vs *VoteSelect) Scan(ctx context.Context, v any) error
- func (s *VoteSelect) ScanX(ctx context.Context, v any)
- func (s *VoteSelect) String(ctx context.Context) (_ string, err error)
- func (s *VoteSelect) StringX(ctx context.Context) string
- func (s *VoteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VoteSelect) StringsX(ctx context.Context) []string
- type VoteUpdate
- func (vu *VoteUpdate) AddRank(i int) *VoteUpdate
- func (vu *VoteUpdate) ClearUser() *VoteUpdate
- func (vu *VoteUpdate) Exec(ctx context.Context) error
- func (vu *VoteUpdate) ExecX(ctx context.Context)
- func (vu *VoteUpdate) Mutation() *VoteMutation
- func (vu *VoteUpdate) Save(ctx context.Context) (int, error)
- func (vu *VoteUpdate) SaveX(ctx context.Context) int
- func (vu *VoteUpdate) SetNillableRank(i *int) *VoteUpdate
- func (vu *VoteUpdate) SetNillableSelection(s *string) *VoteUpdate
- func (vu *VoteUpdate) SetNillableVoteID(s *string) *VoteUpdate
- func (vu *VoteUpdate) SetRank(i int) *VoteUpdate
- func (vu *VoteUpdate) SetSelection(s string) *VoteUpdate
- func (vu *VoteUpdate) SetUser(u *User) *VoteUpdate
- func (vu *VoteUpdate) SetUserID(id string) *VoteUpdate
- func (vu *VoteUpdate) SetVoteID(s string) *VoteUpdate
- func (vu *VoteUpdate) Where(ps ...predicate.Vote) *VoteUpdate
- type VoteUpdateOne
- func (vuo *VoteUpdateOne) AddRank(i int) *VoteUpdateOne
- func (vuo *VoteUpdateOne) ClearUser() *VoteUpdateOne
- func (vuo *VoteUpdateOne) Exec(ctx context.Context) error
- func (vuo *VoteUpdateOne) ExecX(ctx context.Context)
- func (vuo *VoteUpdateOne) Mutation() *VoteMutation
- func (vuo *VoteUpdateOne) Save(ctx context.Context) (*Vote, error)
- func (vuo *VoteUpdateOne) SaveX(ctx context.Context) *Vote
- func (vuo *VoteUpdateOne) Select(field string, fields ...string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetNillableRank(i *int) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetNillableSelection(s *string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetNillableVoteID(s *string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetRank(i int) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetSelection(s string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetUser(u *User) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetUserID(id string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) SetVoteID(s string) *VoteUpdateOne
- func (vuo *VoteUpdateOne) Where(ps ...predicate.Vote) *VoteUpdateOne
- type Votes
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeBirthday = "Birthday" TypeOpenstack = "Openstack" TypeShitpost = "Shitpost" TypeSignin = "Signin" TypeUser = "User" TypeVote = "Vote" TypeVoteResult = "VoteResult" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Birthday ¶
type Birthday struct { // ID of the ent. ID int `json:"id,omitempty"` // The day of the month of the birthday Day int `json:"day,omitempty"` // The month of the birthday Month int `json:"month,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BirthdayQuery when eager-loading is set. Edges BirthdayEdges `json:"edges"` // contains filtered or unexported fields }
Birthday is the model entity for the Birthday schema.
func (*Birthday) Unwrap ¶
Unwrap unwraps the Birthday 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 (*Birthday) Update ¶
func (b *Birthday) Update() *BirthdayUpdateOne
Update returns a builder for updating this Birthday. Note that you need to call Birthday.Unwrap() before calling this method if this Birthday was returned from a transaction, and the transaction was committed or rolled back.
type BirthdayClient ¶
type BirthdayClient struct {
// contains filtered or unexported fields
}
BirthdayClient is a client for the Birthday schema.
func NewBirthdayClient ¶
func NewBirthdayClient(c config) *BirthdayClient
NewBirthdayClient returns a client for the Birthday from the given config.
func (*BirthdayClient) Create ¶
func (c *BirthdayClient) Create() *BirthdayCreate
Create returns a builder for creating a Birthday entity.
func (*BirthdayClient) CreateBulk ¶
func (c *BirthdayClient) CreateBulk(builders ...*BirthdayCreate) *BirthdayCreateBulk
CreateBulk returns a builder for creating a bulk of Birthday entities.
func (*BirthdayClient) Delete ¶
func (c *BirthdayClient) Delete() *BirthdayDelete
Delete returns a delete builder for Birthday.
func (*BirthdayClient) DeleteOne ¶
func (c *BirthdayClient) DeleteOne(b *Birthday) *BirthdayDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BirthdayClient) DeleteOneID ¶
func (c *BirthdayClient) DeleteOneID(id int) *BirthdayDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BirthdayClient) GetX ¶
func (c *BirthdayClient) GetX(ctx context.Context, id int) *Birthday
GetX is like Get, but panics if an error occurs.
func (*BirthdayClient) Hooks ¶
func (c *BirthdayClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BirthdayClient) Intercept ¶
func (c *BirthdayClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `birthday.Intercept(f(g(h())))`.
func (*BirthdayClient) Interceptors ¶
func (c *BirthdayClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BirthdayClient) MapCreateBulk ¶
func (c *BirthdayClient) MapCreateBulk(slice any, setFunc func(*BirthdayCreate, int)) *BirthdayCreateBulk
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 (*BirthdayClient) Query ¶
func (c *BirthdayClient) Query() *BirthdayQuery
Query returns a query builder for Birthday.
func (*BirthdayClient) QueryUser ¶
func (c *BirthdayClient) QueryUser(b *Birthday) *UserQuery
QueryUser queries the user edge of a Birthday.
func (*BirthdayClient) Update ¶
func (c *BirthdayClient) Update() *BirthdayUpdate
Update returns an update builder for Birthday.
func (*BirthdayClient) UpdateOne ¶
func (c *BirthdayClient) UpdateOne(b *Birthday) *BirthdayUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BirthdayClient) UpdateOneID ¶
func (c *BirthdayClient) UpdateOneID(id int) *BirthdayUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BirthdayClient) Use ¶
func (c *BirthdayClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `birthday.Hooks(f(g(h())))`.
type BirthdayCreate ¶
type BirthdayCreate struct {
// contains filtered or unexported fields
}
BirthdayCreate is the builder for creating a Birthday entity.
func (*BirthdayCreate) Exec ¶
func (bc *BirthdayCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BirthdayCreate) ExecX ¶
func (bc *BirthdayCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BirthdayCreate) Mutation ¶
func (bc *BirthdayCreate) Mutation() *BirthdayMutation
Mutation returns the BirthdayMutation object of the builder.
func (*BirthdayCreate) Save ¶
func (bc *BirthdayCreate) Save(ctx context.Context) (*Birthday, error)
Save creates the Birthday in the database.
func (*BirthdayCreate) SaveX ¶
func (bc *BirthdayCreate) SaveX(ctx context.Context) *Birthday
SaveX calls Save and panics if Save returns an error.
func (*BirthdayCreate) SetDay ¶
func (bc *BirthdayCreate) SetDay(i int) *BirthdayCreate
SetDay sets the "day" field.
func (*BirthdayCreate) SetMonth ¶
func (bc *BirthdayCreate) SetMonth(i int) *BirthdayCreate
SetMonth sets the "month" field.
func (*BirthdayCreate) SetNillableUserID ¶
func (bc *BirthdayCreate) SetNillableUserID(id *string) *BirthdayCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BirthdayCreate) SetUser ¶
func (bc *BirthdayCreate) SetUser(u *User) *BirthdayCreate
SetUser sets the "user" edge to the User entity.
func (*BirthdayCreate) SetUserID ¶
func (bc *BirthdayCreate) SetUserID(id string) *BirthdayCreate
SetUserID sets the "user" edge to the User entity by ID.
type BirthdayCreateBulk ¶
type BirthdayCreateBulk struct {
// contains filtered or unexported fields
}
BirthdayCreateBulk is the builder for creating many Birthday entities in bulk.
func (*BirthdayCreateBulk) Exec ¶
func (bcb *BirthdayCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BirthdayCreateBulk) ExecX ¶
func (bcb *BirthdayCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BirthdayDelete ¶
type BirthdayDelete struct {
// contains filtered or unexported fields
}
BirthdayDelete is the builder for deleting a Birthday entity.
func (*BirthdayDelete) Exec ¶
func (bd *BirthdayDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BirthdayDelete) ExecX ¶
func (bd *BirthdayDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BirthdayDelete) Where ¶
func (bd *BirthdayDelete) Where(ps ...predicate.Birthday) *BirthdayDelete
Where appends a list predicates to the BirthdayDelete builder.
type BirthdayDeleteOne ¶
type BirthdayDeleteOne struct {
// contains filtered or unexported fields
}
BirthdayDeleteOne is the builder for deleting a single Birthday entity.
func (*BirthdayDeleteOne) Exec ¶
func (bdo *BirthdayDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BirthdayDeleteOne) ExecX ¶
func (bdo *BirthdayDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BirthdayDeleteOne) Where ¶
func (bdo *BirthdayDeleteOne) Where(ps ...predicate.Birthday) *BirthdayDeleteOne
Where appends a list predicates to the BirthdayDelete builder.
type BirthdayEdges ¶
type BirthdayEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
BirthdayEdges holds the relations/edges for other nodes in the graph.
func (BirthdayEdges) UserOrErr ¶
func (e BirthdayEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type BirthdayGroupBy ¶
type BirthdayGroupBy struct {
// contains filtered or unexported fields
}
BirthdayGroupBy is the group-by builder for Birthday entities.
func (*BirthdayGroupBy) Aggregate ¶
func (bgb *BirthdayGroupBy) Aggregate(fns ...AggregateFunc) *BirthdayGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BirthdayGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BirthdayGroupBy) Scan ¶
func (bgb *BirthdayGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BirthdayGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BirthdayMutation ¶
type BirthdayMutation struct {
// contains filtered or unexported fields
}
BirthdayMutation represents an operation that mutates the Birthday nodes in the graph.
func (*BirthdayMutation) AddDay ¶
func (m *BirthdayMutation) AddDay(i int)
AddDay adds i to the "day" field.
func (*BirthdayMutation) AddField ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) AddMonth ¶
func (m *BirthdayMutation) AddMonth(i int)
AddMonth adds i to the "month" field.
func (*BirthdayMutation) AddedDay ¶
func (m *BirthdayMutation) AddedDay() (r int, exists bool)
AddedDay returns the value that was added to the "day" field in this mutation.
func (*BirthdayMutation) AddedEdges ¶
func (m *BirthdayMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BirthdayMutation) AddedField ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) AddedFields ¶
func (m *BirthdayMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BirthdayMutation) AddedIDs ¶
func (m *BirthdayMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BirthdayMutation) AddedMonth ¶
func (m *BirthdayMutation) AddedMonth() (r int, exists bool)
AddedMonth returns the value that was added to the "month" field in this mutation.
func (*BirthdayMutation) ClearEdge ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ClearField ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ClearUser ¶
func (m *BirthdayMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*BirthdayMutation) ClearedEdges ¶
func (m *BirthdayMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BirthdayMutation) ClearedFields ¶
func (m *BirthdayMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BirthdayMutation) Client ¶
func (m BirthdayMutation) 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 (*BirthdayMutation) Day ¶
func (m *BirthdayMutation) Day() (r int, exists bool)
Day returns the value of the "day" field in the mutation.
func (*BirthdayMutation) EdgeCleared ¶
func (m *BirthdayMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BirthdayMutation) Field ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) FieldCleared ¶
func (m *BirthdayMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BirthdayMutation) Fields ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ID ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) IDs ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) Month ¶
func (m *BirthdayMutation) Month() (r int, exists bool)
Month returns the value of the "month" field in the mutation.
func (*BirthdayMutation) OldDay ¶
func (m *BirthdayMutation) OldDay(ctx context.Context) (v int, err error)
OldDay returns the old "day" field's value of the Birthday entity. If the Birthday 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 (*BirthdayMutation) 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 (*BirthdayMutation) OldMonth ¶
func (m *BirthdayMutation) OldMonth(ctx context.Context) (v int, err error)
OldMonth returns the old "month" field's value of the Birthday entity. If the Birthday 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 (*BirthdayMutation) RemovedEdges ¶
func (m *BirthdayMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BirthdayMutation) RemovedIDs ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ResetDay ¶
func (m *BirthdayMutation) ResetDay()
ResetDay resets all changes to the "day" field.
func (*BirthdayMutation) ResetEdge ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ResetField ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) ResetMonth ¶
func (m *BirthdayMutation) ResetMonth()
ResetMonth resets all changes to the "month" field.
func (*BirthdayMutation) ResetUser ¶
func (m *BirthdayMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*BirthdayMutation) SetDay ¶
func (m *BirthdayMutation) SetDay(i int)
SetDay sets the "day" field.
func (*BirthdayMutation) SetField ¶
func (m *BirthdayMutation) 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 (*BirthdayMutation) SetMonth ¶
func (m *BirthdayMutation) SetMonth(i int)
SetMonth sets the "month" field.
func (*BirthdayMutation) SetOp ¶
func (m *BirthdayMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BirthdayMutation) SetUserID ¶
func (m *BirthdayMutation) SetUserID(id string)
SetUserID sets the "user" edge to the User entity by id.
func (BirthdayMutation) Tx ¶
func (m BirthdayMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BirthdayMutation) Type ¶
func (m *BirthdayMutation) Type() string
Type returns the node type of this mutation (Birthday).
func (*BirthdayMutation) UserCleared ¶
func (m *BirthdayMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*BirthdayMutation) UserID ¶
func (m *BirthdayMutation) UserID() (id string, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*BirthdayMutation) UserIDs ¶
func (m *BirthdayMutation) UserIDs() (ids []string)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*BirthdayMutation) Where ¶
func (m *BirthdayMutation) Where(ps ...predicate.Birthday)
Where appends a list predicates to the BirthdayMutation builder.
func (*BirthdayMutation) WhereP ¶
func (m *BirthdayMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BirthdayMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BirthdayQuery ¶
type BirthdayQuery struct {
// contains filtered or unexported fields
}
BirthdayQuery is the builder for querying Birthday entities.
func (*BirthdayQuery) Aggregate ¶
func (bq *BirthdayQuery) Aggregate(fns ...AggregateFunc) *BirthdaySelect
Aggregate returns a BirthdaySelect configured with the given aggregations.
func (*BirthdayQuery) All ¶
func (bq *BirthdayQuery) All(ctx context.Context) ([]*Birthday, error)
All executes the query and returns a list of Birthdays.
func (*BirthdayQuery) AllX ¶
func (bq *BirthdayQuery) AllX(ctx context.Context) []*Birthday
AllX is like All, but panics if an error occurs.
func (*BirthdayQuery) Clone ¶
func (bq *BirthdayQuery) Clone() *BirthdayQuery
Clone returns a duplicate of the BirthdayQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BirthdayQuery) Count ¶
func (bq *BirthdayQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BirthdayQuery) CountX ¶
func (bq *BirthdayQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BirthdayQuery) Exist ¶
func (bq *BirthdayQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BirthdayQuery) ExistX ¶
func (bq *BirthdayQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BirthdayQuery) First ¶
func (bq *BirthdayQuery) First(ctx context.Context) (*Birthday, error)
First returns the first Birthday entity from the query. Returns a *NotFoundError when no Birthday was found.
func (*BirthdayQuery) FirstID ¶
func (bq *BirthdayQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Birthday ID from the query. Returns a *NotFoundError when no Birthday ID was found.
func (*BirthdayQuery) FirstIDX ¶
func (bq *BirthdayQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BirthdayQuery) FirstX ¶
func (bq *BirthdayQuery) FirstX(ctx context.Context) *Birthday
FirstX is like First, but panics if an error occurs.
func (*BirthdayQuery) GroupBy ¶
func (bq *BirthdayQuery) GroupBy(field string, fields ...string) *BirthdayGroupBy
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 { Day int `json:"day,omitempty"` Count int `json:"count,omitempty"` } client.Birthday.Query(). GroupBy(birthday.FieldDay). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BirthdayQuery) IDs ¶
func (bq *BirthdayQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Birthday IDs.
func (*BirthdayQuery) IDsX ¶
func (bq *BirthdayQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BirthdayQuery) Limit ¶
func (bq *BirthdayQuery) Limit(limit int) *BirthdayQuery
Limit the number of records to be returned by this query.
func (*BirthdayQuery) Offset ¶
func (bq *BirthdayQuery) Offset(offset int) *BirthdayQuery
Offset to start from.
func (*BirthdayQuery) Only ¶
func (bq *BirthdayQuery) Only(ctx context.Context) (*Birthday, error)
Only returns a single Birthday entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Birthday entity is found. Returns a *NotFoundError when no Birthday entities are found.
func (*BirthdayQuery) OnlyID ¶
func (bq *BirthdayQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Birthday ID in the query. Returns a *NotSingularError when more than one Birthday ID is found. Returns a *NotFoundError when no entities are found.
func (*BirthdayQuery) OnlyIDX ¶
func (bq *BirthdayQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BirthdayQuery) OnlyX ¶
func (bq *BirthdayQuery) OnlyX(ctx context.Context) *Birthday
OnlyX is like Only, but panics if an error occurs.
func (*BirthdayQuery) Order ¶
func (bq *BirthdayQuery) Order(o ...birthday.OrderOption) *BirthdayQuery
Order specifies how the records should be ordered.
func (*BirthdayQuery) QueryUser ¶
func (bq *BirthdayQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*BirthdayQuery) Select ¶
func (bq *BirthdayQuery) Select(fields ...string) *BirthdaySelect
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 { Day int `json:"day,omitempty"` } client.Birthday.Query(). Select(birthday.FieldDay). Scan(ctx, &v)
func (*BirthdayQuery) Unique ¶
func (bq *BirthdayQuery) Unique(unique bool) *BirthdayQuery
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 (*BirthdayQuery) Where ¶
func (bq *BirthdayQuery) Where(ps ...predicate.Birthday) *BirthdayQuery
Where adds a new predicate for the BirthdayQuery builder.
func (*BirthdayQuery) WithUser ¶
func (bq *BirthdayQuery) WithUser(opts ...func(*UserQuery)) *BirthdayQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type BirthdaySelect ¶
type BirthdaySelect struct { *BirthdayQuery // contains filtered or unexported fields }
BirthdaySelect is the builder for selecting fields of Birthday entities.
func (*BirthdaySelect) Aggregate ¶
func (bs *BirthdaySelect) Aggregate(fns ...AggregateFunc) *BirthdaySelect
Aggregate adds the given aggregation functions to the selector query.
func (*BirthdaySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BirthdaySelect) Scan ¶
func (bs *BirthdaySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BirthdaySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BirthdayUpdate ¶
type BirthdayUpdate struct {
// contains filtered or unexported fields
}
BirthdayUpdate is the builder for updating Birthday entities.
func (*BirthdayUpdate) AddDay ¶
func (bu *BirthdayUpdate) AddDay(i int) *BirthdayUpdate
AddDay adds i to the "day" field.
func (*BirthdayUpdate) AddMonth ¶
func (bu *BirthdayUpdate) AddMonth(i int) *BirthdayUpdate
AddMonth adds i to the "month" field.
func (*BirthdayUpdate) ClearUser ¶
func (bu *BirthdayUpdate) ClearUser() *BirthdayUpdate
ClearUser clears the "user" edge to the User entity.
func (*BirthdayUpdate) Exec ¶
func (bu *BirthdayUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BirthdayUpdate) ExecX ¶
func (bu *BirthdayUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BirthdayUpdate) Mutation ¶
func (bu *BirthdayUpdate) Mutation() *BirthdayMutation
Mutation returns the BirthdayMutation object of the builder.
func (*BirthdayUpdate) Save ¶
func (bu *BirthdayUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BirthdayUpdate) SaveX ¶
func (bu *BirthdayUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BirthdayUpdate) SetDay ¶
func (bu *BirthdayUpdate) SetDay(i int) *BirthdayUpdate
SetDay sets the "day" field.
func (*BirthdayUpdate) SetMonth ¶
func (bu *BirthdayUpdate) SetMonth(i int) *BirthdayUpdate
SetMonth sets the "month" field.
func (*BirthdayUpdate) SetNillableDay ¶
func (bu *BirthdayUpdate) SetNillableDay(i *int) *BirthdayUpdate
SetNillableDay sets the "day" field if the given value is not nil.
func (*BirthdayUpdate) SetNillableMonth ¶
func (bu *BirthdayUpdate) SetNillableMonth(i *int) *BirthdayUpdate
SetNillableMonth sets the "month" field if the given value is not nil.
func (*BirthdayUpdate) SetNillableUserID ¶
func (bu *BirthdayUpdate) SetNillableUserID(id *string) *BirthdayUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BirthdayUpdate) SetUser ¶
func (bu *BirthdayUpdate) SetUser(u *User) *BirthdayUpdate
SetUser sets the "user" edge to the User entity.
func (*BirthdayUpdate) SetUserID ¶
func (bu *BirthdayUpdate) SetUserID(id string) *BirthdayUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*BirthdayUpdate) Where ¶
func (bu *BirthdayUpdate) Where(ps ...predicate.Birthday) *BirthdayUpdate
Where appends a list predicates to the BirthdayUpdate builder.
type BirthdayUpdateOne ¶
type BirthdayUpdateOne struct {
// contains filtered or unexported fields
}
BirthdayUpdateOne is the builder for updating a single Birthday entity.
func (*BirthdayUpdateOne) AddDay ¶
func (buo *BirthdayUpdateOne) AddDay(i int) *BirthdayUpdateOne
AddDay adds i to the "day" field.
func (*BirthdayUpdateOne) AddMonth ¶
func (buo *BirthdayUpdateOne) AddMonth(i int) *BirthdayUpdateOne
AddMonth adds i to the "month" field.
func (*BirthdayUpdateOne) ClearUser ¶
func (buo *BirthdayUpdateOne) ClearUser() *BirthdayUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*BirthdayUpdateOne) Exec ¶
func (buo *BirthdayUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BirthdayUpdateOne) ExecX ¶
func (buo *BirthdayUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BirthdayUpdateOne) Mutation ¶
func (buo *BirthdayUpdateOne) Mutation() *BirthdayMutation
Mutation returns the BirthdayMutation object of the builder.
func (*BirthdayUpdateOne) Save ¶
func (buo *BirthdayUpdateOne) Save(ctx context.Context) (*Birthday, error)
Save executes the query and returns the updated Birthday entity.
func (*BirthdayUpdateOne) SaveX ¶
func (buo *BirthdayUpdateOne) SaveX(ctx context.Context) *Birthday
SaveX is like Save, but panics if an error occurs.
func (*BirthdayUpdateOne) Select ¶
func (buo *BirthdayUpdateOne) Select(field string, fields ...string) *BirthdayUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BirthdayUpdateOne) SetDay ¶
func (buo *BirthdayUpdateOne) SetDay(i int) *BirthdayUpdateOne
SetDay sets the "day" field.
func (*BirthdayUpdateOne) SetMonth ¶
func (buo *BirthdayUpdateOne) SetMonth(i int) *BirthdayUpdateOne
SetMonth sets the "month" field.
func (*BirthdayUpdateOne) SetNillableDay ¶
func (buo *BirthdayUpdateOne) SetNillableDay(i *int) *BirthdayUpdateOne
SetNillableDay sets the "day" field if the given value is not nil.
func (*BirthdayUpdateOne) SetNillableMonth ¶
func (buo *BirthdayUpdateOne) SetNillableMonth(i *int) *BirthdayUpdateOne
SetNillableMonth sets the "month" field if the given value is not nil.
func (*BirthdayUpdateOne) SetNillableUserID ¶
func (buo *BirthdayUpdateOne) SetNillableUserID(id *string) *BirthdayUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BirthdayUpdateOne) SetUser ¶
func (buo *BirthdayUpdateOne) SetUser(u *User) *BirthdayUpdateOne
SetUser sets the "user" edge to the User entity.
func (*BirthdayUpdateOne) SetUserID ¶
func (buo *BirthdayUpdateOne) SetUserID(id string) *BirthdayUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*BirthdayUpdateOne) Where ¶
func (buo *BirthdayUpdateOne) Where(ps ...predicate.Birthday) *BirthdayUpdateOne
Where appends a list predicates to the BirthdayUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Birthday is the client for interacting with the Birthday builders. Birthday *BirthdayClient // Openstack is the client for interacting with the Openstack builders. Openstack *OpenstackClient // Shitpost is the client for interacting with the Shitpost builders. Shitpost *ShitpostClient // Signin is the client for interacting with the Signin builders. Signin *SigninClient // User is the client for interacting with the User builders. User *UserClient // Vote is the client for interacting with the Vote builders. Vote *VoteClient // VoteResult is the client for interacting with the VoteResult builders. VoteResult *VoteResultClient // 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(). Birthday. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type Openstack ¶
type Openstack struct { // ID of the ent. ID int `json:"id,omitempty"` // Time of last reset Timestamp time.Time `json:"timestamp,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OpenstackQuery when eager-loading is set. Edges OpenstackEdges `json:"edges"` // contains filtered or unexported fields }
Openstack is the model entity for the Openstack schema.
func (*Openstack) Unwrap ¶
Unwrap unwraps the Openstack 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 (*Openstack) Update ¶
func (o *Openstack) Update() *OpenstackUpdateOne
Update returns a builder for updating this Openstack. Note that you need to call Openstack.Unwrap() before calling this method if this Openstack was returned from a transaction, and the transaction was committed or rolled back.
type OpenstackClient ¶
type OpenstackClient struct {
// contains filtered or unexported fields
}
OpenstackClient is a client for the Openstack schema.
func NewOpenstackClient ¶
func NewOpenstackClient(c config) *OpenstackClient
NewOpenstackClient returns a client for the Openstack from the given config.
func (*OpenstackClient) Create ¶
func (c *OpenstackClient) Create() *OpenstackCreate
Create returns a builder for creating a Openstack entity.
func (*OpenstackClient) CreateBulk ¶
func (c *OpenstackClient) CreateBulk(builders ...*OpenstackCreate) *OpenstackCreateBulk
CreateBulk returns a builder for creating a bulk of Openstack entities.
func (*OpenstackClient) Delete ¶
func (c *OpenstackClient) Delete() *OpenstackDelete
Delete returns a delete builder for Openstack.
func (*OpenstackClient) DeleteOne ¶
func (c *OpenstackClient) DeleteOne(o *Openstack) *OpenstackDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OpenstackClient) DeleteOneID ¶
func (c *OpenstackClient) DeleteOneID(id int) *OpenstackDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OpenstackClient) GetX ¶
func (c *OpenstackClient) GetX(ctx context.Context, id int) *Openstack
GetX is like Get, but panics if an error occurs.
func (*OpenstackClient) Hooks ¶
func (c *OpenstackClient) Hooks() []Hook
Hooks returns the client hooks.
func (*OpenstackClient) Intercept ¶
func (c *OpenstackClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `openstack.Intercept(f(g(h())))`.
func (*OpenstackClient) Interceptors ¶
func (c *OpenstackClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OpenstackClient) MapCreateBulk ¶
func (c *OpenstackClient) MapCreateBulk(slice any, setFunc func(*OpenstackCreate, int)) *OpenstackCreateBulk
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 (*OpenstackClient) Query ¶
func (c *OpenstackClient) Query() *OpenstackQuery
Query returns a query builder for Openstack.
func (*OpenstackClient) QueryUser ¶
func (c *OpenstackClient) QueryUser(o *Openstack) *UserQuery
QueryUser queries the user edge of a Openstack.
func (*OpenstackClient) Update ¶
func (c *OpenstackClient) Update() *OpenstackUpdate
Update returns an update builder for Openstack.
func (*OpenstackClient) UpdateOne ¶
func (c *OpenstackClient) UpdateOne(o *Openstack) *OpenstackUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OpenstackClient) UpdateOneID ¶
func (c *OpenstackClient) UpdateOneID(id int) *OpenstackUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OpenstackClient) Use ¶
func (c *OpenstackClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `openstack.Hooks(f(g(h())))`.
type OpenstackCreate ¶
type OpenstackCreate struct {
// contains filtered or unexported fields
}
OpenstackCreate is the builder for creating a Openstack entity.
func (*OpenstackCreate) Exec ¶
func (oc *OpenstackCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenstackCreate) ExecX ¶
func (oc *OpenstackCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenstackCreate) Mutation ¶
func (oc *OpenstackCreate) Mutation() *OpenstackMutation
Mutation returns the OpenstackMutation object of the builder.
func (*OpenstackCreate) Save ¶
func (oc *OpenstackCreate) Save(ctx context.Context) (*Openstack, error)
Save creates the Openstack in the database.
func (*OpenstackCreate) SaveX ¶
func (oc *OpenstackCreate) SaveX(ctx context.Context) *Openstack
SaveX calls Save and panics if Save returns an error.
func (*OpenstackCreate) SetNillableTimestamp ¶
func (oc *OpenstackCreate) SetNillableTimestamp(t *time.Time) *OpenstackCreate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*OpenstackCreate) SetNillableUserID ¶
func (oc *OpenstackCreate) SetNillableUserID(id *string) *OpenstackCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*OpenstackCreate) SetTimestamp ¶
func (oc *OpenstackCreate) SetTimestamp(t time.Time) *OpenstackCreate
SetTimestamp sets the "timestamp" field.
func (*OpenstackCreate) SetUser ¶
func (oc *OpenstackCreate) SetUser(u *User) *OpenstackCreate
SetUser sets the "user" edge to the User entity.
func (*OpenstackCreate) SetUserID ¶
func (oc *OpenstackCreate) SetUserID(id string) *OpenstackCreate
SetUserID sets the "user" edge to the User entity by ID.
type OpenstackCreateBulk ¶
type OpenstackCreateBulk struct {
// contains filtered or unexported fields
}
OpenstackCreateBulk is the builder for creating many Openstack entities in bulk.
func (*OpenstackCreateBulk) Exec ¶
func (ocb *OpenstackCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenstackCreateBulk) ExecX ¶
func (ocb *OpenstackCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type OpenstackDelete ¶
type OpenstackDelete struct {
// contains filtered or unexported fields
}
OpenstackDelete is the builder for deleting a Openstack entity.
func (*OpenstackDelete) Exec ¶
func (od *OpenstackDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OpenstackDelete) ExecX ¶
func (od *OpenstackDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OpenstackDelete) Where ¶
func (od *OpenstackDelete) Where(ps ...predicate.Openstack) *OpenstackDelete
Where appends a list predicates to the OpenstackDelete builder.
type OpenstackDeleteOne ¶
type OpenstackDeleteOne struct {
// contains filtered or unexported fields
}
OpenstackDeleteOne is the builder for deleting a single Openstack entity.
func (*OpenstackDeleteOne) Exec ¶
func (odo *OpenstackDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OpenstackDeleteOne) ExecX ¶
func (odo *OpenstackDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenstackDeleteOne) Where ¶
func (odo *OpenstackDeleteOne) Where(ps ...predicate.Openstack) *OpenstackDeleteOne
Where appends a list predicates to the OpenstackDelete builder.
type OpenstackEdges ¶
type OpenstackEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
OpenstackEdges holds the relations/edges for other nodes in the graph.
func (OpenstackEdges) UserOrErr ¶
func (e OpenstackEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type OpenstackGroupBy ¶
type OpenstackGroupBy struct {
// contains filtered or unexported fields
}
OpenstackGroupBy is the group-by builder for Openstack entities.
func (*OpenstackGroupBy) Aggregate ¶
func (ogb *OpenstackGroupBy) Aggregate(fns ...AggregateFunc) *OpenstackGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OpenstackGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OpenstackGroupBy) Scan ¶
func (ogb *OpenstackGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OpenstackGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OpenstackMutation ¶
type OpenstackMutation struct {
// contains filtered or unexported fields
}
OpenstackMutation represents an operation that mutates the Openstack nodes in the graph.
func (*OpenstackMutation) AddField ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) AddedEdges ¶
func (m *OpenstackMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OpenstackMutation) AddedField ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) AddedFields ¶
func (m *OpenstackMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OpenstackMutation) AddedIDs ¶
func (m *OpenstackMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OpenstackMutation) ClearEdge ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ClearField ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ClearUser ¶
func (m *OpenstackMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*OpenstackMutation) ClearedEdges ¶
func (m *OpenstackMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OpenstackMutation) ClearedFields ¶
func (m *OpenstackMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OpenstackMutation) Client ¶
func (m OpenstackMutation) 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 (*OpenstackMutation) EdgeCleared ¶
func (m *OpenstackMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OpenstackMutation) Field ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) FieldCleared ¶
func (m *OpenstackMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OpenstackMutation) Fields ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ID ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) IDs ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) 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 (*OpenstackMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Openstack entity. If the Openstack 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 (*OpenstackMutation) RemovedEdges ¶
func (m *OpenstackMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OpenstackMutation) RemovedIDs ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ResetEdge ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ResetField ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) ResetTimestamp ¶
func (m *OpenstackMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*OpenstackMutation) ResetUser ¶
func (m *OpenstackMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*OpenstackMutation) SetField ¶
func (m *OpenstackMutation) 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 (*OpenstackMutation) SetOp ¶
func (m *OpenstackMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OpenstackMutation) SetTimestamp ¶
func (m *OpenstackMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*OpenstackMutation) SetUserID ¶
func (m *OpenstackMutation) SetUserID(id string)
SetUserID sets the "user" edge to the User entity by id.
func (*OpenstackMutation) Timestamp ¶
func (m *OpenstackMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (OpenstackMutation) Tx ¶
func (m OpenstackMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OpenstackMutation) Type ¶
func (m *OpenstackMutation) Type() string
Type returns the node type of this mutation (Openstack).
func (*OpenstackMutation) UserCleared ¶
func (m *OpenstackMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*OpenstackMutation) UserID ¶
func (m *OpenstackMutation) UserID() (id string, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*OpenstackMutation) UserIDs ¶
func (m *OpenstackMutation) UserIDs() (ids []string)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*OpenstackMutation) Where ¶
func (m *OpenstackMutation) Where(ps ...predicate.Openstack)
Where appends a list predicates to the OpenstackMutation builder.
func (*OpenstackMutation) WhereP ¶
func (m *OpenstackMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OpenstackMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OpenstackQuery ¶
type OpenstackQuery struct {
// contains filtered or unexported fields
}
OpenstackQuery is the builder for querying Openstack entities.
func (*OpenstackQuery) Aggregate ¶
func (oq *OpenstackQuery) Aggregate(fns ...AggregateFunc) *OpenstackSelect
Aggregate returns a OpenstackSelect configured with the given aggregations.
func (*OpenstackQuery) All ¶
func (oq *OpenstackQuery) All(ctx context.Context) ([]*Openstack, error)
All executes the query and returns a list of Openstacks.
func (*OpenstackQuery) AllX ¶
func (oq *OpenstackQuery) AllX(ctx context.Context) []*Openstack
AllX is like All, but panics if an error occurs.
func (*OpenstackQuery) Clone ¶
func (oq *OpenstackQuery) Clone() *OpenstackQuery
Clone returns a duplicate of the OpenstackQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OpenstackQuery) Count ¶
func (oq *OpenstackQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OpenstackQuery) CountX ¶
func (oq *OpenstackQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OpenstackQuery) Exist ¶
func (oq *OpenstackQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OpenstackQuery) ExistX ¶
func (oq *OpenstackQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OpenstackQuery) First ¶
func (oq *OpenstackQuery) First(ctx context.Context) (*Openstack, error)
First returns the first Openstack entity from the query. Returns a *NotFoundError when no Openstack was found.
func (*OpenstackQuery) FirstID ¶
func (oq *OpenstackQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Openstack ID from the query. Returns a *NotFoundError when no Openstack ID was found.
func (*OpenstackQuery) FirstIDX ¶
func (oq *OpenstackQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*OpenstackQuery) FirstX ¶
func (oq *OpenstackQuery) FirstX(ctx context.Context) *Openstack
FirstX is like First, but panics if an error occurs.
func (*OpenstackQuery) GroupBy ¶
func (oq *OpenstackQuery) GroupBy(field string, fields ...string) *OpenstackGroupBy
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 { Timestamp time.Time `json:"timestamp,omitempty"` Count int `json:"count,omitempty"` } client.Openstack.Query(). GroupBy(openstack.FieldTimestamp). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OpenstackQuery) IDs ¶
func (oq *OpenstackQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Openstack IDs.
func (*OpenstackQuery) IDsX ¶
func (oq *OpenstackQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*OpenstackQuery) Limit ¶
func (oq *OpenstackQuery) Limit(limit int) *OpenstackQuery
Limit the number of records to be returned by this query.
func (*OpenstackQuery) Offset ¶
func (oq *OpenstackQuery) Offset(offset int) *OpenstackQuery
Offset to start from.
func (*OpenstackQuery) Only ¶
func (oq *OpenstackQuery) Only(ctx context.Context) (*Openstack, error)
Only returns a single Openstack entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Openstack entity is found. Returns a *NotFoundError when no Openstack entities are found.
func (*OpenstackQuery) OnlyID ¶
func (oq *OpenstackQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Openstack ID in the query. Returns a *NotSingularError when more than one Openstack ID is found. Returns a *NotFoundError when no entities are found.
func (*OpenstackQuery) OnlyIDX ¶
func (oq *OpenstackQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OpenstackQuery) OnlyX ¶
func (oq *OpenstackQuery) OnlyX(ctx context.Context) *Openstack
OnlyX is like Only, but panics if an error occurs.
func (*OpenstackQuery) Order ¶
func (oq *OpenstackQuery) Order(o ...openstack.OrderOption) *OpenstackQuery
Order specifies how the records should be ordered.
func (*OpenstackQuery) QueryUser ¶
func (oq *OpenstackQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*OpenstackQuery) Select ¶
func (oq *OpenstackQuery) Select(fields ...string) *OpenstackSelect
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 { Timestamp time.Time `json:"timestamp,omitempty"` } client.Openstack.Query(). Select(openstack.FieldTimestamp). Scan(ctx, &v)
func (*OpenstackQuery) Unique ¶
func (oq *OpenstackQuery) Unique(unique bool) *OpenstackQuery
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 (*OpenstackQuery) Where ¶
func (oq *OpenstackQuery) Where(ps ...predicate.Openstack) *OpenstackQuery
Where adds a new predicate for the OpenstackQuery builder.
func (*OpenstackQuery) WithUser ¶
func (oq *OpenstackQuery) WithUser(opts ...func(*UserQuery)) *OpenstackQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type OpenstackSelect ¶
type OpenstackSelect struct { *OpenstackQuery // contains filtered or unexported fields }
OpenstackSelect is the builder for selecting fields of Openstack entities.
func (*OpenstackSelect) Aggregate ¶
func (os *OpenstackSelect) Aggregate(fns ...AggregateFunc) *OpenstackSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OpenstackSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OpenstackSelect) Scan ¶
func (os *OpenstackSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OpenstackSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OpenstackUpdate ¶
type OpenstackUpdate struct {
// contains filtered or unexported fields
}
OpenstackUpdate is the builder for updating Openstack entities.
func (*OpenstackUpdate) ClearUser ¶
func (ou *OpenstackUpdate) ClearUser() *OpenstackUpdate
ClearUser clears the "user" edge to the User entity.
func (*OpenstackUpdate) Exec ¶
func (ou *OpenstackUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OpenstackUpdate) ExecX ¶
func (ou *OpenstackUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenstackUpdate) Mutation ¶
func (ou *OpenstackUpdate) Mutation() *OpenstackMutation
Mutation returns the OpenstackMutation object of the builder.
func (*OpenstackUpdate) Save ¶
func (ou *OpenstackUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OpenstackUpdate) SaveX ¶
func (ou *OpenstackUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OpenstackUpdate) SetNillableTimestamp ¶
func (ou *OpenstackUpdate) SetNillableTimestamp(t *time.Time) *OpenstackUpdate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*OpenstackUpdate) SetNillableUserID ¶
func (ou *OpenstackUpdate) SetNillableUserID(id *string) *OpenstackUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*OpenstackUpdate) SetTimestamp ¶
func (ou *OpenstackUpdate) SetTimestamp(t time.Time) *OpenstackUpdate
SetTimestamp sets the "timestamp" field.
func (*OpenstackUpdate) SetUser ¶
func (ou *OpenstackUpdate) SetUser(u *User) *OpenstackUpdate
SetUser sets the "user" edge to the User entity.
func (*OpenstackUpdate) SetUserID ¶
func (ou *OpenstackUpdate) SetUserID(id string) *OpenstackUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*OpenstackUpdate) Where ¶
func (ou *OpenstackUpdate) Where(ps ...predicate.Openstack) *OpenstackUpdate
Where appends a list predicates to the OpenstackUpdate builder.
type OpenstackUpdateOne ¶
type OpenstackUpdateOne struct {
// contains filtered or unexported fields
}
OpenstackUpdateOne is the builder for updating a single Openstack entity.
func (*OpenstackUpdateOne) ClearUser ¶
func (ouo *OpenstackUpdateOne) ClearUser() *OpenstackUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*OpenstackUpdateOne) Exec ¶
func (ouo *OpenstackUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OpenstackUpdateOne) ExecX ¶
func (ouo *OpenstackUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OpenstackUpdateOne) Mutation ¶
func (ouo *OpenstackUpdateOne) Mutation() *OpenstackMutation
Mutation returns the OpenstackMutation object of the builder.
func (*OpenstackUpdateOne) Save ¶
func (ouo *OpenstackUpdateOne) Save(ctx context.Context) (*Openstack, error)
Save executes the query and returns the updated Openstack entity.
func (*OpenstackUpdateOne) SaveX ¶
func (ouo *OpenstackUpdateOne) SaveX(ctx context.Context) *Openstack
SaveX is like Save, but panics if an error occurs.
func (*OpenstackUpdateOne) Select ¶
func (ouo *OpenstackUpdateOne) Select(field string, fields ...string) *OpenstackUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OpenstackUpdateOne) SetNillableTimestamp ¶
func (ouo *OpenstackUpdateOne) SetNillableTimestamp(t *time.Time) *OpenstackUpdateOne
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*OpenstackUpdateOne) SetNillableUserID ¶
func (ouo *OpenstackUpdateOne) SetNillableUserID(id *string) *OpenstackUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*OpenstackUpdateOne) SetTimestamp ¶
func (ouo *OpenstackUpdateOne) SetTimestamp(t time.Time) *OpenstackUpdateOne
SetTimestamp sets the "timestamp" field.
func (*OpenstackUpdateOne) SetUser ¶
func (ouo *OpenstackUpdateOne) SetUser(u *User) *OpenstackUpdateOne
SetUser sets the "user" edge to the User entity.
func (*OpenstackUpdateOne) SetUserID ¶
func (ouo *OpenstackUpdateOne) SetUserID(id string) *OpenstackUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*OpenstackUpdateOne) Where ¶
func (ouo *OpenstackUpdateOne) Where(ps ...predicate.Openstack) *OpenstackUpdateOne
Where appends a list predicates to the OpenstackUpdate builder.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Shitpost ¶
type Shitpost struct { // ID of the ent. // Message ID ID string `json:"id,omitempty"` // Channel ID ChannelID string `json:"channel_id,omitempty"` // Shitpost Count Count int `json:"count,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ShitpostQuery when eager-loading is set. Edges ShitpostEdges `json:"edges"` // contains filtered or unexported fields }
Shitpost is the model entity for the Shitpost schema.
func (*Shitpost) Unwrap ¶
Unwrap unwraps the Shitpost 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 (*Shitpost) Update ¶
func (s *Shitpost) Update() *ShitpostUpdateOne
Update returns a builder for updating this Shitpost. Note that you need to call Shitpost.Unwrap() before calling this method if this Shitpost was returned from a transaction, and the transaction was committed or rolled back.
type ShitpostClient ¶
type ShitpostClient struct {
// contains filtered or unexported fields
}
ShitpostClient is a client for the Shitpost schema.
func NewShitpostClient ¶
func NewShitpostClient(c config) *ShitpostClient
NewShitpostClient returns a client for the Shitpost from the given config.
func (*ShitpostClient) Create ¶
func (c *ShitpostClient) Create() *ShitpostCreate
Create returns a builder for creating a Shitpost entity.
func (*ShitpostClient) CreateBulk ¶
func (c *ShitpostClient) CreateBulk(builders ...*ShitpostCreate) *ShitpostCreateBulk
CreateBulk returns a builder for creating a bulk of Shitpost entities.
func (*ShitpostClient) Delete ¶
func (c *ShitpostClient) Delete() *ShitpostDelete
Delete returns a delete builder for Shitpost.
func (*ShitpostClient) DeleteOne ¶
func (c *ShitpostClient) DeleteOne(s *Shitpost) *ShitpostDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ShitpostClient) DeleteOneID ¶
func (c *ShitpostClient) DeleteOneID(id string) *ShitpostDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ShitpostClient) GetX ¶
func (c *ShitpostClient) GetX(ctx context.Context, id string) *Shitpost
GetX is like Get, but panics if an error occurs.
func (*ShitpostClient) Hooks ¶
func (c *ShitpostClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ShitpostClient) Intercept ¶
func (c *ShitpostClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shitpost.Intercept(f(g(h())))`.
func (*ShitpostClient) Interceptors ¶
func (c *ShitpostClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ShitpostClient) MapCreateBulk ¶
func (c *ShitpostClient) MapCreateBulk(slice any, setFunc func(*ShitpostCreate, int)) *ShitpostCreateBulk
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 (*ShitpostClient) Query ¶
func (c *ShitpostClient) Query() *ShitpostQuery
Query returns a query builder for Shitpost.
func (*ShitpostClient) QueryUser ¶
func (c *ShitpostClient) QueryUser(s *Shitpost) *UserQuery
QueryUser queries the user edge of a Shitpost.
func (*ShitpostClient) Update ¶
func (c *ShitpostClient) Update() *ShitpostUpdate
Update returns an update builder for Shitpost.
func (*ShitpostClient) UpdateOne ¶
func (c *ShitpostClient) UpdateOne(s *Shitpost) *ShitpostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ShitpostClient) UpdateOneID ¶
func (c *ShitpostClient) UpdateOneID(id string) *ShitpostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ShitpostClient) Use ¶
func (c *ShitpostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shitpost.Hooks(f(g(h())))`.
type ShitpostCreate ¶
type ShitpostCreate struct {
// contains filtered or unexported fields
}
ShitpostCreate is the builder for creating a Shitpost entity.
func (*ShitpostCreate) Exec ¶
func (sc *ShitpostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ShitpostCreate) ExecX ¶
func (sc *ShitpostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ShitpostCreate) Mutation ¶
func (sc *ShitpostCreate) Mutation() *ShitpostMutation
Mutation returns the ShitpostMutation object of the builder.
func (*ShitpostCreate) Save ¶
func (sc *ShitpostCreate) Save(ctx context.Context) (*Shitpost, error)
Save creates the Shitpost in the database.
func (*ShitpostCreate) SaveX ¶
func (sc *ShitpostCreate) SaveX(ctx context.Context) *Shitpost
SaveX calls Save and panics if Save returns an error.
func (*ShitpostCreate) SetChannelID ¶
func (sc *ShitpostCreate) SetChannelID(s string) *ShitpostCreate
SetChannelID sets the "channel_id" field.
func (*ShitpostCreate) SetCount ¶
func (sc *ShitpostCreate) SetCount(i int) *ShitpostCreate
SetCount sets the "count" field.
func (*ShitpostCreate) SetID ¶
func (sc *ShitpostCreate) SetID(s string) *ShitpostCreate
SetID sets the "id" field.
func (*ShitpostCreate) SetNillableUserID ¶
func (sc *ShitpostCreate) SetNillableUserID(id *string) *ShitpostCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*ShitpostCreate) SetUser ¶
func (sc *ShitpostCreate) SetUser(u *User) *ShitpostCreate
SetUser sets the "user" edge to the User entity.
func (*ShitpostCreate) SetUserID ¶
func (sc *ShitpostCreate) SetUserID(id string) *ShitpostCreate
SetUserID sets the "user" edge to the User entity by ID.
type ShitpostCreateBulk ¶
type ShitpostCreateBulk struct {
// contains filtered or unexported fields
}
ShitpostCreateBulk is the builder for creating many Shitpost entities in bulk.
func (*ShitpostCreateBulk) Exec ¶
func (scb *ShitpostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ShitpostCreateBulk) ExecX ¶
func (scb *ShitpostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ShitpostDelete ¶
type ShitpostDelete struct {
// contains filtered or unexported fields
}
ShitpostDelete is the builder for deleting a Shitpost entity.
func (*ShitpostDelete) Exec ¶
func (sd *ShitpostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ShitpostDelete) ExecX ¶
func (sd *ShitpostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ShitpostDelete) Where ¶
func (sd *ShitpostDelete) Where(ps ...predicate.Shitpost) *ShitpostDelete
Where appends a list predicates to the ShitpostDelete builder.
type ShitpostDeleteOne ¶
type ShitpostDeleteOne struct {
// contains filtered or unexported fields
}
ShitpostDeleteOne is the builder for deleting a single Shitpost entity.
func (*ShitpostDeleteOne) Exec ¶
func (sdo *ShitpostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ShitpostDeleteOne) ExecX ¶
func (sdo *ShitpostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ShitpostDeleteOne) Where ¶
func (sdo *ShitpostDeleteOne) Where(ps ...predicate.Shitpost) *ShitpostDeleteOne
Where appends a list predicates to the ShitpostDelete builder.
type ShitpostEdges ¶
type ShitpostEdges struct { // Shitpost Author User *User `json:"user,omitempty"` // contains filtered or unexported fields }
ShitpostEdges holds the relations/edges for other nodes in the graph.
func (ShitpostEdges) UserOrErr ¶
func (e ShitpostEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ShitpostGroupBy ¶
type ShitpostGroupBy struct {
// contains filtered or unexported fields
}
ShitpostGroupBy is the group-by builder for Shitpost entities.
func (*ShitpostGroupBy) Aggregate ¶
func (sgb *ShitpostGroupBy) Aggregate(fns ...AggregateFunc) *ShitpostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ShitpostGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ShitpostGroupBy) Scan ¶
func (sgb *ShitpostGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ShitpostGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ShitpostMutation ¶
type ShitpostMutation struct {
// contains filtered or unexported fields
}
ShitpostMutation represents an operation that mutates the Shitpost nodes in the graph.
func (*ShitpostMutation) AddCount ¶
func (m *ShitpostMutation) AddCount(i int)
AddCount adds i to the "count" field.
func (*ShitpostMutation) AddField ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) AddedCount ¶
func (m *ShitpostMutation) AddedCount() (r int, exists bool)
AddedCount returns the value that was added to the "count" field in this mutation.
func (*ShitpostMutation) AddedEdges ¶
func (m *ShitpostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ShitpostMutation) AddedField ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) AddedFields ¶
func (m *ShitpostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ShitpostMutation) AddedIDs ¶
func (m *ShitpostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ShitpostMutation) ChannelID ¶
func (m *ShitpostMutation) ChannelID() (r string, exists bool)
ChannelID returns the value of the "channel_id" field in the mutation.
func (*ShitpostMutation) ClearEdge ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ClearField ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ClearUser ¶
func (m *ShitpostMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ShitpostMutation) ClearedEdges ¶
func (m *ShitpostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ShitpostMutation) ClearedFields ¶
func (m *ShitpostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ShitpostMutation) Client ¶
func (m ShitpostMutation) 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 (*ShitpostMutation) Count ¶
func (m *ShitpostMutation) Count() (r int, exists bool)
Count returns the value of the "count" field in the mutation.
func (*ShitpostMutation) EdgeCleared ¶
func (m *ShitpostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ShitpostMutation) Field ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) FieldCleared ¶
func (m *ShitpostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ShitpostMutation) Fields ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ID ¶
func (m *ShitpostMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ShitpostMutation) IDs ¶
func (m *ShitpostMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ShitpostMutation) OldChannelID ¶
func (m *ShitpostMutation) OldChannelID(ctx context.Context) (v string, err error)
OldChannelID returns the old "channel_id" field's value of the Shitpost entity. If the Shitpost 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 (*ShitpostMutation) OldCount ¶
func (m *ShitpostMutation) OldCount(ctx context.Context) (v int, err error)
OldCount returns the old "count" field's value of the Shitpost entity. If the Shitpost 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 (*ShitpostMutation) 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 (*ShitpostMutation) RemovedEdges ¶
func (m *ShitpostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ShitpostMutation) RemovedIDs ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ResetChannelID ¶
func (m *ShitpostMutation) ResetChannelID()
ResetChannelID resets all changes to the "channel_id" field.
func (*ShitpostMutation) ResetCount ¶
func (m *ShitpostMutation) ResetCount()
ResetCount resets all changes to the "count" field.
func (*ShitpostMutation) ResetEdge ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ResetField ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) ResetUser ¶
func (m *ShitpostMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ShitpostMutation) SetChannelID ¶
func (m *ShitpostMutation) SetChannelID(s string)
SetChannelID sets the "channel_id" field.
func (*ShitpostMutation) SetCount ¶
func (m *ShitpostMutation) SetCount(i int)
SetCount sets the "count" field.
func (*ShitpostMutation) SetField ¶
func (m *ShitpostMutation) 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 (*ShitpostMutation) SetID ¶
func (m *ShitpostMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Shitpost entities.
func (*ShitpostMutation) SetOp ¶
func (m *ShitpostMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ShitpostMutation) SetUserID ¶
func (m *ShitpostMutation) SetUserID(id string)
SetUserID sets the "user" edge to the User entity by id.
func (ShitpostMutation) Tx ¶
func (m ShitpostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ShitpostMutation) Type ¶
func (m *ShitpostMutation) Type() string
Type returns the node type of this mutation (Shitpost).
func (*ShitpostMutation) UserCleared ¶
func (m *ShitpostMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ShitpostMutation) UserID ¶
func (m *ShitpostMutation) UserID() (id string, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*ShitpostMutation) UserIDs ¶
func (m *ShitpostMutation) UserIDs() (ids []string)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*ShitpostMutation) Where ¶
func (m *ShitpostMutation) Where(ps ...predicate.Shitpost)
Where appends a list predicates to the ShitpostMutation builder.
func (*ShitpostMutation) WhereP ¶
func (m *ShitpostMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ShitpostMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ShitpostQuery ¶
type ShitpostQuery struct {
// contains filtered or unexported fields
}
ShitpostQuery is the builder for querying Shitpost entities.
func (*ShitpostQuery) Aggregate ¶
func (sq *ShitpostQuery) Aggregate(fns ...AggregateFunc) *ShitpostSelect
Aggregate returns a ShitpostSelect configured with the given aggregations.
func (*ShitpostQuery) All ¶
func (sq *ShitpostQuery) All(ctx context.Context) ([]*Shitpost, error)
All executes the query and returns a list of Shitposts.
func (*ShitpostQuery) AllX ¶
func (sq *ShitpostQuery) AllX(ctx context.Context) []*Shitpost
AllX is like All, but panics if an error occurs.
func (*ShitpostQuery) Clone ¶
func (sq *ShitpostQuery) Clone() *ShitpostQuery
Clone returns a duplicate of the ShitpostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ShitpostQuery) Count ¶
func (sq *ShitpostQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ShitpostQuery) CountX ¶
func (sq *ShitpostQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ShitpostQuery) Exist ¶
func (sq *ShitpostQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ShitpostQuery) ExistX ¶
func (sq *ShitpostQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ShitpostQuery) First ¶
func (sq *ShitpostQuery) First(ctx context.Context) (*Shitpost, error)
First returns the first Shitpost entity from the query. Returns a *NotFoundError when no Shitpost was found.
func (*ShitpostQuery) FirstID ¶
func (sq *ShitpostQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Shitpost ID from the query. Returns a *NotFoundError when no Shitpost ID was found.
func (*ShitpostQuery) FirstIDX ¶
func (sq *ShitpostQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*ShitpostQuery) FirstX ¶
func (sq *ShitpostQuery) FirstX(ctx context.Context) *Shitpost
FirstX is like First, but panics if an error occurs.
func (*ShitpostQuery) GroupBy ¶
func (sq *ShitpostQuery) GroupBy(field string, fields ...string) *ShitpostGroupBy
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 { ChannelID string `json:"channel_id,omitempty"` Count int `json:"count,omitempty"` } client.Shitpost.Query(). GroupBy(shitpost.FieldChannelID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ShitpostQuery) IDs ¶
func (sq *ShitpostQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Shitpost IDs.
func (*ShitpostQuery) IDsX ¶
func (sq *ShitpostQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*ShitpostQuery) Limit ¶
func (sq *ShitpostQuery) Limit(limit int) *ShitpostQuery
Limit the number of records to be returned by this query.
func (*ShitpostQuery) Offset ¶
func (sq *ShitpostQuery) Offset(offset int) *ShitpostQuery
Offset to start from.
func (*ShitpostQuery) Only ¶
func (sq *ShitpostQuery) Only(ctx context.Context) (*Shitpost, error)
Only returns a single Shitpost entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Shitpost entity is found. Returns a *NotFoundError when no Shitpost entities are found.
func (*ShitpostQuery) OnlyID ¶
func (sq *ShitpostQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Shitpost ID in the query. Returns a *NotSingularError when more than one Shitpost ID is found. Returns a *NotFoundError when no entities are found.
func (*ShitpostQuery) OnlyIDX ¶
func (sq *ShitpostQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ShitpostQuery) OnlyX ¶
func (sq *ShitpostQuery) OnlyX(ctx context.Context) *Shitpost
OnlyX is like Only, but panics if an error occurs.
func (*ShitpostQuery) Order ¶
func (sq *ShitpostQuery) Order(o ...shitpost.OrderOption) *ShitpostQuery
Order specifies how the records should be ordered.
func (*ShitpostQuery) QueryUser ¶
func (sq *ShitpostQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ShitpostQuery) Select ¶
func (sq *ShitpostQuery) Select(fields ...string) *ShitpostSelect
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 { ChannelID string `json:"channel_id,omitempty"` } client.Shitpost.Query(). Select(shitpost.FieldChannelID). Scan(ctx, &v)
func (*ShitpostQuery) Unique ¶
func (sq *ShitpostQuery) Unique(unique bool) *ShitpostQuery
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 (*ShitpostQuery) Where ¶
func (sq *ShitpostQuery) Where(ps ...predicate.Shitpost) *ShitpostQuery
Where adds a new predicate for the ShitpostQuery builder.
func (*ShitpostQuery) WithUser ¶
func (sq *ShitpostQuery) WithUser(opts ...func(*UserQuery)) *ShitpostQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type ShitpostSelect ¶
type ShitpostSelect struct { *ShitpostQuery // contains filtered or unexported fields }
ShitpostSelect is the builder for selecting fields of Shitpost entities.
func (*ShitpostSelect) Aggregate ¶
func (ss *ShitpostSelect) Aggregate(fns ...AggregateFunc) *ShitpostSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ShitpostSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ShitpostSelect) Scan ¶
func (ss *ShitpostSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ShitpostSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ShitpostUpdate ¶
type ShitpostUpdate struct {
// contains filtered or unexported fields
}
ShitpostUpdate is the builder for updating Shitpost entities.
func (*ShitpostUpdate) AddCount ¶
func (su *ShitpostUpdate) AddCount(i int) *ShitpostUpdate
AddCount adds i to the "count" field.
func (*ShitpostUpdate) ClearUser ¶
func (su *ShitpostUpdate) ClearUser() *ShitpostUpdate
ClearUser clears the "user" edge to the User entity.
func (*ShitpostUpdate) Exec ¶
func (su *ShitpostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ShitpostUpdate) ExecX ¶
func (su *ShitpostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ShitpostUpdate) Mutation ¶
func (su *ShitpostUpdate) Mutation() *ShitpostMutation
Mutation returns the ShitpostMutation object of the builder.
func (*ShitpostUpdate) Save ¶
func (su *ShitpostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ShitpostUpdate) SaveX ¶
func (su *ShitpostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ShitpostUpdate) SetChannelID ¶
func (su *ShitpostUpdate) SetChannelID(s string) *ShitpostUpdate
SetChannelID sets the "channel_id" field.
func (*ShitpostUpdate) SetCount ¶
func (su *ShitpostUpdate) SetCount(i int) *ShitpostUpdate
SetCount sets the "count" field.
func (*ShitpostUpdate) SetNillableChannelID ¶
func (su *ShitpostUpdate) SetNillableChannelID(s *string) *ShitpostUpdate
SetNillableChannelID sets the "channel_id" field if the given value is not nil.
func (*ShitpostUpdate) SetNillableCount ¶
func (su *ShitpostUpdate) SetNillableCount(i *int) *ShitpostUpdate
SetNillableCount sets the "count" field if the given value is not nil.
func (*ShitpostUpdate) SetNillableUserID ¶
func (su *ShitpostUpdate) SetNillableUserID(id *string) *ShitpostUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*ShitpostUpdate) SetUser ¶
func (su *ShitpostUpdate) SetUser(u *User) *ShitpostUpdate
SetUser sets the "user" edge to the User entity.
func (*ShitpostUpdate) SetUserID ¶
func (su *ShitpostUpdate) SetUserID(id string) *ShitpostUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*ShitpostUpdate) Where ¶
func (su *ShitpostUpdate) Where(ps ...predicate.Shitpost) *ShitpostUpdate
Where appends a list predicates to the ShitpostUpdate builder.
type ShitpostUpdateOne ¶
type ShitpostUpdateOne struct {
// contains filtered or unexported fields
}
ShitpostUpdateOne is the builder for updating a single Shitpost entity.
func (*ShitpostUpdateOne) AddCount ¶
func (suo *ShitpostUpdateOne) AddCount(i int) *ShitpostUpdateOne
AddCount adds i to the "count" field.
func (*ShitpostUpdateOne) ClearUser ¶
func (suo *ShitpostUpdateOne) ClearUser() *ShitpostUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ShitpostUpdateOne) Exec ¶
func (suo *ShitpostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ShitpostUpdateOne) ExecX ¶
func (suo *ShitpostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ShitpostUpdateOne) Mutation ¶
func (suo *ShitpostUpdateOne) Mutation() *ShitpostMutation
Mutation returns the ShitpostMutation object of the builder.
func (*ShitpostUpdateOne) Save ¶
func (suo *ShitpostUpdateOne) Save(ctx context.Context) (*Shitpost, error)
Save executes the query and returns the updated Shitpost entity.
func (*ShitpostUpdateOne) SaveX ¶
func (suo *ShitpostUpdateOne) SaveX(ctx context.Context) *Shitpost
SaveX is like Save, but panics if an error occurs.
func (*ShitpostUpdateOne) Select ¶
func (suo *ShitpostUpdateOne) Select(field string, fields ...string) *ShitpostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ShitpostUpdateOne) SetChannelID ¶
func (suo *ShitpostUpdateOne) SetChannelID(s string) *ShitpostUpdateOne
SetChannelID sets the "channel_id" field.
func (*ShitpostUpdateOne) SetCount ¶
func (suo *ShitpostUpdateOne) SetCount(i int) *ShitpostUpdateOne
SetCount sets the "count" field.
func (*ShitpostUpdateOne) SetNillableChannelID ¶
func (suo *ShitpostUpdateOne) SetNillableChannelID(s *string) *ShitpostUpdateOne
SetNillableChannelID sets the "channel_id" field if the given value is not nil.
func (*ShitpostUpdateOne) SetNillableCount ¶
func (suo *ShitpostUpdateOne) SetNillableCount(i *int) *ShitpostUpdateOne
SetNillableCount sets the "count" field if the given value is not nil.
func (*ShitpostUpdateOne) SetNillableUserID ¶
func (suo *ShitpostUpdateOne) SetNillableUserID(id *string) *ShitpostUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*ShitpostUpdateOne) SetUser ¶
func (suo *ShitpostUpdateOne) SetUser(u *User) *ShitpostUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ShitpostUpdateOne) SetUserID ¶
func (suo *ShitpostUpdateOne) SetUserID(id string) *ShitpostUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*ShitpostUpdateOne) Where ¶
func (suo *ShitpostUpdateOne) Where(ps ...predicate.Shitpost) *ShitpostUpdateOne
Where appends a list predicates to the ShitpostUpdate builder.
type Signin ¶
type Signin struct { // ID of the ent. ID int `json:"id,omitempty"` // Time of signin Timestamp time.Time `json:"timestamp,omitempty"` // Type of signin Type signin.Type `json:"type,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SigninQuery when eager-loading is set. Edges SigninEdges `json:"edges"` // contains filtered or unexported fields }
Signin is the model entity for the Signin schema.
func (*Signin) Unwrap ¶
Unwrap unwraps the Signin 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 (*Signin) Update ¶
func (s *Signin) Update() *SigninUpdateOne
Update returns a builder for updating this Signin. Note that you need to call Signin.Unwrap() before calling this method if this Signin was returned from a transaction, and the transaction was committed or rolled back.
type SigninClient ¶
type SigninClient struct {
// contains filtered or unexported fields
}
SigninClient is a client for the Signin schema.
func NewSigninClient ¶
func NewSigninClient(c config) *SigninClient
NewSigninClient returns a client for the Signin from the given config.
func (*SigninClient) Create ¶
func (c *SigninClient) Create() *SigninCreate
Create returns a builder for creating a Signin entity.
func (*SigninClient) CreateBulk ¶
func (c *SigninClient) CreateBulk(builders ...*SigninCreate) *SigninCreateBulk
CreateBulk returns a builder for creating a bulk of Signin entities.
func (*SigninClient) Delete ¶
func (c *SigninClient) Delete() *SigninDelete
Delete returns a delete builder for Signin.
func (*SigninClient) DeleteOne ¶
func (c *SigninClient) DeleteOne(s *Signin) *SigninDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SigninClient) DeleteOneID ¶
func (c *SigninClient) DeleteOneID(id int) *SigninDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SigninClient) GetX ¶
func (c *SigninClient) GetX(ctx context.Context, id int) *Signin
GetX is like Get, but panics if an error occurs.
func (*SigninClient) Intercept ¶
func (c *SigninClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `signin.Intercept(f(g(h())))`.
func (*SigninClient) Interceptors ¶
func (c *SigninClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SigninClient) MapCreateBulk ¶
func (c *SigninClient) MapCreateBulk(slice any, setFunc func(*SigninCreate, int)) *SigninCreateBulk
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 (*SigninClient) Query ¶
func (c *SigninClient) Query() *SigninQuery
Query returns a query builder for Signin.
func (*SigninClient) QueryUser ¶
func (c *SigninClient) QueryUser(s *Signin) *UserQuery
QueryUser queries the user edge of a Signin.
func (*SigninClient) Update ¶
func (c *SigninClient) Update() *SigninUpdate
Update returns an update builder for Signin.
func (*SigninClient) UpdateOne ¶
func (c *SigninClient) UpdateOne(s *Signin) *SigninUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SigninClient) UpdateOneID ¶
func (c *SigninClient) UpdateOneID(id int) *SigninUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SigninClient) Use ¶
func (c *SigninClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `signin.Hooks(f(g(h())))`.
type SigninCreate ¶
type SigninCreate struct {
// contains filtered or unexported fields
}
SigninCreate is the builder for creating a Signin entity.
func (*SigninCreate) Exec ¶
func (sc *SigninCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SigninCreate) ExecX ¶
func (sc *SigninCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SigninCreate) Mutation ¶
func (sc *SigninCreate) Mutation() *SigninMutation
Mutation returns the SigninMutation object of the builder.
func (*SigninCreate) Save ¶
func (sc *SigninCreate) Save(ctx context.Context) (*Signin, error)
Save creates the Signin in the database.
func (*SigninCreate) SaveX ¶
func (sc *SigninCreate) SaveX(ctx context.Context) *Signin
SaveX calls Save and panics if Save returns an error.
func (*SigninCreate) SetNillableTimestamp ¶
func (sc *SigninCreate) SetNillableTimestamp(t *time.Time) *SigninCreate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*SigninCreate) SetTimestamp ¶
func (sc *SigninCreate) SetTimestamp(t time.Time) *SigninCreate
SetTimestamp sets the "timestamp" field.
func (*SigninCreate) SetType ¶
func (sc *SigninCreate) SetType(s signin.Type) *SigninCreate
SetType sets the "type" field.
func (*SigninCreate) SetUser ¶
func (sc *SigninCreate) SetUser(u *User) *SigninCreate
SetUser sets the "user" edge to the User entity.
func (*SigninCreate) SetUserID ¶
func (sc *SigninCreate) SetUserID(id string) *SigninCreate
SetUserID sets the "user" edge to the User entity by ID.
type SigninCreateBulk ¶
type SigninCreateBulk struct {
// contains filtered or unexported fields
}
SigninCreateBulk is the builder for creating many Signin entities in bulk.
func (*SigninCreateBulk) Exec ¶
func (scb *SigninCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SigninCreateBulk) ExecX ¶
func (scb *SigninCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SigninDelete ¶
type SigninDelete struct {
// contains filtered or unexported fields
}
SigninDelete is the builder for deleting a Signin entity.
func (*SigninDelete) Exec ¶
func (sd *SigninDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SigninDelete) ExecX ¶
func (sd *SigninDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SigninDelete) Where ¶
func (sd *SigninDelete) Where(ps ...predicate.Signin) *SigninDelete
Where appends a list predicates to the SigninDelete builder.
type SigninDeleteOne ¶
type SigninDeleteOne struct {
// contains filtered or unexported fields
}
SigninDeleteOne is the builder for deleting a single Signin entity.
func (*SigninDeleteOne) Exec ¶
func (sdo *SigninDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SigninDeleteOne) ExecX ¶
func (sdo *SigninDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SigninDeleteOne) Where ¶
func (sdo *SigninDeleteOne) Where(ps ...predicate.Signin) *SigninDeleteOne
Where appends a list predicates to the SigninDelete builder.
type SigninEdges ¶
type SigninEdges struct { // User who signed in User *User `json:"user,omitempty"` // contains filtered or unexported fields }
SigninEdges holds the relations/edges for other nodes in the graph.
func (SigninEdges) UserOrErr ¶
func (e SigninEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type SigninGroupBy ¶
type SigninGroupBy struct {
// contains filtered or unexported fields
}
SigninGroupBy is the group-by builder for Signin entities.
func (*SigninGroupBy) Aggregate ¶
func (sgb *SigninGroupBy) Aggregate(fns ...AggregateFunc) *SigninGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SigninGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SigninGroupBy) Scan ¶
func (sgb *SigninGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SigninGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SigninMutation ¶
type SigninMutation struct {
// contains filtered or unexported fields
}
SigninMutation represents an operation that mutates the Signin nodes in the graph.
func (*SigninMutation) AddField ¶
func (m *SigninMutation) 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 (*SigninMutation) AddedEdges ¶
func (m *SigninMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SigninMutation) AddedField ¶
func (m *SigninMutation) 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 (*SigninMutation) AddedFields ¶
func (m *SigninMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SigninMutation) AddedIDs ¶
func (m *SigninMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SigninMutation) ClearEdge ¶
func (m *SigninMutation) 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 (*SigninMutation) ClearField ¶
func (m *SigninMutation) 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 (*SigninMutation) ClearUser ¶
func (m *SigninMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*SigninMutation) ClearedEdges ¶
func (m *SigninMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SigninMutation) ClearedFields ¶
func (m *SigninMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SigninMutation) Client ¶
func (m SigninMutation) 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 (*SigninMutation) EdgeCleared ¶
func (m *SigninMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SigninMutation) Field ¶
func (m *SigninMutation) 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 (*SigninMutation) FieldCleared ¶
func (m *SigninMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SigninMutation) Fields ¶
func (m *SigninMutation) 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 (*SigninMutation) GetType ¶
func (m *SigninMutation) GetType() (r signin.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*SigninMutation) ID ¶
func (m *SigninMutation) 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 (*SigninMutation) IDs ¶
func (m *SigninMutation) 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 (*SigninMutation) 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 (*SigninMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Signin entity. If the Signin 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 (*SigninMutation) OldType ¶
OldType returns the old "type" field's value of the Signin entity. If the Signin 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 (*SigninMutation) RemovedEdges ¶
func (m *SigninMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SigninMutation) RemovedIDs ¶
func (m *SigninMutation) 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 (*SigninMutation) ResetEdge ¶
func (m *SigninMutation) 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 (*SigninMutation) ResetField ¶
func (m *SigninMutation) 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 (*SigninMutation) ResetTimestamp ¶
func (m *SigninMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*SigninMutation) ResetType ¶
func (m *SigninMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*SigninMutation) ResetUser ¶
func (m *SigninMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*SigninMutation) SetField ¶
func (m *SigninMutation) 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 (*SigninMutation) SetOp ¶
func (m *SigninMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SigninMutation) SetTimestamp ¶
func (m *SigninMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*SigninMutation) SetType ¶
func (m *SigninMutation) SetType(s signin.Type)
SetType sets the "type" field.
func (*SigninMutation) SetUserID ¶
func (m *SigninMutation) SetUserID(id string)
SetUserID sets the "user" edge to the User entity by id.
func (*SigninMutation) Timestamp ¶
func (m *SigninMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (SigninMutation) Tx ¶
func (m SigninMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SigninMutation) Type ¶
func (m *SigninMutation) Type() string
Type returns the node type of this mutation (Signin).
func (*SigninMutation) UserCleared ¶
func (m *SigninMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*SigninMutation) UserID ¶
func (m *SigninMutation) UserID() (id string, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*SigninMutation) UserIDs ¶
func (m *SigninMutation) UserIDs() (ids []string)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*SigninMutation) Where ¶
func (m *SigninMutation) Where(ps ...predicate.Signin)
Where appends a list predicates to the SigninMutation builder.
func (*SigninMutation) WhereP ¶
func (m *SigninMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SigninMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SigninQuery ¶
type SigninQuery struct {
// contains filtered or unexported fields
}
SigninQuery is the builder for querying Signin entities.
func (*SigninQuery) Aggregate ¶
func (sq *SigninQuery) Aggregate(fns ...AggregateFunc) *SigninSelect
Aggregate returns a SigninSelect configured with the given aggregations.
func (*SigninQuery) All ¶
func (sq *SigninQuery) All(ctx context.Context) ([]*Signin, error)
All executes the query and returns a list of Signins.
func (*SigninQuery) AllX ¶
func (sq *SigninQuery) AllX(ctx context.Context) []*Signin
AllX is like All, but panics if an error occurs.
func (*SigninQuery) Clone ¶
func (sq *SigninQuery) Clone() *SigninQuery
Clone returns a duplicate of the SigninQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SigninQuery) Count ¶
func (sq *SigninQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SigninQuery) CountX ¶
func (sq *SigninQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SigninQuery) Exist ¶
func (sq *SigninQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SigninQuery) ExistX ¶
func (sq *SigninQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SigninQuery) First ¶
func (sq *SigninQuery) First(ctx context.Context) (*Signin, error)
First returns the first Signin entity from the query. Returns a *NotFoundError when no Signin was found.
func (*SigninQuery) FirstID ¶
func (sq *SigninQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Signin ID from the query. Returns a *NotFoundError when no Signin ID was found.
func (*SigninQuery) FirstIDX ¶
func (sq *SigninQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SigninQuery) FirstX ¶
func (sq *SigninQuery) FirstX(ctx context.Context) *Signin
FirstX is like First, but panics if an error occurs.
func (*SigninQuery) GroupBy ¶
func (sq *SigninQuery) GroupBy(field string, fields ...string) *SigninGroupBy
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 { Timestamp time.Time `json:"timestamp,omitempty"` Count int `json:"count,omitempty"` } client.Signin.Query(). GroupBy(signin.FieldTimestamp). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SigninQuery) IDs ¶
func (sq *SigninQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Signin IDs.
func (*SigninQuery) IDsX ¶
func (sq *SigninQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SigninQuery) Limit ¶
func (sq *SigninQuery) Limit(limit int) *SigninQuery
Limit the number of records to be returned by this query.
func (*SigninQuery) Offset ¶
func (sq *SigninQuery) Offset(offset int) *SigninQuery
Offset to start from.
func (*SigninQuery) Only ¶
func (sq *SigninQuery) Only(ctx context.Context) (*Signin, error)
Only returns a single Signin entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Signin entity is found. Returns a *NotFoundError when no Signin entities are found.
func (*SigninQuery) OnlyID ¶
func (sq *SigninQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Signin ID in the query. Returns a *NotSingularError when more than one Signin ID is found. Returns a *NotFoundError when no entities are found.
func (*SigninQuery) OnlyIDX ¶
func (sq *SigninQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SigninQuery) OnlyX ¶
func (sq *SigninQuery) OnlyX(ctx context.Context) *Signin
OnlyX is like Only, but panics if an error occurs.
func (*SigninQuery) Order ¶
func (sq *SigninQuery) Order(o ...signin.OrderOption) *SigninQuery
Order specifies how the records should be ordered.
func (*SigninQuery) QueryUser ¶
func (sq *SigninQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*SigninQuery) Select ¶
func (sq *SigninQuery) Select(fields ...string) *SigninSelect
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 { Timestamp time.Time `json:"timestamp,omitempty"` } client.Signin.Query(). Select(signin.FieldTimestamp). Scan(ctx, &v)
func (*SigninQuery) Unique ¶
func (sq *SigninQuery) Unique(unique bool) *SigninQuery
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 (*SigninQuery) Where ¶
func (sq *SigninQuery) Where(ps ...predicate.Signin) *SigninQuery
Where adds a new predicate for the SigninQuery builder.
func (*SigninQuery) WithUser ¶
func (sq *SigninQuery) WithUser(opts ...func(*UserQuery)) *SigninQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type SigninSelect ¶
type SigninSelect struct { *SigninQuery // contains filtered or unexported fields }
SigninSelect is the builder for selecting fields of Signin entities.
func (*SigninSelect) Aggregate ¶
func (ss *SigninSelect) Aggregate(fns ...AggregateFunc) *SigninSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SigninSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SigninSelect) Scan ¶
func (ss *SigninSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SigninSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SigninUpdate ¶
type SigninUpdate struct {
// contains filtered or unexported fields
}
SigninUpdate is the builder for updating Signin entities.
func (*SigninUpdate) ClearUser ¶
func (su *SigninUpdate) ClearUser() *SigninUpdate
ClearUser clears the "user" edge to the User entity.
func (*SigninUpdate) Exec ¶
func (su *SigninUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SigninUpdate) ExecX ¶
func (su *SigninUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SigninUpdate) Mutation ¶
func (su *SigninUpdate) Mutation() *SigninMutation
Mutation returns the SigninMutation object of the builder.
func (*SigninUpdate) Save ¶
func (su *SigninUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SigninUpdate) SaveX ¶
func (su *SigninUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SigninUpdate) SetNillableTimestamp ¶
func (su *SigninUpdate) SetNillableTimestamp(t *time.Time) *SigninUpdate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*SigninUpdate) SetNillableType ¶
func (su *SigninUpdate) SetNillableType(s *signin.Type) *SigninUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*SigninUpdate) SetTimestamp ¶
func (su *SigninUpdate) SetTimestamp(t time.Time) *SigninUpdate
SetTimestamp sets the "timestamp" field.
func (*SigninUpdate) SetType ¶
func (su *SigninUpdate) SetType(s signin.Type) *SigninUpdate
SetType sets the "type" field.
func (*SigninUpdate) SetUser ¶
func (su *SigninUpdate) SetUser(u *User) *SigninUpdate
SetUser sets the "user" edge to the User entity.
func (*SigninUpdate) SetUserID ¶
func (su *SigninUpdate) SetUserID(id string) *SigninUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*SigninUpdate) Where ¶
func (su *SigninUpdate) Where(ps ...predicate.Signin) *SigninUpdate
Where appends a list predicates to the SigninUpdate builder.
type SigninUpdateOne ¶
type SigninUpdateOne struct {
// contains filtered or unexported fields
}
SigninUpdateOne is the builder for updating a single Signin entity.
func (*SigninUpdateOne) ClearUser ¶
func (suo *SigninUpdateOne) ClearUser() *SigninUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*SigninUpdateOne) Exec ¶
func (suo *SigninUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SigninUpdateOne) ExecX ¶
func (suo *SigninUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SigninUpdateOne) Mutation ¶
func (suo *SigninUpdateOne) Mutation() *SigninMutation
Mutation returns the SigninMutation object of the builder.
func (*SigninUpdateOne) Save ¶
func (suo *SigninUpdateOne) Save(ctx context.Context) (*Signin, error)
Save executes the query and returns the updated Signin entity.
func (*SigninUpdateOne) SaveX ¶
func (suo *SigninUpdateOne) SaveX(ctx context.Context) *Signin
SaveX is like Save, but panics if an error occurs.
func (*SigninUpdateOne) Select ¶
func (suo *SigninUpdateOne) Select(field string, fields ...string) *SigninUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SigninUpdateOne) SetNillableTimestamp ¶
func (suo *SigninUpdateOne) SetNillableTimestamp(t *time.Time) *SigninUpdateOne
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*SigninUpdateOne) SetNillableType ¶
func (suo *SigninUpdateOne) SetNillableType(s *signin.Type) *SigninUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*SigninUpdateOne) SetTimestamp ¶
func (suo *SigninUpdateOne) SetTimestamp(t time.Time) *SigninUpdateOne
SetTimestamp sets the "timestamp" field.
func (*SigninUpdateOne) SetType ¶
func (suo *SigninUpdateOne) SetType(s signin.Type) *SigninUpdateOne
SetType sets the "type" field.
func (*SigninUpdateOne) SetUser ¶
func (suo *SigninUpdateOne) SetUser(u *User) *SigninUpdateOne
SetUser sets the "user" edge to the User entity.
func (*SigninUpdateOne) SetUserID ¶
func (suo *SigninUpdateOne) SetUserID(id string) *SigninUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*SigninUpdateOne) Where ¶
func (suo *SigninUpdateOne) Where(ps ...predicate.Signin) *SigninUpdateOne
Where appends a list predicates to the SigninUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Birthday is the client for interacting with the Birthday builders. Birthday *BirthdayClient // Openstack is the client for interacting with the Openstack builders. Openstack *OpenstackClient // Shitpost is the client for interacting with the Shitpost builders. Shitpost *ShitpostClient // Signin is the client for interacting with the Signin builders. Signin *SigninClient // User is the client for interacting with the User builders. User *UserClient // Vote is the client for interacting with the Vote builders. Vote *VoteClient // VoteResult is the client for interacting with the VoteResult builders. VoteResult *VoteResultClient // 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. // User's Discord ID ID string `json:"id,omitempty"` // User's email address Email string `json:"email,omitempty"` // Number of times the user has attempted to verify their email address VerificationAttempts int8 `json:"verification_attempts,omitempty"` // Whether the user has been verified before Verified bool `json:"verified,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) QueryBirthday ¶
func (u *User) QueryBirthday() *BirthdayQuery
QueryBirthday queries the "birthday" edge of the User entity.
func (*User) QueryOpenstack ¶
func (u *User) QueryOpenstack() *OpenstackQuery
QueryOpenstack queries the "openstack" edge of the User entity.
func (*User) QueryShitposts ¶
func (u *User) QueryShitposts() *ShitpostQuery
QueryShitposts queries the "shitposts" edge of the User entity.
func (*User) QuerySignins ¶
func (u *User) QuerySignins() *SigninQuery
QuerySignins queries the "signins" edge of the User entity.
func (*User) QueryVotes ¶
QueryVotes queries the "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 (u *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(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id string) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id string) *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) QueryBirthday ¶
func (c *UserClient) QueryBirthday(u *User) *BirthdayQuery
QueryBirthday queries the birthday edge of a User.
func (*UserClient) QueryOpenstack ¶
func (c *UserClient) QueryOpenstack(u *User) *OpenstackQuery
QueryOpenstack queries the openstack edge of a User.
func (*UserClient) QueryShitposts ¶
func (c *UserClient) QueryShitposts(u *User) *ShitpostQuery
QueryShitposts queries the shitposts edge of a User.
func (*UserClient) QuerySignins ¶
func (c *UserClient) QuerySignins(u *User) *SigninQuery
QuerySignins queries the signins edge of a User.
func (*UserClient) QueryVotes ¶
func (c *UserClient) QueryVotes(u *User) *VoteQuery
QueryVotes queries the 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(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id string) *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) AddShitpostIDs ¶
func (uc *UserCreate) AddShitpostIDs(ids ...string) *UserCreate
AddShitpostIDs adds the "shitposts" edge to the Shitpost entity by IDs.
func (*UserCreate) AddShitposts ¶
func (uc *UserCreate) AddShitposts(s ...*Shitpost) *UserCreate
AddShitposts adds the "shitposts" edges to the Shitpost entity.
func (*UserCreate) AddSigninIDs ¶
func (uc *UserCreate) AddSigninIDs(ids ...int) *UserCreate
AddSigninIDs adds the "signins" edge to the Signin entity by IDs.
func (*UserCreate) AddSignins ¶
func (uc *UserCreate) AddSignins(s ...*Signin) *UserCreate
AddSignins adds the "signins" edges to the Signin entity.
func (*UserCreate) AddVoteIDs ¶
func (uc *UserCreate) AddVoteIDs(ids ...int) *UserCreate
AddVoteIDs adds the "votes" edge to the Vote entity by IDs.
func (*UserCreate) AddVotes ¶
func (uc *UserCreate) AddVotes(v ...*Vote) *UserCreate
AddVotes adds the "votes" edges to the Vote entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetBirthday ¶
func (uc *UserCreate) SetBirthday(b *Birthday) *UserCreate
SetBirthday sets the "birthday" edge to the Birthday entity.
func (*UserCreate) SetBirthdayID ¶
func (uc *UserCreate) SetBirthdayID(id int) *UserCreate
SetBirthdayID sets the "birthday" edge to the Birthday entity by ID.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(s string) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetNillableBirthdayID ¶
func (uc *UserCreate) SetNillableBirthdayID(id *int) *UserCreate
SetNillableBirthdayID sets the "birthday" edge to the Birthday entity by ID if the given value is not nil.
func (*UserCreate) SetNillableEmail ¶
func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserCreate) SetNillableOpenstackID ¶
func (uc *UserCreate) SetNillableOpenstackID(id *int) *UserCreate
SetNillableOpenstackID sets the "openstack" edge to the Openstack entity by ID if the given value is not nil.
func (*UserCreate) SetNillableVerificationAttempts ¶
func (uc *UserCreate) SetNillableVerificationAttempts(i *int8) *UserCreate
SetNillableVerificationAttempts sets the "verification_attempts" field if the given value is not nil.
func (*UserCreate) SetNillableVerified ¶
func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserCreate) SetOpenstack ¶
func (uc *UserCreate) SetOpenstack(o *Openstack) *UserCreate
SetOpenstack sets the "openstack" edge to the Openstack entity.
func (*UserCreate) SetOpenstackID ¶
func (uc *UserCreate) SetOpenstackID(id int) *UserCreate
SetOpenstackID sets the "openstack" edge to the Openstack entity by ID.
func (*UserCreate) SetVerificationAttempts ¶
func (uc *UserCreate) SetVerificationAttempts(i int8) *UserCreate
SetVerificationAttempts sets the "verification_attempts" field.
func (*UserCreate) SetVerified ¶
func (uc *UserCreate) SetVerified(b bool) *UserCreate
SetVerified sets the "verified" 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 (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *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 (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *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 (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Signins made by the user Signins []*Signin `json:"signins,omitempty"` // Votes made by the user Votes []*Vote `json:"votes,omitempty"` // Shitposts made by the user Shitposts []*Shitpost `json:"shitposts,omitempty"` // Birthdays of the user Birthday *Birthday `json:"birthday,omitempty"` // Openstacks Info of the user Openstack *Openstack `json:"openstack,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) BirthdayOrErr ¶
BirthdayOrErr returns the Birthday value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) OpenstackOrErr ¶
OpenstackOrErr returns the Openstack value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) ShitpostsOrErr ¶
ShitpostsOrErr returns the Shitposts value or an error if the edge was not loaded in eager-loading.
func (UserEdges) SigninsOrErr ¶
SigninsOrErr returns the Signins value or an error if the edge was not loaded in eager-loading.
func (UserEdges) VotesOrErr ¶
VotesOrErr returns the Votes 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 (ugb *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 (ugb *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) AddShitpostIDs ¶
func (m *UserMutation) AddShitpostIDs(ids ...string)
AddShitpostIDs adds the "shitposts" edge to the Shitpost entity by ids.
func (*UserMutation) AddSigninIDs ¶
func (m *UserMutation) AddSigninIDs(ids ...int)
AddSigninIDs adds the "signins" edge to the Signin entity by ids.
func (*UserMutation) AddVerificationAttempts ¶
func (m *UserMutation) AddVerificationAttempts(i int8)
AddVerificationAttempts adds i to the "verification_attempts" field.
func (*UserMutation) AddVoteIDs ¶
func (m *UserMutation) AddVoteIDs(ids ...int)
AddVoteIDs adds the "votes" edge to the Vote 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) AddedVerificationAttempts ¶
func (m *UserMutation) AddedVerificationAttempts() (r int8, exists bool)
AddedVerificationAttempts returns the value that was added to the "verification_attempts" field in this mutation.
func (*UserMutation) BirthdayCleared ¶
func (m *UserMutation) BirthdayCleared() bool
BirthdayCleared reports if the "birthday" edge to the Birthday entity was cleared.
func (*UserMutation) BirthdayID ¶
func (m *UserMutation) BirthdayID() (id int, exists bool)
BirthdayID returns the "birthday" edge ID in the mutation.
func (*UserMutation) BirthdayIDs ¶
func (m *UserMutation) BirthdayIDs() (ids []int)
BirthdayIDs returns the "birthday" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BirthdayID instead. It exists only for internal usage by the builders.
func (*UserMutation) ClearBirthday ¶
func (m *UserMutation) ClearBirthday()
ClearBirthday clears the "birthday" edge to the Birthday entity.
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) ClearOpenstack ¶
func (m *UserMutation) ClearOpenstack()
ClearOpenstack clears the "openstack" edge to the Openstack entity.
func (*UserMutation) ClearShitposts ¶
func (m *UserMutation) ClearShitposts()
ClearShitposts clears the "shitposts" edge to the Shitpost entity.
func (*UserMutation) ClearSignins ¶
func (m *UserMutation) ClearSignins()
ClearSignins clears the "signins" edge to the Signin entity.
func (*UserMutation) ClearVotes ¶
func (m *UserMutation) ClearVotes()
ClearVotes clears the "votes" edge to the Vote 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) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the 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 string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
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) OldVerificationAttempts ¶
func (m *UserMutation) OldVerificationAttempts(ctx context.Context) (v int8, err error)
OldVerificationAttempts returns the old "verification_attempts" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldVerified ¶
func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
OldVerified returns the old "verified" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OpenstackCleared ¶
func (m *UserMutation) OpenstackCleared() bool
OpenstackCleared reports if the "openstack" edge to the Openstack entity was cleared.
func (*UserMutation) OpenstackID ¶
func (m *UserMutation) OpenstackID() (id int, exists bool)
OpenstackID returns the "openstack" edge ID in the mutation.
func (*UserMutation) OpenstackIDs ¶
func (m *UserMutation) OpenstackIDs() (ids []int)
OpenstackIDs returns the "openstack" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OpenstackID instead. It exists only for internal usage by the builders.
func (*UserMutation) RemoveShitpostIDs ¶
func (m *UserMutation) RemoveShitpostIDs(ids ...string)
RemoveShitpostIDs removes the "shitposts" edge to the Shitpost entity by IDs.
func (*UserMutation) RemoveSigninIDs ¶
func (m *UserMutation) RemoveSigninIDs(ids ...int)
RemoveSigninIDs removes the "signins" edge to the Signin entity by IDs.
func (*UserMutation) RemoveVoteIDs ¶
func (m *UserMutation) RemoveVoteIDs(ids ...int)
RemoveVoteIDs removes the "votes" edge to the Vote 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) RemovedShitpostsIDs ¶
func (m *UserMutation) RemovedShitpostsIDs() (ids []string)
RemovedShitposts returns the removed IDs of the "shitposts" edge to the Shitpost entity.
func (*UserMutation) RemovedSigninsIDs ¶
func (m *UserMutation) RemovedSigninsIDs() (ids []int)
RemovedSignins returns the removed IDs of the "signins" edge to the Signin entity.
func (*UserMutation) RemovedVotesIDs ¶
func (m *UserMutation) RemovedVotesIDs() (ids []int)
RemovedVotes returns the removed IDs of the "votes" edge to the Vote entity.
func (*UserMutation) ResetBirthday ¶
func (m *UserMutation) ResetBirthday()
ResetBirthday resets all changes to the "birthday" edge.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetOpenstack ¶
func (m *UserMutation) ResetOpenstack()
ResetOpenstack resets all changes to the "openstack" edge.
func (*UserMutation) ResetShitposts ¶
func (m *UserMutation) ResetShitposts()
ResetShitposts resets all changes to the "shitposts" edge.
func (*UserMutation) ResetSignins ¶
func (m *UserMutation) ResetSignins()
ResetSignins resets all changes to the "signins" edge.
func (*UserMutation) ResetVerificationAttempts ¶
func (m *UserMutation) ResetVerificationAttempts()
ResetVerificationAttempts resets all changes to the "verification_attempts" field.
func (*UserMutation) ResetVerified ¶
func (m *UserMutation) ResetVerified()
ResetVerified resets all changes to the "verified" field.
func (*UserMutation) ResetVotes ¶
func (m *UserMutation) ResetVotes()
ResetVotes resets all changes to the "votes" edge.
func (*UserMutation) SetBirthdayID ¶
func (m *UserMutation) SetBirthdayID(id int)
SetBirthdayID sets the "birthday" edge to the Birthday entity by id.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id string)
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) SetOpenstackID ¶
func (m *UserMutation) SetOpenstackID(id int)
SetOpenstackID sets the "openstack" edge to the Openstack entity by id.
func (*UserMutation) SetVerificationAttempts ¶
func (m *UserMutation) SetVerificationAttempts(i int8)
SetVerificationAttempts sets the "verification_attempts" field.
func (*UserMutation) SetVerified ¶
func (m *UserMutation) SetVerified(b bool)
SetVerified sets the "verified" field.
func (*UserMutation) ShitpostsCleared ¶
func (m *UserMutation) ShitpostsCleared() bool
ShitpostsCleared reports if the "shitposts" edge to the Shitpost entity was cleared.
func (*UserMutation) ShitpostsIDs ¶
func (m *UserMutation) ShitpostsIDs() (ids []string)
ShitpostsIDs returns the "shitposts" edge IDs in the mutation.
func (*UserMutation) SigninsCleared ¶
func (m *UserMutation) SigninsCleared() bool
SigninsCleared reports if the "signins" edge to the Signin entity was cleared.
func (*UserMutation) SigninsIDs ¶
func (m *UserMutation) SigninsIDs() (ids []int)
SigninsIDs returns the "signins" edge IDs in the mutation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) VerificationAttempts ¶
func (m *UserMutation) VerificationAttempts() (r int8, exists bool)
VerificationAttempts returns the value of the "verification_attempts" field in the mutation.
func (*UserMutation) Verified ¶
func (m *UserMutation) Verified() (r bool, exists bool)
Verified returns the value of the "verified" field in the mutation.
func (*UserMutation) VotesCleared ¶
func (m *UserMutation) VotesCleared() bool
VotesCleared reports if the "votes" edge to the Vote entity was cleared.
func (*UserMutation) VotesIDs ¶
func (m *UserMutation) VotesIDs() (ids []int)
VotesIDs returns the "votes" edge IDs in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *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 (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) 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 (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryBirthday ¶
func (uq *UserQuery) QueryBirthday() *BirthdayQuery
QueryBirthday chains the current query on the "birthday" edge.
func (*UserQuery) QueryOpenstack ¶
func (uq *UserQuery) QueryOpenstack() *OpenstackQuery
QueryOpenstack chains the current query on the "openstack" edge.
func (*UserQuery) QueryShitposts ¶
func (uq *UserQuery) QueryShitposts() *ShitpostQuery
QueryShitposts chains the current query on the "shitposts" edge.
func (*UserQuery) QuerySignins ¶
func (uq *UserQuery) QuerySignins() *SigninQuery
QuerySignins chains the current query on the "signins" edge.
func (*UserQuery) QueryVotes ¶
QueryVotes chains the current query on the "votes" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Email string `json:"email,omitempty"` } client.User.Query(). Select(user.FieldEmail). Scan(ctx, &v)
func (*UserQuery) Unique ¶
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) WithBirthday ¶
func (uq *UserQuery) WithBirthday(opts ...func(*BirthdayQuery)) *UserQuery
WithBirthday tells the query-builder to eager-load the nodes that are connected to the "birthday" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithOpenstack ¶
func (uq *UserQuery) WithOpenstack(opts ...func(*OpenstackQuery)) *UserQuery
WithOpenstack tells the query-builder to eager-load the nodes that are connected to the "openstack" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithShitposts ¶
func (uq *UserQuery) WithShitposts(opts ...func(*ShitpostQuery)) *UserQuery
WithShitposts tells the query-builder to eager-load the nodes that are connected to the "shitposts" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithSignins ¶
func (uq *UserQuery) WithSignins(opts ...func(*SigninQuery)) *UserQuery
WithSignins tells the query-builder to eager-load the nodes that are connected to the "signins" 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 (us *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 (us *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) AddShitpostIDs ¶
func (uu *UserUpdate) AddShitpostIDs(ids ...string) *UserUpdate
AddShitpostIDs adds the "shitposts" edge to the Shitpost entity by IDs.
func (*UserUpdate) AddShitposts ¶
func (uu *UserUpdate) AddShitposts(s ...*Shitpost) *UserUpdate
AddShitposts adds the "shitposts" edges to the Shitpost entity.
func (*UserUpdate) AddSigninIDs ¶
func (uu *UserUpdate) AddSigninIDs(ids ...int) *UserUpdate
AddSigninIDs adds the "signins" edge to the Signin entity by IDs.
func (*UserUpdate) AddSignins ¶
func (uu *UserUpdate) AddSignins(s ...*Signin) *UserUpdate
AddSignins adds the "signins" edges to the Signin entity.
func (*UserUpdate) AddVerificationAttempts ¶
func (uu *UserUpdate) AddVerificationAttempts(i int8) *UserUpdate
AddVerificationAttempts adds i to the "verification_attempts" field.
func (*UserUpdate) AddVoteIDs ¶
func (uu *UserUpdate) AddVoteIDs(ids ...int) *UserUpdate
AddVoteIDs adds the "votes" edge to the Vote entity by IDs.
func (*UserUpdate) AddVotes ¶
func (uu *UserUpdate) AddVotes(v ...*Vote) *UserUpdate
AddVotes adds the "votes" edges to the Vote entity.
func (*UserUpdate) ClearBirthday ¶
func (uu *UserUpdate) ClearBirthday() *UserUpdate
ClearBirthday clears the "birthday" edge to the Birthday entity.
func (*UserUpdate) ClearOpenstack ¶
func (uu *UserUpdate) ClearOpenstack() *UserUpdate
ClearOpenstack clears the "openstack" edge to the Openstack entity.
func (*UserUpdate) ClearShitposts ¶
func (uu *UserUpdate) ClearShitposts() *UserUpdate
ClearShitposts clears all "shitposts" edges to the Shitpost entity.
func (*UserUpdate) ClearSignins ¶
func (uu *UserUpdate) ClearSignins() *UserUpdate
ClearSignins clears all "signins" edges to the Signin entity.
func (*UserUpdate) ClearVotes ¶
func (uu *UserUpdate) ClearVotes() *UserUpdate
ClearVotes clears all "votes" edges to the Vote entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveShitpostIDs ¶
func (uu *UserUpdate) RemoveShitpostIDs(ids ...string) *UserUpdate
RemoveShitpostIDs removes the "shitposts" edge to Shitpost entities by IDs.
func (*UserUpdate) RemoveShitposts ¶
func (uu *UserUpdate) RemoveShitposts(s ...*Shitpost) *UserUpdate
RemoveShitposts removes "shitposts" edges to Shitpost entities.
func (*UserUpdate) RemoveSigninIDs ¶
func (uu *UserUpdate) RemoveSigninIDs(ids ...int) *UserUpdate
RemoveSigninIDs removes the "signins" edge to Signin entities by IDs.
func (*UserUpdate) RemoveSignins ¶
func (uu *UserUpdate) RemoveSignins(s ...*Signin) *UserUpdate
RemoveSignins removes "signins" edges to Signin entities.
func (*UserUpdate) RemoveVoteIDs ¶
func (uu *UserUpdate) RemoveVoteIDs(ids ...int) *UserUpdate
RemoveVoteIDs removes the "votes" edge to Vote entities by IDs.
func (*UserUpdate) RemoveVotes ¶
func (uu *UserUpdate) RemoveVotes(v ...*Vote) *UserUpdate
RemoveVotes removes "votes" edges to Vote entities.
func (*UserUpdate) Save ¶
func (uu *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 (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetBirthday ¶
func (uu *UserUpdate) SetBirthday(b *Birthday) *UserUpdate
SetBirthday sets the "birthday" edge to the Birthday entity.
func (*UserUpdate) SetBirthdayID ¶
func (uu *UserUpdate) SetBirthdayID(id int) *UserUpdate
SetBirthdayID sets the "birthday" edge to the Birthday entity by ID.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNillableBirthdayID ¶
func (uu *UserUpdate) SetNillableBirthdayID(id *int) *UserUpdate
SetNillableBirthdayID sets the "birthday" edge to the Birthday entity by ID if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableOpenstackID ¶
func (uu *UserUpdate) SetNillableOpenstackID(id *int) *UserUpdate
SetNillableOpenstackID sets the "openstack" edge to the Openstack entity by ID if the given value is not nil.
func (*UserUpdate) SetNillableVerificationAttempts ¶
func (uu *UserUpdate) SetNillableVerificationAttempts(i *int8) *UserUpdate
SetNillableVerificationAttempts sets the "verification_attempts" field if the given value is not nil.
func (*UserUpdate) SetNillableVerified ¶
func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdate) SetOpenstack ¶
func (uu *UserUpdate) SetOpenstack(o *Openstack) *UserUpdate
SetOpenstack sets the "openstack" edge to the Openstack entity.
func (*UserUpdate) SetOpenstackID ¶
func (uu *UserUpdate) SetOpenstackID(id int) *UserUpdate
SetOpenstackID sets the "openstack" edge to the Openstack entity by ID.
func (*UserUpdate) SetVerificationAttempts ¶
func (uu *UserUpdate) SetVerificationAttempts(i int8) *UserUpdate
SetVerificationAttempts sets the "verification_attempts" field.
func (*UserUpdate) SetVerified ¶
func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
SetVerified sets the "verified" field.
func (*UserUpdate) Where ¶
func (uu *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) AddShitpostIDs ¶
func (uuo *UserUpdateOne) AddShitpostIDs(ids ...string) *UserUpdateOne
AddShitpostIDs adds the "shitposts" edge to the Shitpost entity by IDs.
func (*UserUpdateOne) AddShitposts ¶
func (uuo *UserUpdateOne) AddShitposts(s ...*Shitpost) *UserUpdateOne
AddShitposts adds the "shitposts" edges to the Shitpost entity.
func (*UserUpdateOne) AddSigninIDs ¶
func (uuo *UserUpdateOne) AddSigninIDs(ids ...int) *UserUpdateOne
AddSigninIDs adds the "signins" edge to the Signin entity by IDs.
func (*UserUpdateOne) AddSignins ¶
func (uuo *UserUpdateOne) AddSignins(s ...*Signin) *UserUpdateOne
AddSignins adds the "signins" edges to the Signin entity.
func (*UserUpdateOne) AddVerificationAttempts ¶
func (uuo *UserUpdateOne) AddVerificationAttempts(i int8) *UserUpdateOne
AddVerificationAttempts adds i to the "verification_attempts" field.
func (*UserUpdateOne) AddVoteIDs ¶
func (uuo *UserUpdateOne) AddVoteIDs(ids ...int) *UserUpdateOne
AddVoteIDs adds the "votes" edge to the Vote entity by IDs.
func (*UserUpdateOne) AddVotes ¶
func (uuo *UserUpdateOne) AddVotes(v ...*Vote) *UserUpdateOne
AddVotes adds the "votes" edges to the Vote entity.
func (*UserUpdateOne) ClearBirthday ¶
func (uuo *UserUpdateOne) ClearBirthday() *UserUpdateOne
ClearBirthday clears the "birthday" edge to the Birthday entity.
func (*UserUpdateOne) ClearOpenstack ¶
func (uuo *UserUpdateOne) ClearOpenstack() *UserUpdateOne
ClearOpenstack clears the "openstack" edge to the Openstack entity.
func (*UserUpdateOne) ClearShitposts ¶
func (uuo *UserUpdateOne) ClearShitposts() *UserUpdateOne
ClearShitposts clears all "shitposts" edges to the Shitpost entity.
func (*UserUpdateOne) ClearSignins ¶
func (uuo *UserUpdateOne) ClearSignins() *UserUpdateOne
ClearSignins clears all "signins" edges to the Signin entity.
func (*UserUpdateOne) ClearVotes ¶
func (uuo *UserUpdateOne) ClearVotes() *UserUpdateOne
ClearVotes clears all "votes" edges to the Vote entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveShitpostIDs ¶
func (uuo *UserUpdateOne) RemoveShitpostIDs(ids ...string) *UserUpdateOne
RemoveShitpostIDs removes the "shitposts" edge to Shitpost entities by IDs.
func (*UserUpdateOne) RemoveShitposts ¶
func (uuo *UserUpdateOne) RemoveShitposts(s ...*Shitpost) *UserUpdateOne
RemoveShitposts removes "shitposts" edges to Shitpost entities.
func (*UserUpdateOne) RemoveSigninIDs ¶
func (uuo *UserUpdateOne) RemoveSigninIDs(ids ...int) *UserUpdateOne
RemoveSigninIDs removes the "signins" edge to Signin entities by IDs.
func (*UserUpdateOne) RemoveSignins ¶
func (uuo *UserUpdateOne) RemoveSignins(s ...*Signin) *UserUpdateOne
RemoveSignins removes "signins" edges to Signin entities.
func (*UserUpdateOne) RemoveVoteIDs ¶
func (uuo *UserUpdateOne) RemoveVoteIDs(ids ...int) *UserUpdateOne
RemoveVoteIDs removes the "votes" edge to Vote entities by IDs.
func (*UserUpdateOne) RemoveVotes ¶
func (uuo *UserUpdateOne) RemoveVotes(v ...*Vote) *UserUpdateOne
RemoveVotes removes "votes" edges to Vote entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *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) SetBirthday ¶
func (uuo *UserUpdateOne) SetBirthday(b *Birthday) *UserUpdateOne
SetBirthday sets the "birthday" edge to the Birthday entity.
func (*UserUpdateOne) SetBirthdayID ¶
func (uuo *UserUpdateOne) SetBirthdayID(id int) *UserUpdateOne
SetBirthdayID sets the "birthday" edge to the Birthday entity by ID.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNillableBirthdayID ¶
func (uuo *UserUpdateOne) SetNillableBirthdayID(id *int) *UserUpdateOne
SetNillableBirthdayID sets the "birthday" edge to the Birthday entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableOpenstackID ¶
func (uuo *UserUpdateOne) SetNillableOpenstackID(id *int) *UserUpdateOne
SetNillableOpenstackID sets the "openstack" edge to the Openstack entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillableVerificationAttempts ¶
func (uuo *UserUpdateOne) SetNillableVerificationAttempts(i *int8) *UserUpdateOne
SetNillableVerificationAttempts sets the "verification_attempts" field if the given value is not nil.
func (*UserUpdateOne) SetNillableVerified ¶
func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdateOne) SetOpenstack ¶
func (uuo *UserUpdateOne) SetOpenstack(o *Openstack) *UserUpdateOne
SetOpenstack sets the "openstack" edge to the Openstack entity.
func (*UserUpdateOne) SetOpenstackID ¶
func (uuo *UserUpdateOne) SetOpenstackID(id int) *UserUpdateOne
SetOpenstackID sets the "openstack" edge to the Openstack entity by ID.
func (*UserUpdateOne) SetVerificationAttempts ¶
func (uuo *UserUpdateOne) SetVerificationAttempts(i int8) *UserUpdateOne
SetVerificationAttempts sets the "verification_attempts" field.
func (*UserUpdateOne) SetVerified ¶
func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
SetVerified sets the "verified" field.
func (*UserUpdateOne) Where ¶
func (uuo *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.
type Vote ¶
type Vote struct { // ID of the ent. ID int `json:"id,omitempty"` // The user's selection Selection string `json:"selection,omitempty"` // The selection's position Rank int `json:"rank,omitempty"` // The vote's ID VoteID string `json:"vote_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the VoteQuery when eager-loading is set. Edges VoteEdges `json:"edges"` // contains filtered or unexported fields }
Vote is the model entity for the Vote schema.
func (*Vote) Unwrap ¶
Unwrap unwraps the Vote 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 (*Vote) Update ¶
func (v *Vote) Update() *VoteUpdateOne
Update returns a builder for updating this Vote. Note that you need to call Vote.Unwrap() before calling this method if this Vote was returned from a transaction, and the transaction was committed or rolled back.
type VoteClient ¶
type VoteClient struct {
// contains filtered or unexported fields
}
VoteClient is a client for the Vote schema.
func NewVoteClient ¶
func NewVoteClient(c config) *VoteClient
NewVoteClient returns a client for the Vote from the given config.
func (*VoteClient) Create ¶
func (c *VoteClient) Create() *VoteCreate
Create returns a builder for creating a Vote entity.
func (*VoteClient) CreateBulk ¶
func (c *VoteClient) CreateBulk(builders ...*VoteCreate) *VoteCreateBulk
CreateBulk returns a builder for creating a bulk of Vote entities.
func (*VoteClient) Delete ¶
func (c *VoteClient) Delete() *VoteDelete
Delete returns a delete builder for Vote.
func (*VoteClient) DeleteOne ¶
func (c *VoteClient) DeleteOne(v *Vote) *VoteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VoteClient) DeleteOneID ¶
func (c *VoteClient) DeleteOneID(id int) *VoteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VoteClient) GetX ¶
func (c *VoteClient) GetX(ctx context.Context, id int) *Vote
GetX is like Get, but panics if an error occurs.
func (*VoteClient) Intercept ¶
func (c *VoteClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `vote.Intercept(f(g(h())))`.
func (*VoteClient) Interceptors ¶
func (c *VoteClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VoteClient) MapCreateBulk ¶
func (c *VoteClient) MapCreateBulk(slice any, setFunc func(*VoteCreate, int)) *VoteCreateBulk
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 (*VoteClient) Query ¶
func (c *VoteClient) Query() *VoteQuery
Query returns a query builder for Vote.
func (*VoteClient) QueryUser ¶
func (c *VoteClient) QueryUser(v *Vote) *UserQuery
QueryUser queries the user edge of a Vote.
func (*VoteClient) Update ¶
func (c *VoteClient) Update() *VoteUpdate
Update returns an update builder for Vote.
func (*VoteClient) UpdateOne ¶
func (c *VoteClient) UpdateOne(v *Vote) *VoteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VoteClient) UpdateOneID ¶
func (c *VoteClient) UpdateOneID(id int) *VoteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VoteClient) Use ¶
func (c *VoteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vote.Hooks(f(g(h())))`.
type VoteCreate ¶
type VoteCreate struct {
// contains filtered or unexported fields
}
VoteCreate is the builder for creating a Vote entity.
func (*VoteCreate) Exec ¶
func (vc *VoteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteCreate) ExecX ¶
func (vc *VoteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteCreate) Mutation ¶
func (vc *VoteCreate) Mutation() *VoteMutation
Mutation returns the VoteMutation object of the builder.
func (*VoteCreate) Save ¶
func (vc *VoteCreate) Save(ctx context.Context) (*Vote, error)
Save creates the Vote in the database.
func (*VoteCreate) SaveX ¶
func (vc *VoteCreate) SaveX(ctx context.Context) *Vote
SaveX calls Save and panics if Save returns an error.
func (*VoteCreate) SetRank ¶
func (vc *VoteCreate) SetRank(i int) *VoteCreate
SetRank sets the "rank" field.
func (*VoteCreate) SetSelection ¶
func (vc *VoteCreate) SetSelection(s string) *VoteCreate
SetSelection sets the "selection" field.
func (*VoteCreate) SetUser ¶
func (vc *VoteCreate) SetUser(u *User) *VoteCreate
SetUser sets the "user" edge to the User entity.
func (*VoteCreate) SetUserID ¶
func (vc *VoteCreate) SetUserID(id string) *VoteCreate
SetUserID sets the "user" edge to the User entity by ID.
func (*VoteCreate) SetVoteID ¶
func (vc *VoteCreate) SetVoteID(s string) *VoteCreate
SetVoteID sets the "vote_id" field.
type VoteCreateBulk ¶
type VoteCreateBulk struct {
// contains filtered or unexported fields
}
VoteCreateBulk is the builder for creating many Vote entities in bulk.
func (*VoteCreateBulk) Exec ¶
func (vcb *VoteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteCreateBulk) ExecX ¶
func (vcb *VoteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VoteDelete ¶
type VoteDelete struct {
// contains filtered or unexported fields
}
VoteDelete is the builder for deleting a Vote entity.
func (*VoteDelete) Exec ¶
func (vd *VoteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VoteDelete) ExecX ¶
func (vd *VoteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VoteDelete) Where ¶
func (vd *VoteDelete) Where(ps ...predicate.Vote) *VoteDelete
Where appends a list predicates to the VoteDelete builder.
type VoteDeleteOne ¶
type VoteDeleteOne struct {
// contains filtered or unexported fields
}
VoteDeleteOne is the builder for deleting a single Vote entity.
func (*VoteDeleteOne) Exec ¶
func (vdo *VoteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VoteDeleteOne) ExecX ¶
func (vdo *VoteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteDeleteOne) Where ¶
func (vdo *VoteDeleteOne) Where(ps ...predicate.Vote) *VoteDeleteOne
Where appends a list predicates to the VoteDelete builder.
type VoteEdges ¶
type VoteEdges struct { // User who voted User *User `json:"user,omitempty"` // contains filtered or unexported fields }
VoteEdges holds the relations/edges for other nodes in the graph.
type VoteGroupBy ¶
type VoteGroupBy struct {
// contains filtered or unexported fields
}
VoteGroupBy is the group-by builder for Vote entities.
func (*VoteGroupBy) Aggregate ¶
func (vgb *VoteGroupBy) Aggregate(fns ...AggregateFunc) *VoteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VoteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoteGroupBy) Scan ¶
func (vgb *VoteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoteMutation ¶
type VoteMutation struct {
// contains filtered or unexported fields
}
VoteMutation represents an operation that mutates the Vote nodes in the graph.
func (*VoteMutation) AddField ¶
func (m *VoteMutation) 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 (*VoteMutation) AddRank ¶
func (m *VoteMutation) AddRank(i int)
AddRank adds i to the "rank" field.
func (*VoteMutation) AddedEdges ¶
func (m *VoteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VoteMutation) AddedField ¶
func (m *VoteMutation) 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 (*VoteMutation) AddedFields ¶
func (m *VoteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VoteMutation) AddedIDs ¶
func (m *VoteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VoteMutation) AddedRank ¶
func (m *VoteMutation) AddedRank() (r int, exists bool)
AddedRank returns the value that was added to the "rank" field in this mutation.
func (*VoteMutation) ClearEdge ¶
func (m *VoteMutation) 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 (*VoteMutation) ClearField ¶
func (m *VoteMutation) 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 (*VoteMutation) ClearUser ¶
func (m *VoteMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*VoteMutation) ClearedEdges ¶
func (m *VoteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VoteMutation) ClearedFields ¶
func (m *VoteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VoteMutation) Client ¶
func (m VoteMutation) 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 (*VoteMutation) EdgeCleared ¶
func (m *VoteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VoteMutation) Field ¶
func (m *VoteMutation) 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 (*VoteMutation) FieldCleared ¶
func (m *VoteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VoteMutation) Fields ¶
func (m *VoteMutation) 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 (*VoteMutation) ID ¶
func (m *VoteMutation) 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 (*VoteMutation) IDs ¶
func (m *VoteMutation) 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 (*VoteMutation) 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 (*VoteMutation) OldRank ¶
func (m *VoteMutation) OldRank(ctx context.Context) (v int, err error)
OldRank returns the old "rank" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldSelection ¶
func (m *VoteMutation) OldSelection(ctx context.Context) (v string, err error)
OldSelection returns the old "selection" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldVoteID ¶
func (m *VoteMutation) OldVoteID(ctx context.Context) (v string, err error)
OldVoteID returns the old "vote_id" field's value of the Vote entity. If the Vote 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 (*VoteMutation) Rank ¶
func (m *VoteMutation) Rank() (r int, exists bool)
Rank returns the value of the "rank" field in the mutation.
func (*VoteMutation) RemovedEdges ¶
func (m *VoteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VoteMutation) RemovedIDs ¶
func (m *VoteMutation) 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 (*VoteMutation) ResetEdge ¶
func (m *VoteMutation) 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 (*VoteMutation) ResetField ¶
func (m *VoteMutation) 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 (*VoteMutation) ResetRank ¶
func (m *VoteMutation) ResetRank()
ResetRank resets all changes to the "rank" field.
func (*VoteMutation) ResetSelection ¶
func (m *VoteMutation) ResetSelection()
ResetSelection resets all changes to the "selection" field.
func (*VoteMutation) ResetUser ¶
func (m *VoteMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*VoteMutation) ResetVoteID ¶
func (m *VoteMutation) ResetVoteID()
ResetVoteID resets all changes to the "vote_id" field.
func (*VoteMutation) Selection ¶
func (m *VoteMutation) Selection() (r string, exists bool)
Selection returns the value of the "selection" field in the mutation.
func (*VoteMutation) SetField ¶
func (m *VoteMutation) 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 (*VoteMutation) SetOp ¶
func (m *VoteMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VoteMutation) SetSelection ¶
func (m *VoteMutation) SetSelection(s string)
SetSelection sets the "selection" field.
func (*VoteMutation) SetUserID ¶
func (m *VoteMutation) SetUserID(id string)
SetUserID sets the "user" edge to the User entity by id.
func (*VoteMutation) SetVoteID ¶
func (m *VoteMutation) SetVoteID(s string)
SetVoteID sets the "vote_id" field.
func (VoteMutation) Tx ¶
func (m VoteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VoteMutation) Type ¶
func (m *VoteMutation) Type() string
Type returns the node type of this mutation (Vote).
func (*VoteMutation) UserCleared ¶
func (m *VoteMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*VoteMutation) UserID ¶
func (m *VoteMutation) UserID() (id string, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*VoteMutation) UserIDs ¶
func (m *VoteMutation) UserIDs() (ids []string)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*VoteMutation) VoteID ¶
func (m *VoteMutation) VoteID() (r string, exists bool)
VoteID returns the value of the "vote_id" field in the mutation.
func (*VoteMutation) Where ¶
func (m *VoteMutation) Where(ps ...predicate.Vote)
Where appends a list predicates to the VoteMutation builder.
func (*VoteMutation) WhereP ¶
func (m *VoteMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VoteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VoteQuery ¶
type VoteQuery struct {
// contains filtered or unexported fields
}
VoteQuery is the builder for querying Vote entities.
func (*VoteQuery) Aggregate ¶
func (vq *VoteQuery) Aggregate(fns ...AggregateFunc) *VoteSelect
Aggregate returns a VoteSelect configured with the given aggregations.
func (*VoteQuery) Clone ¶
Clone returns a duplicate of the VoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VoteQuery) First ¶
First returns the first Vote entity from the query. Returns a *NotFoundError when no Vote was found.
func (*VoteQuery) FirstID ¶
FirstID returns the first Vote ID from the query. Returns a *NotFoundError when no Vote ID was found.
func (*VoteQuery) GroupBy ¶
func (vq *VoteQuery) GroupBy(field string, fields ...string) *VoteGroupBy
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 { Selection string `json:"selection,omitempty"` Count int `json:"count,omitempty"` } client.Vote.Query(). GroupBy(vote.FieldSelection). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VoteQuery) Only ¶
Only returns a single Vote entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Vote entity is found. Returns a *NotFoundError when no Vote entities are found.
func (*VoteQuery) OnlyID ¶
OnlyID is like Only, but returns the only Vote ID in the query. Returns a *NotSingularError when more than one Vote ID is found. Returns a *NotFoundError when no entities are found.
func (*VoteQuery) Order ¶
func (vq *VoteQuery) Order(o ...vote.OrderOption) *VoteQuery
Order specifies how the records should be ordered.
func (*VoteQuery) Select ¶
func (vq *VoteQuery) Select(fields ...string) *VoteSelect
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 { Selection string `json:"selection,omitempty"` } client.Vote.Query(). Select(vote.FieldSelection). Scan(ctx, &v)
func (*VoteQuery) 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.
type VoteResult ¶
type VoteResult struct { // ID of the ent. ID int `json:"id,omitempty"` // The vote's HTML Results HTML string `json:"html,omitempty"` // The vote's plaintext results Plain string `json:"plain,omitempty"` // The vote's ID VoteID string `json:"vote_id,omitempty"` // contains filtered or unexported fields }
VoteResult is the model entity for the VoteResult schema.
func (*VoteResult) String ¶
func (vr *VoteResult) String() string
String implements the fmt.Stringer.
func (*VoteResult) Unwrap ¶
func (vr *VoteResult) Unwrap() *VoteResult
Unwrap unwraps the VoteResult 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 (*VoteResult) Update ¶
func (vr *VoteResult) Update() *VoteResultUpdateOne
Update returns a builder for updating this VoteResult. Note that you need to call VoteResult.Unwrap() before calling this method if this VoteResult was returned from a transaction, and the transaction was committed or rolled back.
type VoteResultClient ¶
type VoteResultClient struct {
// contains filtered or unexported fields
}
VoteResultClient is a client for the VoteResult schema.
func NewVoteResultClient ¶
func NewVoteResultClient(c config) *VoteResultClient
NewVoteResultClient returns a client for the VoteResult from the given config.
func (*VoteResultClient) Create ¶
func (c *VoteResultClient) Create() *VoteResultCreate
Create returns a builder for creating a VoteResult entity.
func (*VoteResultClient) CreateBulk ¶
func (c *VoteResultClient) CreateBulk(builders ...*VoteResultCreate) *VoteResultCreateBulk
CreateBulk returns a builder for creating a bulk of VoteResult entities.
func (*VoteResultClient) Delete ¶
func (c *VoteResultClient) Delete() *VoteResultDelete
Delete returns a delete builder for VoteResult.
func (*VoteResultClient) DeleteOne ¶
func (c *VoteResultClient) DeleteOne(vr *VoteResult) *VoteResultDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VoteResultClient) DeleteOneID ¶
func (c *VoteResultClient) DeleteOneID(id int) *VoteResultDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VoteResultClient) Get ¶
func (c *VoteResultClient) Get(ctx context.Context, id int) (*VoteResult, error)
Get returns a VoteResult entity by its id.
func (*VoteResultClient) GetX ¶
func (c *VoteResultClient) GetX(ctx context.Context, id int) *VoteResult
GetX is like Get, but panics if an error occurs.
func (*VoteResultClient) Hooks ¶
func (c *VoteResultClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VoteResultClient) Intercept ¶
func (c *VoteResultClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `voteresult.Intercept(f(g(h())))`.
func (*VoteResultClient) Interceptors ¶
func (c *VoteResultClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VoteResultClient) MapCreateBulk ¶
func (c *VoteResultClient) MapCreateBulk(slice any, setFunc func(*VoteResultCreate, int)) *VoteResultCreateBulk
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 (*VoteResultClient) Query ¶
func (c *VoteResultClient) Query() *VoteResultQuery
Query returns a query builder for VoteResult.
func (*VoteResultClient) Update ¶
func (c *VoteResultClient) Update() *VoteResultUpdate
Update returns an update builder for VoteResult.
func (*VoteResultClient) UpdateOne ¶
func (c *VoteResultClient) UpdateOne(vr *VoteResult) *VoteResultUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VoteResultClient) UpdateOneID ¶
func (c *VoteResultClient) UpdateOneID(id int) *VoteResultUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VoteResultClient) Use ¶
func (c *VoteResultClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `voteresult.Hooks(f(g(h())))`.
type VoteResultCreate ¶
type VoteResultCreate struct {
// contains filtered or unexported fields
}
VoteResultCreate is the builder for creating a VoteResult entity.
func (*VoteResultCreate) Exec ¶
func (vrc *VoteResultCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteResultCreate) ExecX ¶
func (vrc *VoteResultCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultCreate) Mutation ¶
func (vrc *VoteResultCreate) Mutation() *VoteResultMutation
Mutation returns the VoteResultMutation object of the builder.
func (*VoteResultCreate) Save ¶
func (vrc *VoteResultCreate) Save(ctx context.Context) (*VoteResult, error)
Save creates the VoteResult in the database.
func (*VoteResultCreate) SaveX ¶
func (vrc *VoteResultCreate) SaveX(ctx context.Context) *VoteResult
SaveX calls Save and panics if Save returns an error.
func (*VoteResultCreate) SetHTML ¶
func (vrc *VoteResultCreate) SetHTML(s string) *VoteResultCreate
SetHTML sets the "html" field.
func (*VoteResultCreate) SetPlain ¶
func (vrc *VoteResultCreate) SetPlain(s string) *VoteResultCreate
SetPlain sets the "plain" field.
func (*VoteResultCreate) SetVoteID ¶
func (vrc *VoteResultCreate) SetVoteID(s string) *VoteResultCreate
SetVoteID sets the "vote_id" field.
type VoteResultCreateBulk ¶
type VoteResultCreateBulk struct {
// contains filtered or unexported fields
}
VoteResultCreateBulk is the builder for creating many VoteResult entities in bulk.
func (*VoteResultCreateBulk) Exec ¶
func (vrcb *VoteResultCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteResultCreateBulk) ExecX ¶
func (vrcb *VoteResultCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultCreateBulk) Save ¶
func (vrcb *VoteResultCreateBulk) Save(ctx context.Context) ([]*VoteResult, error)
Save creates the VoteResult entities in the database.
func (*VoteResultCreateBulk) SaveX ¶
func (vrcb *VoteResultCreateBulk) SaveX(ctx context.Context) []*VoteResult
SaveX is like Save, but panics if an error occurs.
type VoteResultDelete ¶
type VoteResultDelete struct {
// contains filtered or unexported fields
}
VoteResultDelete is the builder for deleting a VoteResult entity.
func (*VoteResultDelete) Exec ¶
func (vrd *VoteResultDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VoteResultDelete) ExecX ¶
func (vrd *VoteResultDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultDelete) Where ¶
func (vrd *VoteResultDelete) Where(ps ...predicate.VoteResult) *VoteResultDelete
Where appends a list predicates to the VoteResultDelete builder.
type VoteResultDeleteOne ¶
type VoteResultDeleteOne struct {
// contains filtered or unexported fields
}
VoteResultDeleteOne is the builder for deleting a single VoteResult entity.
func (*VoteResultDeleteOne) Exec ¶
func (vrdo *VoteResultDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VoteResultDeleteOne) ExecX ¶
func (vrdo *VoteResultDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultDeleteOne) Where ¶
func (vrdo *VoteResultDeleteOne) Where(ps ...predicate.VoteResult) *VoteResultDeleteOne
Where appends a list predicates to the VoteResultDelete builder.
type VoteResultGroupBy ¶
type VoteResultGroupBy struct {
// contains filtered or unexported fields
}
VoteResultGroupBy is the group-by builder for VoteResult entities.
func (*VoteResultGroupBy) Aggregate ¶
func (vrgb *VoteResultGroupBy) Aggregate(fns ...AggregateFunc) *VoteResultGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VoteResultGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoteResultGroupBy) Scan ¶
func (vrgb *VoteResultGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoteResultGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoteResultMutation ¶
type VoteResultMutation struct {
// contains filtered or unexported fields
}
VoteResultMutation represents an operation that mutates the VoteResult nodes in the graph.
func (*VoteResultMutation) AddField ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) AddedEdges ¶
func (m *VoteResultMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VoteResultMutation) AddedField ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) AddedFields ¶
func (m *VoteResultMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VoteResultMutation) AddedIDs ¶
func (m *VoteResultMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VoteResultMutation) ClearEdge ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) ClearField ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) ClearedEdges ¶
func (m *VoteResultMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VoteResultMutation) ClearedFields ¶
func (m *VoteResultMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VoteResultMutation) Client ¶
func (m VoteResultMutation) 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 (*VoteResultMutation) EdgeCleared ¶
func (m *VoteResultMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VoteResultMutation) Field ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) FieldCleared ¶
func (m *VoteResultMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VoteResultMutation) Fields ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) HTML ¶
func (m *VoteResultMutation) HTML() (r string, exists bool)
HTML returns the value of the "html" field in the mutation.
func (*VoteResultMutation) ID ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) IDs ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) 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 (*VoteResultMutation) OldHTML ¶
func (m *VoteResultMutation) OldHTML(ctx context.Context) (v string, err error)
OldHTML returns the old "html" field's value of the VoteResult entity. If the VoteResult 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 (*VoteResultMutation) OldPlain ¶
func (m *VoteResultMutation) OldPlain(ctx context.Context) (v string, err error)
OldPlain returns the old "plain" field's value of the VoteResult entity. If the VoteResult 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 (*VoteResultMutation) OldVoteID ¶
func (m *VoteResultMutation) OldVoteID(ctx context.Context) (v string, err error)
OldVoteID returns the old "vote_id" field's value of the VoteResult entity. If the VoteResult 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 (*VoteResultMutation) Plain ¶
func (m *VoteResultMutation) Plain() (r string, exists bool)
Plain returns the value of the "plain" field in the mutation.
func (*VoteResultMutation) RemovedEdges ¶
func (m *VoteResultMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VoteResultMutation) RemovedIDs ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) ResetEdge ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) ResetField ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) ResetHTML ¶
func (m *VoteResultMutation) ResetHTML()
ResetHTML resets all changes to the "html" field.
func (*VoteResultMutation) ResetPlain ¶
func (m *VoteResultMutation) ResetPlain()
ResetPlain resets all changes to the "plain" field.
func (*VoteResultMutation) ResetVoteID ¶
func (m *VoteResultMutation) ResetVoteID()
ResetVoteID resets all changes to the "vote_id" field.
func (*VoteResultMutation) SetField ¶
func (m *VoteResultMutation) 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 (*VoteResultMutation) SetHTML ¶
func (m *VoteResultMutation) SetHTML(s string)
SetHTML sets the "html" field.
func (*VoteResultMutation) SetOp ¶
func (m *VoteResultMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VoteResultMutation) SetPlain ¶
func (m *VoteResultMutation) SetPlain(s string)
SetPlain sets the "plain" field.
func (*VoteResultMutation) SetVoteID ¶
func (m *VoteResultMutation) SetVoteID(s string)
SetVoteID sets the "vote_id" field.
func (VoteResultMutation) Tx ¶
func (m VoteResultMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VoteResultMutation) Type ¶
func (m *VoteResultMutation) Type() string
Type returns the node type of this mutation (VoteResult).
func (*VoteResultMutation) VoteID ¶
func (m *VoteResultMutation) VoteID() (r string, exists bool)
VoteID returns the value of the "vote_id" field in the mutation.
func (*VoteResultMutation) Where ¶
func (m *VoteResultMutation) Where(ps ...predicate.VoteResult)
Where appends a list predicates to the VoteResultMutation builder.
func (*VoteResultMutation) WhereP ¶
func (m *VoteResultMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VoteResultMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VoteResultQuery ¶
type VoteResultQuery struct {
// contains filtered or unexported fields
}
VoteResultQuery is the builder for querying VoteResult entities.
func (*VoteResultQuery) Aggregate ¶
func (vrq *VoteResultQuery) Aggregate(fns ...AggregateFunc) *VoteResultSelect
Aggregate returns a VoteResultSelect configured with the given aggregations.
func (*VoteResultQuery) All ¶
func (vrq *VoteResultQuery) All(ctx context.Context) ([]*VoteResult, error)
All executes the query and returns a list of VoteResults.
func (*VoteResultQuery) AllX ¶
func (vrq *VoteResultQuery) AllX(ctx context.Context) []*VoteResult
AllX is like All, but panics if an error occurs.
func (*VoteResultQuery) Clone ¶
func (vrq *VoteResultQuery) Clone() *VoteResultQuery
Clone returns a duplicate of the VoteResultQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VoteResultQuery) Count ¶
func (vrq *VoteResultQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VoteResultQuery) CountX ¶
func (vrq *VoteResultQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VoteResultQuery) Exist ¶
func (vrq *VoteResultQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VoteResultQuery) ExistX ¶
func (vrq *VoteResultQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VoteResultQuery) First ¶
func (vrq *VoteResultQuery) First(ctx context.Context) (*VoteResult, error)
First returns the first VoteResult entity from the query. Returns a *NotFoundError when no VoteResult was found.
func (*VoteResultQuery) FirstID ¶
func (vrq *VoteResultQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first VoteResult ID from the query. Returns a *NotFoundError when no VoteResult ID was found.
func (*VoteResultQuery) FirstIDX ¶
func (vrq *VoteResultQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VoteResultQuery) FirstX ¶
func (vrq *VoteResultQuery) FirstX(ctx context.Context) *VoteResult
FirstX is like First, but panics if an error occurs.
func (*VoteResultQuery) GroupBy ¶
func (vrq *VoteResultQuery) GroupBy(field string, fields ...string) *VoteResultGroupBy
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 { HTML string `json:"html,omitempty"` Count int `json:"count,omitempty"` } client.VoteResult.Query(). GroupBy(voteresult.FieldHTML). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VoteResultQuery) IDs ¶
func (vrq *VoteResultQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of VoteResult IDs.
func (*VoteResultQuery) IDsX ¶
func (vrq *VoteResultQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VoteResultQuery) Limit ¶
func (vrq *VoteResultQuery) Limit(limit int) *VoteResultQuery
Limit the number of records to be returned by this query.
func (*VoteResultQuery) Offset ¶
func (vrq *VoteResultQuery) Offset(offset int) *VoteResultQuery
Offset to start from.
func (*VoteResultQuery) Only ¶
func (vrq *VoteResultQuery) Only(ctx context.Context) (*VoteResult, error)
Only returns a single VoteResult entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VoteResult entity is found. Returns a *NotFoundError when no VoteResult entities are found.
func (*VoteResultQuery) OnlyID ¶
func (vrq *VoteResultQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only VoteResult ID in the query. Returns a *NotSingularError when more than one VoteResult ID is found. Returns a *NotFoundError when no entities are found.
func (*VoteResultQuery) OnlyIDX ¶
func (vrq *VoteResultQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VoteResultQuery) OnlyX ¶
func (vrq *VoteResultQuery) OnlyX(ctx context.Context) *VoteResult
OnlyX is like Only, but panics if an error occurs.
func (*VoteResultQuery) Order ¶
func (vrq *VoteResultQuery) Order(o ...voteresult.OrderOption) *VoteResultQuery
Order specifies how the records should be ordered.
func (*VoteResultQuery) Select ¶
func (vrq *VoteResultQuery) Select(fields ...string) *VoteResultSelect
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 { HTML string `json:"html,omitempty"` } client.VoteResult.Query(). Select(voteresult.FieldHTML). Scan(ctx, &v)
func (*VoteResultQuery) Unique ¶
func (vrq *VoteResultQuery) Unique(unique bool) *VoteResultQuery
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 (*VoteResultQuery) Where ¶
func (vrq *VoteResultQuery) Where(ps ...predicate.VoteResult) *VoteResultQuery
Where adds a new predicate for the VoteResultQuery builder.
type VoteResultSelect ¶
type VoteResultSelect struct { *VoteResultQuery // contains filtered or unexported fields }
VoteResultSelect is the builder for selecting fields of VoteResult entities.
func (*VoteResultSelect) Aggregate ¶
func (vrs *VoteResultSelect) Aggregate(fns ...AggregateFunc) *VoteResultSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VoteResultSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoteResultSelect) Scan ¶
func (vrs *VoteResultSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoteResultSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoteResultUpdate ¶
type VoteResultUpdate struct {
// contains filtered or unexported fields
}
VoteResultUpdate is the builder for updating VoteResult entities.
func (*VoteResultUpdate) Exec ¶
func (vru *VoteResultUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteResultUpdate) ExecX ¶
func (vru *VoteResultUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultUpdate) Mutation ¶
func (vru *VoteResultUpdate) Mutation() *VoteResultMutation
Mutation returns the VoteResultMutation object of the builder.
func (*VoteResultUpdate) Save ¶
func (vru *VoteResultUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VoteResultUpdate) SaveX ¶
func (vru *VoteResultUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VoteResultUpdate) SetHTML ¶
func (vru *VoteResultUpdate) SetHTML(s string) *VoteResultUpdate
SetHTML sets the "html" field.
func (*VoteResultUpdate) SetNillableHTML ¶
func (vru *VoteResultUpdate) SetNillableHTML(s *string) *VoteResultUpdate
SetNillableHTML sets the "html" field if the given value is not nil.
func (*VoteResultUpdate) SetNillablePlain ¶
func (vru *VoteResultUpdate) SetNillablePlain(s *string) *VoteResultUpdate
SetNillablePlain sets the "plain" field if the given value is not nil.
func (*VoteResultUpdate) SetNillableVoteID ¶
func (vru *VoteResultUpdate) SetNillableVoteID(s *string) *VoteResultUpdate
SetNillableVoteID sets the "vote_id" field if the given value is not nil.
func (*VoteResultUpdate) SetPlain ¶
func (vru *VoteResultUpdate) SetPlain(s string) *VoteResultUpdate
SetPlain sets the "plain" field.
func (*VoteResultUpdate) SetVoteID ¶
func (vru *VoteResultUpdate) SetVoteID(s string) *VoteResultUpdate
SetVoteID sets the "vote_id" field.
func (*VoteResultUpdate) Where ¶
func (vru *VoteResultUpdate) Where(ps ...predicate.VoteResult) *VoteResultUpdate
Where appends a list predicates to the VoteResultUpdate builder.
type VoteResultUpdateOne ¶
type VoteResultUpdateOne struct {
// contains filtered or unexported fields
}
VoteResultUpdateOne is the builder for updating a single VoteResult entity.
func (*VoteResultUpdateOne) Exec ¶
func (vruo *VoteResultUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VoteResultUpdateOne) ExecX ¶
func (vruo *VoteResultUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteResultUpdateOne) Mutation ¶
func (vruo *VoteResultUpdateOne) Mutation() *VoteResultMutation
Mutation returns the VoteResultMutation object of the builder.
func (*VoteResultUpdateOne) Save ¶
func (vruo *VoteResultUpdateOne) Save(ctx context.Context) (*VoteResult, error)
Save executes the query and returns the updated VoteResult entity.
func (*VoteResultUpdateOne) SaveX ¶
func (vruo *VoteResultUpdateOne) SaveX(ctx context.Context) *VoteResult
SaveX is like Save, but panics if an error occurs.
func (*VoteResultUpdateOne) Select ¶
func (vruo *VoteResultUpdateOne) Select(field string, fields ...string) *VoteResultUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VoteResultUpdateOne) SetHTML ¶
func (vruo *VoteResultUpdateOne) SetHTML(s string) *VoteResultUpdateOne
SetHTML sets the "html" field.
func (*VoteResultUpdateOne) SetNillableHTML ¶
func (vruo *VoteResultUpdateOne) SetNillableHTML(s *string) *VoteResultUpdateOne
SetNillableHTML sets the "html" field if the given value is not nil.
func (*VoteResultUpdateOne) SetNillablePlain ¶
func (vruo *VoteResultUpdateOne) SetNillablePlain(s *string) *VoteResultUpdateOne
SetNillablePlain sets the "plain" field if the given value is not nil.
func (*VoteResultUpdateOne) SetNillableVoteID ¶
func (vruo *VoteResultUpdateOne) SetNillableVoteID(s *string) *VoteResultUpdateOne
SetNillableVoteID sets the "vote_id" field if the given value is not nil.
func (*VoteResultUpdateOne) SetPlain ¶
func (vruo *VoteResultUpdateOne) SetPlain(s string) *VoteResultUpdateOne
SetPlain sets the "plain" field.
func (*VoteResultUpdateOne) SetVoteID ¶
func (vruo *VoteResultUpdateOne) SetVoteID(s string) *VoteResultUpdateOne
SetVoteID sets the "vote_id" field.
func (*VoteResultUpdateOne) Where ¶
func (vruo *VoteResultUpdateOne) Where(ps ...predicate.VoteResult) *VoteResultUpdateOne
Where appends a list predicates to the VoteResultUpdate builder.
type VoteSelect ¶
type VoteSelect struct { *VoteQuery // contains filtered or unexported fields }
VoteSelect is the builder for selecting fields of Vote entities.
func (*VoteSelect) Aggregate ¶
func (vs *VoteSelect) Aggregate(fns ...AggregateFunc) *VoteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VoteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoteSelect) Scan ¶
func (vs *VoteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoteUpdate ¶
type VoteUpdate struct {
// contains filtered or unexported fields
}
VoteUpdate is the builder for updating Vote entities.
func (*VoteUpdate) AddRank ¶
func (vu *VoteUpdate) AddRank(i int) *VoteUpdate
AddRank adds i to the "rank" field.
func (*VoteUpdate) ClearUser ¶
func (vu *VoteUpdate) ClearUser() *VoteUpdate
ClearUser clears the "user" edge to the User entity.
func (*VoteUpdate) Exec ¶
func (vu *VoteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoteUpdate) ExecX ¶
func (vu *VoteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteUpdate) Mutation ¶
func (vu *VoteUpdate) Mutation() *VoteMutation
Mutation returns the VoteMutation object of the builder.
func (*VoteUpdate) Save ¶
func (vu *VoteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VoteUpdate) SaveX ¶
func (vu *VoteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VoteUpdate) SetNillableRank ¶
func (vu *VoteUpdate) SetNillableRank(i *int) *VoteUpdate
SetNillableRank sets the "rank" field if the given value is not nil.
func (*VoteUpdate) SetNillableSelection ¶
func (vu *VoteUpdate) SetNillableSelection(s *string) *VoteUpdate
SetNillableSelection sets the "selection" field if the given value is not nil.
func (*VoteUpdate) SetNillableVoteID ¶
func (vu *VoteUpdate) SetNillableVoteID(s *string) *VoteUpdate
SetNillableVoteID sets the "vote_id" field if the given value is not nil.
func (*VoteUpdate) SetRank ¶
func (vu *VoteUpdate) SetRank(i int) *VoteUpdate
SetRank sets the "rank" field.
func (*VoteUpdate) SetSelection ¶
func (vu *VoteUpdate) SetSelection(s string) *VoteUpdate
SetSelection sets the "selection" field.
func (*VoteUpdate) SetUser ¶
func (vu *VoteUpdate) SetUser(u *User) *VoteUpdate
SetUser sets the "user" edge to the User entity.
func (*VoteUpdate) SetUserID ¶
func (vu *VoteUpdate) SetUserID(id string) *VoteUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*VoteUpdate) SetVoteID ¶
func (vu *VoteUpdate) SetVoteID(s string) *VoteUpdate
SetVoteID sets the "vote_id" field.
func (*VoteUpdate) Where ¶
func (vu *VoteUpdate) Where(ps ...predicate.Vote) *VoteUpdate
Where appends a list predicates to the VoteUpdate builder.
type VoteUpdateOne ¶
type VoteUpdateOne struct {
// contains filtered or unexported fields
}
VoteUpdateOne is the builder for updating a single Vote entity.
func (*VoteUpdateOne) AddRank ¶
func (vuo *VoteUpdateOne) AddRank(i int) *VoteUpdateOne
AddRank adds i to the "rank" field.
func (*VoteUpdateOne) ClearUser ¶
func (vuo *VoteUpdateOne) ClearUser() *VoteUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*VoteUpdateOne) Exec ¶
func (vuo *VoteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VoteUpdateOne) ExecX ¶
func (vuo *VoteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoteUpdateOne) Mutation ¶
func (vuo *VoteUpdateOne) Mutation() *VoteMutation
Mutation returns the VoteMutation object of the builder.
func (*VoteUpdateOne) Save ¶
func (vuo *VoteUpdateOne) Save(ctx context.Context) (*Vote, error)
Save executes the query and returns the updated Vote entity.
func (*VoteUpdateOne) SaveX ¶
func (vuo *VoteUpdateOne) SaveX(ctx context.Context) *Vote
SaveX is like Save, but panics if an error occurs.
func (*VoteUpdateOne) Select ¶
func (vuo *VoteUpdateOne) Select(field string, fields ...string) *VoteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VoteUpdateOne) SetNillableRank ¶
func (vuo *VoteUpdateOne) SetNillableRank(i *int) *VoteUpdateOne
SetNillableRank sets the "rank" field if the given value is not nil.
func (*VoteUpdateOne) SetNillableSelection ¶
func (vuo *VoteUpdateOne) SetNillableSelection(s *string) *VoteUpdateOne
SetNillableSelection sets the "selection" field if the given value is not nil.
func (*VoteUpdateOne) SetNillableVoteID ¶
func (vuo *VoteUpdateOne) SetNillableVoteID(s *string) *VoteUpdateOne
SetNillableVoteID sets the "vote_id" field if the given value is not nil.
func (*VoteUpdateOne) SetRank ¶
func (vuo *VoteUpdateOne) SetRank(i int) *VoteUpdateOne
SetRank sets the "rank" field.
func (*VoteUpdateOne) SetSelection ¶
func (vuo *VoteUpdateOne) SetSelection(s string) *VoteUpdateOne
SetSelection sets the "selection" field.
func (*VoteUpdateOne) SetUser ¶
func (vuo *VoteUpdateOne) SetUser(u *User) *VoteUpdateOne
SetUser sets the "user" edge to the User entity.
func (*VoteUpdateOne) SetUserID ¶
func (vuo *VoteUpdateOne) SetUserID(id string) *VoteUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*VoteUpdateOne) SetVoteID ¶
func (vuo *VoteUpdateOne) SetVoteID(s string) *VoteUpdateOne
SetVoteID sets the "vote_id" field.
func (*VoteUpdateOne) Where ¶
func (vuo *VoteUpdateOne) Where(ps ...predicate.Vote) *VoteUpdateOne
Where appends a list predicates to the VoteUpdate builder.
Source Files ¶
- birthday.go
- birthday_create.go
- birthday_delete.go
- birthday_query.go
- birthday_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- openstack.go
- openstack_create.go
- openstack_delete.go
- openstack_query.go
- openstack_update.go
- runtime.go
- shitpost.go
- shitpost_create.go
- shitpost_delete.go
- shitpost_query.go
- shitpost_update.go
- signin.go
- signin_create.go
- signin_delete.go
- signin_query.go
- signin_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go
- vote.go
- vote_create.go
- vote_delete.go
- vote_query.go
- vote_update.go
- voteresult.go
- voteresult_create.go
- voteresult_delete.go
- voteresult_query.go
- voteresult_update.go