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 int) *BadgeDeleteOne
- func (c *BadgeClient) Get(ctx context.Context, id int) (*Badge, error)
- func (c *BadgeClient) GetX(ctx context.Context, id int) *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 int) *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) 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 int, 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) 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 int, err error)
- func (bq *BadgeQuery) FirstIDX(ctx context.Context) int
- func (bq *BadgeQuery) FirstX(ctx context.Context) *Badge
- func (bq *BadgeQuery) GroupBy(field string, fields ...string) *BadgeGroupBy
- func (bq *BadgeQuery) IDs(ctx context.Context) ([]int, error)
- func (bq *BadgeQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (bq *BadgeQuery) OnlyIDX(ctx context.Context) int
- 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 ...int) *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 int) *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 ...int)
- 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 int, exists bool)
- func (m *PetMutation) BadgeIDs() (ids []int)
- 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 ...int)
- 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 []int)
- 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 int)
- 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 []int)
- 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 ...int) *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 ...int) *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 int) *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 ...int) *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 ...int) *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 int) *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 int) *ToyDeleteOne
- func (c *ToyClient) Get(ctx context.Context, id int) (*Toy, error)
- func (c *ToyClient) GetX(ctx context.Context, id int) *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 int) *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) 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 int, 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) 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 int, err error)
- func (tq *ToyQuery) FirstIDX(ctx context.Context) int
- func (tq *ToyQuery) FirstX(ctx context.Context) *Toy
- func (tq *ToyQuery) GroupBy(field string, fields ...string) *ToyGroupBy
- func (tq *ToyQuery) IDs(ctx context.Context) ([]int, error)
- func (tq *ToyQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (tq *ToyQuery) OnlyIDX(ctx context.Context) int
- 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 ¶ added in v0.3.2
type Badge struct { // ID of the ent. ID int `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 ¶ added in v0.3.2
QueryWearer queries the "wearer" edge of the Badge entity.
func (*Badge) Unwrap ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type BadgeClient struct {
// contains filtered or unexported fields
}
BadgeClient is a client for the Badge schema.
func NewBadgeClient ¶ added in v0.3.2
func NewBadgeClient(c config) *BadgeClient
NewBadgeClient returns a client for the Badge from the given config.
func (*BadgeClient) Create ¶ added in v0.3.2
func (c *BadgeClient) Create() *BadgeCreate
Create returns a create builder for Badge.
func (*BadgeClient) CreateBulk ¶ added in v0.3.2
func (c *BadgeClient) CreateBulk(builders ...*BadgeCreate) *BadgeCreateBulk
CreateBulk returns a builder for creating a bulk of Badge entities.
func (*BadgeClient) Delete ¶ added in v0.3.2
func (c *BadgeClient) Delete() *BadgeDelete
Delete returns a delete builder for Badge.
func (*BadgeClient) DeleteOne ¶ added in v0.3.2
func (c *BadgeClient) DeleteOne(b *Badge) *BadgeDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*BadgeClient) DeleteOneID ¶ added in v0.3.2
func (c *BadgeClient) DeleteOneID(id int) *BadgeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*BadgeClient) GetX ¶ added in v0.3.2
func (c *BadgeClient) GetX(ctx context.Context, id int) *Badge
GetX is like Get, but panics if an error occurs.
func (*BadgeClient) Hooks ¶ added in v0.3.2
func (c *BadgeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BadgeClient) Query ¶ added in v0.3.2
func (c *BadgeClient) Query() *BadgeQuery
Query returns a query builder for Badge.
func (*BadgeClient) QueryWearer ¶ added in v0.3.2
func (c *BadgeClient) QueryWearer(b *Badge) *PetQuery
QueryWearer queries the wearer edge of a Badge.
func (*BadgeClient) Update ¶ added in v0.3.2
func (c *BadgeClient) Update() *BadgeUpdate
Update returns an update builder for Badge.
func (*BadgeClient) UpdateOne ¶ added in v0.3.2
func (c *BadgeClient) UpdateOne(b *Badge) *BadgeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BadgeClient) UpdateOneID ¶ added in v0.3.2
func (c *BadgeClient) UpdateOneID(id int) *BadgeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BadgeClient) Use ¶ added in v0.3.2
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 ¶ added in v0.3.2
type BadgeCreate struct {
// contains filtered or unexported fields
}
BadgeCreate is the builder for creating a Badge entity.
func (*BadgeCreate) Exec ¶ added in v0.3.2
func (bc *BadgeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeCreate) ExecX ¶ added in v0.3.2
func (bc *BadgeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeCreate) Mutation ¶ added in v0.3.2
func (bc *BadgeCreate) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeCreate) Save ¶ added in v0.3.2
func (bc *BadgeCreate) Save(ctx context.Context) (*Badge, error)
Save creates the Badge in the database.
func (*BadgeCreate) SaveX ¶ added in v0.3.2
func (bc *BadgeCreate) SaveX(ctx context.Context) *Badge
SaveX calls Save and panics if Save returns an error.
func (*BadgeCreate) SetColor ¶ added in v0.3.2
func (bc *BadgeCreate) SetColor(b badge.Color) *BadgeCreate
SetColor sets the "color" field.
func (*BadgeCreate) SetMaterial ¶ added in v0.3.2
func (bc *BadgeCreate) SetMaterial(b badge.Material) *BadgeCreate
SetMaterial sets the "material" field.
func (*BadgeCreate) SetNillableWearerID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bc *BadgeCreate) SetWearer(p *Pet) *BadgeCreate
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeCreate) SetWearerID ¶ added in v0.3.2
func (bc *BadgeCreate) SetWearerID(id int) *BadgeCreate
SetWearerID sets the "wearer" edge to the Pet entity by ID.
type BadgeCreateBulk ¶ added in v0.3.2
type BadgeCreateBulk struct {
// contains filtered or unexported fields
}
BadgeCreateBulk is the builder for creating many Badge entities in bulk.
func (*BadgeCreateBulk) Exec ¶ added in v0.3.2
func (bcb *BadgeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeCreateBulk) ExecX ¶ added in v0.3.2
func (bcb *BadgeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BadgeDelete ¶ added in v0.3.2
type BadgeDelete struct {
// contains filtered or unexported fields
}
BadgeDelete is the builder for deleting a Badge entity.
func (*BadgeDelete) Exec ¶ added in v0.3.2
func (bd *BadgeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BadgeDelete) ExecX ¶ added in v0.3.2
func (bd *BadgeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BadgeDelete) Where ¶ added in v0.3.2
func (bd *BadgeDelete) Where(ps ...predicate.Badge) *BadgeDelete
Where appends a list predicates to the BadgeDelete builder.
type BadgeDeleteOne ¶ added in v0.3.2
type BadgeDeleteOne struct {
// contains filtered or unexported fields
}
BadgeDeleteOne is the builder for deleting a single Badge entity.
func (*BadgeDeleteOne) Exec ¶ added in v0.3.2
func (bdo *BadgeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BadgeDeleteOne) ExecX ¶ added in v0.3.2
func (bdo *BadgeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BadgeEdges ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type BadgeGroupBy struct {
// contains filtered or unexported fields
}
BadgeGroupBy is the group-by builder for Badge entities.
func (*BadgeGroupBy) Aggregate ¶ added in v0.3.2
func (bgb *BadgeGroupBy) Aggregate(fns ...AggregateFunc) *BadgeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BadgeGroupBy) Bool ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*BadgeGroupBy) Bools ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*BadgeGroupBy) Float64 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*BadgeGroupBy) Float64s ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*BadgeGroupBy) Int ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*BadgeGroupBy) Ints ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*BadgeGroupBy) Scan ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*BadgeGroupBy) String ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bgb *BadgeGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type BadgeMutation ¶ added in v0.3.2
type BadgeMutation struct {
// contains filtered or unexported fields
}
BadgeMutation represents an operation that mutates the Badge nodes in the graph.
func (*BadgeMutation) AddField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BadgeMutation) AddedField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BadgeMutation) AddedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) ClearWearer()
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeMutation) ClearedEdges ¶ added in v0.3.2
func (m *BadgeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BadgeMutation) ClearedFields ¶ added in v0.3.2
func (m *BadgeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BadgeMutation) Client ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) Color() (r badge.Color, exists bool)
Color returns the value of the "color" field in the mutation.
func (*BadgeMutation) EdgeCleared ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) 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 (*BadgeMutation) Material ¶ added in v0.3.2
func (m *BadgeMutation) Material() (r badge.Material, exists bool)
Material returns the value of the "material" field in the mutation.
func (*BadgeMutation) OldColor ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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) Op ¶ added in v0.3.2
func (m *BadgeMutation) Op() Op
Op returns the operation name.
func (*BadgeMutation) RemovedEdges ¶ added in v0.3.2
func (m *BadgeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BadgeMutation) RemovedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*BadgeMutation) ResetEdge ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) ResetMaterial()
ResetMaterial resets all changes to the "material" field.
func (*BadgeMutation) ResetWearer ¶ added in v0.3.2
func (m *BadgeMutation) ResetWearer()
ResetWearer resets all changes to the "wearer" edge.
func (*BadgeMutation) SetColor ¶ added in v0.3.2
func (m *BadgeMutation) SetColor(b badge.Color)
SetColor sets the "color" field.
func (*BadgeMutation) SetField ¶ added in v0.3.2
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) SetMaterial ¶ added in v0.3.2
func (m *BadgeMutation) SetMaterial(b badge.Material)
SetMaterial sets the "material" field.
func (*BadgeMutation) SetWearerID ¶ added in v0.3.2
func (m *BadgeMutation) SetWearerID(id int)
SetWearerID sets the "wearer" edge to the Pet entity by id.
func (BadgeMutation) Tx ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) Type() string
Type returns the node type of this mutation (Badge).
func (*BadgeMutation) WearerCleared ¶ added in v0.3.2
func (m *BadgeMutation) WearerCleared() bool
WearerCleared reports if the "wearer" edge to the Pet entity was cleared.
func (*BadgeMutation) WearerID ¶ added in v0.3.2
func (m *BadgeMutation) WearerID() (id int, exists bool)
WearerID returns the "wearer" edge ID in the mutation.
func (*BadgeMutation) WearerIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *BadgeMutation) Where(ps ...predicate.Badge)
Where appends a list predicates to the BadgeMutation builder.
type BadgeQuery ¶ added in v0.3.2
type BadgeQuery struct {
// contains filtered or unexported fields
}
BadgeQuery is the builder for querying Badge entities.
func (*BadgeQuery) All ¶ added in v0.3.2
func (bq *BadgeQuery) All(ctx context.Context) ([]*Badge, error)
All executes the query and returns a list of Badges.
func (*BadgeQuery) AllX ¶ added in v0.3.2
func (bq *BadgeQuery) AllX(ctx context.Context) []*Badge
AllX is like All, but panics if an error occurs.
func (*BadgeQuery) Clone ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bq *BadgeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BadgeQuery) CountX ¶ added in v0.3.2
func (bq *BadgeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BadgeQuery) Exist ¶ added in v0.3.2
func (bq *BadgeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BadgeQuery) ExistX ¶ added in v0.3.2
func (bq *BadgeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BadgeQuery) First ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bq *BadgeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Badge ID from the query. Returns a *NotFoundError when no Badge ID was found.
func (*BadgeQuery) FirstIDX ¶ added in v0.3.2
func (bq *BadgeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BadgeQuery) FirstX ¶ added in v0.3.2
func (bq *BadgeQuery) FirstX(ctx context.Context) *Badge
FirstX is like First, but panics if an error occurs.
func (*BadgeQuery) GroupBy ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bq *BadgeQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Badge IDs.
func (*BadgeQuery) IDsX ¶ added in v0.3.2
func (bq *BadgeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BadgeQuery) Limit ¶ added in v0.3.2
func (bq *BadgeQuery) Limit(limit int) *BadgeQuery
Limit adds a limit step to the query.
func (*BadgeQuery) Offset ¶ added in v0.3.2
func (bq *BadgeQuery) Offset(offset int) *BadgeQuery
Offset adds an offset step to the query.
func (*BadgeQuery) Only ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bq *BadgeQuery) OnlyID(ctx context.Context) (id int, 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 ¶ added in v0.3.2
func (bq *BadgeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BadgeQuery) OnlyX ¶ added in v0.3.2
func (bq *BadgeQuery) OnlyX(ctx context.Context) *Badge
OnlyX is like Only, but panics if an error occurs.
func (*BadgeQuery) Order ¶ added in v0.3.2
func (bq *BadgeQuery) Order(o ...OrderFunc) *BadgeQuery
Order adds an order step to the query.
func (*BadgeQuery) QueryWearer ¶ added in v0.3.2
func (bq *BadgeQuery) QueryWearer() *PetQuery
QueryWearer chains the current query on the "wearer" edge.
func (*BadgeQuery) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bq *BadgeQuery) Where(ps ...predicate.Badge) *BadgeQuery
Where adds a new predicate for the BadgeQuery builder.
func (*BadgeQuery) WithWearer ¶ added in v0.3.2
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 ¶ added in v0.3.2
type BadgeSelect struct { *BadgeQuery // contains filtered or unexported fields }
BadgeSelect is the builder for selecting fields of Badge entities.
func (*BadgeSelect) Bool ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*BadgeSelect) Bools ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*BadgeSelect) Float64 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*BadgeSelect) Float64s ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*BadgeSelect) Int ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*BadgeSelect) Ints ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*BadgeSelect) Scan ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*BadgeSelect) String ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bs *BadgeSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type BadgeUpdate ¶ added in v0.3.2
type BadgeUpdate struct {
// contains filtered or unexported fields
}
BadgeUpdate is the builder for updating Badge entities.
func (*BadgeUpdate) ClearWearer ¶ added in v0.3.2
func (bu *BadgeUpdate) ClearWearer() *BadgeUpdate
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeUpdate) Exec ¶ added in v0.3.2
func (bu *BadgeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BadgeUpdate) ExecX ¶ added in v0.3.2
func (bu *BadgeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeUpdate) Mutation ¶ added in v0.3.2
func (bu *BadgeUpdate) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeUpdate) Save ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bu *BadgeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BadgeUpdate) SetColor ¶ added in v0.3.2
func (bu *BadgeUpdate) SetColor(b badge.Color) *BadgeUpdate
SetColor sets the "color" field.
func (*BadgeUpdate) SetMaterial ¶ added in v0.3.2
func (bu *BadgeUpdate) SetMaterial(b badge.Material) *BadgeUpdate
SetMaterial sets the "material" field.
func (*BadgeUpdate) SetNillableWearerID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (bu *BadgeUpdate) SetWearer(p *Pet) *BadgeUpdate
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeUpdate) SetWearerID ¶ added in v0.3.2
func (bu *BadgeUpdate) SetWearerID(id int) *BadgeUpdate
SetWearerID sets the "wearer" edge to the Pet entity by ID.
func (*BadgeUpdate) Where ¶ added in v0.3.2
func (bu *BadgeUpdate) Where(ps ...predicate.Badge) *BadgeUpdate
Where appends a list predicates to the BadgeUpdate builder.
type BadgeUpdateOne ¶ added in v0.3.2
type BadgeUpdateOne struct {
// contains filtered or unexported fields
}
BadgeUpdateOne is the builder for updating a single Badge entity.
func (*BadgeUpdateOne) ClearWearer ¶ added in v0.3.2
func (buo *BadgeUpdateOne) ClearWearer() *BadgeUpdateOne
ClearWearer clears the "wearer" edge to the Pet entity.
func (*BadgeUpdateOne) Exec ¶ added in v0.3.2
func (buo *BadgeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BadgeUpdateOne) ExecX ¶ added in v0.3.2
func (buo *BadgeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BadgeUpdateOne) Mutation ¶ added in v0.3.2
func (buo *BadgeUpdateOne) Mutation() *BadgeMutation
Mutation returns the BadgeMutation object of the builder.
func (*BadgeUpdateOne) Save ¶ added in v0.3.2
func (buo *BadgeUpdateOne) Save(ctx context.Context) (*Badge, error)
Save executes the query and returns the updated Badge entity.
func (*BadgeUpdateOne) SaveX ¶ added in v0.3.2
func (buo *BadgeUpdateOne) SaveX(ctx context.Context) *Badge
SaveX is like Save, but panics if an error occurs.
func (*BadgeUpdateOne) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (buo *BadgeUpdateOne) SetColor(b badge.Color) *BadgeUpdateOne
SetColor sets the "color" field.
func (*BadgeUpdateOne) SetMaterial ¶ added in v0.3.2
func (buo *BadgeUpdateOne) SetMaterial(b badge.Material) *BadgeUpdateOne
SetMaterial sets the "material" field.
func (*BadgeUpdateOne) SetNillableWearerID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (buo *BadgeUpdateOne) SetWearer(p *Pet) *BadgeUpdateOne
SetWearer sets the "wearer" edge to the Pet entity.
func (*BadgeUpdateOne) SetWearerID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pe *Pet) QueryBadge() *BadgeQuery
QueryBadge queries the "badge" edge of the Pet entity.
func (*Pet) QueryChildren ¶ added in v0.3.2
QueryChildren queries the "children" edge of the Pet entity.
func (*Pet) QueryFriends ¶
QueryFriends queries the "friends" edge of the Pet entity.
func (*Pet) QueryMentor ¶ added in v0.3.2
QueryMentor queries the "mentor" edge of the Pet entity.
func (*Pet) QueryParent ¶ added in v0.3.2
QueryParent queries the "parent" edge of the Pet entity.
func (*Pet) QueryPlayGroups ¶ added in v0.3.2
func (pe *Pet) QueryPlayGroups() *PlayGroupQuery
QueryPlayGroups queries the "play_groups" edge of the Pet entity.
func (*Pet) QueryProtege ¶ added in v0.3.2
QueryProtege queries the "protege" edge of the Pet entity.
func (*Pet) QuerySpouse ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (c *PetClient) QueryBadge(pe *Pet) *BadgeQuery
QueryBadge queries the badge edge of a Pet.
func (*PetClient) QueryChildren ¶ added in v0.3.2
QueryChildren queries the children edge of a Pet.
func (*PetClient) QueryFriends ¶
QueryFriends queries the friends edge of a Pet.
func (*PetClient) QueryMentor ¶ added in v0.3.2
QueryMentor queries the mentor edge of a Pet.
func (*PetClient) QueryParent ¶ added in v0.3.2
QueryParent queries the parent edge of a Pet.
func (*PetClient) QueryPlayGroups ¶ added in v0.3.2
func (c *PetClient) QueryPlayGroups(pe *Pet) *PlayGroupQuery
QueryPlayGroups queries the play_groups edge of a Pet.
func (*PetClient) QueryProtege ¶ added in v0.3.2
QueryProtege queries the protege edge of a Pet.
func (*PetClient) QuerySpouse ¶ added in v0.3.2
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 ¶ added in v0.3.2
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetCreate) AddChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetCreate) AddPlayGroups ¶ added in v0.3.2
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetCreate) AddToyIDs ¶ added in v0.3.2
AddToyIDs adds the "toys" edge to the Toy entity by IDs.
func (*PetCreate) Mutation ¶
func (pc *PetCreate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetCreate) SetBadgeID ¶ added in v0.3.2
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetCreate) SetBirthday ¶ added in v0.3.2
SetBirthday sets the "birthday" field.
func (*PetCreate) SetCastrated ¶ added in v0.3.2
SetCastrated sets the "castrated" field.
func (*PetCreate) SetMentorID ¶ added in v0.3.2
SetMentorID sets the "mentor" edge to the Pet entity by ID.
func (*PetCreate) SetNicknames ¶ added in v0.3.2
SetNicknames sets the "nicknames" field.
func (*PetCreate) SetNillableBirthday ¶ added in v0.3.2
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetCreate) SetNillableMentorID ¶ added in v0.3.2
SetNillableMentorID sets the "mentor" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableParentID ¶ added in v0.3.2
SetNillableParentID sets the "parent" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableProtegeID ¶ added in v0.3.2
SetNillableProtegeID sets the "protege" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableSpouseID ¶ added in v0.3.2
SetNillableSpouseID sets the "spouse" edge to the Pet entity by ID if the given value is not nil.
func (*PetCreate) SetNillableWeight ¶ added in v0.3.2
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetCreate) SetParentID ¶ added in v0.3.2
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetCreate) SetProtege ¶ added in v0.3.2
SetProtege sets the "protege" edge to the Pet entity.
func (*PetCreate) SetProtegeID ¶ added in v0.3.2
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetCreate) SetSpouseID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pcb *PetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PetCreateBulk) ExecX ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
PlayGroupsOrErr returns the PlayGroups value or an error if the edge was not loaded in eager-loading.
func (PetEdges) ProtegeOrErr ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) AddHeight(i int)
AddHeight adds i to the "height" field.
func (*PetMutation) AddPlayGroupIDs ¶ added in v0.3.2
func (m *PetMutation) AddPlayGroupIDs(ids ...int)
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by ids.
func (*PetMutation) AddToyIDs ¶ added in v0.3.2
func (m *PetMutation) AddToyIDs(ids ...int)
AddToyIDs adds the "toys" edge to the Toy entity by ids.
func (*PetMutation) AddWeight ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) BadgeCleared() bool
BadgeCleared reports if the "badge" edge to the Badge entity was cleared.
func (*PetMutation) BadgeID ¶ added in v0.3.2
func (m *PetMutation) BadgeID() (id int, exists bool)
BadgeID returns the "badge" edge ID in the mutation.
func (*PetMutation) BadgeIDs ¶ added in v0.3.2
func (m *PetMutation) BadgeIDs() (ids []int)
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 ¶ added in v0.3.2
func (m *PetMutation) Birthday() (r time.Time, exists bool)
Birthday returns the value of the "birthday" field in the mutation.
func (*PetMutation) BirthdayCleared ¶ added in v0.3.2
func (m *PetMutation) BirthdayCleared() bool
BirthdayCleared returns if the "birthday" field was cleared in this mutation.
func (*PetMutation) Castrated ¶ added in v0.3.2
func (m *PetMutation) Castrated() (r bool, exists bool)
Castrated returns the value of the "castrated" field in the mutation.
func (*PetMutation) ChildrenCleared ¶ added in v0.3.2
func (m *PetMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Pet entity was cleared.
func (*PetMutation) ChildrenIDs ¶ added in v0.3.2
func (m *PetMutation) ChildrenIDs() (ids []int)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*PetMutation) Chip ¶ added in v0.3.2
func (m *PetMutation) Chip() (r uuid.UUID, exists bool)
Chip returns the value of the "chip" field in the mutation.
func (*PetMutation) ClearBadge ¶ added in v0.3.2
func (m *PetMutation) ClearBadge()
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetMutation) ClearBirthday ¶ added in v0.3.2
func (m *PetMutation) ClearBirthday()
ClearBirthday clears the value of the "birthday" field.
func (*PetMutation) ClearChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) ClearMentor()
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetMutation) ClearNicknames ¶ added in v0.3.2
func (m *PetMutation) ClearNicknames()
ClearNicknames clears the value of the "nicknames" field.
func (*PetMutation) ClearParent ¶ added in v0.3.2
func (m *PetMutation) ClearParent()
ClearParent clears the "parent" edge to the Pet entity.
func (*PetMutation) ClearPlayGroups ¶ added in v0.3.2
func (m *PetMutation) ClearPlayGroups()
ClearPlayGroups clears the "play_groups" edge to the PlayGroup entity.
func (*PetMutation) ClearProtege ¶ added in v0.3.2
func (m *PetMutation) ClearProtege()
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetMutation) ClearSpouse ¶ added in v0.3.2
func (m *PetMutation) ClearSpouse()
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetMutation) ClearToys ¶ added in v0.3.2
func (m *PetMutation) ClearToys()
ClearToys clears the "toys" edge to the Toy entity.
func (*PetMutation) ClearWeight ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) MentorCleared() bool
MentorCleared reports if the "mentor" edge to the Pet entity was cleared.
func (*PetMutation) MentorID ¶ added in v0.3.2
func (m *PetMutation) MentorID() (id int, exists bool)
MentorID returns the "mentor" edge ID in the mutation.
func (*PetMutation) MentorIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) Nicknames() (r []string, exists bool)
Nicknames returns the value of the "nicknames" field in the mutation.
func (*PetMutation) NicknamesCleared ¶ added in v0.3.2
func (m *PetMutation) NicknamesCleared() bool
NicknamesCleared returns if the "nicknames" field was cleared in this mutation.
func (*PetMutation) OldBirthday ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Pet entity was cleared.
func (*PetMutation) ParentID ¶ added in v0.3.2
func (m *PetMutation) ParentID() (id int, exists bool)
ParentID returns the "parent" edge ID in the mutation.
func (*PetMutation) ParentIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) PlayGroupsCleared() bool
PlayGroupsCleared reports if the "play_groups" edge to the PlayGroup entity was cleared.
func (*PetMutation) PlayGroupsIDs ¶ added in v0.3.2
func (m *PetMutation) PlayGroupsIDs() (ids []int)
PlayGroupsIDs returns the "play_groups" edge IDs in the mutation.
func (*PetMutation) ProtegeCleared ¶ added in v0.3.2
func (m *PetMutation) ProtegeCleared() bool
ProtegeCleared reports if the "protege" edge to the Pet entity was cleared.
func (*PetMutation) ProtegeID ¶ added in v0.3.2
func (m *PetMutation) ProtegeID() (id int, exists bool)
ProtegeID returns the "protege" edge ID in the mutation.
func (*PetMutation) ProtegeIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) RemovePlayGroupIDs(ids ...int)
RemovePlayGroupIDs removes the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetMutation) RemoveToyIDs ¶ added in v0.3.2
func (m *PetMutation) RemoveToyIDs(ids ...int)
RemoveToyIDs removes the "toys" edge to the Toy entity by IDs.
func (*PetMutation) RemovedChildrenIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) RemovedPlayGroupsIDs() (ids []int)
RemovedPlayGroups returns the removed IDs of the "play_groups" edge to the PlayGroup entity.
func (*PetMutation) RemovedToysIDs ¶ added in v0.3.2
func (m *PetMutation) RemovedToysIDs() (ids []int)
RemovedToys returns the removed IDs of the "toys" edge to the Toy entity.
func (*PetMutation) ResetBadge ¶ added in v0.3.2
func (m *PetMutation) ResetBadge()
ResetBadge resets all changes to the "badge" edge.
func (*PetMutation) ResetBirthday ¶ added in v0.3.2
func (m *PetMutation) ResetBirthday()
ResetBirthday resets all changes to the "birthday" field.
func (*PetMutation) ResetCastrated ¶ added in v0.3.2
func (m *PetMutation) ResetCastrated()
ResetCastrated resets all changes to the "castrated" field.
func (*PetMutation) ResetChildren ¶ added in v0.3.2
func (m *PetMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*PetMutation) ResetChip ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) ResetHeight()
ResetHeight resets all changes to the "height" field.
func (*PetMutation) ResetMentor ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) ResetNicknames()
ResetNicknames resets all changes to the "nicknames" field.
func (*PetMutation) ResetParent ¶ added in v0.3.2
func (m *PetMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*PetMutation) ResetPlayGroups ¶ added in v0.3.2
func (m *PetMutation) ResetPlayGroups()
ResetPlayGroups resets all changes to the "play_groups" edge.
func (*PetMutation) ResetProtege ¶ added in v0.3.2
func (m *PetMutation) ResetProtege()
ResetProtege resets all changes to the "protege" edge.
func (*PetMutation) ResetSex ¶ added in v0.3.2
func (m *PetMutation) ResetSex()
ResetSex resets all changes to the "sex" field.
func (*PetMutation) ResetSpouse ¶ added in v0.3.2
func (m *PetMutation) ResetSpouse()
ResetSpouse resets all changes to the "spouse" edge.
func (*PetMutation) ResetToys ¶ added in v0.3.2
func (m *PetMutation) ResetToys()
ResetToys resets all changes to the "toys" edge.
func (*PetMutation) ResetWeight ¶ added in v0.3.2
func (m *PetMutation) ResetWeight()
ResetWeight resets all changes to the "weight" field.
func (*PetMutation) SetBadgeID ¶ added in v0.3.2
func (m *PetMutation) SetBadgeID(id int)
SetBadgeID sets the "badge" edge to the Badge entity by id.
func (*PetMutation) SetBirthday ¶ added in v0.3.2
func (m *PetMutation) SetBirthday(t time.Time)
SetBirthday sets the "birthday" field.
func (*PetMutation) SetCastrated ¶ added in v0.3.2
func (m *PetMutation) SetCastrated(b bool)
SetCastrated sets the "castrated" field.
func (*PetMutation) SetChip ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) SetHeight(i int)
SetHeight sets the "height" field.
func (*PetMutation) SetMentorID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) SetNicknames(s []string)
SetNicknames sets the "nicknames" field.
func (*PetMutation) SetParentID ¶ added in v0.3.2
func (m *PetMutation) SetParentID(id int)
SetParentID sets the "parent" edge to the Pet entity by id.
func (*PetMutation) SetProtegeID ¶ added in v0.3.2
func (m *PetMutation) SetProtegeID(id int)
SetProtegeID sets the "protege" edge to the Pet entity by id.
func (*PetMutation) SetSex ¶ added in v0.3.2
func (m *PetMutation) SetSex(pe pet.Sex)
SetSex sets the "sex" field.
func (*PetMutation) SetSpouseID ¶ added in v0.3.2
func (m *PetMutation) SetSpouseID(id int)
SetSpouseID sets the "spouse" edge to the Pet entity by id.
func (*PetMutation) SetWeight ¶ added in v0.3.2
func (m *PetMutation) SetWeight(f float64)
SetWeight sets the "weight" field.
func (*PetMutation) Sex ¶ added in v0.3.2
func (m *PetMutation) Sex() (r pet.Sex, exists bool)
Sex returns the value of the "sex" field in the mutation.
func (*PetMutation) SpouseCleared ¶ added in v0.3.2
func (m *PetMutation) SpouseCleared() bool
SpouseCleared reports if the "spouse" edge to the Pet entity was cleared.
func (*PetMutation) SpouseID ¶ added in v0.3.2
func (m *PetMutation) SpouseID() (id int, exists bool)
SpouseID returns the "spouse" edge ID in the mutation.
func (*PetMutation) SpouseIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PetMutation) ToysCleared() bool
ToysCleared reports if the "toys" edge to the Toy entity was cleared.
func (*PetMutation) ToysIDs ¶ added in v0.3.2
func (m *PetMutation) ToysIDs() (ids []int)
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 ¶ added in v0.3.2
func (m *PetMutation) Weight() (r float64, exists bool)
Weight returns the value of the "weight" field in the mutation.
func (*PetMutation) WeightCleared ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pq *PetQuery) QueryBadge() *BadgeQuery
QueryBadge chains the current query on the "badge" edge.
func (*PetQuery) QueryChildren ¶ added in v0.3.2
QueryChildren chains the current query on the "children" edge.
func (*PetQuery) QueryFriends ¶
QueryFriends chains the current query on the "friends" edge.
func (*PetQuery) QueryMentor ¶ added in v0.3.2
QueryMentor chains the current query on the "mentor" edge.
func (*PetQuery) QueryParent ¶ added in v0.3.2
QueryParent chains the current query on the "parent" edge.
func (*PetQuery) QueryPlayGroups ¶ added in v0.3.2
func (pq *PetQuery) QueryPlayGroups() *PlayGroupQuery
QueryPlayGroups chains the current query on the "play_groups" edge.
func (*PetQuery) QueryProtege ¶ added in v0.3.2
QueryProtege chains the current query on the "protege" edge.
func (*PetQuery) QuerySpouse ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetUpdate) AddChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetUpdate) AddPlayGroups ¶ added in v0.3.2
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetUpdate) AddToyIDs ¶ added in v0.3.2
AddToyIDs adds the "toys" edge to the Toy entity by IDs.
func (*PetUpdate) ClearBadge ¶ added in v0.3.2
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetUpdate) ClearBirthday ¶ added in v0.3.2
ClearBirthday clears the value of the "birthday" field.
func (*PetUpdate) ClearChildren ¶ added in v0.3.2
ClearChildren clears all "children" edges to the Pet entity.
func (*PetUpdate) ClearFriends ¶
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdate) ClearMentor ¶ added in v0.3.2
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetUpdate) ClearNicknames ¶ added in v0.3.2
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdate) ClearParent ¶ added in v0.3.2
ClearParent clears the "parent" edge to the Pet entity.
func (*PetUpdate) ClearPlayGroups ¶ added in v0.3.2
ClearPlayGroups clears all "play_groups" edges to the PlayGroup entity.
func (*PetUpdate) ClearProtege ¶ added in v0.3.2
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetUpdate) ClearSpouse ¶ added in v0.3.2
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetUpdate) ClearWeight ¶ added in v0.3.2
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 ¶ added in v0.3.2
RemoveChildIDs removes the "children" edge to Pet entities by IDs.
func (*PetUpdate) RemoveChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
RemovePlayGroupIDs removes the "play_groups" edge to PlayGroup entities by IDs.
func (*PetUpdate) RemovePlayGroups ¶ added in v0.3.2
RemovePlayGroups removes "play_groups" edges to PlayGroup entities.
func (*PetUpdate) RemoveToyIDs ¶ added in v0.3.2
RemoveToyIDs removes the "toys" edge to Toy entities by IDs.
func (*PetUpdate) RemoveToys ¶ added in v0.3.2
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 ¶ added in v0.3.2
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetUpdate) SetBirthday ¶ added in v0.3.2
SetBirthday sets the "birthday" field.
func (*PetUpdate) SetCastrated ¶ added in v0.3.2
SetCastrated sets the "castrated" field.
func (*PetUpdate) SetMentorID ¶ added in v0.3.2
SetMentorID sets the "mentor" edge to the Pet entity by ID.
func (*PetUpdate) SetNicknames ¶ added in v0.3.2
SetNicknames sets the "nicknames" field.
func (*PetUpdate) SetNillableBirthday ¶ added in v0.3.2
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetUpdate) SetNillableMentorID ¶ added in v0.3.2
SetNillableMentorID sets the "mentor" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableParentID ¶ added in v0.3.2
SetNillableParentID sets the "parent" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableProtegeID ¶ added in v0.3.2
SetNillableProtegeID sets the "protege" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableSpouseID ¶ added in v0.3.2
SetNillableSpouseID sets the "spouse" edge to the Pet entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableWeight ¶ added in v0.3.2
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetUpdate) SetParentID ¶ added in v0.3.2
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetUpdate) SetProtege ¶ added in v0.3.2
SetProtege sets the "protege" edge to the Pet entity.
func (*PetUpdate) SetProtegeID ¶ added in v0.3.2
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetUpdate) SetSpouseID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) AddChildIDs(ids ...int) *PetUpdateOne
AddChildIDs adds the "children" edge to the Pet entity by IDs.
func (*PetUpdateOne) AddChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) AddHeight(i int) *PetUpdateOne
AddHeight adds i to the "height" field.
func (*PetUpdateOne) AddPlayGroupIDs ¶ added in v0.3.2
func (puo *PetUpdateOne) AddPlayGroupIDs(ids ...int) *PetUpdateOne
AddPlayGroupIDs adds the "play_groups" edge to the PlayGroup entity by IDs.
func (*PetUpdateOne) AddPlayGroups ¶ added in v0.3.2
func (puo *PetUpdateOne) AddPlayGroups(p ...*PlayGroup) *PetUpdateOne
AddPlayGroups adds the "play_groups" edges to the PlayGroup entity.
func (*PetUpdateOne) AddToyIDs ¶ added in v0.3.2
func (puo *PetUpdateOne) AddToyIDs(ids ...int) *PetUpdateOne
AddToyIDs adds the "toys" edge to the Toy entity by IDs.
func (*PetUpdateOne) AddToys ¶ added in v0.3.2
func (puo *PetUpdateOne) AddToys(t ...*Toy) *PetUpdateOne
AddToys adds the "toys" edges to the Toy entity.
func (*PetUpdateOne) AddWeight ¶ added in v0.3.2
func (puo *PetUpdateOne) AddWeight(f float64) *PetUpdateOne
AddWeight adds f to the "weight" field.
func (*PetUpdateOne) ClearBadge ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearBadge() *PetUpdateOne
ClearBadge clears the "badge" edge to the Badge entity.
func (*PetUpdateOne) ClearBirthday ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearBirthday() *PetUpdateOne
ClearBirthday clears the value of the "birthday" field.
func (*PetUpdateOne) ClearChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearMentor() *PetUpdateOne
ClearMentor clears the "mentor" edge to the Pet entity.
func (*PetUpdateOne) ClearNicknames ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearNicknames() *PetUpdateOne
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdateOne) ClearParent ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearParent() *PetUpdateOne
ClearParent clears the "parent" edge to the Pet entity.
func (*PetUpdateOne) ClearPlayGroups ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearPlayGroups() *PetUpdateOne
ClearPlayGroups clears all "play_groups" edges to the PlayGroup entity.
func (*PetUpdateOne) ClearProtege ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearProtege() *PetUpdateOne
ClearProtege clears the "protege" edge to the Pet entity.
func (*PetUpdateOne) ClearSpouse ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearSpouse() *PetUpdateOne
ClearSpouse clears the "spouse" edge to the Pet entity.
func (*PetUpdateOne) ClearToys ¶ added in v0.3.2
func (puo *PetUpdateOne) ClearToys() *PetUpdateOne
ClearToys clears all "toys" edges to the Toy entity.
func (*PetUpdateOne) ClearWeight ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) RemoveChildIDs(ids ...int) *PetUpdateOne
RemoveChildIDs removes the "children" edge to Pet entities by IDs.
func (*PetUpdateOne) RemoveChildren ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) RemovePlayGroupIDs(ids ...int) *PetUpdateOne
RemovePlayGroupIDs removes the "play_groups" edge to PlayGroup entities by IDs.
func (*PetUpdateOne) RemovePlayGroups ¶ added in v0.3.2
func (puo *PetUpdateOne) RemovePlayGroups(p ...*PlayGroup) *PetUpdateOne
RemovePlayGroups removes "play_groups" edges to PlayGroup entities.
func (*PetUpdateOne) RemoveToyIDs ¶ added in v0.3.2
func (puo *PetUpdateOne) RemoveToyIDs(ids ...int) *PetUpdateOne
RemoveToyIDs removes the "toys" edge to Toy entities by IDs.
func (*PetUpdateOne) RemoveToys ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) SetBadge(b *Badge) *PetUpdateOne
SetBadge sets the "badge" edge to the Badge entity.
func (*PetUpdateOne) SetBadgeID ¶ added in v0.3.2
func (puo *PetUpdateOne) SetBadgeID(id int) *PetUpdateOne
SetBadgeID sets the "badge" edge to the Badge entity by ID.
func (*PetUpdateOne) SetBirthday ¶ added in v0.3.2
func (puo *PetUpdateOne) SetBirthday(t time.Time) *PetUpdateOne
SetBirthday sets the "birthday" field.
func (*PetUpdateOne) SetCastrated ¶ added in v0.3.2
func (puo *PetUpdateOne) SetCastrated(b bool) *PetUpdateOne
SetCastrated sets the "castrated" field.
func (*PetUpdateOne) SetChip ¶ added in v0.3.2
func (puo *PetUpdateOne) SetChip(u uuid.UUID) *PetUpdateOne
SetChip sets the "chip" field.
func (*PetUpdateOne) SetHeight ¶ added in v0.3.2
func (puo *PetUpdateOne) SetHeight(i int) *PetUpdateOne
SetHeight sets the "height" field.
func (*PetUpdateOne) SetMentor ¶ added in v0.3.2
func (puo *PetUpdateOne) SetMentor(p *Pet) *PetUpdateOne
SetMentor sets the "mentor" edge to the Pet entity.
func (*PetUpdateOne) SetMentorID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) SetNicknames(s []string) *PetUpdateOne
SetNicknames sets the "nicknames" field.
func (*PetUpdateOne) SetNillableBirthday ¶ added in v0.3.2
func (puo *PetUpdateOne) SetNillableBirthday(t *time.Time) *PetUpdateOne
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*PetUpdateOne) SetNillableMentorID ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (puo *PetUpdateOne) SetNillableWeight(f *float64) *PetUpdateOne
SetNillableWeight sets the "weight" field if the given value is not nil.
func (*PetUpdateOne) SetParent ¶ added in v0.3.2
func (puo *PetUpdateOne) SetParent(p *Pet) *PetUpdateOne
SetParent sets the "parent" edge to the Pet entity.
func (*PetUpdateOne) SetParentID ¶ added in v0.3.2
func (puo *PetUpdateOne) SetParentID(id int) *PetUpdateOne
SetParentID sets the "parent" edge to the Pet entity by ID.
func (*PetUpdateOne) SetProtege ¶ added in v0.3.2
func (puo *PetUpdateOne) SetProtege(p *Pet) *PetUpdateOne
SetProtege sets the "protege" edge to the Pet entity.
func (*PetUpdateOne) SetProtegeID ¶ added in v0.3.2
func (puo *PetUpdateOne) SetProtegeID(id int) *PetUpdateOne
SetProtegeID sets the "protege" edge to the Pet entity by ID.
func (*PetUpdateOne) SetSex ¶ added in v0.3.2
func (puo *PetUpdateOne) SetSex(pe pet.Sex) *PetUpdateOne
SetSex sets the "sex" field.
func (*PetUpdateOne) SetSpouse ¶ added in v0.3.2
func (puo *PetUpdateOne) SetSpouse(p *Pet) *PetUpdateOne
SetSpouse sets the "spouse" edge to the Pet entity.
func (*PetUpdateOne) SetSpouseID ¶ added in v0.3.2
func (puo *PetUpdateOne) SetSpouseID(id int) *PetUpdateOne
SetSpouseID sets the "spouse" edge to the Pet entity by ID.
func (*PetUpdateOne) SetWeight ¶ added in v0.3.2
func (puo *PetUpdateOne) SetWeight(f float64) *PetUpdateOne
SetWeight sets the "weight" field.
type PlayGroup ¶ added in v0.3.2
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 ¶ added in v0.3.2
QueryParticipants queries the "participants" edge of the PlayGroup entity.
func (*PlayGroup) Unwrap ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type PlayGroupClient struct {
// contains filtered or unexported fields
}
PlayGroupClient is a client for the PlayGroup schema.
func NewPlayGroupClient ¶ added in v0.3.2
func NewPlayGroupClient(c config) *PlayGroupClient
NewPlayGroupClient returns a client for the PlayGroup from the given config.
func (*PlayGroupClient) Create ¶ added in v0.3.2
func (c *PlayGroupClient) Create() *PlayGroupCreate
Create returns a create builder for PlayGroup.
func (*PlayGroupClient) CreateBulk ¶ added in v0.3.2
func (c *PlayGroupClient) CreateBulk(builders ...*PlayGroupCreate) *PlayGroupCreateBulk
CreateBulk returns a builder for creating a bulk of PlayGroup entities.
func (*PlayGroupClient) Delete ¶ added in v0.3.2
func (c *PlayGroupClient) Delete() *PlayGroupDelete
Delete returns a delete builder for PlayGroup.
func (*PlayGroupClient) DeleteOne ¶ added in v0.3.2
func (c *PlayGroupClient) DeleteOne(pg *PlayGroup) *PlayGroupDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PlayGroupClient) DeleteOneID ¶ added in v0.3.2
func (c *PlayGroupClient) DeleteOneID(id int) *PlayGroupDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PlayGroupClient) GetX ¶ added in v0.3.2
func (c *PlayGroupClient) GetX(ctx context.Context, id int) *PlayGroup
GetX is like Get, but panics if an error occurs.
func (*PlayGroupClient) Hooks ¶ added in v0.3.2
func (c *PlayGroupClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PlayGroupClient) Query ¶ added in v0.3.2
func (c *PlayGroupClient) Query() *PlayGroupQuery
Query returns a query builder for PlayGroup.
func (*PlayGroupClient) QueryParticipants ¶ added in v0.3.2
func (c *PlayGroupClient) QueryParticipants(pg *PlayGroup) *PetQuery
QueryParticipants queries the participants edge of a PlayGroup.
func (*PlayGroupClient) Update ¶ added in v0.3.2
func (c *PlayGroupClient) Update() *PlayGroupUpdate
Update returns an update builder for PlayGroup.
func (*PlayGroupClient) UpdateOne ¶ added in v0.3.2
func (c *PlayGroupClient) UpdateOne(pg *PlayGroup) *PlayGroupUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PlayGroupClient) UpdateOneID ¶ added in v0.3.2
func (c *PlayGroupClient) UpdateOneID(id int) *PlayGroupUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PlayGroupClient) Use ¶ added in v0.3.2
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 ¶ added in v0.3.2
type PlayGroupCreate struct {
// contains filtered or unexported fields
}
PlayGroupCreate is the builder for creating a PlayGroup entity.
func (*PlayGroupCreate) AddParticipantIDs ¶ added in v0.3.2
func (pgc *PlayGroupCreate) AddParticipantIDs(ids ...int) *PlayGroupCreate
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupCreate) AddParticipants ¶ added in v0.3.2
func (pgc *PlayGroupCreate) AddParticipants(p ...*Pet) *PlayGroupCreate
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupCreate) Exec ¶ added in v0.3.2
func (pgc *PlayGroupCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupCreate) ExecX ¶ added in v0.3.2
func (pgc *PlayGroupCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupCreate) Mutation ¶ added in v0.3.2
func (pgc *PlayGroupCreate) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupCreate) Save ¶ added in v0.3.2
func (pgc *PlayGroupCreate) Save(ctx context.Context) (*PlayGroup, error)
Save creates the PlayGroup in the database.
func (*PlayGroupCreate) SaveX ¶ added in v0.3.2
func (pgc *PlayGroupCreate) SaveX(ctx context.Context) *PlayGroup
SaveX calls Save and panics if Save returns an error.
func (*PlayGroupCreate) SetDescription ¶ added in v0.3.2
func (pgc *PlayGroupCreate) SetDescription(s string) *PlayGroupCreate
SetDescription sets the "description" field.
func (*PlayGroupCreate) SetNillableDescription ¶ added in v0.3.2
func (pgc *PlayGroupCreate) SetNillableDescription(s *string) *PlayGroupCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupCreate) SetTitle ¶ added in v0.3.2
func (pgc *PlayGroupCreate) SetTitle(s string) *PlayGroupCreate
SetTitle sets the "title" field.
func (*PlayGroupCreate) SetWeekday ¶ added in v0.3.2
func (pgc *PlayGroupCreate) SetWeekday(pl playgroup.Weekday) *PlayGroupCreate
SetWeekday sets the "weekday" field.
type PlayGroupCreateBulk ¶ added in v0.3.2
type PlayGroupCreateBulk struct {
// contains filtered or unexported fields
}
PlayGroupCreateBulk is the builder for creating many PlayGroup entities in bulk.
func (*PlayGroupCreateBulk) Exec ¶ added in v0.3.2
func (pgcb *PlayGroupCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupCreateBulk) ExecX ¶ added in v0.3.2
func (pgcb *PlayGroupCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PlayGroupDelete ¶ added in v0.3.2
type PlayGroupDelete struct {
// contains filtered or unexported fields
}
PlayGroupDelete is the builder for deleting a PlayGroup entity.
func (*PlayGroupDelete) Exec ¶ added in v0.3.2
func (pgd *PlayGroupDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PlayGroupDelete) ExecX ¶ added in v0.3.2
func (pgd *PlayGroupDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupDelete) Where ¶ added in v0.3.2
func (pgd *PlayGroupDelete) Where(ps ...predicate.PlayGroup) *PlayGroupDelete
Where appends a list predicates to the PlayGroupDelete builder.
type PlayGroupDeleteOne ¶ added in v0.3.2
type PlayGroupDeleteOne struct {
// contains filtered or unexported fields
}
PlayGroupDeleteOne is the builder for deleting a single PlayGroup entity.
func (*PlayGroupDeleteOne) Exec ¶ added in v0.3.2
func (pgdo *PlayGroupDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PlayGroupDeleteOne) ExecX ¶ added in v0.3.2
func (pgdo *PlayGroupDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PlayGroupEdges ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type PlayGroupGroupBy struct {
// contains filtered or unexported fields
}
PlayGroupGroupBy is the group-by builder for PlayGroup entities.
func (*PlayGroupGroupBy) Aggregate ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) Aggregate(fns ...AggregateFunc) *PlayGroupGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PlayGroupGroupBy) Bool ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PlayGroupGroupBy) Bools ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PlayGroupGroupBy) Float64 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PlayGroupGroupBy) Float64s ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PlayGroupGroupBy) Int ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PlayGroupGroupBy) Ints ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PlayGroupGroupBy) Scan ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PlayGroupGroupBy) String ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pggb *PlayGroupGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PlayGroupMutation ¶ added in v0.3.2
type PlayGroupMutation struct {
// contains filtered or unexported fields
}
PlayGroupMutation represents an operation that mutates the PlayGroup nodes in the graph.
func (*PlayGroupMutation) AddField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) AddParticipantIDs(ids ...int)
AddParticipantIDs adds the "participants" edge to the Pet entity by ids.
func (*PlayGroupMutation) AddedEdges ¶ added in v0.3.2
func (m *PlayGroupMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PlayGroupMutation) AddedField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PlayGroupMutation) AddedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*PlayGroupMutation) ClearEdge ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) ClearParticipants()
ClearParticipants clears the "participants" edge to the Pet entity.
func (*PlayGroupMutation) ClearedEdges ¶ added in v0.3.2
func (m *PlayGroupMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PlayGroupMutation) ClearedFields ¶ added in v0.3.2
func (m *PlayGroupMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PlayGroupMutation) Client ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*PlayGroupMutation) DescriptionCleared ¶ added in v0.3.2
func (m *PlayGroupMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*PlayGroupMutation) EdgeCleared ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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) Op ¶ added in v0.3.2
func (m *PlayGroupMutation) Op() Op
Op returns the operation name.
func (*PlayGroupMutation) ParticipantsCleared ¶ added in v0.3.2
func (m *PlayGroupMutation) ParticipantsCleared() bool
ParticipantsCleared reports if the "participants" edge to the Pet entity was cleared.
func (*PlayGroupMutation) ParticipantsIDs ¶ added in v0.3.2
func (m *PlayGroupMutation) ParticipantsIDs() (ids []int)
ParticipantsIDs returns the "participants" edge IDs in the mutation.
func (*PlayGroupMutation) RemoveParticipantIDs ¶ added in v0.3.2
func (m *PlayGroupMutation) RemoveParticipantIDs(ids ...int)
RemoveParticipantIDs removes the "participants" edge to the Pet entity by IDs.
func (*PlayGroupMutation) RemovedEdges ¶ added in v0.3.2
func (m *PlayGroupMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PlayGroupMutation) RemovedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) RemovedParticipantsIDs() (ids []int)
RemovedParticipants returns the removed IDs of the "participants" edge to the Pet entity.
func (*PlayGroupMutation) ResetDescription ¶ added in v0.3.2
func (m *PlayGroupMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*PlayGroupMutation) ResetEdge ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) ResetParticipants()
ResetParticipants resets all changes to the "participants" edge.
func (*PlayGroupMutation) ResetTitle ¶ added in v0.3.2
func (m *PlayGroupMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*PlayGroupMutation) ResetWeekday ¶ added in v0.3.2
func (m *PlayGroupMutation) ResetWeekday()
ResetWeekday resets all changes to the "weekday" field.
func (*PlayGroupMutation) SetDescription ¶ added in v0.3.2
func (m *PlayGroupMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*PlayGroupMutation) SetField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*PlayGroupMutation) SetWeekday ¶ added in v0.3.2
func (m *PlayGroupMutation) SetWeekday(pl playgroup.Weekday)
SetWeekday sets the "weekday" field.
func (*PlayGroupMutation) Title ¶ added in v0.3.2
func (m *PlayGroupMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (PlayGroupMutation) Tx ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *PlayGroupMutation) Type() string
Type returns the node type of this mutation (PlayGroup).
func (*PlayGroupMutation) Weekday ¶ added in v0.3.2
func (m *PlayGroupMutation) Weekday() (r playgroup.Weekday, exists bool)
Weekday returns the value of the "weekday" field in the mutation.
func (*PlayGroupMutation) Where ¶ added in v0.3.2
func (m *PlayGroupMutation) Where(ps ...predicate.PlayGroup)
Where appends a list predicates to the PlayGroupMutation builder.
type PlayGroupQuery ¶ added in v0.3.2
type PlayGroupQuery struct {
// contains filtered or unexported fields
}
PlayGroupQuery is the builder for querying PlayGroup entities.
func (*PlayGroupQuery) All ¶ added in v0.3.2
func (pgq *PlayGroupQuery) All(ctx context.Context) ([]*PlayGroup, error)
All executes the query and returns a list of PlayGroups.
func (*PlayGroupQuery) AllX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) AllX(ctx context.Context) []*PlayGroup
AllX is like All, but panics if an error occurs.
func (*PlayGroupQuery) Clone ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PlayGroupQuery) CountX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PlayGroupQuery) Exist ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PlayGroupQuery) ExistX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PlayGroupQuery) First ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgq *PlayGroupQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PlayGroupQuery) FirstX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) FirstX(ctx context.Context) *PlayGroup
FirstX is like First, but panics if an error occurs.
func (*PlayGroupQuery) GroupBy ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgq *PlayGroupQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of PlayGroup IDs.
func (*PlayGroupQuery) IDsX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PlayGroupQuery) Limit ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Limit(limit int) *PlayGroupQuery
Limit adds a limit step to the query.
func (*PlayGroupQuery) Offset ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Offset(offset int) *PlayGroupQuery
Offset adds an offset step to the query.
func (*PlayGroupQuery) Only ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgq *PlayGroupQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PlayGroupQuery) OnlyX ¶ added in v0.3.2
func (pgq *PlayGroupQuery) OnlyX(ctx context.Context) *PlayGroup
OnlyX is like Only, but panics if an error occurs.
func (*PlayGroupQuery) Order ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Order(o ...OrderFunc) *PlayGroupQuery
Order adds an order step to the query.
func (*PlayGroupQuery) QueryParticipants ¶ added in v0.3.2
func (pgq *PlayGroupQuery) QueryParticipants() *PetQuery
QueryParticipants chains the current query on the "participants" edge.
func (*PlayGroupQuery) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgq *PlayGroupQuery) Where(ps ...predicate.PlayGroup) *PlayGroupQuery
Where adds a new predicate for the PlayGroupQuery builder.
func (*PlayGroupQuery) WithParticipants ¶ added in v0.3.2
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 ¶ added in v0.3.2
type PlayGroupSelect struct { *PlayGroupQuery // contains filtered or unexported fields }
PlayGroupSelect is the builder for selecting fields of PlayGroup entities.
func (*PlayGroupSelect) Bool ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PlayGroupSelect) Bools ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PlayGroupSelect) Float64 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PlayGroupSelect) Float64s ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PlayGroupSelect) Int ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PlayGroupSelect) Ints ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PlayGroupSelect) Scan ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PlayGroupSelect) String ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgs *PlayGroupSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PlayGroupUpdate ¶ added in v0.3.2
type PlayGroupUpdate struct {
// contains filtered or unexported fields
}
PlayGroupUpdate is the builder for updating PlayGroup entities.
func (*PlayGroupUpdate) AddParticipantIDs ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) AddParticipantIDs(ids ...int) *PlayGroupUpdate
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupUpdate) AddParticipants ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) AddParticipants(p ...*Pet) *PlayGroupUpdate
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupUpdate) ClearDescription ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) ClearDescription() *PlayGroupUpdate
ClearDescription clears the value of the "description" field.
func (*PlayGroupUpdate) ClearParticipants ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) ClearParticipants() *PlayGroupUpdate
ClearParticipants clears all "participants" edges to the Pet entity.
func (*PlayGroupUpdate) Exec ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlayGroupUpdate) ExecX ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupUpdate) Mutation ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupUpdate) RemoveParticipantIDs ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) RemoveParticipantIDs(ids ...int) *PlayGroupUpdate
RemoveParticipantIDs removes the "participants" edge to Pet entities by IDs.
func (*PlayGroupUpdate) RemoveParticipants ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) RemoveParticipants(p ...*Pet) *PlayGroupUpdate
RemoveParticipants removes "participants" edges to Pet entities.
func (*PlayGroupUpdate) Save ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PlayGroupUpdate) SetDescription ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) SetDescription(s string) *PlayGroupUpdate
SetDescription sets the "description" field.
func (*PlayGroupUpdate) SetNillableDescription ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) SetNillableDescription(s *string) *PlayGroupUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupUpdate) SetTitle ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) SetTitle(s string) *PlayGroupUpdate
SetTitle sets the "title" field.
func (*PlayGroupUpdate) SetWeekday ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdate
SetWeekday sets the "weekday" field.
func (*PlayGroupUpdate) Where ¶ added in v0.3.2
func (pgu *PlayGroupUpdate) Where(ps ...predicate.PlayGroup) *PlayGroupUpdate
Where appends a list predicates to the PlayGroupUpdate builder.
type PlayGroupUpdateOne ¶ added in v0.3.2
type PlayGroupUpdateOne struct {
// contains filtered or unexported fields
}
PlayGroupUpdateOne is the builder for updating a single PlayGroup entity.
func (*PlayGroupUpdateOne) AddParticipantIDs ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) AddParticipantIDs(ids ...int) *PlayGroupUpdateOne
AddParticipantIDs adds the "participants" edge to the Pet entity by IDs.
func (*PlayGroupUpdateOne) AddParticipants ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) AddParticipants(p ...*Pet) *PlayGroupUpdateOne
AddParticipants adds the "participants" edges to the Pet entity.
func (*PlayGroupUpdateOne) ClearDescription ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) ClearDescription() *PlayGroupUpdateOne
ClearDescription clears the value of the "description" field.
func (*PlayGroupUpdateOne) ClearParticipants ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) ClearParticipants() *PlayGroupUpdateOne
ClearParticipants clears all "participants" edges to the Pet entity.
func (*PlayGroupUpdateOne) Exec ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PlayGroupUpdateOne) ExecX ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlayGroupUpdateOne) Mutation ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) Mutation() *PlayGroupMutation
Mutation returns the PlayGroupMutation object of the builder.
func (*PlayGroupUpdateOne) RemoveParticipantIDs ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) RemoveParticipantIDs(ids ...int) *PlayGroupUpdateOne
RemoveParticipantIDs removes the "participants" edge to Pet entities by IDs.
func (*PlayGroupUpdateOne) RemoveParticipants ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) RemoveParticipants(p ...*Pet) *PlayGroupUpdateOne
RemoveParticipants removes "participants" edges to Pet entities.
func (*PlayGroupUpdateOne) Save ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) Save(ctx context.Context) (*PlayGroup, error)
Save executes the query and returns the updated PlayGroup entity.
func (*PlayGroupUpdateOne) SaveX ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) SaveX(ctx context.Context) *PlayGroup
SaveX is like Save, but panics if an error occurs.
func (*PlayGroupUpdateOne) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) SetDescription(s string) *PlayGroupUpdateOne
SetDescription sets the "description" field.
func (*PlayGroupUpdateOne) SetNillableDescription ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) SetNillableDescription(s *string) *PlayGroupUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PlayGroupUpdateOne) SetTitle ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) SetTitle(s string) *PlayGroupUpdateOne
SetTitle sets the "title" field.
func (*PlayGroupUpdateOne) SetWeekday ¶ added in v0.3.2
func (pguo *PlayGroupUpdateOne) SetWeekday(pl playgroup.Weekday) *PlayGroupUpdateOne
SetWeekday sets the "weekday" field.
type PlayGroups ¶ added in v0.3.2
type PlayGroups []*PlayGroup
PlayGroups is a parsable slice of PlayGroup.
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 ¶ added in v0.3.2
type Toy struct { // ID of the ent. ID int `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 ¶ added in v0.3.2
QueryOwner queries the "owner" edge of the Toy entity.
func (*Toy) Unwrap ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type ToyClient struct {
// contains filtered or unexported fields
}
ToyClient is a client for the Toy schema.
func NewToyClient ¶ added in v0.3.2
func NewToyClient(c config) *ToyClient
NewToyClient returns a client for the Toy from the given config.
func (*ToyClient) CreateBulk ¶ added in v0.3.2
func (c *ToyClient) CreateBulk(builders ...*ToyCreate) *ToyCreateBulk
CreateBulk returns a builder for creating a bulk of Toy entities.
func (*ToyClient) DeleteOne ¶ added in v0.3.2
func (c *ToyClient) DeleteOne(t *Toy) *ToyDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ToyClient) DeleteOneID ¶ added in v0.3.2
func (c *ToyClient) DeleteOneID(id int) *ToyDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ToyClient) QueryOwner ¶ added in v0.3.2
QueryOwner queries the owner edge of a Toy.
func (*ToyClient) UpdateOne ¶ added in v0.3.2
func (c *ToyClient) UpdateOne(t *Toy) *ToyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ToyClient) UpdateOneID ¶ added in v0.3.2
func (c *ToyClient) UpdateOneID(id int) *ToyUpdateOne
UpdateOneID returns an update builder for the given id.
type ToyCreate ¶ added in v0.3.2
type ToyCreate struct {
// contains filtered or unexported fields
}
ToyCreate is the builder for creating a Toy entity.
func (*ToyCreate) Mutation ¶ added in v0.3.2
func (tc *ToyCreate) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyCreate) SetMaterial ¶ added in v0.3.2
SetMaterial sets the "material" field.
func (*ToyCreate) SetNillableOwnerID ¶ added in v0.3.2
SetNillableOwnerID sets the "owner" edge to the Pet entity by ID if the given value is not nil.
func (*ToyCreate) SetOwnerID ¶ added in v0.3.2
SetOwnerID sets the "owner" edge to the Pet entity by ID.
type ToyCreateBulk ¶ added in v0.3.2
type ToyCreateBulk struct {
// contains filtered or unexported fields
}
ToyCreateBulk is the builder for creating many Toy entities in bulk.
func (*ToyCreateBulk) Exec ¶ added in v0.3.2
func (tcb *ToyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ToyCreateBulk) ExecX ¶ added in v0.3.2
func (tcb *ToyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ToyDelete ¶ added in v0.3.2
type ToyDelete struct {
// contains filtered or unexported fields
}
ToyDelete is the builder for deleting a Toy entity.
func (*ToyDelete) Exec ¶ added in v0.3.2
Exec executes the deletion query and returns how many vertices were deleted.
type ToyDeleteOne ¶ added in v0.3.2
type ToyDeleteOne struct {
// contains filtered or unexported fields
}
ToyDeleteOne is the builder for deleting a single Toy entity.
func (*ToyDeleteOne) Exec ¶ added in v0.3.2
func (tdo *ToyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ToyDeleteOne) ExecX ¶ added in v0.3.2
func (tdo *ToyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ToyEdges ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type ToyGroupBy struct {
// contains filtered or unexported fields
}
ToyGroupBy is the group-by builder for Toy entities.
func (*ToyGroupBy) Aggregate ¶ added in v0.3.2
func (tgb *ToyGroupBy) Aggregate(fns ...AggregateFunc) *ToyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ToyGroupBy) Bool ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ToyGroupBy) Bools ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ToyGroupBy) Float64 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ToyGroupBy) Float64s ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ToyGroupBy) Int ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ToyGroupBy) Ints ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ToyGroupBy) Scan ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ToyGroupBy) String ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tgb *ToyGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ToyMutation ¶ added in v0.3.2
type ToyMutation struct {
// contains filtered or unexported fields
}
ToyMutation represents an operation that mutates the Toy nodes in the graph.
func (*ToyMutation) AddField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ToyMutation) AddedField ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ToyMutation) AddedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyMutation) ClearedEdges ¶ added in v0.3.2
func (m *ToyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ToyMutation) ClearedFields ¶ added in v0.3.2
func (m *ToyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ToyMutation) Client ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) Color() (r toy.Color, exists bool)
Color returns the value of the "color" field in the mutation.
func (*ToyMutation) EdgeCleared ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) 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 (*ToyMutation) Material ¶ added in v0.3.2
func (m *ToyMutation) Material() (r toy.Material, exists bool)
Material returns the value of the "material" field in the mutation.
func (*ToyMutation) OldColor ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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) Op ¶ added in v0.3.2
func (m *ToyMutation) Op() Op
Op returns the operation name.
func (*ToyMutation) OwnerCleared ¶ added in v0.3.2
func (m *ToyMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Pet entity was cleared.
func (*ToyMutation) OwnerID ¶ added in v0.3.2
func (m *ToyMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*ToyMutation) OwnerIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ToyMutation) RemovedIDs ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*ToyMutation) ResetEdge ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) ResetMaterial()
ResetMaterial resets all changes to the "material" field.
func (*ToyMutation) ResetOwner ¶ added in v0.3.2
func (m *ToyMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*ToyMutation) ResetTitle ¶ added in v0.3.2
func (m *ToyMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ToyMutation) SetColor ¶ added in v0.3.2
func (m *ToyMutation) SetColor(t toy.Color)
SetColor sets the "color" field.
func (*ToyMutation) SetField ¶ added in v0.3.2
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) SetMaterial ¶ added in v0.3.2
func (m *ToyMutation) SetMaterial(t toy.Material)
SetMaterial sets the "material" field.
func (*ToyMutation) SetOwnerID ¶ added in v0.3.2
func (m *ToyMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the Pet entity by id.
func (*ToyMutation) SetTitle ¶ added in v0.3.2
func (m *ToyMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ToyMutation) Title ¶ added in v0.3.2
func (m *ToyMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (ToyMutation) Tx ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (m *ToyMutation) Type() string
Type returns the node type of this mutation (Toy).
func (*ToyMutation) Where ¶ added in v0.3.2
func (m *ToyMutation) Where(ps ...predicate.Toy)
Where appends a list predicates to the ToyMutation builder.
type ToyQuery ¶ added in v0.3.2
type ToyQuery struct {
// contains filtered or unexported fields
}
ToyQuery is the builder for querying Toy entities.
func (*ToyQuery) Clone ¶ added in v0.3.2
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 ¶ added in v0.3.2
First returns the first Toy entity from the query. Returns a *NotFoundError when no Toy was found.
func (*ToyQuery) FirstID ¶ added in v0.3.2
FirstID returns the first Toy ID from the query. Returns a *NotFoundError when no Toy ID was found.
func (*ToyQuery) FirstIDX ¶ added in v0.3.2
FirstIDX is like FirstID, but panics if an error occurs.
func (*ToyQuery) GroupBy ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
QueryOwner chains the current query on the "owner" edge.
func (*ToyQuery) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
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 ¶ added in v0.3.2
type ToySelect struct { *ToyQuery // contains filtered or unexported fields }
ToySelect is the builder for selecting fields of Toy entities.
func (*ToySelect) Bool ¶ added in v0.3.2
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ToySelect) Bools ¶ added in v0.3.2
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ToySelect) Float64 ¶ added in v0.3.2
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ToySelect) Float64X ¶ added in v0.3.2
Float64X is like Float64, but panics if an error occurs.
func (*ToySelect) Float64s ¶ added in v0.3.2
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ToySelect) Float64sX ¶ added in v0.3.2
Float64sX is like Float64s, but panics if an error occurs.
func (*ToySelect) Int ¶ added in v0.3.2
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ToySelect) Ints ¶ added in v0.3.2
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ToySelect) Scan ¶ added in v0.3.2
Scan applies the selector query and scans the result into the given value.
func (*ToySelect) String ¶ added in v0.3.2
String returns a single string from a selector. It is only allowed when selecting one field.
type ToyUpdate ¶ added in v0.3.2
type ToyUpdate struct {
// contains filtered or unexported fields
}
ToyUpdate is the builder for updating Toy entities.
func (*ToyUpdate) ClearOwner ¶ added in v0.3.2
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyUpdate) Mutation ¶ added in v0.3.2
func (tu *ToyUpdate) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyUpdate) Save ¶ added in v0.3.2
Save executes the query and returns the number of nodes affected by the update operation.
func (*ToyUpdate) SetMaterial ¶ added in v0.3.2
SetMaterial sets the "material" field.
func (*ToyUpdate) SetNillableOwnerID ¶ added in v0.3.2
SetNillableOwnerID sets the "owner" edge to the Pet entity by ID if the given value is not nil.
func (*ToyUpdate) SetOwnerID ¶ added in v0.3.2
SetOwnerID sets the "owner" edge to the Pet entity by ID.
type ToyUpdateOne ¶ added in v0.3.2
type ToyUpdateOne struct {
// contains filtered or unexported fields
}
ToyUpdateOne is the builder for updating a single Toy entity.
func (*ToyUpdateOne) ClearOwner ¶ added in v0.3.2
func (tuo *ToyUpdateOne) ClearOwner() *ToyUpdateOne
ClearOwner clears the "owner" edge to the Pet entity.
func (*ToyUpdateOne) Exec ¶ added in v0.3.2
func (tuo *ToyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ToyUpdateOne) ExecX ¶ added in v0.3.2
func (tuo *ToyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ToyUpdateOne) Mutation ¶ added in v0.3.2
func (tuo *ToyUpdateOne) Mutation() *ToyMutation
Mutation returns the ToyMutation object of the builder.
func (*ToyUpdateOne) Save ¶ added in v0.3.2
func (tuo *ToyUpdateOne) Save(ctx context.Context) (*Toy, error)
Save executes the query and returns the updated Toy entity.
func (*ToyUpdateOne) SaveX ¶ added in v0.3.2
func (tuo *ToyUpdateOne) SaveX(ctx context.Context) *Toy
SaveX is like Save, but panics if an error occurs.
func (*ToyUpdateOne) Select ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tuo *ToyUpdateOne) SetColor(t toy.Color) *ToyUpdateOne
SetColor sets the "color" field.
func (*ToyUpdateOne) SetMaterial ¶ added in v0.3.2
func (tuo *ToyUpdateOne) SetMaterial(t toy.Material) *ToyUpdateOne
SetMaterial sets the "material" field.
func (*ToyUpdateOne) SetNillableOwnerID ¶ added in v0.3.2
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 ¶ added in v0.3.2
func (tuo *ToyUpdateOne) SetOwner(p *Pet) *ToyUpdateOne
SetOwner sets the "owner" edge to the Pet entity.
func (*ToyUpdateOne) SetOwnerID ¶ added in v0.3.2
func (tuo *ToyUpdateOne) SetOwnerID(id int) *ToyUpdateOne
SetOwnerID sets the "owner" edge to the Pet entity by ID.
func (*ToyUpdateOne) SetTitle ¶ added in v0.3.2
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