Documentation ¶
Index ¶
- Constants
- 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 Badge
- type BadgeClient
- func (c *BadgeClient) Create() *BadgeCreate
- func (c *BadgeClient) CreateBulk(builders ...*BadgeCreate) *BadgeCreateBulk
- func (c *BadgeClient) Delete() *BadgeDelete
- func (c *BadgeClient) DeleteOne(b *Badge) *BadgeDeleteOne
- func (c *BadgeClient) DeleteOneID(id uint32) *BadgeDeleteOne
- func (c *BadgeClient) Get(ctx context.Context, id uint32) (*Badge, error)
- func (c *BadgeClient) GetX(ctx context.Context, id uint32) *Badge
- func (c *BadgeClient) Hooks() []Hook
- func (c *BadgeClient) Query() *BadgeQuery
- func (c *BadgeClient) QueryWearer(b *Badge) *PetQuery
- func (c *BadgeClient) Update() *BadgeUpdate
- func (c *BadgeClient) UpdateOne(b *Badge) *BadgeUpdateOne
- func (c *BadgeClient) UpdateOneID(id uint32) *BadgeUpdateOne
- func (c *BadgeClient) Use(hooks ...Hook)
- type BadgeCreate
- func (bc *BadgeCreate) Exec(ctx context.Context) error
- func (bc *BadgeCreate) ExecX(ctx context.Context)
- func (bc *BadgeCreate) Mutation() *BadgeMutation
- func (bc *BadgeCreate) Save(ctx context.Context) (*Badge, error)
- func (bc *BadgeCreate) SaveX(ctx context.Context) *Badge
- func (bc *BadgeCreate) SetColor(b badge.Color) *BadgeCreate
- func (bc *BadgeCreate) SetID(u uint32) *BadgeCreate
- func (bc *BadgeCreate) SetMaterial(b badge.Material) *BadgeCreate
- func (bc *BadgeCreate) SetNillableWearerID(id *int) *BadgeCreate
- func (bc *BadgeCreate) SetWearer(p *Pet) *BadgeCreate
- func (bc *BadgeCreate) SetWearerID(id int) *BadgeCreate
- type BadgeCreateBulk
- type BadgeDelete
- type BadgeDeleteOne
- type BadgeEdges
- type BadgeGroupBy
- func (bgb *BadgeGroupBy) Aggregate(fns ...AggregateFunc) *BadgeGroupBy
- func (bgb *BadgeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (bgb *BadgeGroupBy) BoolX(ctx context.Context) bool
- func (bgb *BadgeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (bgb *BadgeGroupBy) BoolsX(ctx context.Context) []bool
- func (bgb *BadgeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (bgb *BadgeGroupBy) Float64X(ctx context.Context) float64
- func (bgb *BadgeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (bgb *BadgeGroupBy) Float64sX(ctx context.Context) []float64
- func (bgb *BadgeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (bgb *BadgeGroupBy) IntX(ctx context.Context) int
- func (bgb *BadgeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (bgb *BadgeGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BadgeGroupBy) Scan(ctx context.Context, v interface{}) error
- func (bgb *BadgeGroupBy) ScanX(ctx context.Context, v interface{})
- func (bgb *BadgeGroupBy) String(ctx context.Context) (_ string, err error)
- func (bgb *BadgeGroupBy) StringX(ctx context.Context) string
- func (bgb *BadgeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (bgb *BadgeGroupBy) StringsX(ctx context.Context) []string
- type BadgeMutation
- func (m *BadgeMutation) AddField(name string, value ent.Value) error
- func (m *BadgeMutation) AddedEdges() []string
- func (m *BadgeMutation) AddedField(name string) (ent.Value, bool)
- func (m *BadgeMutation) AddedFields() []string
- func (m *BadgeMutation) AddedIDs(name string) []ent.Value
- func (m *BadgeMutation) ClearEdge(name string) error
- func (m *BadgeMutation) ClearField(name string) error
- func (m *BadgeMutation) ClearWearer()
- func (m *BadgeMutation) ClearedEdges() []string
- func (m *BadgeMutation) ClearedFields() []string
- func (m BadgeMutation) Client() *Client
- func (m *BadgeMutation) Color() (r badge.Color, exists bool)
- func (m *BadgeMutation) EdgeCleared(name string) bool
- func (m *BadgeMutation) Field(name string) (ent.Value, bool)
- func (m *BadgeMutation) FieldCleared(name string) bool
- func (m *BadgeMutation) Fields() []string
- func (m *BadgeMutation) ID() (id uint32, exists bool)
- func (m *BadgeMutation) Material() (r badge.Material, exists bool)
- func (m *BadgeMutation) OldColor(ctx context.Context) (v badge.Color, err error)
- func (m *BadgeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BadgeMutation) OldMaterial(ctx context.Context) (v badge.Material, err error)
- func (m *BadgeMutation) Op() Op
- func (m *BadgeMutation) RemovedEdges() []string
- func (m *BadgeMutation) RemovedIDs(name string) []ent.Value
- func (m *BadgeMutation) ResetColor()
- func (m *BadgeMutation) ResetEdge(name string) error
- func (m *BadgeMutation) ResetField(name string) error
- func (m *BadgeMutation) ResetMaterial()
- func (m *BadgeMutation) ResetWearer()
- func (m *BadgeMutation) SetColor(b badge.Color)
- func (m *BadgeMutation) SetField(name string, value ent.Value) error
- func (m *BadgeMutation) SetID(id uint32)
- func (m *BadgeMutation) SetMaterial(b badge.Material)
- func (m *BadgeMutation) SetWearerID(id int)
- func (m BadgeMutation) Tx() (*Tx, error)
- func (m *BadgeMutation) Type() string
- func (m *BadgeMutation) WearerCleared() bool
- func (m *BadgeMutation) WearerID() (id int, exists bool)
- func (m *BadgeMutation) WearerIDs() (ids []int)
- func (m *BadgeMutation) Where(ps ...predicate.Badge)
- type BadgeQuery
- func (bq *BadgeQuery) All(ctx context.Context) ([]*Badge, error)
- func (bq *BadgeQuery) AllX(ctx context.Context) []*Badge
- func (bq *BadgeQuery) Clone() *BadgeQuery
- func (bq *BadgeQuery) Count(ctx context.Context) (int, error)
- func (bq *BadgeQuery) CountX(ctx context.Context) int
- func (bq *BadgeQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BadgeQuery) ExistX(ctx context.Context) bool
- func (bq *BadgeQuery) First(ctx context.Context) (*Badge, error)
- func (bq *BadgeQuery) FirstID(ctx context.Context) (id uint32, err error)
- func (bq *BadgeQuery) FirstIDX(ctx context.Context) uint32
- func (bq *BadgeQuery) FirstX(ctx context.Context) *Badge
- func (bq *BadgeQuery) GroupBy(field string, fields ...string) *BadgeGroupBy
- func (bq *BadgeQuery) IDs(ctx context.Context) ([]uint32, error)
- func (bq *BadgeQuery) IDsX(ctx context.Context) []uint32
- func (bq *BadgeQuery) Limit(limit int) *BadgeQuery
- func (bq *BadgeQuery) Offset(offset int) *BadgeQuery
- func (bq *BadgeQuery) Only(ctx context.Context) (*Badge, error)
- func (bq *BadgeQuery) OnlyID(ctx context.Context) (id uint32, err error)
- func (bq *BadgeQuery) OnlyIDX(ctx context.Context) uint32
- func (bq *BadgeQuery) OnlyX(ctx context.Context) *Badge
- func (bq *BadgeQuery) Order(o ...OrderFunc) *BadgeQuery
- func (bq *BadgeQuery) QueryWearer() *PetQuery
- func (bq *BadgeQuery) Select(fields ...string) *BadgeSelect
- func (bq *BadgeQuery) Unique(unique bool) *BadgeQuery
- func (bq *BadgeQuery) Where(ps ...predicate.Badge) *BadgeQuery
- func (bq *BadgeQuery) WithWearer(opts ...func(*PetQuery)) *BadgeQuery
- type BadgeSelect
- func (bs *BadgeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (bs *BadgeSelect) BoolX(ctx context.Context) bool
- func (bs *BadgeSelect) Bools(ctx context.Context) ([]bool, error)
- func (bs *BadgeSelect) BoolsX(ctx context.Context) []bool
- func (bs *BadgeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (bs *BadgeSelect) Float64X(ctx context.Context) float64
- func (bs *BadgeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (bs *BadgeSelect) Float64sX(ctx context.Context) []float64
- func (bs *BadgeSelect) Int(ctx context.Context) (_ int, err error)
- func (bs *BadgeSelect) IntX(ctx context.Context) int
- func (bs *BadgeSelect) Ints(ctx context.Context) ([]int, error)
- func (bs *BadgeSelect) IntsX(ctx context.Context) []int
- func (bs *BadgeSelect) Scan(ctx context.Context, v interface{}) error
- func (bs *BadgeSelect) ScanX(ctx context.Context, v interface{})
- func (bs *BadgeSelect) String(ctx context.Context) (_ string, err error)
- func (bs *BadgeSelect) StringX(ctx context.Context) string
- func (bs *BadgeSelect) Strings(ctx context.Context) ([]string, error)
- func (bs *BadgeSelect) StringsX(ctx context.Context) []string
- type BadgeUpdate
- func (bu *BadgeUpdate) ClearWearer() *BadgeUpdate
- func (bu *BadgeUpdate) Exec(ctx context.Context) error
- func (bu *BadgeUpdate) ExecX(ctx context.Context)
- func (bu *BadgeUpdate) Mutation() *BadgeMutation
- func (bu *BadgeUpdate) Save(ctx context.Context) (int, error)
- func (bu *BadgeUpdate) SaveX(ctx context.Context) int
- func (bu *BadgeUpdate) SetColor(b badge.Color) *BadgeUpdate
- func (bu *BadgeUpdate) SetMaterial(b badge.Material) *BadgeUpdate
- func (bu *BadgeUpdate) SetNillableWearerID(id *int) *BadgeUpdate
- func (bu *BadgeUpdate) SetWearer(p *Pet) *BadgeUpdate
- func (bu *BadgeUpdate) SetWearerID(id int) *BadgeUpdate
- func (bu *BadgeUpdate) Where(ps ...predicate.Badge) *BadgeUpdate
- type BadgeUpdateOne
- func (buo *BadgeUpdateOne) ClearWearer() *BadgeUpdateOne
- func (buo *BadgeUpdateOne) Exec(ctx context.Context) error
- func (buo *BadgeUpdateOne) ExecX(ctx context.Context)
- func (buo *BadgeUpdateOne) Mutation() *BadgeMutation
- func (buo *BadgeUpdateOne) Save(ctx context.Context) (*Badge, error)
- func (buo *BadgeUpdateOne) SaveX(ctx context.Context) *Badge
- func (buo *BadgeUpdateOne) Select(field string, fields ...string) *BadgeUpdateOne
- func (buo *BadgeUpdateOne) SetColor(b badge.Color) *BadgeUpdateOne
- func (buo *BadgeUpdateOne) SetMaterial(b badge.Material) *BadgeUpdateOne
- func (buo *BadgeUpdateOne) SetNillableWearerID(id *int) *BadgeUpdateOne
- func (buo *BadgeUpdateOne) SetWearer(p *Pet) *BadgeUpdateOne
- func (buo *BadgeUpdateOne) SetWearerID(id int) *BadgeUpdateOne
- type Badges
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Pet
- func (pe *Pet) QueryBadge() *BadgeQuery
- func (pe *Pet) QueryChildren() *PetQuery
- func (pe *Pet) QueryFriends() *PetQuery
- func (pe *Pet) QueryMentor() *PetQuery
- func (pe *Pet) QueryParent() *PetQuery
- func (pe *Pet) QueryPlayGroups() *PlayGroupQuery
- func (pe *Pet) QueryProtege() *PetQuery
- func (pe *Pet) QuerySpouse() *PetQuery
- func (pe *Pet) QueryToys() *ToyQuery
- func (pe *Pet) String() string
- func (pe *Pet) Unwrap() *Pet
- func (pe *Pet) Update() *PetUpdateOne
- type PetClient
- func (c *PetClient) Create() *PetCreate
- func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
- func (c *PetClient) Delete() *PetDelete
- func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
- func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
- func (c *PetClient) Get(ctx context.Context, id int) (*Pet, error)
- func (c *PetClient) GetX(ctx context.Context, id int) *Pet
- func (c *PetClient) Hooks() []Hook
- func (c *PetClient) Query() *PetQuery
- func (c *PetClient) QueryBadge(pe *Pet) *BadgeQuery
- func (c *PetClient) QueryChildren(pe *Pet) *PetQuery
- func (c *PetClient) QueryFriends(pe *Pet) *PetQuery
- func (c *PetClient) QueryMentor(pe *Pet) *PetQuery
- func (c *PetClient) QueryParent(pe *Pet) *PetQuery
- func (c *PetClient) QueryPlayGroups(pe *Pet) *PlayGroupQuery
- func (c *PetClient) QueryProtege(pe *Pet) *PetQuery
- func (c *PetClient) QuerySpouse(pe *Pet) *PetQuery
- func (c *PetClient) QueryToys(pe *Pet) *ToyQuery
- func (c *PetClient) Update() *PetUpdate
- func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
- func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
- func (c *PetClient) Use(hooks ...Hook)
- type PetCreate
- func (pc *PetCreate) AddChildIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddChildren(p ...*Pet) *PetCreate
- func (pc *PetCreate) AddFriendIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddFriends(p ...*Pet) *PetCreate
- func (pc *PetCreate) AddPlayGroupIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddPlayGroups(p ...*PlayGroup) *PetCreate
- func (pc *PetCreate) AddToyIDs(ids ...uuid.UUID) *PetCreate
- func (pc *PetCreate) AddToys(t ...*Toy) *PetCreate
- func (pc *PetCreate) Exec(ctx context.Context) error
- func (pc *PetCreate) ExecX(ctx context.Context)
- func (pc *PetCreate) Mutation() *PetMutation
- func (pc *PetCreate) Save(ctx context.Context) (*Pet, error)
- func (pc *PetCreate) SaveX(ctx context.Context) *Pet
- func (pc *PetCreate) SetBadge(b *Badge) *PetCreate
- func (pc *PetCreate) SetBadgeID(id uint32) *PetCreate
- func (pc *PetCreate) SetBirthday(t time.Time) *PetCreate
- func (pc *PetCreate) SetCastrated(b bool) *PetCreate
- func (pc *PetCreate) SetChip(u uuid.UUID) *PetCreate
- func (pc *PetCreate) SetHeight(i int) *PetCreate
- func (pc *PetCreate) SetMentor(p *Pet) *PetCreate
- func (pc *PetCreate) SetMentorID(id int) *PetCreate
- func (pc *PetCreate) SetName(s string) *PetCreate
- func (pc *PetCreate) SetNicknames(s []string) *PetCreate
- func (pc *PetCreate) SetNillableBirthday(t *time.Time) *PetCreate
- func (pc *PetCreate) SetNillableMentorID(id *int) *PetCreate
- func (pc *PetCreate) SetNillableParentID(id *int) *PetCreate
- func (pc *PetCreate) SetNillableProtegeID(id *int) *PetCreate
- func (pc *PetCreate) SetNillableSpouseID(id *int) *PetCreate
- func (pc *PetCreate) SetNillableWeight(f *float64) *PetCreate
- func (pc *PetCreate) SetParent(p *Pet) *PetCreate
- func (pc *PetCreate) SetParentID(id int) *PetCreate
- func (pc *PetCreate) SetProtege(p *Pet) *PetCreate
- func (pc *PetCreate) SetProtegeID(id int) *PetCreate
- func (pc *PetCreate) SetSex(pe pet.Sex) *PetCreate
- func (pc *PetCreate) SetSpouse(p *Pet) *PetCreate
- func (pc *PetCreate) SetSpouseID(id int) *PetCreate
- func (pc *PetCreate) SetWeight(f float64) *PetCreate
- type PetCreateBulk
- type PetDelete
- type PetDeleteOne
- type PetEdges
- func (e PetEdges) BadgeOrErr() (*Badge, error)
- func (e PetEdges) ChildrenOrErr() ([]*Pet, error)
- func (e PetEdges) FriendsOrErr() ([]*Pet, error)
- func (e PetEdges) MentorOrErr() (*Pet, error)
- func (e PetEdges) ParentOrErr() (*Pet, error)
- func (e PetEdges) PlayGroupsOrErr() ([]*PlayGroup, error)
- func (e PetEdges) ProtegeOrErr() (*Pet, error)
- func (e PetEdges) SpouseOrErr() (*Pet, error)
- func (e PetEdges) ToysOrErr() ([]*Toy, error)
- type PetGroupBy
- func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
- func (pgb *PetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (pgb *PetGroupBy) BoolX(ctx context.Context) bool
- func (pgb *PetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (pgb *PetGroupBy) BoolsX(ctx context.Context) []bool
- func (pgb *PetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (pgb *PetGroupBy) Float64X(ctx context.Context) float64
- func (pgb *PetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (pgb *PetGroupBy) Float64sX(ctx context.Context) []float64
- func (pgb *PetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (pgb *PetGroupBy) IntX(ctx context.Context) int
- func (pgb *PetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (pgb *PetGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error
- func (pgb *PetGroupBy) ScanX(ctx context.Context, v interface{})
- func (pgb *PetGroupBy) String(ctx context.Context) (_ string, err error)
- func (pgb *PetGroupBy) StringX(ctx context.Context) string
- func (pgb *PetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (pgb *PetGroupBy) StringsX(ctx context.Context) []string
- type PetMutation
- func (m *PetMutation) AddChildIDs(ids ...int)
- func (m *PetMutation) AddField(name string, value ent.Value) error
- func (m *PetMutation) AddFriendIDs(ids ...int)
- func (m *PetMutation) AddHeight(i int)
- func (m *PetMutation) AddPlayGroupIDs(ids ...int)
- func (m *PetMutation) AddToyIDs(ids ...uuid.UUID)
- func (m *PetMutation) AddWeight(f float64)
- func (m *PetMutation) AddedEdges() []string
- func (m *PetMutation) AddedField(name string) (ent.Value, bool)
- func (m *PetMutation) AddedFields() []string
- func (m *PetMutation) AddedHeight() (r int, exists bool)
- func (m *PetMutation) AddedIDs(name string) []ent.Value
- func (m *PetMutation) AddedWeight() (r float64, exists bool)
- func (m *PetMutation) BadgeCleared() bool
- func (m *PetMutation) BadgeID() (id uint32, exists bool)
- func (m *PetMutation) BadgeIDs() (ids []uint32)
- func (m *PetMutation) Birthday() (r time.Time, exists bool)
- func (m *PetMutation) BirthdayCleared() bool
- func (m *PetMutation) Castrated() (r bool, exists bool)
- func (m *PetMutation) ChildrenCleared() bool
- func (m *PetMutation) ChildrenIDs() (ids []int)
- func (m *PetMutation) Chip() (r uuid.UUID, exists bool)
- func (m *PetMutation) ClearBadge()
- func (m *PetMutation) ClearBirthday()
- func (m *PetMutation) ClearChildren()
- func (m *PetMutation) ClearEdge(name string) error
- func (m *PetMutation) ClearField(name string) error
- func (m *PetMutation) ClearFriends()
- func (m *PetMutation) ClearMentor()
- func (m *PetMutation) ClearNicknames()
- func (m *PetMutation) ClearParent()
- func (m *PetMutation) ClearPlayGroups()
- func (m *PetMutation) ClearProtege()
- func (m *PetMutation) ClearSpouse()
- func (m *PetMutation) ClearToys()
- func (m *PetMutation) ClearWeight()
- func (m *PetMutation) ClearedEdges() []string
- func (m *PetMutation) ClearedFields() []string
- func (m PetMutation) Client() *Client
- func (m *PetMutation) EdgeCleared(name string) bool
- func (m *PetMutation) Field(name string) (ent.Value, bool)
- func (m *PetMutation) FieldCleared(name string) bool
- func (m *PetMutation) Fields() []string
- func (m *PetMutation) FriendsCleared() bool
- func (m *PetMutation) FriendsIDs() (ids []int)
- func (m *PetMutation) Height() (r int, exists bool)
- func (m *PetMutation) ID() (id int, exists bool)
- func (m *PetMutation) MentorCleared() bool
- func (m *PetMutation) MentorID() (id int, exists bool)
- func (m *PetMutation) MentorIDs() (ids []int)
- func (m *PetMutation) Name() (r string, exists bool)
- func (m *PetMutation) Nicknames() (r []string, exists bool)
- func (m *PetMutation) NicknamesCleared() bool
- func (m *PetMutation) OldBirthday(ctx context.Context) (v time.Time, err error)
- func (m *PetMutation) OldCastrated(ctx context.Context) (v bool, err error)
- func (m *PetMutation) OldChip(ctx context.Context) (v uuid.UUID, err error)
- func (m *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PetMutation) OldHeight(ctx context.Context) (v int, err error)
- func (m *PetMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PetMutation) OldNicknames(ctx context.Context) (v []string, err error)
- func (m *PetMutation) OldSex(ctx context.Context) (v pet.Sex, err error)
- func (m *PetMutation) OldWeight(ctx context.Context) (v float64, err error)
- func (m *PetMutation) Op() Op
- func (m *PetMutation) ParentCleared() bool
- func (m *PetMutation) ParentID() (id int, exists bool)
- func (m *PetMutation) ParentIDs() (ids []int)
- func (m *PetMutation) PlayGroupsCleared() bool
- func (m *PetMutation) PlayGroupsIDs() (ids []int)
- func (m *PetMutation) ProtegeCleared() bool
- func (m *PetMutation) ProtegeID() (id int, exists bool)
- func (m *PetMutation) ProtegeIDs() (ids []int)
- func (m *PetMutation) RemoveChildIDs(ids ...int)
- func (m *PetMutation) RemoveFriendIDs(ids ...int)
- func (m *PetMutation) RemovePlayGroupIDs(ids ...int)
- func (m *PetMutation) RemoveToyIDs(ids ...uuid.UUID)
- func (m *PetMutation) RemovedChildrenIDs() (ids []int)
- func (m *PetMutation) RemovedEdges() []string
- func (m *PetMutation) RemovedFriendsIDs() (ids []int)
- func (m *PetMutation) RemovedIDs(name string) []ent.Value
- func (m *PetMutation) RemovedPlayGroupsIDs() (ids []int)
- func (m *PetMutation) RemovedToysIDs() (ids []uuid.UUID)
- func (m *PetMutation) ResetBadge()
- func (m *PetMutation) ResetBirthday()
- func (m *PetMutation) ResetCastrated()
- func (m *PetMutation) ResetChildren()
- func (m *PetMutation) ResetChip()
- func (m *PetMutation) ResetEdge(name string) error
- func (m *PetMutation) ResetField(name string) error
- func (m *PetMutation) ResetFriends()
- func (m *PetMutation) ResetHeight()
- func (m *PetMutation) ResetMentor()
- func (m *PetMutation) ResetName()
- func (m *PetMutation) ResetNicknames()
- func (m *PetMutation) ResetParent()
- func (m *PetMutation) ResetPlayGroups()
- func (m *PetMutation) ResetProtege()
- func (m *PetMutation) ResetSex()
- func (m *PetMutation) ResetSpouse()
- func (m *PetMutation) ResetToys()
- func (m *PetMutation) ResetWeight()
- func (m *PetMutation) SetBadgeID(id uint32)
- func (m *PetMutation) SetBirthday(t time.Time)
- func (m *PetMutation) SetCastrated(b bool)
- func (m *PetMutation) SetChip(u uuid.UUID)
- func (m *PetMutation) SetField(name string, value ent.Value) error
- func (m *PetMutation) SetHeight(i int)
- func (m *PetMutation) SetMentorID(id int)
- func (m *PetMutation) SetName(s string)
- func (m *PetMutation) SetNicknames(s []string)
- func (m *PetMutation) SetParentID(id int)
- func (m *PetMutation) SetProtegeID(id int)
- func (m *PetMutation) SetSex(pe pet.Sex)
- func (m *PetMutation) SetSpouseID(id int)
- func (m *PetMutation) SetWeight(f float64)
- func (m *PetMutation) Sex() (r pet.Sex, exists bool)
- func (m *PetMutation) SpouseCleared() bool
- func (m *PetMutation) SpouseID() (id int, exists bool)
- func (m *PetMutation) SpouseIDs() (ids []int)
- func (m *PetMutation) ToysCleared() bool
- func (m *PetMutation) ToysIDs() (ids []uuid.UUID)
- func (m PetMutation) Tx() (*Tx, error)
- func (m *PetMutation) Type() string
- func (m *PetMutation) Weight() (r float64, exists bool)
- func (m *PetMutation) WeightCleared() bool
- func (m *PetMutation) Where(ps ...predicate.Pet)
- type PetQuery
- func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error)
- func (pq *PetQuery) AllX(ctx context.Context) []*Pet
- func (pq *PetQuery) Clone() *PetQuery
- func (pq *PetQuery) Count(ctx context.Context) (int, error)
- func (pq *PetQuery) CountX(ctx context.Context) int
- func (pq *PetQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PetQuery) ExistX(ctx context.Context) bool
- func (pq *PetQuery) First(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) FirstIDX(ctx context.Context) int
- func (pq *PetQuery) FirstX(ctx context.Context) *Pet
- func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
- func (pq *PetQuery) IDs(ctx context.Context) ([]int, error)
- func (pq *PetQuery) IDsX(ctx context.Context) []int
- func (pq *PetQuery) Limit(limit int) *PetQuery
- func (pq *PetQuery) Offset(offset int) *PetQuery
- func (pq *PetQuery) Only(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) OnlyIDX(ctx context.Context) int
- func (pq *PetQuery) OnlyX(ctx context.Context) *Pet
- func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery
- func (pq *PetQuery) QueryBadge() *BadgeQuery
- func (pq *PetQuery) QueryChildren() *PetQuery
- func (pq *PetQuery) QueryFriends() *PetQuery
- func (pq *PetQuery) QueryMentor() *PetQuery
- func (pq *PetQuery) QueryParent() *PetQuery
- func (pq *PetQuery) QueryPlayGroups() *PlayGroupQuery
- func (pq *PetQuery) QueryProtege() *PetQuery
- func (pq *PetQuery) QuerySpouse() *PetQuery
- func (pq *PetQuery) QueryToys() *ToyQuery
- func (pq *PetQuery) Select(fields ...string) *PetSelect
- func (pq *PetQuery) Unique(unique bool) *PetQuery
- func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery
- func (pq *PetQuery) WithBadge(opts ...func(*BadgeQuery)) *PetQuery
- func (pq *PetQuery) WithChildren(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithFriends(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithMentor(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithParent(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithPlayGroups(opts ...func(*PlayGroupQuery)) *PetQuery
- func (pq *PetQuery) WithProtege(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithSpouse(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithToys(opts ...func(*ToyQuery)) *PetQuery
- type PetSelect
- func (ps *PetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ps *PetSelect) BoolX(ctx context.Context) bool
- func (ps *PetSelect) Bools(ctx context.Context) ([]bool, error)
- func (ps *PetSelect) BoolsX(ctx context.Context) []bool
- func (ps *PetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ps *PetSelect) Float64X(ctx context.Context) float64
- func (ps *PetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ps *PetSelect) Float64sX(ctx context.Context) []float64
- func (ps *PetSelect) Int(ctx context.Context) (_ int, err error)
- func (ps *PetSelect) IntX(ctx context.Context) int
- func (ps *PetSelect) Ints(ctx context.Context) ([]int, error)
- func (ps *PetSelect) IntsX(ctx context.Context) []int
- func (ps *PetSelect) Scan(ctx context.Context, v interface{}) error
- func (ps *PetSelect) ScanX(ctx context.Context, v interface{})
- func (ps *PetSelect) String(ctx context.Context) (_ string, err error)
- func (ps *PetSelect) StringX(ctx context.Context) string
- func (ps *PetSelect) Strings(ctx context.Context) ([]string, error)
- func (ps *PetSelect) StringsX(ctx context.Context) []string
- type PetUpdate
- func (pu *PetUpdate) AddChildIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddChildren(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) AddFriendIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) AddHeight(i int) *PetUpdate
- func (pu *PetUpdate) AddPlayGroupIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddPlayGroups(p ...*PlayGroup) *PetUpdate
- func (pu *PetUpdate) AddToyIDs(ids ...uuid.UUID) *PetUpdate
- func (pu *PetUpdate) AddToys(t ...*Toy) *PetUpdate
- func (pu *PetUpdate) AddWeight(f float64) *PetUpdate
- func (pu *PetUpdate) ClearBadge() *PetUpdate
- func (pu *PetUpdate) ClearBirthday() *PetUpdate
- func (pu *PetUpdate) ClearChildren() *PetUpdate
- func (pu *PetUpdate) ClearFriends() *PetUpdate
- func (pu *PetUpdate) ClearMentor() *PetUpdate
- func (pu *PetUpdate) ClearNicknames() *PetUpdate
- func (pu *PetUpdate) ClearParent() *PetUpdate
- func (pu *PetUpdate) ClearPlayGroups() *PetUpdate
- func (pu *PetUpdate) ClearProtege() *PetUpdate
- func (pu *PetUpdate) ClearSpouse() *PetUpdate
- func (pu *PetUpdate) ClearToys() *PetUpdate
- func (pu *PetUpdate) ClearWeight() *PetUpdate
- func (pu *PetUpdate) Exec(ctx context.Context) error
- func (pu *PetUpdate) ExecX(ctx context.Context)
- func (pu *PetUpdate) Mutation() *PetMutation
- func (pu *PetUpdate) RemoveChildIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemoveChildren(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) RemoveFriendIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemoveFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) RemovePlayGroupIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemovePlayGroups(p ...*PlayGroup) *PetUpdate
- func (pu *PetUpdate) RemoveToyIDs(ids ...uuid.UUID) *PetUpdate
- func (pu *PetUpdate) RemoveToys(t ...*Toy) *PetUpdate
- func (pu *PetUpdate) Save(ctx context.Context) (int, error)
- func (pu *PetUpdate) SaveX(ctx context.Context) int
- func (pu *PetUpdate) SetBadge(b *Badge) *PetUpdate
- func (pu *PetUpdate) SetBadgeID(id uint32) *PetUpdate
- func (pu *PetUpdate) SetBirthday(t time.Time) *PetUpdate
- func (pu *PetUpdate) SetCastrated(b bool) *PetUpdate
- func (pu *PetUpdate) SetChip(u uuid.UUID) *PetUpdate
- func (pu *PetUpdate) SetHeight(i int) *PetUpdate
- func (pu *PetUpdate) SetMentor(p *Pet) *PetUpdate
- func (pu *PetUpdate) SetMentorID(id int) *PetUpdate
- func (pu *PetUpdate) SetName(s string) *PetUpdate
- func (pu *PetUpdate) SetNicknames(s []string) *PetUpdate
- func (pu *PetUpdate) SetNillableBirthday(t *time.Time) *PetUpdate
- func (pu *PetUpdate) SetNillableMentorID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableParentID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableProtegeID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableSpouseID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableWeight(f *float64) *PetUpdate
- func (pu *PetUpdate) SetParent(p *Pet) *PetUpdate
- func (pu *PetUpdate) SetParentID(id int) *PetUpdate
- func (pu *PetUpdate) SetProtege(p *Pet) *PetUpdate
- func (pu *PetUpdate) SetProtegeID(id int) *PetUpdate
- func (pu *PetUpdate) SetSex(pe pet.Sex) *PetUpdate
- func (pu *PetUpdate) SetSpouse(p *Pet) *PetUpdate
- func (pu *PetUpdate) SetSpouseID(id int) *PetUpdate
- func (pu *PetUpdate) SetWeight(f float64) *PetUpdate
- func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate
- type PetUpdateOne
- func (puo *PetUpdateOne) AddChildIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddChildren(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriendIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriends(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) AddHeight(i int) *PetUpdateOne
- func (puo *PetUpdateOne) AddPlayGroupIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddPlayGroups(p ...*PlayGroup) *PetUpdateOne
- func (puo *PetUpdateOne) AddToyIDs(ids ...uuid.UUID) *PetUpdateOne
- func (puo *PetUpdateOne) AddToys(t ...*Toy) *PetUpdateOne
- func (puo *PetUpdateOne) AddWeight(f float64) *PetUpdateOne
- func (puo *PetUpdateOne) ClearBadge() *PetUpdateOne
- func (puo *PetUpdateOne) ClearBirthday() *PetUpdateOne
- func (puo *PetUpdateOne) ClearChildren() *PetUpdateOne
- func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
- func (puo *PetUpdateOne) ClearMentor() *PetUpdateOne
- func (puo *PetUpdateOne) ClearNicknames() *PetUpdateOne
- func (puo *PetUpdateOne) ClearParent() *PetUpdateOne
- func (puo *PetUpdateOne) ClearPlayGroups() *PetUpdateOne
- func (puo *PetUpdateOne) ClearProtege() *PetUpdateOne
- func (puo *PetUpdateOne) ClearSpouse() *PetUpdateOne
- func (puo *PetUpdateOne) ClearToys() *PetUpdateOne
- func (puo *PetUpdateOne) ClearWeight() *PetUpdateOne
- func (puo *PetUpdateOne) Exec(ctx context.Context) error
- func (puo *PetUpdateOne) ExecX(ctx context.Context)
- func (puo *PetUpdateOne) Mutation() *PetMutation
- func (puo *PetUpdateOne) RemoveChildIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveChildren(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriendIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriends(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) RemovePlayGroupIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemovePlayGroups(p ...*PlayGroup) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveToyIDs(ids ...uuid.UUID) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveToys(t ...*Toy) *PetUpdateOne
- func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
- func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
- func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
- func (puo *PetUpdateOne) SetBadge(b *Badge) *PetUpdateOne
- func (puo *PetUpdateOne) SetBadgeID(id uint32) *PetUpdateOne
- func (puo *PetUpdateOne) SetBirthday(t time.Time) *PetUpdateOne
- func (puo *PetUpdateOne) SetCastrated(b bool) *PetUpdateOne
- func (puo *PetUpdateOne) SetChip(u uuid.UUID) *PetUpdateOne
- func (puo *PetUpdateOne) SetHeight(i int) *PetUpdateOne
- func (puo *PetUpdateOne) SetMentor(p *Pet) *PetUpdateOne
- func (puo *PetUpdateOne) SetMentorID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNicknames(s []string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableBirthday(t *time.Time) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableMentorID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableParentID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableProtegeID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableSpouseID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableWeight(f *float64) *PetUpdateOne
- func (puo *PetUpdateOne) SetParent(p *Pet) *PetUpdateOne
- func (puo *PetUpdateOne) SetParentID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetProtege(p *Pet) *PetUpdateOne
- func (puo *PetUpdateOne) SetProtegeID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetSex(pe pet.Sex) *PetUpdateOne
- func (puo *PetUpdateOne) SetSpouse(p *Pet) *PetUpdateOne
- func (puo *PetUpdateOne) SetSpouseID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetWeight(f float64) *PetUpdateOne
- type Pets
- type PlayGroup
- type PlayGroupClient
- func (c *PlayGroupClient) Create() *PlayGroupCreate
- func (c *PlayGroupClient) CreateBulk(builders ...*PlayGroupCreate) *PlayGroupCreateBulk
- func (c *PlayGroupClient) Delete() *PlayGroupDelete
- func (c *PlayGroupClient) DeleteOne(pg *PlayGroup) *PlayGroupDeleteOne
- func (c *PlayGroupClient) DeleteOneID(id int) *PlayGroupDeleteOne
- func (c *PlayGroupClient) Get(ctx context.Context, id int) (*PlayGroup, error)
- func (c *PlayGroupClient) GetX(ctx context.Context, id int) *PlayGroup
- func (c *PlayGroupClient) Hooks() []Hook
- func (c *PlayGroupClient) Query() *PlayGroupQuery
- func (c *PlayGroupClient) QueryParticipants(pg *PlayGroup) *PetQuery
- func (c *PlayGroupClient) Update() *PlayGroupUpdate
- func (c *PlayGroupClient) UpdateOne(pg *PlayGroup) *PlayGroupUpdateOne
- func (c *PlayGroupClient) UpdateOneID(id int) *PlayGroupUpdateOne
- func (c *PlayGroupClient) Use(hooks ...Hook)
- type PlayGroupCreate
- func (pgc *PlayGroupCreate) AddParticipantIDs(ids ...int) *PlayGroupCreate
- func (pgc *PlayGroupCreate) AddParticipants(p ...*Pet) *PlayGroupCreate
- func (pgc *PlayGroupCreate) Exec(ctx context.Context) error
- func (pgc *PlayGroupCreate) ExecX(ctx context.Context)
- func (pgc *PlayGroupCreate) Mutation() *PlayGroupMutation
- func (pgc *PlayGroupCreate) Save(ctx context.Context) (*PlayGroup, error)
- func (pgc *PlayGroupCreate) SaveX(ctx context.Context) *PlayGroup
- func (pgc *PlayGroupCreate) SetDescription(s string) *PlayGroupCreate
- func (pgc *PlayGroupCreate) SetNillableDescription(s *string) *PlayGroupCreate
- func (pgc *PlayGroupCreate) SetTitle(s string) *PlayGroupCreate
- func (pgc *PlayGroupCreate) SetWeekday(pl playgroup.Weekday) *PlayGroupCreate
- type PlayGroupCreateBulk
- type PlayGroupDelete
- type PlayGroupDeleteOne
- type PlayGroupEdges
- type PlayGroupGroupBy
- func (pggb *PlayGroupGroupBy) Aggregate(fns ...AggregateFunc) *PlayGroupGroupBy
- func (pggb *PlayGroupGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (pggb *PlayGroupGroupBy) BoolX(ctx context.Context) bool
- func (pggb *PlayGroupGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (pggb *PlayGroupGroupBy) BoolsX(ctx context.Context) []bool
- func (pggb *PlayGroupGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (pggb *PlayGroupGroupBy) Float64X(ctx context.Context) float64
- func (pggb *PlayGroupGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (pggb *PlayGroupGroupBy) Float64sX(ctx context.Context) []float64
- func (pggb *PlayGroupGroupBy) Int(ctx context.Context) (_ int, err error)
- func (pggb *PlayGroupGroupBy) IntX(ctx context.Context) int
- func (pggb *PlayGroupGroupBy) Ints(ctx context.Context) ([]int, error)
- func (pggb *PlayGroupGroupBy) IntsX(ctx context.Context) []int
- func (pggb *PlayGroupGroupBy) Scan(ctx context.Context, v interface{}) error
- func (pggb *PlayGroupGroupBy) ScanX(ctx context.Context, v interface{})
- func (pggb *PlayGroupGroupBy) String(ctx context.Context) (_ string, err error)
- func (pggb *PlayGroupGroupBy) StringX(ctx context.Context) string
- func (pggb *PlayGroupGroupBy) Strings(ctx context.Context) ([]string, error)
- func (pggb *PlayGroupGroupBy) StringsX(ctx context.Context) []string
- type PlayGroupMutation
- func (m *PlayGroupMutation) AddField(name string, value ent.Value) error
- func (m *PlayGroupMutation) AddParticipantIDs(ids ...int)
- func (m *PlayGroupMutation) AddedEdges() []string
- func (m *PlayGroupMutation) AddedField(name string) (ent.Value, bool)
- func (m *PlayGroupMutation) AddedFields() []string
- func (m *PlayGroupMutation) AddedIDs(name string) []ent.Value
- func (m *PlayGroupMutation) ClearDescription()
- func (m *PlayGroupMutation) ClearEdge(name string) error
- func (m *PlayGroupMutation) ClearField(name string) error
- func (m *PlayGroupMutation) ClearParticipants()
- func (m *PlayGroupMutation) ClearedEdges() []string
- func (m *PlayGroupMutation) ClearedFields() []string
- func (m PlayGroupMutation) Client() *Client
- func (m *PlayGroupMutation) Description() (r string, exists bool)
- func (m *PlayGroupMutation) DescriptionCleared() bool
- func (m *PlayGroupMutation) EdgeCleared(name string) bool
- func (m *PlayGroupMutation) Field(name string) (ent.Value, bool)
- func (m *PlayGroupMutation) FieldCleared(name string) bool
- func (m *PlayGroupMutation) Fields() []string
- func (m *PlayGroupMutation) ID() (id int, exists bool)
- func (m *PlayGroupMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *PlayGroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PlayGroupMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *PlayGroupMutation) OldWeekday(ctx context.Context) (v playgroup.Weekday, err error)
- func (m *PlayGroupMutation) Op() Op
- func (m *PlayGroupMutation) ParticipantsCleared() bool
- func (m *PlayGroupMutation) ParticipantsIDs() (ids []int)
- func (m *PlayGroupMutation) RemoveParticipantIDs(ids ...int)
- func (m *PlayGroupMutation) RemovedEdges() []string
- func (m *PlayGroupMutation) RemovedIDs(name string) []ent.Value
- func (m *PlayGroupMutation) RemovedParticipantsIDs() (ids []int)
- func (m *PlayGroupMutation) ResetDescription()
- func (m *PlayGroupMutation) ResetEdge(name string) error
- func (m *PlayGroupMutation) ResetField(name string) error
- func (m *PlayGroupMutation) ResetParticipants()
- func (m *PlayGroupMutation) ResetTitle()
- func (m *PlayGroupMutation) ResetWeekday()
- func (m *PlayGroupMutation) SetDescription(s string)
- func (m *PlayGroupMutation) SetField(name string, value ent.Value) error
- func (m *PlayGroupMutation) SetTitle(s string)
- func (m *PlayGroupMutation) SetWeekday(pl playgroup.Weekday)
- func (m *PlayGroupMutation) Title() (r string, exists bool)
- func (m PlayGroupMutation) Tx() (*Tx, error)
- func (m *PlayGroupMutation) Type() string
- func (m *PlayGroupMutation) Weekday() (r playgroup.Weekday, exists bool)
- func (m *PlayGroupMutation) Where(ps ...predicate.PlayGroup)
- type PlayGroupQuery
- func (pgq *PlayGroupQuery) All(ctx context.Context) ([]*PlayGroup, error)
- func (pgq *PlayGroupQuery) AllX(ctx context.Context) []*PlayGroup
- func (pgq *PlayGroupQuery) Clone() *PlayGroupQuery
- func (pgq *PlayGroupQuery) Count(ctx context.Context) (int, error)
- func (pgq *PlayGroupQuery) CountX(ctx context.Context) int
- func (pgq *PlayGroupQuery) Exist(ctx context.Context) (bool, error)
- func (pgq *PlayGroupQuery) ExistX(ctx context.Context) bool
- func (pgq *PlayGroupQuery) First(ctx context.Context) (*PlayGroup, error)
- func (pgq *PlayGroupQuery) FirstID(ctx context.Context) (id int, err error)
- func (pgq *PlayGroupQuery) FirstIDX(ctx context.Context) int
- func (pgq *PlayGroupQuery) FirstX(ctx context.Context) *PlayGroup
- func (pgq *PlayGroupQuery) GroupBy(field string, fields ...string) *PlayGroupGroupBy
- func (pgq *PlayGroupQuery) IDs(ctx context.Context) ([]int, error)
- func (pgq *PlayGroupQuery) IDsX(ctx context.Context) []int
- func (pgq *PlayGroupQuery) Limit(limit int) *PlayGroupQuery
- func (pgq *PlayGroupQuery) Offset(offset int) *PlayGroupQuery
- func (pgq *PlayGroupQuery) Only(ctx context.Context) (*PlayGroup, error)
- func (pgq *PlayGroupQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pgq *PlayGroupQuery) OnlyIDX(ctx context.Context) int
- func (pgq *PlayGroupQuery) OnlyX(ctx context.Context) *PlayGroup
- func (pgq *PlayGroupQuery) Order(o ...OrderFunc) *PlayGroupQuery
- func (pgq *PlayGroupQuery) QueryParticipants() *PetQuery
- func (pgq *PlayGroupQuery) Select(fields ...string) *PlayGroupSelect
- func (pgq *PlayGroupQuery) Unique(unique bool) *PlayGroupQuery
- func (pgq *PlayGroupQuery) Where(ps ...predicate.PlayGroup) *PlayGroupQuery
- func (pgq *PlayGroupQuery) WithParticipants(opts ...func(*PetQuery)) *PlayGroupQuery
- type PlayGroupSelect
- func (pgs *PlayGroupSelect) Bool(ctx context.Context) (_ bool, err error)
- func (pgs *PlayGroupSelect) BoolX(ctx context.Context) bool
- func (pgs *PlayGroupSelect) Bools(ctx context.Context) ([]bool, error)
- func (pgs *PlayGroupSelect) BoolsX(ctx context.Context) []bool
- func (pgs *PlayGroupSelect) Float64(ctx context.Context) (_ float64, err error)
- func (pgs *PlayGroupSelect) Float64X(ctx context.Context) float64
- func (pgs *PlayGroupSelect) Float64s(ctx context.Context) ([]float64, error)
- func (pgs *PlayGroupSelect) Float64sX(ctx context.Context) []float64
- func (pgs *PlayGroupSelect) Int(ctx context.Context) (_ int, err error)
- func (pgs *PlayGroupSelect) IntX(ctx context.Context) int
- func (pgs *PlayGroupSelect) Ints(ctx context.Context) ([]int, error)
- func (pgs *PlayGroupSelect) IntsX(ctx context.Context) []int
- func (pgs *PlayGroupSelect) Scan(ctx context.Context, v interface{}) error
- func (pgs *PlayGroupSelect) ScanX(ctx context.Context, v interface{})
- func (pgs *PlayGroupSelect) String(ctx context.Context) (_ string, err error)
- func (pgs *PlayGroupSelect) StringX(ctx context.Context) string
- func (pgs *PlayGroupSelect) Strings(ctx context.Context) ([]string, error)
- func (pgs *PlayGroupSelect) StringsX(ctx context.Context) []string
- type PlayGroupUpdate
- func (pgu *PlayGroupUpdate) AddParticipantIDs(ids ...int) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) AddParticipants(p ...*Pet) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) ClearDescription() *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) ClearParticipants() *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) Exec(ctx context.Context) error
- func (pgu *PlayGroupUpdate) ExecX(ctx context.Context)
- func (pgu *PlayGroupUpdate) Mutation() *PlayGroupMutation
- func (pgu *PlayGroupUpdate) RemoveParticipantIDs(ids ...int) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) RemoveParticipants(p ...*Pet) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) Save(ctx context.Context) (int, error)
- func (pgu *PlayGroupUpdate) SaveX(ctx context.Context) int
- func (pgu *PlayGroupUpdate) SetDescription(s string) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) SetNillableDescription(s *string) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) SetTitle(s string) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdate
- func (pgu *PlayGroupUpdate) Where(ps ...predicate.PlayGroup) *PlayGroupUpdate
- type PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) AddParticipantIDs(ids ...int) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) AddParticipants(p ...*Pet) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) ClearDescription() *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) ClearParticipants() *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) Exec(ctx context.Context) error
- func (pguo *PlayGroupUpdateOne) ExecX(ctx context.Context)
- func (pguo *PlayGroupUpdateOne) Mutation() *PlayGroupMutation
- func (pguo *PlayGroupUpdateOne) RemoveParticipantIDs(ids ...int) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) RemoveParticipants(p ...*Pet) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) Save(ctx context.Context) (*PlayGroup, error)
- func (pguo *PlayGroupUpdateOne) SaveX(ctx context.Context) *PlayGroup
- func (pguo *PlayGroupUpdateOne) Select(field string, fields ...string) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) SetDescription(s string) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) SetNillableDescription(s *string) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) SetTitle(s string) *PlayGroupUpdateOne
- func (pguo *PlayGroupUpdateOne) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdateOne
- type PlayGroups
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Toy
- type ToyClient
- func (c *ToyClient) Create() *ToyCreate
- func (c *ToyClient) CreateBulk(builders ...*ToyCreate) *ToyCreateBulk
- func (c *ToyClient) Delete() *ToyDelete
- func (c *ToyClient) DeleteOne(t *Toy) *ToyDeleteOne
- func (c *ToyClient) DeleteOneID(id uuid.UUID) *ToyDeleteOne
- func (c *ToyClient) Get(ctx context.Context, id uuid.UUID) (*Toy, error)
- func (c *ToyClient) GetX(ctx context.Context, id uuid.UUID) *Toy
- func (c *ToyClient) Hooks() []Hook
- func (c *ToyClient) Query() *ToyQuery
- func (c *ToyClient) QueryOwner(t *Toy) *PetQuery
- func (c *ToyClient) Update() *ToyUpdate
- func (c *ToyClient) UpdateOne(t *Toy) *ToyUpdateOne
- func (c *ToyClient) UpdateOneID(id uuid.UUID) *ToyUpdateOne
- func (c *ToyClient) Use(hooks ...Hook)
- type ToyCreate
- func (tc *ToyCreate) Exec(ctx context.Context) error
- func (tc *ToyCreate) ExecX(ctx context.Context)
- func (tc *ToyCreate) Mutation() *ToyMutation
- func (tc *ToyCreate) Save(ctx context.Context) (*Toy, error)
- func (tc *ToyCreate) SaveX(ctx context.Context) *Toy
- func (tc *ToyCreate) SetColor(t toy.Color) *ToyCreate
- func (tc *ToyCreate) SetID(u uuid.UUID) *ToyCreate
- func (tc *ToyCreate) SetMaterial(t toy.Material) *ToyCreate
- func (tc *ToyCreate) SetNillableOwnerID(id *int) *ToyCreate
- func (tc *ToyCreate) SetOwner(p *Pet) *ToyCreate
- func (tc *ToyCreate) SetOwnerID(id int) *ToyCreate
- func (tc *ToyCreate) SetTitle(s string) *ToyCreate
- type ToyCreateBulk
- type ToyDelete
- type ToyDeleteOne
- type ToyEdges
- type ToyGroupBy
- func (tgb *ToyGroupBy) Aggregate(fns ...AggregateFunc) *ToyGroupBy
- func (tgb *ToyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (tgb *ToyGroupBy) BoolX(ctx context.Context) bool
- func (tgb *ToyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (tgb *ToyGroupBy) BoolsX(ctx context.Context) []bool
- func (tgb *ToyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (tgb *ToyGroupBy) Float64X(ctx context.Context) float64
- func (tgb *ToyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (tgb *ToyGroupBy) Float64sX(ctx context.Context) []float64
- func (tgb *ToyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (tgb *ToyGroupBy) IntX(ctx context.Context) int
- func (tgb *ToyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (tgb *ToyGroupBy) IntsX(ctx context.Context) []int
- func (tgb *ToyGroupBy) Scan(ctx context.Context, v interface{}) error
- func (tgb *ToyGroupBy) ScanX(ctx context.Context, v interface{})
- func (tgb *ToyGroupBy) String(ctx context.Context) (_ string, err error)
- func (tgb *ToyGroupBy) StringX(ctx context.Context) string
- func (tgb *ToyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (tgb *ToyGroupBy) StringsX(ctx context.Context) []string
- type ToyMutation
- func (m *ToyMutation) AddField(name string, value ent.Value) error
- func (m *ToyMutation) AddedEdges() []string
- func (m *ToyMutation) AddedField(name string) (ent.Value, bool)
- func (m *ToyMutation) AddedFields() []string
- func (m *ToyMutation) AddedIDs(name string) []ent.Value
- func (m *ToyMutation) ClearEdge(name string) error
- func (m *ToyMutation) ClearField(name string) error
- func (m *ToyMutation) ClearOwner()
- func (m *ToyMutation) ClearedEdges() []string
- func (m *ToyMutation) ClearedFields() []string
- func (m ToyMutation) Client() *Client
- func (m *ToyMutation) Color() (r toy.Color, exists bool)
- func (m *ToyMutation) EdgeCleared(name string) bool
- func (m *ToyMutation) Field(name string) (ent.Value, bool)
- func (m *ToyMutation) FieldCleared(name string) bool
- func (m *ToyMutation) Fields() []string
- func (m *ToyMutation) ID() (id uuid.UUID, exists bool)
- func (m *ToyMutation) Material() (r toy.Material, exists bool)
- func (m *ToyMutation) OldColor(ctx context.Context) (v toy.Color, err error)
- func (m *ToyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ToyMutation) OldMaterial(ctx context.Context) (v toy.Material, err error)
- func (m *ToyMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ToyMutation) Op() Op
- func (m *ToyMutation) OwnerCleared() bool
- func (m *ToyMutation) OwnerID() (id int, exists bool)
- func (m *ToyMutation) OwnerIDs() (ids []int)
- func (m *ToyMutation) RemovedEdges() []string
- func (m *ToyMutation) RemovedIDs(name string) []ent.Value
- func (m *ToyMutation) ResetColor()
- func (m *ToyMutation) ResetEdge(name string) error
- func (m *ToyMutation) ResetField(name string) error
- func (m *ToyMutation) ResetMaterial()
- func (m *ToyMutation) ResetOwner()
- func (m *ToyMutation) ResetTitle()
- func (m *ToyMutation) SetColor(t toy.Color)
- func (m *ToyMutation) SetField(name string, value ent.Value) error
- func (m *ToyMutation) SetID(id uuid.UUID)
- func (m *ToyMutation) SetMaterial(t toy.Material)
- func (m *ToyMutation) SetOwnerID(id int)
- func (m *ToyMutation) SetTitle(s string)
- func (m *ToyMutation) Title() (r string, exists bool)
- func (m ToyMutation) Tx() (*Tx, error)
- func (m *ToyMutation) Type() string
- func (m *ToyMutation) Where(ps ...predicate.Toy)
- type ToyQuery
- func (tq *ToyQuery) All(ctx context.Context) ([]*Toy, error)
- func (tq *ToyQuery) AllX(ctx context.Context) []*Toy
- func (tq *ToyQuery) Clone() *ToyQuery
- func (tq *ToyQuery) Count(ctx context.Context) (int, error)
- func (tq *ToyQuery) CountX(ctx context.Context) int
- func (tq *ToyQuery) Exist(ctx context.Context) (bool, error)
- func (tq *ToyQuery) ExistX(ctx context.Context) bool
- func (tq *ToyQuery) First(ctx context.Context) (*Toy, error)
- func (tq *ToyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *ToyQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (tq *ToyQuery) FirstX(ctx context.Context) *Toy
- func (tq *ToyQuery) GroupBy(field string, fields ...string) *ToyGroupBy
- func (tq *ToyQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (tq *ToyQuery) IDsX(ctx context.Context) []uuid.UUID
- func (tq *ToyQuery) Limit(limit int) *ToyQuery
- func (tq *ToyQuery) Offset(offset int) *ToyQuery
- func (tq *ToyQuery) Only(ctx context.Context) (*Toy, error)
- func (tq *ToyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *ToyQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (tq *ToyQuery) OnlyX(ctx context.Context) *Toy
- func (tq *ToyQuery) Order(o ...OrderFunc) *ToyQuery
- func (tq *ToyQuery) QueryOwner() *PetQuery
- func (tq *ToyQuery) Select(fields ...string) *ToySelect
- func (tq *ToyQuery) Unique(unique bool) *ToyQuery
- func (tq *ToyQuery) Where(ps ...predicate.Toy) *ToyQuery
- func (tq *ToyQuery) WithOwner(opts ...func(*PetQuery)) *ToyQuery
- type ToySelect
- func (ts *ToySelect) Bool(ctx context.Context) (_ bool, err error)
- func (ts *ToySelect) BoolX(ctx context.Context) bool
- func (ts *ToySelect) Bools(ctx context.Context) ([]bool, error)
- func (ts *ToySelect) BoolsX(ctx context.Context) []bool
- func (ts *ToySelect) Float64(ctx context.Context) (_ float64, err error)
- func (ts *ToySelect) Float64X(ctx context.Context) float64
- func (ts *ToySelect) Float64s(ctx context.Context) ([]float64, error)
- func (ts *ToySelect) Float64sX(ctx context.Context) []float64
- func (ts *ToySelect) Int(ctx context.Context) (_ int, err error)
- func (ts *ToySelect) IntX(ctx context.Context) int
- func (ts *ToySelect) Ints(ctx context.Context) ([]int, error)
- func (ts *ToySelect) IntsX(ctx context.Context) []int
- func (ts *ToySelect) Scan(ctx context.Context, v interface{}) error
- func (ts *ToySelect) ScanX(ctx context.Context, v interface{})
- func (ts *ToySelect) String(ctx context.Context) (_ string, err error)
- func (ts *ToySelect) StringX(ctx context.Context) string
- func (ts *ToySelect) Strings(ctx context.Context) ([]string, error)
- func (ts *ToySelect) StringsX(ctx context.Context) []string
- type ToyUpdate
- func (tu *ToyUpdate) ClearOwner() *ToyUpdate
- func (tu *ToyUpdate) Exec(ctx context.Context) error
- func (tu *ToyUpdate) ExecX(ctx context.Context)
- func (tu *ToyUpdate) Mutation() *ToyMutation
- func (tu *ToyUpdate) Save(ctx context.Context) (int, error)
- func (tu *ToyUpdate) SaveX(ctx context.Context) int
- func (tu *ToyUpdate) SetColor(t toy.Color) *ToyUpdate
- func (tu *ToyUpdate) SetMaterial(t toy.Material) *ToyUpdate
- func (tu *ToyUpdate) SetNillableOwnerID(id *int) *ToyUpdate
- func (tu *ToyUpdate) SetOwner(p *Pet) *ToyUpdate
- func (tu *ToyUpdate) SetOwnerID(id int) *ToyUpdate
- func (tu *ToyUpdate) SetTitle(s string) *ToyUpdate
- func (tu *ToyUpdate) Where(ps ...predicate.Toy) *ToyUpdate
- type ToyUpdateOne
- func (tuo *ToyUpdateOne) ClearOwner() *ToyUpdateOne
- func (tuo *ToyUpdateOne) Exec(ctx context.Context) error
- func (tuo *ToyUpdateOne) ExecX(ctx context.Context)
- func (tuo *ToyUpdateOne) Mutation() *ToyMutation
- func (tuo *ToyUpdateOne) Save(ctx context.Context) (*Toy, error)
- func (tuo *ToyUpdateOne) SaveX(ctx context.Context) *Toy
- func (tuo *ToyUpdateOne) Select(field string, fields ...string) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetColor(t toy.Color) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetMaterial(t toy.Material) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetNillableOwnerID(id *int) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetOwner(p *Pet) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetOwnerID(id int) *ToyUpdateOne
- func (tuo *ToyUpdateOne) SetTitle(s string) *ToyUpdateOne
- type Toys
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeBadge = "Badge" TypePet = "Pet" TypePlayGroup = "PlayGroup" TypeToy = "Toy" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Badge ¶
type Badge struct { // ID of the ent. ID uint32 `json:"id,omitempty"` // Color holds the value of the "color" field. Color badge.Color `json:"color,omitempty"` // Material holds the value of the "material" field. Material badge.Material `json:"material,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BadgeQuery when eager-loading is set. Edges BadgeEdges `json:"edges"` // contains filtered or unexported fields }
Badge is the model entity for the Badge schema.
func (*Badge) QueryWearer ¶
QueryWearer queries the "wearer" edge of the Badge entity.
func (*Badge) Unwrap ¶
Unwrap unwraps the Badge 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 (*Badge) Update ¶
func (b *Badge) Update() *BadgeUpdateOne
Update returns a builder for updating this Badge. Note that you need to call Badge.Unwrap() before calling this method if this Badge was returned from a transaction, and the transaction was committed or rolled back.
type BadgeClient ¶
type BadgeClient struct {
// contains filtered or unexported fields
}
BadgeClient is a client for the Badge schema.
func NewBadgeClient ¶
func NewBadgeClient(c config) *BadgeClient
NewBadgeClient returns a client for the Badge from the given config.
func (*BadgeClient) Create ¶
func (c *BadgeClient) Create() *BadgeCreate
Create returns a create builder for Badge.
func (*BadgeClient) CreateBulk ¶
func (c *BadgeClient) CreateBulk(builders ...*BadgeCreate) *BadgeCreateBulk
CreateBulk returns a builder for creating a bulk of Badge entities.
func (*BadgeClient) Delete ¶
func (c *BadgeClient) Delete() *BadgeDelete
Delete returns a delete builder for Badge.
func (*BadgeClient) DeleteOne ¶
func (c *BadgeClient) DeleteOne(b *Badge) *BadgeDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*BadgeClient) DeleteOneID ¶
func (c *BadgeClient) DeleteOneID(id uint32) *BadgeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*BadgeClient) GetX ¶
func (c *BadgeClient) GetX(ctx context.Context, id uint32) *Badge
GetX is like Get, but panics if an error occurs.
func (*BadgeClient) Query ¶
func (c *BadgeClient) Query() *BadgeQuery
Query returns a query builder for Badge.
func (*BadgeClient) QueryWearer ¶
func (c *BadgeClient) QueryWearer(b *Badge) *PetQuery
QueryWearer queries the wearer edge of a Badge.
func (*BadgeClient) Update ¶
func (c *BadgeClient) Update() *BadgeUpdate
Update returns an update builder for Badge.
func (*BadgeClient) UpdateOne ¶
func (c *BadgeClient) UpdateOne(b *Badge) *BadgeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BadgeClient) UpdateOneID ¶
func (c *BadgeClient) UpdateOneID(id uint32) *BadgeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BadgeClient) Use ¶
func (c *BadgeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `badge.Hooks(f(g(h())))`.
type BadgeCreate ¶
type BadgeCreate struct {
// contains filtered or unexported fields
}
BadgeCreate is the builder for creating a Badge entity.
func (*BadgeCreate) Exec ¶
func (bc *BadgeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeCreate) ExecX ¶
func (bc *BadgeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeCreate) Mutation ¶
func (bc *BadgeCreate) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeCreate) Save ¶
func (bc *BadgeCreate) Save(ctx context.Context) (*Badge, error)
Save creates the Badge in the database.
func (*BadgeCreate) SaveX ¶
func (bc *BadgeCreate) SaveX(ctx context.Context) *Badge
SaveX calls Save and panics if Save returns an error.
func (*BadgeCreate) SetColor ¶
func (bc *BadgeCreate) SetColor(b badge.Color) *BadgeCreate
SetColor sets the "color" field.
func (*BadgeCreate) SetID ¶ added in v0.4.1
func (bc *BadgeCreate) SetID(u uint32) *BadgeCreate
SetID sets the "id" field.
func (*BadgeCreate) SetMaterial ¶
func (bc *BadgeCreate) SetMaterial(b badge.Material) *BadgeCreate
SetMaterial sets the "material" field.
func (*BadgeCreate) SetNillableWearerID ¶
func (bc *BadgeCreate) SetNillableWearerID(id *int) *BadgeCreate
SetNillableWearerID sets the "wearer" edge to the Pet entity by ID if the given value is not nil.
func (*BadgeCreate) SetWearer ¶
func (bc *BadgeCreate) SetWearer(p *Pet) *BadgeCreate
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeCreate) SetWearerID ¶
func (bc *BadgeCreate) SetWearerID(id int) *BadgeCreate
SetWearerID sets the "wearer" edge to the Pet entity by ID.
type BadgeCreateBulk ¶
type BadgeCreateBulk struct {
// contains filtered or unexported fields
}
BadgeCreateBulk is the builder for creating many Badge entities in bulk.
func (*BadgeCreateBulk) Exec ¶
func (bcb *BadgeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeCreateBulk) ExecX ¶
func (bcb *BadgeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BadgeDelete ¶
type BadgeDelete struct {
// contains filtered or unexported fields
}
BadgeDelete is the builder for deleting a Badge entity.
func (*BadgeDelete) Exec ¶
func (bd *BadgeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BadgeDelete) ExecX ¶
func (bd *BadgeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BadgeDelete) Where ¶
func (bd *BadgeDelete) Where(ps ...predicate.Badge) *BadgeDelete
Where appends a list predicates to the BadgeDelete builder.
type BadgeDeleteOne ¶
type BadgeDeleteOne struct {
// contains filtered or unexported fields
}
BadgeDeleteOne is the builder for deleting a single Badge entity.
func (*BadgeDeleteOne) Exec ¶
func (bdo *BadgeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BadgeDeleteOne) ExecX ¶
func (bdo *BadgeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BadgeEdges ¶
type BadgeEdges struct { // Wearer holds the value of the wearer edge. Wearer *Pet `json:"wearer,omitempty"` // contains filtered or unexported fields }
BadgeEdges holds the relations/edges for other nodes in the graph.
func (BadgeEdges) WearerOrErr ¶
func (e BadgeEdges) WearerOrErr() (*Pet, error)
WearerOrErr returns the Wearer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type BadgeGroupBy ¶
type BadgeGroupBy struct {
// contains filtered or unexported fields
}
BadgeGroupBy is the group-by builder for Badge entities.
func (*BadgeGroupBy) Aggregate ¶
func (bgb *BadgeGroupBy) Aggregate(fns ...AggregateFunc) *BadgeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BadgeGroupBy) Bool ¶
func (bgb *BadgeGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) BoolX ¶
func (bgb *BadgeGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*BadgeGroupBy) Bools ¶
func (bgb *BadgeGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) BoolsX ¶
func (bgb *BadgeGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*BadgeGroupBy) Float64 ¶
func (bgb *BadgeGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) Float64X ¶
func (bgb *BadgeGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*BadgeGroupBy) Float64s ¶
func (bgb *BadgeGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) Float64sX ¶
func (bgb *BadgeGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*BadgeGroupBy) Int ¶
func (bgb *BadgeGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) IntX ¶
func (bgb *BadgeGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*BadgeGroupBy) Ints ¶
func (bgb *BadgeGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) IntsX ¶
func (bgb *BadgeGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*BadgeGroupBy) Scan ¶
func (bgb *BadgeGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*BadgeGroupBy) ScanX ¶
func (bgb *BadgeGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*BadgeGroupBy) String ¶
func (bgb *BadgeGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*BadgeGroupBy) StringX ¶
func (bgb *BadgeGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type BadgeMutation ¶
type BadgeMutation struct {
// contains filtered or unexported fields
}
BadgeMutation represents an operation that mutates the Badge nodes in the graph.
func (*BadgeMutation) AddField ¶
func (m *BadgeMutation) 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 (*BadgeMutation) AddedEdges ¶
func (m *BadgeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BadgeMutation) AddedField ¶
func (m *BadgeMutation) 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 (*BadgeMutation) AddedFields ¶
func (m *BadgeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BadgeMutation) AddedIDs ¶
func (m *BadgeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BadgeMutation) ClearEdge ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ClearField ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ClearWearer ¶
func (m *BadgeMutation) ClearWearer()
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeMutation) ClearedEdges ¶
func (m *BadgeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BadgeMutation) ClearedFields ¶
func (m *BadgeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BadgeMutation) Client ¶
func (m BadgeMutation) 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 (*BadgeMutation) Color ¶
func (m *BadgeMutation) Color() (r badge.Color, exists bool)
Color returns the value of the "color" field in the mutation.
func (*BadgeMutation) EdgeCleared ¶
func (m *BadgeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BadgeMutation) Field ¶
func (m *BadgeMutation) 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 (*BadgeMutation) FieldCleared ¶
func (m *BadgeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BadgeMutation) Fields ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ID ¶
func (m *BadgeMutation) ID() (id uint32, 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 (*BadgeMutation) Material ¶
func (m *BadgeMutation) Material() (r badge.Material, exists bool)
Material returns the value of the "material" field in the mutation.
func (*BadgeMutation) OldColor ¶
OldColor returns the old "color" field's value of the Badge entity. If the Badge 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 (*BadgeMutation) 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 (*BadgeMutation) OldMaterial ¶
OldMaterial returns the old "material" field's value of the Badge entity. If the Badge 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 (*BadgeMutation) RemovedEdges ¶
func (m *BadgeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BadgeMutation) RemovedIDs ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ResetColor ¶
func (m *BadgeMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*BadgeMutation) ResetEdge ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ResetField ¶
func (m *BadgeMutation) 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 (*BadgeMutation) ResetMaterial ¶
func (m *BadgeMutation) ResetMaterial()
ResetMaterial resets all changes to the "material" field.
func (*BadgeMutation) ResetWearer ¶
func (m *BadgeMutation) ResetWearer()
ResetWearer resets all changes to the "wearer" edge.
func (*BadgeMutation) SetColor ¶
func (m *BadgeMutation) SetColor(b badge.Color)
SetColor sets the "color" field.
func (*BadgeMutation) SetField ¶
func (m *BadgeMutation) 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 (*BadgeMutation) SetID ¶ added in v0.4.1
func (m *BadgeMutation) SetID(id uint32)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Badge entities.
func (*BadgeMutation) SetMaterial ¶
func (m *BadgeMutation) SetMaterial(b badge.Material)
SetMaterial sets the "material" field.
func (*BadgeMutation) SetWearerID ¶
func (m *BadgeMutation) SetWearerID(id int)
SetWearerID sets the "wearer" edge to the Pet entity by id.
func (BadgeMutation) Tx ¶
func (m BadgeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BadgeMutation) Type ¶
func (m *BadgeMutation) Type() string
Type returns the node type of this mutation (Badge).
func (*BadgeMutation) WearerCleared ¶
func (m *BadgeMutation) WearerCleared() bool
WearerCleared reports if the "wearer" edge to the Pet entity was cleared.
func (*BadgeMutation) WearerID ¶
func (m *BadgeMutation) WearerID() (id int, exists bool)
WearerID returns the "wearer" edge ID in the mutation.
func (*BadgeMutation) WearerIDs ¶
func (m *BadgeMutation) WearerIDs() (ids []int)
WearerIDs returns the "wearer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WearerID instead. It exists only for internal usage by the builders.
func (*BadgeMutation) Where ¶
func (m *BadgeMutation) Where(ps ...predicate.Badge)
Where appends a list predicates to the BadgeMutation builder.
type BadgeQuery ¶
type BadgeQuery struct {
// contains filtered or unexported fields
}
BadgeQuery is the builder for querying Badge entities.
func (*BadgeQuery) All ¶
func (bq *BadgeQuery) All(ctx context.Context) ([]*Badge, error)
All executes the query and returns a list of Badges.
func (*BadgeQuery) AllX ¶
func (bq *BadgeQuery) AllX(ctx context.Context) []*Badge
AllX is like All, but panics if an error occurs.
func (*BadgeQuery) Clone ¶
func (bq *BadgeQuery) Clone() *BadgeQuery
Clone returns a duplicate of the BadgeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BadgeQuery) Count ¶
func (bq *BadgeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BadgeQuery) CountX ¶
func (bq *BadgeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BadgeQuery) Exist ¶
func (bq *BadgeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BadgeQuery) ExistX ¶
func (bq *BadgeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BadgeQuery) First ¶
func (bq *BadgeQuery) First(ctx context.Context) (*Badge, error)
First returns the first Badge entity from the query. Returns a *NotFoundError when no Badge was found.
func (*BadgeQuery) FirstID ¶
func (bq *BadgeQuery) FirstID(ctx context.Context) (id uint32, err error)
FirstID returns the first Badge ID from the query. Returns a *NotFoundError when no Badge ID was found.
func (*BadgeQuery) FirstIDX ¶
func (bq *BadgeQuery) FirstIDX(ctx context.Context) uint32
FirstIDX is like FirstID, but panics if an error occurs.
func (*BadgeQuery) FirstX ¶
func (bq *BadgeQuery) FirstX(ctx context.Context) *Badge
FirstX is like First, but panics if an error occurs.
func (*BadgeQuery) GroupBy ¶
func (bq *BadgeQuery) GroupBy(field string, fields ...string) *BadgeGroupBy
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 { Color badge.Color `json:"color,omitempty"` Count int `json:"count,omitempty"` } client.Badge.Query(). GroupBy(badge.FieldColor). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BadgeQuery) IDs ¶
func (bq *BadgeQuery) IDs(ctx context.Context) ([]uint32, error)
IDs executes the query and returns a list of Badge IDs.
func (*BadgeQuery) IDsX ¶
func (bq *BadgeQuery) IDsX(ctx context.Context) []uint32
IDsX is like IDs, but panics if an error occurs.
func (*BadgeQuery) Limit ¶
func (bq *BadgeQuery) Limit(limit int) *BadgeQuery
Limit adds a limit step to the query.
func (*BadgeQuery) Offset ¶
func (bq *BadgeQuery) Offset(offset int) *BadgeQuery
Offset adds an offset step to the query.
func (*BadgeQuery) Only ¶
func (bq *BadgeQuery) Only(ctx context.Context) (*Badge, error)
Only returns a single Badge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Badge entity is not found. Returns a *NotFoundError when no Badge entities are found.
func (*BadgeQuery) OnlyID ¶
func (bq *BadgeQuery) OnlyID(ctx context.Context) (id uint32, err error)
OnlyID is like Only, but returns the only Badge ID in the query. Returns a *NotSingularError when exactly one Badge ID is not found. Returns a *NotFoundError when no entities are found.
func (*BadgeQuery) OnlyIDX ¶
func (bq *BadgeQuery) OnlyIDX(ctx context.Context) uint32
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BadgeQuery) OnlyX ¶
func (bq *BadgeQuery) OnlyX(ctx context.Context) *Badge
OnlyX is like Only, but panics if an error occurs.
func (*BadgeQuery) Order ¶
func (bq *BadgeQuery) Order(o ...OrderFunc) *BadgeQuery
Order adds an order step to the query.
func (*BadgeQuery) QueryWearer ¶
func (bq *BadgeQuery) QueryWearer() *PetQuery
QueryWearer chains the current query on the "wearer" edge.
func (*BadgeQuery) Select ¶
func (bq *BadgeQuery) Select(fields ...string) *BadgeSelect
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 { Color badge.Color `json:"color,omitempty"` } client.Badge.Query(). Select(badge.FieldColor). Scan(ctx, &v)
func (*BadgeQuery) Unique ¶
func (bq *BadgeQuery) Unique(unique bool) *BadgeQuery
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 (*BadgeQuery) Where ¶
func (bq *BadgeQuery) Where(ps ...predicate.Badge) *BadgeQuery
Where adds a new predicate for the BadgeQuery builder.
func (*BadgeQuery) WithWearer ¶
func (bq *BadgeQuery) WithWearer(opts ...func(*PetQuery)) *BadgeQuery
WithWearer tells the query-builder to eager-load the nodes that are connected to the "wearer" edge. The optional arguments are used to configure the query builder of the edge.
type BadgeSelect ¶
type BadgeSelect struct { *BadgeQuery // contains filtered or unexported fields }
BadgeSelect is the builder for selecting fields of Badge entities.
func (*BadgeSelect) Bool ¶
func (bs *BadgeSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) BoolX ¶
func (bs *BadgeSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*BadgeSelect) Bools ¶
func (bs *BadgeSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) BoolsX ¶
func (bs *BadgeSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*BadgeSelect) Float64 ¶
func (bs *BadgeSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) Float64X ¶
func (bs *BadgeSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*BadgeSelect) Float64s ¶
func (bs *BadgeSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) Float64sX ¶
func (bs *BadgeSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*BadgeSelect) Int ¶
func (bs *BadgeSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) IntX ¶
func (bs *BadgeSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*BadgeSelect) Ints ¶
func (bs *BadgeSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) IntsX ¶
func (bs *BadgeSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*BadgeSelect) Scan ¶
func (bs *BadgeSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*BadgeSelect) ScanX ¶
func (bs *BadgeSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*BadgeSelect) String ¶
func (bs *BadgeSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*BadgeSelect) StringX ¶
func (bs *BadgeSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type BadgeUpdate ¶
type BadgeUpdate struct {
// contains filtered or unexported fields
}
BadgeUpdate is the builder for updating Badge entities.
func (*BadgeUpdate) ClearWearer ¶
func (bu *BadgeUpdate) ClearWearer() *BadgeUpdate
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeUpdate) Exec ¶
func (bu *BadgeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeUpdate) ExecX ¶
func (bu *BadgeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeUpdate) Mutation ¶
func (bu *BadgeUpdate) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeUpdate) Save ¶
func (bu *BadgeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BadgeUpdate) SaveX ¶
func (bu *BadgeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BadgeUpdate) SetColor ¶
func (bu *BadgeUpdate) SetColor(b badge.Color) *BadgeUpdate
SetColor sets the "color" field.
func (*BadgeUpdate) SetMaterial ¶
func (bu *BadgeUpdate) SetMaterial(b badge.Material) *BadgeUpdate
SetMaterial sets the "material" field.
func (*BadgeUpdate) SetNillableWearerID ¶
func (bu *BadgeUpdate) SetNillableWearerID(id *int) *BadgeUpdate
SetNillableWearerID sets the "wearer" edge to the Pet entity by ID if the given value is not nil.
func (*BadgeUpdate) SetWearer ¶
func (bu *BadgeUpdate) SetWearer(p *Pet) *BadgeUpdate
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeUpdate) SetWearerID ¶
func (bu *BadgeUpdate) SetWearerID(id int) *BadgeUpdate
SetWearerID sets the "wearer" edge to the Pet entity by ID.
func (*BadgeUpdate) Where ¶
func (bu *BadgeUpdate) Where(ps ...predicate.Badge) *BadgeUpdate
Where appends a list predicates to the BadgeUpdate builder.
type BadgeUpdateOne ¶
type BadgeUpdateOne struct {
// contains filtered or unexported fields
}
BadgeUpdateOne is the builder for updating a single Badge entity.
func (*BadgeUpdateOne) ClearWearer ¶
func (buo *BadgeUpdateOne) ClearWearer() *BadgeUpdateOne
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeUpdateOne) Exec ¶
func (buo *BadgeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BadgeUpdateOne) ExecX ¶
func (buo *BadgeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeUpdateOne) Mutation ¶
func (buo *BadgeUpdateOne) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeUpdateOne) Save ¶
func (buo *BadgeUpdateOne) Save(ctx context.Context) (*Badge, error)
Save executes the query and returns the updated Badge entity.
func (*BadgeUpdateOne) SaveX ¶
func (buo *BadgeUpdateOne) SaveX(ctx context.Context) *Badge
SaveX is like Save, but panics if an error occurs.
func (*BadgeUpdateOne) Select ¶
func (buo *BadgeUpdateOne) Select(field string, fields ...string) *BadgeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BadgeUpdateOne) SetColor ¶
func (buo *BadgeUpdateOne) SetColor(b badge.Color) *BadgeUpdateOne
SetColor sets the "color" field.
func (*BadgeUpdateOne) SetMaterial ¶
func (buo *BadgeUpdateOne) SetMaterial(b badge.Material) *BadgeUpdateOne
SetMaterial sets the "material" field.
func (*BadgeUpdateOne) SetNillableWearerID ¶
func (buo *BadgeUpdateOne) SetNillableWearerID(id *int) *BadgeUpdateOne
SetNillableWearerID sets the "wearer" edge to the Pet entity by ID if the given value is not nil.
func (*BadgeUpdateOne) SetWearer ¶
func (buo *BadgeUpdateOne) SetWearer(p *Pet) *BadgeUpdateOne
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeUpdateOne) SetWearerID ¶
func (buo *BadgeUpdateOne) SetWearerID(id int) *BadgeUpdateOne
SetWearerID sets the "wearer" edge to the Pet entity by ID.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Badge is the client for interacting with the Badge builders. Badge *BadgeClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // PlayGroup is the client for interacting with the PlayGroup builders. PlayGroup *PlayGroupClient // Toy is the client for interacting with the Toy builders. Toy *ToyClient // 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(). Badge. Query(). Count(ctx)
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(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 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 Pet ¶
type Pet struct { // ID of the ent. ID int `json:"id,omitempty"` // Height holds the value of the "height" field. Height int `json:"height,omitempty"` // Weight holds the value of the "weight" field. Weight float64 `json:"weight,omitempty"` // Castrated holds the value of the "castrated" field. Castrated bool `json:"castrated,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Birthday holds the value of the "birthday" field. Birthday time.Time `json:"birthday,omitempty"` // Nicknames holds the value of the "nicknames" field. Nicknames []string `json:"nicknames,omitempty"` // Sex holds the value of the "sex" field. Sex pet.Sex `json:"sex,omitempty"` // Chip holds the value of the "chip" field. Chip uuid.UUID `json:"chip,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PetQuery when eager-loading is set. Edges PetEdges `json:"edges"` // contains filtered or unexported fields }
Pet is the model entity for the Pet schema.
func (*Pet) QueryBadge ¶
func (pe *Pet) QueryBadge() *BadgeQuery
QueryBadge queries the "badge" edge of the Pet entity.
func (*Pet) QueryChildren ¶
QueryChildren queries the "children" edge of the Pet entity.
func (*Pet) QueryFriends ¶
QueryFriends queries the "friends" edge of the Pet entity.
func (*Pet) QueryMentor ¶
QueryMentor queries the "mentor" edge of the Pet entity.
func (*Pet) QueryParent ¶
QueryParent queries the "parent" edge of the Pet entity.
func (*Pet) QueryPlayGroups ¶
func (pe *Pet) QueryPlayGroups() *PlayGroupQuery
QueryPlayGroups queries the "play_groups" edge of the Pet entity.
func (*Pet) QueryProtege ¶
QueryProtege queries the "protege" edge of the Pet entity.
func (*Pet) QuerySpouse ¶
QuerySpouse queries the "spouse" edge of the Pet entity.
func (*Pet) Unwrap ¶
Unwrap unwraps the Pet 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 (*Pet) Update ¶
func (pe *Pet) Update() *PetUpdateOne
Update returns a builder for updating this Pet. Note that you need to call Pet.Unwrap() before calling this method if this Pet was returned from a transaction, and the transaction was committed or rolled back.
type PetClient ¶
type PetClient struct {
// contains filtered or unexported fields
}
PetClient is a client for the Pet schema.
func NewPetClient ¶
func NewPetClient(c config) *PetClient
NewPetClient returns a client for the Pet from the given config.
func (*PetClient) CreateBulk ¶
func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
CreateBulk returns a builder for creating a bulk of Pet entities.
func (*PetClient) DeleteOne ¶
func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PetClient) DeleteOneID ¶
func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PetClient) QueryBadge ¶
func (c *PetClient) QueryBadge(pe *Pet) *BadgeQuery
QueryBadge queries the badge edge of a Pet.
func (*PetClient) QueryChildren ¶
QueryChildren queries the children edge of a Pet.
func (*PetClient) QueryFriends ¶
QueryFriends queries the friends edge of a Pet.
func (*PetClient) QueryMentor ¶
QueryMentor queries the mentor edge of a Pet.
func (*PetClient) QueryParent ¶
QueryParent queries the parent edge of a Pet.
func (*PetClient) QueryPlayGroups ¶
func (c *PetClient) QueryPlayGroups(pe *Pet) *PlayGroupQuery
QueryPlayGroups queries the play_groups edge of a Pet.
func (*PetClient) QueryProtege ¶
QueryProtege queries the protege edge of a Pet.
func (*PetClient) QuerySpouse ¶
QuerySpouse queries the spouse edge of a Pet.
func (*PetClient) UpdateOne ¶
func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PetClient) UpdateOneID ¶
func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
UpdateOneID returns an update builder for the given id.
type PetCreate ¶
type PetCreate struct {
// contains filtered or unexported fields
}
PetCreate is the builder for creating a Pet entity.
func (*PetCreate) AddChildIDs ¶
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetCreate) AddChildren ¶
AddChildren adds the "children" edges to the Pet entity.
func (*PetCreate) AddFriendIDs ¶
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetCreate) AddFriends ¶
AddFriends adds the "friends" edges to the Pet entity.
func (*PetCreate) AddPlayGroupIDs ¶
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetCreate) AddPlayGroups ¶
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetCreate) Mutation ¶
func (pc *PetCreate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetCreate) SetBadgeID ¶
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetCreate) SetBirthday ¶
SetBirthday sets the "birthday" field.
func (*PetCreate) SetCastrated ¶
SetCastrated sets the "castrated" field.
func (*PetCreate) SetMentorID ¶
SetMentorID sets the "mentor" edge to the Pet entity by ID.
func (*PetCreate) SetNicknames ¶
SetNicknames sets the "nicknames" field.
func (*PetCreate) SetNillableBirthday ¶
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetCreate) SetNillableMentorID ¶
SetNillableMentorID sets the "mentor" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableParentID ¶
SetNillableParentID sets the "parent" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableProtegeID ¶
SetNillableProtegeID sets the "protege" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableSpouseID ¶
SetNillableSpouseID sets the "spouse" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableWeight ¶
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetCreate) SetParentID ¶
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetCreate) SetProtege ¶
SetProtege sets the "protege" edge to the Pet entity.
func (*PetCreate) SetProtegeID ¶
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetCreate) SetSpouseID ¶
SetSpouseID sets the "spouse" edge to the Pet entity by ID.
type PetCreateBulk ¶
type PetCreateBulk struct {
// contains filtered or unexported fields
}
PetCreateBulk is the builder for creating many Pet entities in bulk.
func (*PetCreateBulk) Exec ¶
func (pcb *PetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PetCreateBulk) ExecX ¶
func (pcb *PetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetDelete ¶
type PetDelete struct {
// contains filtered or unexported fields
}
PetDelete is the builder for deleting a Pet entity.
func (*PetDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type PetDeleteOne ¶
type PetDeleteOne struct {
// contains filtered or unexported fields
}
PetDeleteOne is the builder for deleting a single Pet entity.
func (*PetDeleteOne) Exec ¶
func (pdo *PetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PetDeleteOne) ExecX ¶
func (pdo *PetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetEdges ¶
type PetEdges struct { // Badge holds the value of the badge edge. Badge *Badge `json:"badge,omitempty"` // Protege holds the value of the protege edge. Protege *Pet `json:"protege,omitempty"` // Mentor holds the value of the mentor edge. Mentor *Pet `json:"mentor,omitempty"` // Spouse holds the value of the spouse edge. Spouse *Pet `json:"spouse,omitempty"` // Toys holds the value of the toys edge. Toys []*Toy `json:"toys,omitempty"` // Parent holds the value of the parent edge. Parent *Pet `json:"parent,omitempty"` // Children holds the value of the children edge. Children []*Pet `json:"children,omitempty"` // PlayGroups holds the value of the play_groups edge. PlayGroups []*PlayGroup `json:"play_groups,omitempty"` // Friends holds the value of the friends edge. Friends []*Pet `json:"friends,omitempty"` // contains filtered or unexported fields }
PetEdges holds the relations/edges for other nodes in the graph.
func (PetEdges) BadgeOrErr ¶
BadgeOrErr returns the Badge value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PetEdges) ChildrenOrErr ¶
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (PetEdges) FriendsOrErr ¶
FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.
func (PetEdges) MentorOrErr ¶
MentorOrErr returns the Mentor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PetEdges) ParentOrErr ¶
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PetEdges) PlayGroupsOrErr ¶
PlayGroupsOrErr returns the PlayGroups value or an error if the edge was not loaded in eager-loading.
func (PetEdges) ProtegeOrErr ¶
ProtegeOrErr returns the Protege value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PetEdges) SpouseOrErr ¶
SpouseOrErr returns the Spouse value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PetGroupBy ¶
type PetGroupBy struct {
// contains filtered or unexported fields
}
PetGroupBy is the group-by builder for Pet entities.
func (*PetGroupBy) Aggregate ¶
func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PetGroupBy) Bool ¶
func (pgb *PetGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) BoolX ¶
func (pgb *PetGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PetGroupBy) Bools ¶
func (pgb *PetGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) BoolsX ¶
func (pgb *PetGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PetGroupBy) Float64 ¶
func (pgb *PetGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) Float64X ¶
func (pgb *PetGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PetGroupBy) Float64s ¶
func (pgb *PetGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) Float64sX ¶
func (pgb *PetGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PetGroupBy) Int ¶
func (pgb *PetGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) IntX ¶
func (pgb *PetGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PetGroupBy) Ints ¶
func (pgb *PetGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) IntsX ¶
func (pgb *PetGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PetGroupBy) Scan ¶
func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*PetGroupBy) ScanX ¶
func (pgb *PetGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PetGroupBy) String ¶
func (pgb *PetGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PetGroupBy) StringX ¶
func (pgb *PetGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PetMutation ¶
type PetMutation struct {
// contains filtered or unexported fields
}
PetMutation represents an operation that mutates the Pet nodes in the graph.
func (*PetMutation) AddChildIDs ¶
func (m *PetMutation) AddChildIDs(ids ...int)
AddChildIDs adds the "children" edge to the Pet entity by ids.
func (*PetMutation) AddField ¶
func (m *PetMutation) 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 (*PetMutation) AddFriendIDs ¶
func (m *PetMutation) AddFriendIDs(ids ...int)
AddFriendIDs adds the "friends" edge to the Pet entity by ids.
func (*PetMutation) AddHeight ¶
func (m *PetMutation) AddHeight(i int)
AddHeight adds i to the "height" field.
func (*PetMutation) AddPlayGroupIDs ¶
func (m *PetMutation) AddPlayGroupIDs(ids ...int)
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by ids.
func (*PetMutation) AddToyIDs ¶
func (m *PetMutation) AddToyIDs(ids ...uuid.UUID)
AddToyIDs adds the "toys" edge to the Toy entity by ids.
func (*PetMutation) AddWeight ¶
func (m *PetMutation) AddWeight(f float64)
AddWeight adds f to the "weight" field.
func (*PetMutation) AddedEdges ¶
func (m *PetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PetMutation) AddedField ¶
func (m *PetMutation) 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 (*PetMutation) AddedFields ¶
func (m *PetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PetMutation) AddedHeight ¶
func (m *PetMutation) AddedHeight() (r int, exists bool)
AddedHeight returns the value that was added to the "height" field in this mutation.
func (*PetMutation) AddedIDs ¶
func (m *PetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PetMutation) AddedWeight ¶
func (m *PetMutation) AddedWeight() (r float64, exists bool)
AddedWeight returns the value that was added to the "weight" field in this mutation.
func (*PetMutation) BadgeCleared ¶
func (m *PetMutation) BadgeCleared() bool
BadgeCleared reports if the "badge" edge to the Badge entity was cleared.
func (*PetMutation) BadgeID ¶
func (m *PetMutation) BadgeID() (id uint32, exists bool)
BadgeID returns the "badge" edge ID in the mutation.
func (*PetMutation) BadgeIDs ¶
func (m *PetMutation) BadgeIDs() (ids []uint32)
BadgeIDs returns the "badge" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BadgeID instead. It exists only for internal usage by the builders.
func (*PetMutation) Birthday ¶
func (m *PetMutation) Birthday() (r time.Time, exists bool)
Birthday returns the value of the "birthday" field in the mutation.
func (*PetMutation) BirthdayCleared ¶
func (m *PetMutation) BirthdayCleared() bool
BirthdayCleared returns if the "birthday" field was cleared in this mutation.
func (*PetMutation) Castrated ¶
func (m *PetMutation) Castrated() (r bool, exists bool)
Castrated returns the value of the "castrated" field in the mutation.
func (*PetMutation) ChildrenCleared ¶
func (m *PetMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Pet entity was cleared.
func (*PetMutation) ChildrenIDs ¶
func (m *PetMutation) ChildrenIDs() (ids []int)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*PetMutation) Chip ¶
func (m *PetMutation) Chip() (r uuid.UUID, exists bool)
Chip returns the value of the "chip" field in the mutation.
func (*PetMutation) ClearBadge ¶
func (m *PetMutation) ClearBadge()
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetMutation) ClearBirthday ¶
func (m *PetMutation) ClearBirthday()
ClearBirthday clears the value of the "birthday" field.
func (*PetMutation) ClearChildren ¶
func (m *PetMutation) ClearChildren()
ClearChildren clears the "children" edge to the Pet entity.
func (*PetMutation) ClearEdge ¶
func (m *PetMutation) 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 (*PetMutation) ClearField ¶
func (m *PetMutation) 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 (*PetMutation) ClearFriends ¶
func (m *PetMutation) ClearFriends()
ClearFriends clears the "friends" edge to the Pet entity.
func (*PetMutation) ClearMentor ¶
func (m *PetMutation) ClearMentor()
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetMutation) ClearNicknames ¶
func (m *PetMutation) ClearNicknames()
ClearNicknames clears the value of the "nicknames" field.
func (*PetMutation) ClearParent ¶
func (m *PetMutation) ClearParent()
ClearParent clears the "parent" edge to the Pet entity.
func (*PetMutation) ClearPlayGroups ¶
func (m *PetMutation) ClearPlayGroups()
ClearPlayGroups clears the "play_groups" edge to the PlayGroup entity.
func (*PetMutation) ClearProtege ¶
func (m *PetMutation) ClearProtege()
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetMutation) ClearSpouse ¶
func (m *PetMutation) ClearSpouse()
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetMutation) ClearToys ¶
func (m *PetMutation) ClearToys()
ClearToys clears the "toys" edge to the Toy entity.
func (*PetMutation) ClearWeight ¶
func (m *PetMutation) ClearWeight()
ClearWeight clears the value of the "weight" field.
func (*PetMutation) ClearedEdges ¶
func (m *PetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PetMutation) ClearedFields ¶
func (m *PetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PetMutation) Client ¶
func (m PetMutation) 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 (*PetMutation) EdgeCleared ¶
func (m *PetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PetMutation) Field ¶
func (m *PetMutation) 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 (*PetMutation) FieldCleared ¶
func (m *PetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PetMutation) Fields ¶
func (m *PetMutation) 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 (*PetMutation) FriendsCleared ¶
func (m *PetMutation) FriendsCleared() bool
FriendsCleared reports if the "friends" edge to the Pet entity was cleared.
func (*PetMutation) FriendsIDs ¶
func (m *PetMutation) FriendsIDs() (ids []int)
FriendsIDs returns the "friends" edge IDs in the mutation.
func (*PetMutation) Height ¶
func (m *PetMutation) Height() (r int, exists bool)
Height returns the value of the "height" field in the mutation.
func (*PetMutation) ID ¶
func (m *PetMutation) 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 (*PetMutation) MentorCleared ¶
func (m *PetMutation) MentorCleared() bool
MentorCleared reports if the "mentor" edge to the Pet entity was cleared.
func (*PetMutation) MentorID ¶
func (m *PetMutation) MentorID() (id int, exists bool)
MentorID returns the "mentor" edge ID in the mutation.
func (*PetMutation) MentorIDs ¶
func (m *PetMutation) MentorIDs() (ids []int)
MentorIDs returns the "mentor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MentorID instead. It exists only for internal usage by the builders.
func (*PetMutation) Name ¶
func (m *PetMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PetMutation) Nicknames ¶
func (m *PetMutation) Nicknames() (r []string, exists bool)
Nicknames returns the value of the "nicknames" field in the mutation.
func (*PetMutation) NicknamesCleared ¶
func (m *PetMutation) NicknamesCleared() bool
NicknamesCleared returns if the "nicknames" field was cleared in this mutation.
func (*PetMutation) OldBirthday ¶
OldBirthday returns the old "birthday" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldCastrated ¶
func (m *PetMutation) OldCastrated(ctx context.Context) (v bool, err error)
OldCastrated returns the old "castrated" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldChip ¶
OldChip returns the old "chip" field's value of the Pet entity. If the Pet 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 (*PetMutation) 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 (*PetMutation) OldHeight ¶
func (m *PetMutation) OldHeight(ctx context.Context) (v int, err error)
OldHeight returns the old "height" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldName ¶
func (m *PetMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldNicknames ¶
func (m *PetMutation) OldNicknames(ctx context.Context) (v []string, err error)
OldNicknames returns the old "nicknames" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldSex ¶
OldSex returns the old "sex" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldWeight ¶
func (m *PetMutation) OldWeight(ctx context.Context) (v float64, err error)
OldWeight returns the old "weight" field's value of the Pet entity. If the Pet 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 (*PetMutation) ParentCleared ¶
func (m *PetMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Pet entity was cleared.
func (*PetMutation) ParentID ¶
func (m *PetMutation) ParentID() (id int, exists bool)
ParentID returns the "parent" edge ID in the mutation.
func (*PetMutation) ParentIDs ¶
func (m *PetMutation) ParentIDs() (ids []int)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*PetMutation) PlayGroupsCleared ¶
func (m *PetMutation) PlayGroupsCleared() bool
PlayGroupsCleared reports if the "play_groups" edge to the PlayGroup entity was cleared.
func (*PetMutation) PlayGroupsIDs ¶
func (m *PetMutation) PlayGroupsIDs() (ids []int)
PlayGroupsIDs returns the "play_groups" edge IDs in the mutation.
func (*PetMutation) ProtegeCleared ¶
func (m *PetMutation) ProtegeCleared() bool
ProtegeCleared reports if the "protege" edge to the Pet entity was cleared.
func (*PetMutation) ProtegeID ¶
func (m *PetMutation) ProtegeID() (id int, exists bool)
ProtegeID returns the "protege" edge ID in the mutation.
func (*PetMutation) ProtegeIDs ¶
func (m *PetMutation) ProtegeIDs() (ids []int)
ProtegeIDs returns the "protege" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProtegeID instead. It exists only for internal usage by the builders.
func (*PetMutation) RemoveChildIDs ¶
func (m *PetMutation) RemoveChildIDs(ids ...int)
RemoveChildIDs removes the "children" edge to the Pet entity by IDs.
func (*PetMutation) RemoveFriendIDs ¶
func (m *PetMutation) RemoveFriendIDs(ids ...int)
RemoveFriendIDs removes the "friends" edge to the Pet entity by IDs.
func (*PetMutation) RemovePlayGroupIDs ¶
func (m *PetMutation) RemovePlayGroupIDs(ids ...int)
RemovePlayGroupIDs removes the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetMutation) RemoveToyIDs ¶
func (m *PetMutation) RemoveToyIDs(ids ...uuid.UUID)
RemoveToyIDs removes the "toys" edge to the Toy entity by IDs.
func (*PetMutation) RemovedChildrenIDs ¶
func (m *PetMutation) RemovedChildrenIDs() (ids []int)
RemovedChildren returns the removed IDs of the "children" edge to the Pet entity.
func (*PetMutation) RemovedEdges ¶
func (m *PetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PetMutation) RemovedFriendsIDs ¶
func (m *PetMutation) RemovedFriendsIDs() (ids []int)
RemovedFriends returns the removed IDs of the "friends" edge to the Pet entity.
func (*PetMutation) RemovedIDs ¶
func (m *PetMutation) 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 (*PetMutation) RemovedPlayGroupsIDs ¶
func (m *PetMutation) RemovedPlayGroupsIDs() (ids []int)
RemovedPlayGroups returns the removed IDs of the "play_groups" edge to the PlayGroup entity.
func (*PetMutation) RemovedToysIDs ¶
func (m *PetMutation) RemovedToysIDs() (ids []uuid.UUID)
RemovedToys returns the removed IDs of the "toys" edge to the Toy entity.
func (*PetMutation) ResetBadge ¶
func (m *PetMutation) ResetBadge()
ResetBadge resets all changes to the "badge" edge.
func (*PetMutation) ResetBirthday ¶
func (m *PetMutation) ResetBirthday()
ResetBirthday resets all changes to the "birthday" field.
func (*PetMutation) ResetCastrated ¶
func (m *PetMutation) ResetCastrated()
ResetCastrated resets all changes to the "castrated" field.
func (*PetMutation) ResetChildren ¶
func (m *PetMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*PetMutation) ResetChip ¶
func (m *PetMutation) ResetChip()
ResetChip resets all changes to the "chip" field.
func (*PetMutation) ResetEdge ¶
func (m *PetMutation) 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 (*PetMutation) ResetField ¶
func (m *PetMutation) 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 (*PetMutation) ResetFriends ¶
func (m *PetMutation) ResetFriends()
ResetFriends resets all changes to the "friends" edge.
func (*PetMutation) ResetHeight ¶
func (m *PetMutation) ResetHeight()
ResetHeight resets all changes to the "height" field.
func (*PetMutation) ResetMentor ¶
func (m *PetMutation) ResetMentor()
ResetMentor resets all changes to the "mentor" edge.
func (*PetMutation) ResetName ¶
func (m *PetMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PetMutation) ResetNicknames ¶
func (m *PetMutation) ResetNicknames()
ResetNicknames resets all changes to the "nicknames" field.
func (*PetMutation) ResetParent ¶
func (m *PetMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*PetMutation) ResetPlayGroups ¶
func (m *PetMutation) ResetPlayGroups()
ResetPlayGroups resets all changes to the "play_groups" edge.
func (*PetMutation) ResetProtege ¶
func (m *PetMutation) ResetProtege()
ResetProtege resets all changes to the "protege" edge.
func (*PetMutation) ResetSex ¶
func (m *PetMutation) ResetSex()
ResetSex resets all changes to the "sex" field.
func (*PetMutation) ResetSpouse ¶
func (m *PetMutation) ResetSpouse()
ResetSpouse resets all changes to the "spouse" edge.
func (*PetMutation) ResetToys ¶
func (m *PetMutation) ResetToys()
ResetToys resets all changes to the "toys" edge.
func (*PetMutation) ResetWeight ¶
func (m *PetMutation) ResetWeight()
ResetWeight resets all changes to the "weight" field.
func (*PetMutation) SetBadgeID ¶
func (m *PetMutation) SetBadgeID(id uint32)
SetBadgeID sets the "badge" edge to the Badge entity by id.
func (*PetMutation) SetBirthday ¶
func (m *PetMutation) SetBirthday(t time.Time)
SetBirthday sets the "birthday" field.
func (*PetMutation) SetCastrated ¶
func (m *PetMutation) SetCastrated(b bool)
SetCastrated sets the "castrated" field.
func (*PetMutation) SetChip ¶
func (m *PetMutation) SetChip(u uuid.UUID)
SetChip sets the "chip" field.
func (*PetMutation) SetField ¶
func (m *PetMutation) 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 (*PetMutation) SetHeight ¶
func (m *PetMutation) SetHeight(i int)
SetHeight sets the "height" field.
func (*PetMutation) SetMentorID ¶
func (m *PetMutation) SetMentorID(id int)
SetMentorID sets the "mentor" edge to the Pet entity by id.
func (*PetMutation) SetName ¶
func (m *PetMutation) SetName(s string)
SetName sets the "name" field.
func (*PetMutation) SetNicknames ¶
func (m *PetMutation) SetNicknames(s []string)
SetNicknames sets the "nicknames" field.
func (*PetMutation) SetParentID ¶
func (m *PetMutation) SetParentID(id int)
SetParentID sets the "parent" edge to the Pet entity by id.
func (*PetMutation) SetProtegeID ¶
func (m *PetMutation) SetProtegeID(id int)
SetProtegeID sets the "protege" edge to the Pet entity by id.
func (*PetMutation) SetSpouseID ¶
func (m *PetMutation) SetSpouseID(id int)
SetSpouseID sets the "spouse" edge to the Pet entity by id.
func (*PetMutation) SetWeight ¶
func (m *PetMutation) SetWeight(f float64)
SetWeight sets the "weight" field.
func (*PetMutation) Sex ¶
func (m *PetMutation) Sex() (r pet.Sex, exists bool)
Sex returns the value of the "sex" field in the mutation.
func (*PetMutation) SpouseCleared ¶
func (m *PetMutation) SpouseCleared() bool
SpouseCleared reports if the "spouse" edge to the Pet entity was cleared.
func (*PetMutation) SpouseID ¶
func (m *PetMutation) SpouseID() (id int, exists bool)
SpouseID returns the "spouse" edge ID in the mutation.
func (*PetMutation) SpouseIDs ¶
func (m *PetMutation) SpouseIDs() (ids []int)
SpouseIDs returns the "spouse" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SpouseID instead. It exists only for internal usage by the builders.
func (*PetMutation) ToysCleared ¶
func (m *PetMutation) ToysCleared() bool
ToysCleared reports if the "toys" edge to the Toy entity was cleared.
func (*PetMutation) ToysIDs ¶
func (m *PetMutation) ToysIDs() (ids []uuid.UUID)
ToysIDs returns the "toys" edge IDs in the mutation.
func (PetMutation) Tx ¶
func (m PetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PetMutation) Type ¶
func (m *PetMutation) Type() string
Type returns the node type of this mutation (Pet).
func (*PetMutation) Weight ¶
func (m *PetMutation) Weight() (r float64, exists bool)
Weight returns the value of the "weight" field in the mutation.
func (*PetMutation) WeightCleared ¶
func (m *PetMutation) WeightCleared() bool
WeightCleared returns if the "weight" field was cleared in this mutation.
func (*PetMutation) Where ¶
func (m *PetMutation) Where(ps ...predicate.Pet)
Where appends a list predicates to the PetMutation builder.
type PetQuery ¶
type PetQuery struct {
// contains filtered or unexported fields
}
PetQuery is the builder for querying Pet entities.
func (*PetQuery) Clone ¶
Clone returns a duplicate of the PetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PetQuery) First ¶
First returns the first Pet entity from the query. Returns a *NotFoundError when no Pet was found.
func (*PetQuery) FirstID ¶
FirstID returns the first Pet ID from the query. Returns a *NotFoundError when no Pet ID was found.
func (*PetQuery) GroupBy ¶
func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
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 { Height int `json:"height,omitempty"` Count int `json:"count,omitempty"` } client.Pet.Query(). GroupBy(pet.FieldHeight). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PetQuery) Only ¶
Only returns a single Pet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Pet entity is not found. Returns a *NotFoundError when no Pet entities are found.
func (*PetQuery) OnlyID ¶
OnlyID is like Only, but returns the only Pet ID in the query. Returns a *NotSingularError when exactly one Pet ID is not found. Returns a *NotFoundError when no entities are found.
func (*PetQuery) QueryBadge ¶
func (pq *PetQuery) QueryBadge() *BadgeQuery
QueryBadge chains the current query on the "badge" edge.
func (*PetQuery) QueryChildren ¶
QueryChildren chains the current query on the "children" edge.
func (*PetQuery) QueryFriends ¶
QueryFriends chains the current query on the "friends" edge.
func (*PetQuery) QueryMentor ¶
QueryMentor chains the current query on the "mentor" edge.
func (*PetQuery) QueryParent ¶
QueryParent chains the current query on the "parent" edge.
func (*PetQuery) QueryPlayGroups ¶
func (pq *PetQuery) QueryPlayGroups() *PlayGroupQuery
QueryPlayGroups chains the current query on the "play_groups" edge.
func (*PetQuery) QueryProtege ¶
QueryProtege chains the current query on the "protege" edge.
func (*PetQuery) QuerySpouse ¶
QuerySpouse chains the current query on the "spouse" edge.
func (*PetQuery) Select ¶
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 { Height int `json:"height,omitempty"` } client.Pet.Query(). Select(pet.FieldHeight). Scan(ctx, &v)
func (*PetQuery) 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 (*PetQuery) WithBadge ¶
func (pq *PetQuery) WithBadge(opts ...func(*BadgeQuery)) *PetQuery
WithBadge tells the query-builder to eager-load the nodes that are connected to the "badge" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithChildren ¶
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithFriends ¶
WithFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithMentor ¶
WithMentor tells the query-builder to eager-load the nodes that are connected to the "mentor" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithParent ¶
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithPlayGroups ¶
func (pq *PetQuery) WithPlayGroups(opts ...func(*PlayGroupQuery)) *PetQuery
WithPlayGroups tells the query-builder to eager-load the nodes that are connected to the "play_groups" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithProtege ¶
WithProtege tells the query-builder to eager-load the nodes that are connected to the "protege" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithSpouse ¶
WithSpouse tells the query-builder to eager-load the nodes that are connected to the "spouse" edge. The optional arguments are used to configure the query builder of the edge.
type PetSelect ¶
type PetSelect struct { *PetQuery // contains filtered or unexported fields }
PetSelect is the builder for selecting fields of Pet entities.
func (*PetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PetUpdate ¶
type PetUpdate struct {
// contains filtered or unexported fields
}
PetUpdate is the builder for updating Pet entities.
func (*PetUpdate) AddChildIDs ¶
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetUpdate) AddChildren ¶
AddChildren adds the "children" edges to the Pet entity.
func (*PetUpdate) AddFriendIDs ¶
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetUpdate) AddFriends ¶
AddFriends adds the "friends" edges to the Pet entity.
func (*PetUpdate) AddPlayGroupIDs ¶
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetUpdate) AddPlayGroups ¶
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetUpdate) ClearBadge ¶
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetUpdate) ClearBirthday ¶
ClearBirthday clears the value of the "birthday" field.
func (*PetUpdate) ClearChildren ¶
ClearChildren clears all "children" edges to the Pet entity.
func (*PetUpdate) ClearFriends ¶
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdate) ClearMentor ¶
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetUpdate) ClearNicknames ¶
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdate) ClearParent ¶
ClearParent clears the "parent" edge to the Pet entity.
func (*PetUpdate) ClearPlayGroups ¶
ClearPlayGroups clears all "play_groups" edges to the PlayGroup entity.
func (*PetUpdate) ClearProtege ¶
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetUpdate) ClearSpouse ¶
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetUpdate) ClearWeight ¶
ClearWeight clears the value of the "weight" field.
func (*PetUpdate) Mutation ¶
func (pu *PetUpdate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdate) RemoveChildIDs ¶
RemoveChildIDs removes the "children" edge to Pet entities by IDs.
func (*PetUpdate) RemoveChildren ¶
RemoveChildren removes "children" edges to Pet entities.
func (*PetUpdate) RemoveFriendIDs ¶
RemoveFriendIDs removes the "friends" edge to Pet entities by IDs.
func (*PetUpdate) RemoveFriends ¶
RemoveFriends removes "friends" edges to Pet entities.
func (*PetUpdate) RemovePlayGroupIDs ¶
RemovePlayGroupIDs removes the "play_groups" edge to PlayGroup entities by IDs.
func (*PetUpdate) RemovePlayGroups ¶
RemovePlayGroups removes "play_groups" edges to PlayGroup entities.
func (*PetUpdate) RemoveToyIDs ¶
RemoveToyIDs removes the "toys" edge to Toy entities by IDs.
func (*PetUpdate) RemoveToys ¶
RemoveToys removes "toys" edges to Toy entities.
func (*PetUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*PetUpdate) SetBadgeID ¶
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetUpdate) SetBirthday ¶
SetBirthday sets the "birthday" field.
func (*PetUpdate) SetCastrated ¶
SetCastrated sets the "castrated" field.
func (*PetUpdate) SetMentorID ¶
SetMentorID sets the "mentor" edge to the Pet entity by ID.
func (*PetUpdate) SetNicknames ¶
SetNicknames sets the "nicknames" field.
func (*PetUpdate) SetNillableBirthday ¶
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetUpdate) SetNillableMentorID ¶
SetNillableMentorID sets the "mentor" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableParentID ¶
SetNillableParentID sets the "parent" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableProtegeID ¶
SetNillableProtegeID sets the "protege" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableSpouseID ¶
SetNillableSpouseID sets the "spouse" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableWeight ¶
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetUpdate) SetParentID ¶
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetUpdate) SetProtege ¶
SetProtege sets the "protege" edge to the Pet entity.
func (*PetUpdate) SetProtegeID ¶
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetUpdate) SetSpouseID ¶
SetSpouseID sets the "spouse" edge to the Pet entity by ID.
type PetUpdateOne ¶
type PetUpdateOne struct {
// contains filtered or unexported fields
}
PetUpdateOne is the builder for updating a single Pet entity.
func (*PetUpdateOne) AddChildIDs ¶
func (puo *PetUpdateOne) AddChildIDs(ids ...int) *PetUpdateOne
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetUpdateOne) AddChildren ¶
func (puo *PetUpdateOne) AddChildren(p ...*Pet) *PetUpdateOne
AddChildren adds the "children" edges to the Pet entity.
func (*PetUpdateOne) AddFriendIDs ¶
func (puo *PetUpdateOne) AddFriendIDs(ids ...int) *PetUpdateOne
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetUpdateOne) AddFriends ¶
func (puo *PetUpdateOne) AddFriends(p ...*Pet) *PetUpdateOne
AddFriends adds the "friends" edges to the Pet entity.
func (*PetUpdateOne) AddHeight ¶
func (puo *PetUpdateOne) AddHeight(i int) *PetUpdateOne
AddHeight adds i to the "height" field.
func (*PetUpdateOne) AddPlayGroupIDs ¶
func (puo *PetUpdateOne) AddPlayGroupIDs(ids ...int) *PetUpdateOne
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetUpdateOne) AddPlayGroups ¶
func (puo *PetUpdateOne) AddPlayGroups(p ...*PlayGroup) *PetUpdateOne
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetUpdateOne) AddToyIDs ¶
func (puo *PetUpdateOne) AddToyIDs(ids ...uuid.UUID) *PetUpdateOne
AddToyIDs adds the "toys" edge to the Toy entity by IDs.
func (*PetUpdateOne) AddToys ¶
func (puo *PetUpdateOne) AddToys(t ...*Toy) *PetUpdateOne
AddToys adds the "toys" edges to the Toy entity.
func (*PetUpdateOne) AddWeight ¶
func (puo *PetUpdateOne) AddWeight(f float64) *PetUpdateOne
AddWeight adds f to the "weight" field.
func (*PetUpdateOne) ClearBadge ¶
func (puo *PetUpdateOne) ClearBadge() *PetUpdateOne
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetUpdateOne) ClearBirthday ¶
func (puo *PetUpdateOne) ClearBirthday() *PetUpdateOne
ClearBirthday clears the value of the "birthday" field.
func (*PetUpdateOne) ClearChildren ¶
func (puo *PetUpdateOne) ClearChildren() *PetUpdateOne
ClearChildren clears all "children" edges to the Pet entity.
func (*PetUpdateOne) ClearFriends ¶
func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdateOne) ClearMentor ¶
func (puo *PetUpdateOne) ClearMentor() *PetUpdateOne
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetUpdateOne) ClearNicknames ¶
func (puo *PetUpdateOne) ClearNicknames() *PetUpdateOne
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdateOne) ClearParent ¶
func (puo *PetUpdateOne) ClearParent() *PetUpdateOne
ClearParent clears the "parent" edge to the Pet entity.
func (*PetUpdateOne) ClearPlayGroups ¶
func (puo *PetUpdateOne) ClearPlayGroups() *PetUpdateOne
ClearPlayGroups clears all "play_groups" edges to the PlayGroup entity.
func (*PetUpdateOne) ClearProtege ¶
func (puo *PetUpdateOne) ClearProtege() *PetUpdateOne
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetUpdateOne) ClearSpouse ¶
func (puo *PetUpdateOne) ClearSpouse() *PetUpdateOne
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetUpdateOne) ClearToys ¶
func (puo *PetUpdateOne) ClearToys() *PetUpdateOne
ClearToys clears all "toys" edges to the Toy entity.
func (*PetUpdateOne) ClearWeight ¶
func (puo *PetUpdateOne) ClearWeight() *PetUpdateOne
ClearWeight clears the value of the "weight" field.
func (*PetUpdateOne) Exec ¶
func (puo *PetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PetUpdateOne) ExecX ¶
func (puo *PetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PetUpdateOne) Mutation ¶
func (puo *PetUpdateOne) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdateOne) RemoveChildIDs ¶
func (puo *PetUpdateOne) RemoveChildIDs(ids ...int) *PetUpdateOne
RemoveChildIDs removes the "children" edge to Pet entities by IDs.
func (*PetUpdateOne) RemoveChildren ¶
func (puo *PetUpdateOne) RemoveChildren(p ...*Pet) *PetUpdateOne
RemoveChildren removes "children" edges to Pet entities.
func (*PetUpdateOne) RemoveFriendIDs ¶
func (puo *PetUpdateOne) RemoveFriendIDs(ids ...int) *PetUpdateOne
RemoveFriendIDs removes the "friends" edge to Pet entities by IDs.
func (*PetUpdateOne) RemoveFriends ¶
func (puo *PetUpdateOne) RemoveFriends(p ...*Pet) *PetUpdateOne
RemoveFriends removes "friends" edges to Pet entities.
func (*PetUpdateOne) RemovePlayGroupIDs ¶
func (puo *PetUpdateOne) RemovePlayGroupIDs(ids ...int) *PetUpdateOne
RemovePlayGroupIDs removes the "play_groups" edge to PlayGroup entities by IDs.
func (*PetUpdateOne) RemovePlayGroups ¶
func (puo *PetUpdateOne) RemovePlayGroups(p ...*PlayGroup) *PetUpdateOne
RemovePlayGroups removes "play_groups" edges to PlayGroup entities.
func (*PetUpdateOne) RemoveToyIDs ¶
func (puo *PetUpdateOne) RemoveToyIDs(ids ...uuid.UUID) *PetUpdateOne
RemoveToyIDs removes the "toys" edge to Toy entities by IDs.
func (*PetUpdateOne) RemoveToys ¶
func (puo *PetUpdateOne) RemoveToys(t ...*Toy) *PetUpdateOne
RemoveToys removes "toys" edges to Toy entities.
func (*PetUpdateOne) Save ¶
func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
Save executes the query and returns the updated Pet entity.
func (*PetUpdateOne) SaveX ¶
func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
SaveX is like Save, but panics if an error occurs.
func (*PetUpdateOne) Select ¶
func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PetUpdateOne) SetBadge ¶
func (puo *PetUpdateOne) SetBadge(b *Badge) *PetUpdateOne
SetBadge sets the "badge" edge to the Badge entity.
func (*PetUpdateOne) SetBadgeID ¶
func (puo *PetUpdateOne) SetBadgeID(id uint32) *PetUpdateOne
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetUpdateOne) SetBirthday ¶
func (puo *PetUpdateOne) SetBirthday(t time.Time) *PetUpdateOne
SetBirthday sets the "birthday" field.
func (*PetUpdateOne) SetCastrated ¶
func (puo *PetUpdateOne) SetCastrated(b bool) *PetUpdateOne
SetCastrated sets the "castrated" field.
func (*PetUpdateOne) SetChip ¶
func (puo *PetUpdateOne) SetChip(u uuid.UUID) *PetUpdateOne
SetChip sets the "chip" field.
func (*PetUpdateOne) SetHeight ¶
func (puo *PetUpdateOne) SetHeight(i int) *PetUpdateOne
SetHeight sets the "height" field.
func (*PetUpdateOne) SetMentor ¶
func (puo *PetUpdateOne) SetMentor(p *Pet) *PetUpdateOne
SetMentor sets the "mentor" edge to the Pet entity.
func (*PetUpdateOne) SetMentorID ¶
func (puo *PetUpdateOne) SetMentorID(id int) *PetUpdateOne
SetMentorID sets the "mentor" edge to the Pet entity by ID.
func (*PetUpdateOne) SetName ¶
func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
SetName sets the "name" field.
func (*PetUpdateOne) SetNicknames ¶
func (puo *PetUpdateOne) SetNicknames(s []string) *PetUpdateOne
SetNicknames sets the "nicknames" field.
func (*PetUpdateOne) SetNillableBirthday ¶
func (puo *PetUpdateOne) SetNillableBirthday(t *time.Time) *PetUpdateOne
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetUpdateOne) SetNillableMentorID ¶
func (puo *PetUpdateOne) SetNillableMentorID(id *int) *PetUpdateOne
SetNillableMentorID sets the "mentor" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableParentID ¶
func (puo *PetUpdateOne) SetNillableParentID(id *int) *PetUpdateOne
SetNillableParentID sets the "parent" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableProtegeID ¶
func (puo *PetUpdateOne) SetNillableProtegeID(id *int) *PetUpdateOne
SetNillableProtegeID sets the "protege" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableSpouseID ¶
func (puo *PetUpdateOne) SetNillableSpouseID(id *int) *PetUpdateOne
SetNillableSpouseID sets the "spouse" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableWeight ¶
func (puo *PetUpdateOne) SetNillableWeight(f *float64) *PetUpdateOne
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetUpdateOne) SetParent ¶
func (puo *PetUpdateOne) SetParent(p *Pet) *PetUpdateOne
SetParent sets the "parent" edge to the Pet entity.
func (*PetUpdateOne) SetParentID ¶
func (puo *PetUpdateOne) SetParentID(id int) *PetUpdateOne
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetUpdateOne) SetProtege ¶
func (puo *PetUpdateOne) SetProtege(p *Pet) *PetUpdateOne
SetProtege sets the "protege" edge to the Pet entity.
func (*PetUpdateOne) SetProtegeID ¶
func (puo *PetUpdateOne) SetProtegeID(id int) *PetUpdateOne
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetUpdateOne) SetSex ¶
func (puo *PetUpdateOne) SetSex(pe pet.Sex) *PetUpdateOne
SetSex sets the "sex" field.
func (*PetUpdateOne) SetSpouse ¶
func (puo *PetUpdateOne) SetSpouse(p *Pet) *PetUpdateOne
SetSpouse sets the "spouse" edge to the Pet entity.
func (*PetUpdateOne) SetSpouseID ¶
func (puo *PetUpdateOne) SetSpouseID(id int) *PetUpdateOne
SetSpouseID sets the "spouse" edge to the Pet entity by ID.
func (*PetUpdateOne) SetWeight ¶
func (puo *PetUpdateOne) SetWeight(f float64) *PetUpdateOne
SetWeight sets the "weight" field.
type PlayGroup ¶
type PlayGroup struct { // ID of the ent. ID int `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Weekday holds the value of the "weekday" field. Weekday playgroup.Weekday `json:"weekday,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PlayGroupQuery when eager-loading is set. Edges PlayGroupEdges `json:"edges"` // contains filtered or unexported fields }
PlayGroup is the model entity for the PlayGroup schema.
func (*PlayGroup) QueryParticipants ¶
QueryParticipants queries the "participants" edge of the PlayGroup entity.
func (*PlayGroup) Unwrap ¶
Unwrap unwraps the PlayGroup 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 (*PlayGroup) Update ¶
func (pg *PlayGroup) Update() *PlayGroupUpdateOne
Update returns a builder for updating this PlayGroup. Note that you need to call PlayGroup.Unwrap() before calling this method if this PlayGroup was returned from a transaction, and the transaction was committed or rolled back.
type PlayGroupClient ¶
type PlayGroupClient struct {
// contains filtered or unexported fields
}
PlayGroupClient is a client for the PlayGroup schema.
func NewPlayGroupClient ¶
func NewPlayGroupClient(c config) *PlayGroupClient
NewPlayGroupClient returns a client for the PlayGroup from the given config.
func (*PlayGroupClient) Create ¶
func (c *PlayGroupClient) Create() *PlayGroupCreate
Create returns a create builder for PlayGroup.
func (*PlayGroupClient) CreateBulk ¶
func (c *PlayGroupClient) CreateBulk(builders ...*PlayGroupCreate) *PlayGroupCreateBulk
CreateBulk returns a builder for creating a bulk of PlayGroup entities.
func (*PlayGroupClient) Delete ¶
func (c *PlayGroupClient) Delete() *PlayGroupDelete
Delete returns a delete builder for PlayGroup.
func (*PlayGroupClient) DeleteOne ¶
func (c *PlayGroupClient) DeleteOne(pg *PlayGroup) *PlayGroupDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PlayGroupClient) DeleteOneID ¶
func (c *PlayGroupClient) DeleteOneID(id int) *PlayGroupDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PlayGroupClient) GetX ¶
func (c *PlayGroupClient) GetX(ctx context.Context, id int) *PlayGroup
GetX is like Get, but panics if an error occurs.
func (*PlayGroupClient) Hooks ¶
func (c *PlayGroupClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PlayGroupClient) Query ¶
func (c *PlayGroupClient) Query() *PlayGroupQuery
Query returns a query builder for PlayGroup.
func (*PlayGroupClient) QueryParticipants ¶
func (c *PlayGroupClient) QueryParticipants(pg *PlayGroup) *PetQuery
QueryParticipants queries the participants edge of a PlayGroup.
func (*PlayGroupClient) Update ¶
func (c *PlayGroupClient) Update() *PlayGroupUpdate
Update returns an update builder for PlayGroup.
func (*PlayGroupClient) UpdateOne ¶
func (c *PlayGroupClient) UpdateOne(pg *PlayGroup) *PlayGroupUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PlayGroupClient) UpdateOneID ¶
func (c *PlayGroupClient) UpdateOneID(id int) *PlayGroupUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PlayGroupClient) Use ¶
func (c *PlayGroupClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `playgroup.Hooks(f(g(h())))`.
type PlayGroupCreate ¶
type PlayGroupCreate struct {
// contains filtered or unexported fields
}
PlayGroupCreate is the builder for creating a PlayGroup entity.
func (*PlayGroupCreate) AddParticipantIDs ¶
func (pgc *PlayGroupCreate) AddParticipantIDs(ids ...int) *PlayGroupCreate
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupCreate) AddParticipants ¶
func (pgc *PlayGroupCreate) AddParticipants(p ...*Pet) *PlayGroupCreate
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupCreate) Exec ¶
func (pgc *PlayGroupCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupCreate) ExecX ¶
func (pgc *PlayGroupCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupCreate) Mutation ¶
func (pgc *PlayGroupCreate) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupCreate) Save ¶
func (pgc *PlayGroupCreate) Save(ctx context.Context) (*PlayGroup, error)
Save creates the PlayGroup in the database.
func (*PlayGroupCreate) SaveX ¶
func (pgc *PlayGroupCreate) SaveX(ctx context.Context) *PlayGroup
SaveX calls Save and panics if Save returns an error.
func (*PlayGroupCreate) SetDescription ¶
func (pgc *PlayGroupCreate) SetDescription(s string) *PlayGroupCreate
SetDescription sets the "description" field.
func (*PlayGroupCreate) SetNillableDescription ¶
func (pgc *PlayGroupCreate) SetNillableDescription(s *string) *PlayGroupCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupCreate) SetTitle ¶
func (pgc *PlayGroupCreate) SetTitle(s string) *PlayGroupCreate
SetTitle sets the "title" field.
func (*PlayGroupCreate) SetWeekday ¶
func (pgc *PlayGroupCreate) SetWeekday(pl playgroup.Weekday) *PlayGroupCreate
SetWeekday sets the "weekday" field.
type PlayGroupCreateBulk ¶
type PlayGroupCreateBulk struct {
// contains filtered or unexported fields
}
PlayGroupCreateBulk is the builder for creating many PlayGroup entities in bulk.
func (*PlayGroupCreateBulk) Exec ¶
func (pgcb *PlayGroupCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupCreateBulk) ExecX ¶
func (pgcb *PlayGroupCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PlayGroupDelete ¶
type PlayGroupDelete struct {
// contains filtered or unexported fields
}
PlayGroupDelete is the builder for deleting a PlayGroup entity.
func (*PlayGroupDelete) Exec ¶
func (pgd *PlayGroupDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PlayGroupDelete) ExecX ¶
func (pgd *PlayGroupDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupDelete) Where ¶
func (pgd *PlayGroupDelete) Where(ps ...predicate.PlayGroup) *PlayGroupDelete
Where appends a list predicates to the PlayGroupDelete builder.
type PlayGroupDeleteOne ¶
type PlayGroupDeleteOne struct {
// contains filtered or unexported fields
}
PlayGroupDeleteOne is the builder for deleting a single PlayGroup entity.
func (*PlayGroupDeleteOne) Exec ¶
func (pgdo *PlayGroupDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PlayGroupDeleteOne) ExecX ¶
func (pgdo *PlayGroupDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PlayGroupEdges ¶
type PlayGroupEdges struct { // Participants holds the value of the participants edge. Participants []*Pet `json:"participants,omitempty"` // contains filtered or unexported fields }
PlayGroupEdges holds the relations/edges for other nodes in the graph.
func (PlayGroupEdges) ParticipantsOrErr ¶
func (e PlayGroupEdges) ParticipantsOrErr() ([]*Pet, error)
ParticipantsOrErr returns the Participants value or an error if the edge was not loaded in eager-loading.
type PlayGroupGroupBy ¶
type PlayGroupGroupBy struct {
// contains filtered or unexported fields
}
PlayGroupGroupBy is the group-by builder for PlayGroup entities.
func (*PlayGroupGroupBy) Aggregate ¶
func (pggb *PlayGroupGroupBy) Aggregate(fns ...AggregateFunc) *PlayGroupGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PlayGroupGroupBy) Bool ¶
func (pggb *PlayGroupGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) BoolX ¶
func (pggb *PlayGroupGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PlayGroupGroupBy) Bools ¶
func (pggb *PlayGroupGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) BoolsX ¶
func (pggb *PlayGroupGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PlayGroupGroupBy) Float64 ¶
func (pggb *PlayGroupGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) Float64X ¶
func (pggb *PlayGroupGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PlayGroupGroupBy) Float64s ¶
func (pggb *PlayGroupGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) Float64sX ¶
func (pggb *PlayGroupGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PlayGroupGroupBy) Int ¶
func (pggb *PlayGroupGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) IntX ¶
func (pggb *PlayGroupGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PlayGroupGroupBy) Ints ¶
func (pggb *PlayGroupGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) IntsX ¶
func (pggb *PlayGroupGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PlayGroupGroupBy) Scan ¶
func (pggb *PlayGroupGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*PlayGroupGroupBy) ScanX ¶
func (pggb *PlayGroupGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PlayGroupGroupBy) String ¶
func (pggb *PlayGroupGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PlayGroupGroupBy) StringX ¶
func (pggb *PlayGroupGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PlayGroupMutation ¶
type PlayGroupMutation struct {
// contains filtered or unexported fields
}
PlayGroupMutation represents an operation that mutates the PlayGroup nodes in the graph.
func (*PlayGroupMutation) AddField ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) AddParticipantIDs ¶
func (m *PlayGroupMutation) AddParticipantIDs(ids ...int)
AddParticipantIDs adds the "participants" edge to the Pet entity by ids.
func (*PlayGroupMutation) AddedEdges ¶
func (m *PlayGroupMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PlayGroupMutation) AddedField ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) AddedFields ¶
func (m *PlayGroupMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PlayGroupMutation) AddedIDs ¶
func (m *PlayGroupMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PlayGroupMutation) ClearDescription ¶
func (m *PlayGroupMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*PlayGroupMutation) ClearEdge ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) ClearField ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) ClearParticipants ¶
func (m *PlayGroupMutation) ClearParticipants()
ClearParticipants clears the "participants" edge to the Pet entity.
func (*PlayGroupMutation) ClearedEdges ¶
func (m *PlayGroupMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PlayGroupMutation) ClearedFields ¶
func (m *PlayGroupMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PlayGroupMutation) Client ¶
func (m PlayGroupMutation) 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 (*PlayGroupMutation) Description ¶
func (m *PlayGroupMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*PlayGroupMutation) DescriptionCleared ¶
func (m *PlayGroupMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*PlayGroupMutation) EdgeCleared ¶
func (m *PlayGroupMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PlayGroupMutation) Field ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) FieldCleared ¶
func (m *PlayGroupMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PlayGroupMutation) Fields ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) ID ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) OldDescription ¶
func (m *PlayGroupMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the PlayGroup entity. If the PlayGroup 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 (*PlayGroupMutation) 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 (*PlayGroupMutation) OldTitle ¶
func (m *PlayGroupMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the PlayGroup entity. If the PlayGroup 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 (*PlayGroupMutation) OldWeekday ¶
OldWeekday returns the old "weekday" field's value of the PlayGroup entity. If the PlayGroup 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 (*PlayGroupMutation) ParticipantsCleared ¶
func (m *PlayGroupMutation) ParticipantsCleared() bool
ParticipantsCleared reports if the "participants" edge to the Pet entity was cleared.
func (*PlayGroupMutation) ParticipantsIDs ¶
func (m *PlayGroupMutation) ParticipantsIDs() (ids []int)
ParticipantsIDs returns the "participants" edge IDs in the mutation.
func (*PlayGroupMutation) RemoveParticipantIDs ¶
func (m *PlayGroupMutation) RemoveParticipantIDs(ids ...int)
RemoveParticipantIDs removes the "participants" edge to the Pet entity by IDs.
func (*PlayGroupMutation) RemovedEdges ¶
func (m *PlayGroupMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PlayGroupMutation) RemovedIDs ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) RemovedParticipantsIDs ¶
func (m *PlayGroupMutation) RemovedParticipantsIDs() (ids []int)
RemovedParticipants returns the removed IDs of the "participants" edge to the Pet entity.
func (*PlayGroupMutation) ResetDescription ¶
func (m *PlayGroupMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*PlayGroupMutation) ResetEdge ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) ResetField ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) ResetParticipants ¶
func (m *PlayGroupMutation) ResetParticipants()
ResetParticipants resets all changes to the "participants" edge.
func (*PlayGroupMutation) ResetTitle ¶
func (m *PlayGroupMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*PlayGroupMutation) ResetWeekday ¶
func (m *PlayGroupMutation) ResetWeekday()
ResetWeekday resets all changes to the "weekday" field.
func (*PlayGroupMutation) SetDescription ¶
func (m *PlayGroupMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*PlayGroupMutation) SetField ¶
func (m *PlayGroupMutation) 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 (*PlayGroupMutation) SetTitle ¶
func (m *PlayGroupMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*PlayGroupMutation) SetWeekday ¶
func (m *PlayGroupMutation) SetWeekday(pl playgroup.Weekday)
SetWeekday sets the "weekday" field.
func (*PlayGroupMutation) Title ¶
func (m *PlayGroupMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (PlayGroupMutation) Tx ¶
func (m PlayGroupMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PlayGroupMutation) Type ¶
func (m *PlayGroupMutation) Type() string
Type returns the node type of this mutation (PlayGroup).
func (*PlayGroupMutation) Weekday ¶
func (m *PlayGroupMutation) Weekday() (r playgroup.Weekday, exists bool)
Weekday returns the value of the "weekday" field in the mutation.
func (*PlayGroupMutation) Where ¶
func (m *PlayGroupMutation) Where(ps ...predicate.PlayGroup)
Where appends a list predicates to the PlayGroupMutation builder.
type PlayGroupQuery ¶
type PlayGroupQuery struct {
// contains filtered or unexported fields
}
PlayGroupQuery is the builder for querying PlayGroup entities.
func (*PlayGroupQuery) All ¶
func (pgq *PlayGroupQuery) All(ctx context.Context) ([]*PlayGroup, error)
All executes the query and returns a list of PlayGroups.
func (*PlayGroupQuery) AllX ¶
func (pgq *PlayGroupQuery) AllX(ctx context.Context) []*PlayGroup
AllX is like All, but panics if an error occurs.
func (*PlayGroupQuery) Clone ¶
func (pgq *PlayGroupQuery) Clone() *PlayGroupQuery
Clone returns a duplicate of the PlayGroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PlayGroupQuery) Count ¶
func (pgq *PlayGroupQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PlayGroupQuery) CountX ¶
func (pgq *PlayGroupQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PlayGroupQuery) Exist ¶
func (pgq *PlayGroupQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PlayGroupQuery) ExistX ¶
func (pgq *PlayGroupQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PlayGroupQuery) First ¶
func (pgq *PlayGroupQuery) First(ctx context.Context) (*PlayGroup, error)
First returns the first PlayGroup entity from the query. Returns a *NotFoundError when no PlayGroup was found.
func (*PlayGroupQuery) FirstID ¶
func (pgq *PlayGroupQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PlayGroup ID from the query. Returns a *NotFoundError when no PlayGroup ID was found.
func (*PlayGroupQuery) FirstIDX ¶
func (pgq *PlayGroupQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PlayGroupQuery) FirstX ¶
func (pgq *PlayGroupQuery) FirstX(ctx context.Context) *PlayGroup
FirstX is like First, but panics if an error occurs.
func (*PlayGroupQuery) GroupBy ¶
func (pgq *PlayGroupQuery) GroupBy(field string, fields ...string) *PlayGroupGroupBy
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 { Title string `json:"title,omitempty"` Count int `json:"count,omitempty"` } client.PlayGroup.Query(). GroupBy(playgroup.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PlayGroupQuery) IDs ¶
func (pgq *PlayGroupQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of PlayGroup IDs.
func (*PlayGroupQuery) IDsX ¶
func (pgq *PlayGroupQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PlayGroupQuery) Limit ¶
func (pgq *PlayGroupQuery) Limit(limit int) *PlayGroupQuery
Limit adds a limit step to the query.
func (*PlayGroupQuery) Offset ¶
func (pgq *PlayGroupQuery) Offset(offset int) *PlayGroupQuery
Offset adds an offset step to the query.
func (*PlayGroupQuery) Only ¶
func (pgq *PlayGroupQuery) Only(ctx context.Context) (*PlayGroup, error)
Only returns a single PlayGroup entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one PlayGroup entity is not found. Returns a *NotFoundError when no PlayGroup entities are found.
func (*PlayGroupQuery) OnlyID ¶
func (pgq *PlayGroupQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PlayGroup ID in the query. Returns a *NotSingularError when exactly one PlayGroup ID is not found. Returns a *NotFoundError when no entities are found.
func (*PlayGroupQuery) OnlyIDX ¶
func (pgq *PlayGroupQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PlayGroupQuery) OnlyX ¶
func (pgq *PlayGroupQuery) OnlyX(ctx context.Context) *PlayGroup
OnlyX is like Only, but panics if an error occurs.
func (*PlayGroupQuery) Order ¶
func (pgq *PlayGroupQuery) Order(o ...OrderFunc) *PlayGroupQuery
Order adds an order step to the query.
func (*PlayGroupQuery) QueryParticipants ¶
func (pgq *PlayGroupQuery) QueryParticipants() *PetQuery
QueryParticipants chains the current query on the "participants" edge.
func (*PlayGroupQuery) Select ¶
func (pgq *PlayGroupQuery) Select(fields ...string) *PlayGroupSelect
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 { Title string `json:"title,omitempty"` } client.PlayGroup.Query(). Select(playgroup.FieldTitle). Scan(ctx, &v)
func (*PlayGroupQuery) Unique ¶
func (pgq *PlayGroupQuery) Unique(unique bool) *PlayGroupQuery
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 (*PlayGroupQuery) Where ¶
func (pgq *PlayGroupQuery) Where(ps ...predicate.PlayGroup) *PlayGroupQuery
Where adds a new predicate for the PlayGroupQuery builder.
func (*PlayGroupQuery) WithParticipants ¶
func (pgq *PlayGroupQuery) WithParticipants(opts ...func(*PetQuery)) *PlayGroupQuery
WithParticipants tells the query-builder to eager-load the nodes that are connected to the "participants" edge. The optional arguments are used to configure the query builder of the edge.
type PlayGroupSelect ¶
type PlayGroupSelect struct { *PlayGroupQuery // contains filtered or unexported fields }
PlayGroupSelect is the builder for selecting fields of PlayGroup entities.
func (*PlayGroupSelect) Bool ¶
func (pgs *PlayGroupSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) BoolX ¶
func (pgs *PlayGroupSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PlayGroupSelect) Bools ¶
func (pgs *PlayGroupSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) BoolsX ¶
func (pgs *PlayGroupSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PlayGroupSelect) Float64 ¶
func (pgs *PlayGroupSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) Float64X ¶
func (pgs *PlayGroupSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PlayGroupSelect) Float64s ¶
func (pgs *PlayGroupSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) Float64sX ¶
func (pgs *PlayGroupSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PlayGroupSelect) Int ¶
func (pgs *PlayGroupSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) IntX ¶
func (pgs *PlayGroupSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PlayGroupSelect) Ints ¶
func (pgs *PlayGroupSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) IntsX ¶
func (pgs *PlayGroupSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PlayGroupSelect) Scan ¶
func (pgs *PlayGroupSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*PlayGroupSelect) ScanX ¶
func (pgs *PlayGroupSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PlayGroupSelect) String ¶
func (pgs *PlayGroupSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*PlayGroupSelect) StringX ¶
func (pgs *PlayGroupSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PlayGroupUpdate ¶
type PlayGroupUpdate struct {
// contains filtered or unexported fields
}
PlayGroupUpdate is the builder for updating PlayGroup entities.
func (*PlayGroupUpdate) AddParticipantIDs ¶
func (pgu *PlayGroupUpdate) AddParticipantIDs(ids ...int) *PlayGroupUpdate
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupUpdate) AddParticipants ¶
func (pgu *PlayGroupUpdate) AddParticipants(p ...*Pet) *PlayGroupUpdate
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupUpdate) ClearDescription ¶
func (pgu *PlayGroupUpdate) ClearDescription() *PlayGroupUpdate
ClearDescription clears the value of the "description" field.
func (*PlayGroupUpdate) ClearParticipants ¶
func (pgu *PlayGroupUpdate) ClearParticipants() *PlayGroupUpdate
ClearParticipants clears all "participants" edges to the Pet entity.
func (*PlayGroupUpdate) Exec ¶
func (pgu *PlayGroupUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupUpdate) ExecX ¶
func (pgu *PlayGroupUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupUpdate) Mutation ¶
func (pgu *PlayGroupUpdate) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupUpdate) RemoveParticipantIDs ¶
func (pgu *PlayGroupUpdate) RemoveParticipantIDs(ids ...int) *PlayGroupUpdate
RemoveParticipantIDs removes the "participants" edge to Pet entities by IDs.
func (*PlayGroupUpdate) RemoveParticipants ¶
func (pgu *PlayGroupUpdate) RemoveParticipants(p ...*Pet) *PlayGroupUpdate
RemoveParticipants removes "participants" edges to Pet entities.
func (*PlayGroupUpdate) Save ¶
func (pgu *PlayGroupUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PlayGroupUpdate) SaveX ¶
func (pgu *PlayGroupUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PlayGroupUpdate) SetDescription ¶
func (pgu *PlayGroupUpdate) SetDescription(s string) *PlayGroupUpdate
SetDescription sets the "description" field.
func (*PlayGroupUpdate) SetNillableDescription ¶
func (pgu *PlayGroupUpdate) SetNillableDescription(s *string) *PlayGroupUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupUpdate) SetTitle ¶
func (pgu *PlayGroupUpdate) SetTitle(s string) *PlayGroupUpdate
SetTitle sets the "title" field.
func (*PlayGroupUpdate) SetWeekday ¶
func (pgu *PlayGroupUpdate) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdate
SetWeekday sets the "weekday" field.
func (*PlayGroupUpdate) Where ¶
func (pgu *PlayGroupUpdate) Where(ps ...predicate.PlayGroup) *PlayGroupUpdate
Where appends a list predicates to the PlayGroupUpdate builder.
type PlayGroupUpdateOne ¶
type PlayGroupUpdateOne struct {
// contains filtered or unexported fields
}
PlayGroupUpdateOne is the builder for updating a single PlayGroup entity.
func (*PlayGroupUpdateOne) AddParticipantIDs ¶
func (pguo *PlayGroupUpdateOne) AddParticipantIDs(ids ...int) *PlayGroupUpdateOne
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupUpdateOne) AddParticipants ¶
func (pguo *PlayGroupUpdateOne) AddParticipants(p ...*Pet) *PlayGroupUpdateOne
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupUpdateOne) ClearDescription ¶
func (pguo *PlayGroupUpdateOne) ClearDescription() *PlayGroupUpdateOne
ClearDescription clears the value of the "description" field.
func (*PlayGroupUpdateOne) ClearParticipants ¶
func (pguo *PlayGroupUpdateOne) ClearParticipants() *PlayGroupUpdateOne
ClearParticipants clears all "participants" edges to the Pet entity.
func (*PlayGroupUpdateOne) Exec ¶
func (pguo *PlayGroupUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PlayGroupUpdateOne) ExecX ¶
func (pguo *PlayGroupUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupUpdateOne) Mutation ¶
func (pguo *PlayGroupUpdateOne) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupUpdateOne) RemoveParticipantIDs ¶
func (pguo *PlayGroupUpdateOne) RemoveParticipantIDs(ids ...int) *PlayGroupUpdateOne
RemoveParticipantIDs removes the "participants" edge to Pet entities by IDs.
func (*PlayGroupUpdateOne) RemoveParticipants ¶
func (pguo *PlayGroupUpdateOne) RemoveParticipants(p ...*Pet) *PlayGroupUpdateOne
RemoveParticipants removes "participants" edges to Pet entities.
func (*PlayGroupUpdateOne) Save ¶
func (pguo *PlayGroupUpdateOne) Save(ctx context.Context) (*PlayGroup, error)
Save executes the query and returns the updated PlayGroup entity.
func (*PlayGroupUpdateOne) SaveX ¶
func (pguo *PlayGroupUpdateOne) SaveX(ctx context.Context) *PlayGroup
SaveX is like Save, but panics if an error occurs.
func (*PlayGroupUpdateOne) Select ¶
func (pguo *PlayGroupUpdateOne) Select(field string, fields ...string) *PlayGroupUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PlayGroupUpdateOne) SetDescription ¶
func (pguo *PlayGroupUpdateOne) SetDescription(s string) *PlayGroupUpdateOne
SetDescription sets the "description" field.
func (*PlayGroupUpdateOne) SetNillableDescription ¶
func (pguo *PlayGroupUpdateOne) SetNillableDescription(s *string) *PlayGroupUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupUpdateOne) SetTitle ¶
func (pguo *PlayGroupUpdateOne) SetTitle(s string) *PlayGroupUpdateOne
SetTitle sets the "title" field.
func (*PlayGroupUpdateOne) SetWeekday ¶
func (pguo *PlayGroupUpdateOne) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdateOne
SetWeekday sets the "weekday" field.
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(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 Rollbacker method.
type Toy ¶
type Toy struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Color holds the value of the "color" field. Color toy.Color `json:"color,omitempty"` // Material holds the value of the "material" field. Material toy.Material `json:"material,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ToyQuery when eager-loading is set. Edges ToyEdges `json:"edges"` // contains filtered or unexported fields }
Toy is the model entity for the Toy schema.
func (*Toy) QueryOwner ¶
QueryOwner queries the "owner" edge of the Toy entity.
func (*Toy) Unwrap ¶
Unwrap unwraps the Toy 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 (*Toy) Update ¶
func (t *Toy) Update() *ToyUpdateOne
Update returns a builder for updating this Toy. Note that you need to call Toy.Unwrap() before calling this method if this Toy was returned from a transaction, and the transaction was committed or rolled back.
type ToyClient ¶
type ToyClient struct {
// contains filtered or unexported fields
}
ToyClient is a client for the Toy schema.
func NewToyClient ¶
func NewToyClient(c config) *ToyClient
NewToyClient returns a client for the Toy from the given config.
func (*ToyClient) CreateBulk ¶
func (c *ToyClient) CreateBulk(builders ...*ToyCreate) *ToyCreateBulk
CreateBulk returns a builder for creating a bulk of Toy entities.
func (*ToyClient) DeleteOne ¶
func (c *ToyClient) DeleteOne(t *Toy) *ToyDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ToyClient) DeleteOneID ¶
func (c *ToyClient) DeleteOneID(id uuid.UUID) *ToyDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ToyClient) QueryOwner ¶
QueryOwner queries the owner edge of a Toy.
func (*ToyClient) UpdateOne ¶
func (c *ToyClient) UpdateOne(t *Toy) *ToyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ToyClient) UpdateOneID ¶
func (c *ToyClient) UpdateOneID(id uuid.UUID) *ToyUpdateOne
UpdateOneID returns an update builder for the given id.
type ToyCreate ¶
type ToyCreate struct {
// contains filtered or unexported fields
}
ToyCreate is the builder for creating a Toy entity.
func (*ToyCreate) Mutation ¶
func (tc *ToyCreate) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyCreate) SetMaterial ¶
SetMaterial sets the "material" field.
func (*ToyCreate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the Pet entity by ID if the given value is not nil.
func (*ToyCreate) SetOwnerID ¶
SetOwnerID sets the "owner" edge to the Pet entity by ID.
type ToyCreateBulk ¶
type ToyCreateBulk struct {
// contains filtered or unexported fields
}
ToyCreateBulk is the builder for creating many Toy entities in bulk.
func (*ToyCreateBulk) Exec ¶
func (tcb *ToyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ToyCreateBulk) ExecX ¶
func (tcb *ToyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ToyDelete ¶
type ToyDelete struct {
// contains filtered or unexported fields
}
ToyDelete is the builder for deleting a Toy entity.
func (*ToyDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type ToyDeleteOne ¶
type ToyDeleteOne struct {
// contains filtered or unexported fields
}
ToyDeleteOne is the builder for deleting a single Toy entity.
func (*ToyDeleteOne) Exec ¶
func (tdo *ToyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ToyDeleteOne) ExecX ¶
func (tdo *ToyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ToyEdges ¶
type ToyEdges struct { // Owner holds the value of the owner edge. Owner *Pet `json:"owner,omitempty"` // contains filtered or unexported fields }
ToyEdges holds the relations/edges for other nodes in the graph.
func (ToyEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ToyGroupBy ¶
type ToyGroupBy struct {
// contains filtered or unexported fields
}
ToyGroupBy is the group-by builder for Toy entities.
func (*ToyGroupBy) Aggregate ¶
func (tgb *ToyGroupBy) Aggregate(fns ...AggregateFunc) *ToyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ToyGroupBy) Bool ¶
func (tgb *ToyGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) BoolX ¶
func (tgb *ToyGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ToyGroupBy) Bools ¶
func (tgb *ToyGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) BoolsX ¶
func (tgb *ToyGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ToyGroupBy) Float64 ¶
func (tgb *ToyGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) Float64X ¶
func (tgb *ToyGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ToyGroupBy) Float64s ¶
func (tgb *ToyGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) Float64sX ¶
func (tgb *ToyGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ToyGroupBy) Int ¶
func (tgb *ToyGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) IntX ¶
func (tgb *ToyGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ToyGroupBy) Ints ¶
func (tgb *ToyGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) IntsX ¶
func (tgb *ToyGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ToyGroupBy) Scan ¶
func (tgb *ToyGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*ToyGroupBy) ScanX ¶
func (tgb *ToyGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ToyGroupBy) String ¶
func (tgb *ToyGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ToyGroupBy) StringX ¶
func (tgb *ToyGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ToyMutation ¶
type ToyMutation struct {
// contains filtered or unexported fields
}
ToyMutation represents an operation that mutates the Toy nodes in the graph.
func (*ToyMutation) AddField ¶
func (m *ToyMutation) 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 (*ToyMutation) AddedEdges ¶
func (m *ToyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ToyMutation) AddedField ¶
func (m *ToyMutation) 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 (*ToyMutation) AddedFields ¶
func (m *ToyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ToyMutation) AddedIDs ¶
func (m *ToyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ToyMutation) ClearEdge ¶
func (m *ToyMutation) 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 (*ToyMutation) ClearField ¶
func (m *ToyMutation) 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 (*ToyMutation) ClearOwner ¶
func (m *ToyMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyMutation) ClearedEdges ¶
func (m *ToyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ToyMutation) ClearedFields ¶
func (m *ToyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ToyMutation) Client ¶
func (m ToyMutation) 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 (*ToyMutation) Color ¶
func (m *ToyMutation) Color() (r toy.Color, exists bool)
Color returns the value of the "color" field in the mutation.
func (*ToyMutation) EdgeCleared ¶
func (m *ToyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ToyMutation) Field ¶
func (m *ToyMutation) 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 (*ToyMutation) FieldCleared ¶
func (m *ToyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ToyMutation) Fields ¶
func (m *ToyMutation) 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 (*ToyMutation) ID ¶
func (m *ToyMutation) ID() (id uuid.UUID, 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 (*ToyMutation) Material ¶
func (m *ToyMutation) Material() (r toy.Material, exists bool)
Material returns the value of the "material" field in the mutation.
func (*ToyMutation) OldColor ¶
OldColor returns the old "color" field's value of the Toy entity. If the Toy 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 (*ToyMutation) 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 (*ToyMutation) OldMaterial ¶
OldMaterial returns the old "material" field's value of the Toy entity. If the Toy 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 (*ToyMutation) OldTitle ¶
func (m *ToyMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Toy entity. If the Toy 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 (*ToyMutation) OwnerCleared ¶
func (m *ToyMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Pet entity was cleared.
func (*ToyMutation) OwnerID ¶
func (m *ToyMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*ToyMutation) OwnerIDs ¶
func (m *ToyMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*ToyMutation) RemovedEdges ¶
func (m *ToyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ToyMutation) RemovedIDs ¶
func (m *ToyMutation) 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 (*ToyMutation) ResetColor ¶
func (m *ToyMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*ToyMutation) ResetEdge ¶
func (m *ToyMutation) 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 (*ToyMutation) ResetField ¶
func (m *ToyMutation) 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 (*ToyMutation) ResetMaterial ¶
func (m *ToyMutation) ResetMaterial()
ResetMaterial resets all changes to the "material" field.
func (*ToyMutation) ResetOwner ¶
func (m *ToyMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*ToyMutation) ResetTitle ¶
func (m *ToyMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ToyMutation) SetColor ¶
func (m *ToyMutation) SetColor(t toy.Color)
SetColor sets the "color" field.
func (*ToyMutation) SetField ¶
func (m *ToyMutation) 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 (*ToyMutation) SetID ¶ added in v0.4.1
func (m *ToyMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Toy entities.
func (*ToyMutation) SetMaterial ¶
func (m *ToyMutation) SetMaterial(t toy.Material)
SetMaterial sets the "material" field.
func (*ToyMutation) SetOwnerID ¶
func (m *ToyMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the Pet entity by id.
func (*ToyMutation) SetTitle ¶
func (m *ToyMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ToyMutation) Title ¶
func (m *ToyMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (ToyMutation) Tx ¶
func (m ToyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ToyMutation) Type ¶
func (m *ToyMutation) Type() string
Type returns the node type of this mutation (Toy).
func (*ToyMutation) Where ¶
func (m *ToyMutation) Where(ps ...predicate.Toy)
Where appends a list predicates to the ToyMutation builder.
type ToyQuery ¶
type ToyQuery struct {
// contains filtered or unexported fields
}
ToyQuery is the builder for querying Toy entities.
func (*ToyQuery) Clone ¶
Clone returns a duplicate of the ToyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ToyQuery) First ¶
First returns the first Toy entity from the query. Returns a *NotFoundError when no Toy was found.
func (*ToyQuery) FirstID ¶
FirstID returns the first Toy ID from the query. Returns a *NotFoundError when no Toy ID was found.
func (*ToyQuery) GroupBy ¶
func (tq *ToyQuery) GroupBy(field string, fields ...string) *ToyGroupBy
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 { Color toy.Color `json:"color,omitempty"` Count int `json:"count,omitempty"` } client.Toy.Query(). GroupBy(toy.FieldColor). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ToyQuery) Only ¶
Only returns a single Toy entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Toy entity is not found. Returns a *NotFoundError when no Toy entities are found.
func (*ToyQuery) OnlyID ¶
OnlyID is like Only, but returns the only Toy ID in the query. Returns a *NotSingularError when exactly one Toy ID is not found. Returns a *NotFoundError when no entities are found.
func (*ToyQuery) QueryOwner ¶
QueryOwner chains the current query on the "owner" edge.
func (*ToyQuery) Select ¶
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 { Color toy.Color `json:"color,omitempty"` } client.Toy.Query(). Select(toy.FieldColor). Scan(ctx, &v)
func (*ToyQuery) 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 ToySelect ¶
type ToySelect struct { *ToyQuery // contains filtered or unexported fields }
ToySelect is the builder for selecting fields of Toy entities.
func (*ToySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ToySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ToySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ToySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ToySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ToySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ToySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ToyUpdate ¶
type ToyUpdate struct {
// contains filtered or unexported fields
}
ToyUpdate is the builder for updating Toy entities.
func (*ToyUpdate) ClearOwner ¶
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyUpdate) Mutation ¶
func (tu *ToyUpdate) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*ToyUpdate) SetMaterial ¶
SetMaterial sets the "material" field.
func (*ToyUpdate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the Pet entity by ID if the given value is not nil.
func (*ToyUpdate) SetOwnerID ¶
SetOwnerID sets the "owner" edge to the Pet entity by ID.
type ToyUpdateOne ¶
type ToyUpdateOne struct {
// contains filtered or unexported fields
}
ToyUpdateOne is the builder for updating a single Toy entity.
func (*ToyUpdateOne) ClearOwner ¶
func (tuo *ToyUpdateOne) ClearOwner() *ToyUpdateOne
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyUpdateOne) Exec ¶
func (tuo *ToyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ToyUpdateOne) ExecX ¶
func (tuo *ToyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ToyUpdateOne) Mutation ¶
func (tuo *ToyUpdateOne) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyUpdateOne) Save ¶
func (tuo *ToyUpdateOne) Save(ctx context.Context) (*Toy, error)
Save executes the query and returns the updated Toy entity.
func (*ToyUpdateOne) SaveX ¶
func (tuo *ToyUpdateOne) SaveX(ctx context.Context) *Toy
SaveX is like Save, but panics if an error occurs.
func (*ToyUpdateOne) Select ¶
func (tuo *ToyUpdateOne) Select(field string, fields ...string) *ToyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ToyUpdateOne) SetColor ¶
func (tuo *ToyUpdateOne) SetColor(t toy.Color) *ToyUpdateOne
SetColor sets the "color" field.
func (*ToyUpdateOne) SetMaterial ¶
func (tuo *ToyUpdateOne) SetMaterial(t toy.Material) *ToyUpdateOne
SetMaterial sets the "material" field.
func (*ToyUpdateOne) SetNillableOwnerID ¶
func (tuo *ToyUpdateOne) SetNillableOwnerID(id *int) *ToyUpdateOne
SetNillableOwnerID sets the "owner" edge to the Pet entity by ID if the given value is not nil.
func (*ToyUpdateOne) SetOwner ¶
func (tuo *ToyUpdateOne) SetOwner(p *Pet) *ToyUpdateOne
SetOwner sets the "owner" edge to the Pet entity.
func (*ToyUpdateOne) SetOwnerID ¶
func (tuo *ToyUpdateOne) SetOwnerID(id int) *ToyUpdateOne
SetOwnerID sets the "owner" edge to the Pet entity by ID.
func (*ToyUpdateOne) SetTitle ¶
func (tuo *ToyUpdateOne) SetTitle(s string) *ToyUpdateOne
SetTitle sets the "title" field.
type Tx ¶
type Tx struct { // Badge is the client for interacting with the Badge builders. Badge *BadgeClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // PlayGroup is the client for interacting with the PlayGroup builders. PlayGroup *PlayGroupClient // Toy is the client for interacting with the Toy builders. Toy *ToyClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- badge.go
- badge_create.go
- badge_delete.go
- badge_query.go
- badge_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- mutation.go
- pet.go
- pet_create.go
- pet_delete.go
- pet_query.go
- pet_update.go
- playgroup.go
- playgroup_create.go
- playgroup_delete.go
- playgroup_query.go
- playgroup_update.go
- runtime.go
- toy.go
- toy_create.go
- toy_delete.go
- toy_query.go
- toy_update.go
- tx.go