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 Categories
- type Category
- type CategoryClient
- func (c *CategoryClient) Create() *CategoryCreate
- func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
- func (c *CategoryClient) Delete() *CategoryDelete
- func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
- func (c *CategoryClient) DeleteOneID(id uint64) *CategoryDeleteOne
- func (c *CategoryClient) Get(ctx context.Context, id uint64) (*Category, error)
- func (c *CategoryClient) GetX(ctx context.Context, id uint64) *Category
- func (c *CategoryClient) Hooks() []Hook
- func (c *CategoryClient) Query() *CategoryQuery
- func (c *CategoryClient) QueryPets(ca *Category) *PetQuery
- func (c *CategoryClient) Update() *CategoryUpdate
- func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
- func (c *CategoryClient) UpdateOneID(id uint64) *CategoryUpdateOne
- func (c *CategoryClient) Use(hooks ...Hook)
- type CategoryCreate
- func (cc *CategoryCreate) AddPetIDs(ids ...string) *CategoryCreate
- func (cc *CategoryCreate) AddPets(p ...*Pet) *CategoryCreate
- func (cc *CategoryCreate) Exec(ctx context.Context) error
- func (cc *CategoryCreate) ExecX(ctx context.Context)
- func (cc *CategoryCreate) Mutation() *CategoryMutation
- func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
- func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
- func (cc *CategoryCreate) SetID(u uint64) *CategoryCreate
- func (cc *CategoryCreate) SetName(s string) *CategoryCreate
- type CategoryCreateBulk
- type CategoryDelete
- type CategoryDeleteOne
- type CategoryEdges
- type CategoryGroupBy
- func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
- func (cgb *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (cgb *CategoryGroupBy) BoolX(ctx context.Context) bool
- func (cgb *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (cgb *CategoryGroupBy) BoolsX(ctx context.Context) []bool
- func (cgb *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (cgb *CategoryGroupBy) Float64X(ctx context.Context) float64
- func (cgb *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (cgb *CategoryGroupBy) Float64sX(ctx context.Context) []float64
- func (cgb *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (cgb *CategoryGroupBy) IntX(ctx context.Context) int
- func (cgb *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (cgb *CategoryGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
- func (cgb *CategoryGroupBy) ScanX(ctx context.Context, v interface{})
- func (cgb *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (cgb *CategoryGroupBy) StringX(ctx context.Context) string
- func (cgb *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (cgb *CategoryGroupBy) StringsX(ctx context.Context) []string
- type CategoryMutation
- func (m *CategoryMutation) AddField(name string, value ent.Value) error
- func (m *CategoryMutation) AddPetIDs(ids ...string)
- func (m *CategoryMutation) AddedEdges() []string
- func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoryMutation) AddedFields() []string
- func (m *CategoryMutation) AddedIDs(name string) []ent.Value
- func (m *CategoryMutation) ClearEdge(name string) error
- func (m *CategoryMutation) ClearField(name string) error
- func (m *CategoryMutation) ClearPets()
- func (m *CategoryMutation) ClearedEdges() []string
- func (m *CategoryMutation) ClearedFields() []string
- func (m CategoryMutation) Client() *Client
- func (m *CategoryMutation) EdgeCleared(name string) bool
- func (m *CategoryMutation) Field(name string) (ent.Value, bool)
- func (m *CategoryMutation) FieldCleared(name string) bool
- func (m *CategoryMutation) Fields() []string
- func (m *CategoryMutation) ID() (id uint64, exists bool)
- func (m *CategoryMutation) Name() (r string, exists bool)
- func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) Op() Op
- func (m *CategoryMutation) PetsCleared() bool
- func (m *CategoryMutation) PetsIDs() (ids []string)
- func (m *CategoryMutation) RemovePetIDs(ids ...string)
- func (m *CategoryMutation) RemovedEdges() []string
- func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoryMutation) RemovedPetsIDs() (ids []string)
- func (m *CategoryMutation) ResetEdge(name string) error
- func (m *CategoryMutation) ResetField(name string) error
- func (m *CategoryMutation) ResetName()
- func (m *CategoryMutation) ResetPets()
- func (m *CategoryMutation) SetField(name string, value ent.Value) error
- func (m *CategoryMutation) SetID(id uint64)
- func (m *CategoryMutation) SetName(s string)
- func (m CategoryMutation) Tx() (*Tx, error)
- func (m *CategoryMutation) Type() string
- func (m *CategoryMutation) Where(ps ...predicate.Category)
- type CategoryQuery
- func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
- func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
- func (cq *CategoryQuery) Clone() *CategoryQuery
- func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoryQuery) CountX(ctx context.Context) int
- func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoryQuery) ExistX(ctx context.Context) bool
- func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (cq *CategoryQuery) FirstIDX(ctx context.Context) uint64
- func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
- func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
- func (cq *CategoryQuery) IDs(ctx context.Context) ([]uint64, error)
- func (cq *CategoryQuery) IDsX(ctx context.Context) []uint64
- func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
- func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
- func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (cq *CategoryQuery) OnlyIDX(ctx context.Context) uint64
- func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
- func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
- func (cq *CategoryQuery) QueryPets() *PetQuery
- func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
- func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
- func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
- func (cq *CategoryQuery) WithPets(opts ...func(*PetQuery)) *CategoryQuery
- type CategorySelect
- func (cs *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (cs *CategorySelect) BoolX(ctx context.Context) bool
- func (cs *CategorySelect) Bools(ctx context.Context) ([]bool, error)
- func (cs *CategorySelect) BoolsX(ctx context.Context) []bool
- func (cs *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (cs *CategorySelect) Float64X(ctx context.Context) float64
- func (cs *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (cs *CategorySelect) Float64sX(ctx context.Context) []float64
- func (cs *CategorySelect) Int(ctx context.Context) (_ int, err error)
- func (cs *CategorySelect) IntX(ctx context.Context) int
- func (cs *CategorySelect) Ints(ctx context.Context) ([]int, error)
- func (cs *CategorySelect) IntsX(ctx context.Context) []int
- func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
- func (cs *CategorySelect) ScanX(ctx context.Context, v interface{})
- func (cs *CategorySelect) String(ctx context.Context) (_ string, err error)
- func (cs *CategorySelect) StringX(ctx context.Context) string
- func (cs *CategorySelect) Strings(ctx context.Context) ([]string, error)
- func (cs *CategorySelect) StringsX(ctx context.Context) []string
- type CategoryUpdate
- func (cu *CategoryUpdate) AddPetIDs(ids ...string) *CategoryUpdate
- func (cu *CategoryUpdate) AddPets(p ...*Pet) *CategoryUpdate
- func (cu *CategoryUpdate) ClearPets() *CategoryUpdate
- func (cu *CategoryUpdate) Exec(ctx context.Context) error
- func (cu *CategoryUpdate) ExecX(ctx context.Context)
- func (cu *CategoryUpdate) Mutation() *CategoryMutation
- func (cu *CategoryUpdate) RemovePetIDs(ids ...string) *CategoryUpdate
- func (cu *CategoryUpdate) RemovePets(p ...*Pet) *CategoryUpdate
- func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoryUpdate) SaveX(ctx context.Context) int
- func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
- func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
- type CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddPetIDs(ids ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddPets(p ...*Pet) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearPets() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
- func (cuo *CategoryUpdateOne) RemovePetIDs(ids ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) RemovePets(p ...*Pet) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
- func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
- func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
- type Client
- type Collar
- type CollarClient
- func (c *CollarClient) Create() *CollarCreate
- func (c *CollarClient) CreateBulk(builders ...*CollarCreate) *CollarCreateBulk
- func (c *CollarClient) Delete() *CollarDelete
- func (c *CollarClient) DeleteOne(co *Collar) *CollarDeleteOne
- func (c *CollarClient) DeleteOneID(id int) *CollarDeleteOne
- func (c *CollarClient) Get(ctx context.Context, id int) (*Collar, error)
- func (c *CollarClient) GetX(ctx context.Context, id int) *Collar
- func (c *CollarClient) Hooks() []Hook
- func (c *CollarClient) Query() *CollarQuery
- func (c *CollarClient) QueryPet(co *Collar) *PetQuery
- func (c *CollarClient) Update() *CollarUpdate
- func (c *CollarClient) UpdateOne(co *Collar) *CollarUpdateOne
- func (c *CollarClient) UpdateOneID(id int) *CollarUpdateOne
- func (c *CollarClient) Use(hooks ...Hook)
- type CollarCreate
- func (cc *CollarCreate) Exec(ctx context.Context) error
- func (cc *CollarCreate) ExecX(ctx context.Context)
- func (cc *CollarCreate) Mutation() *CollarMutation
- func (cc *CollarCreate) Save(ctx context.Context) (*Collar, error)
- func (cc *CollarCreate) SaveX(ctx context.Context) *Collar
- func (cc *CollarCreate) SetColor(c collar.Color) *CollarCreate
- func (cc *CollarCreate) SetNillablePetID(id *string) *CollarCreate
- func (cc *CollarCreate) SetPet(p *Pet) *CollarCreate
- func (cc *CollarCreate) SetPetID(id string) *CollarCreate
- type CollarCreateBulk
- type CollarDelete
- type CollarDeleteOne
- type CollarEdges
- type CollarGroupBy
- func (cgb *CollarGroupBy) Aggregate(fns ...AggregateFunc) *CollarGroupBy
- func (cgb *CollarGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (cgb *CollarGroupBy) BoolX(ctx context.Context) bool
- func (cgb *CollarGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (cgb *CollarGroupBy) BoolsX(ctx context.Context) []bool
- func (cgb *CollarGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (cgb *CollarGroupBy) Float64X(ctx context.Context) float64
- func (cgb *CollarGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (cgb *CollarGroupBy) Float64sX(ctx context.Context) []float64
- func (cgb *CollarGroupBy) Int(ctx context.Context) (_ int, err error)
- func (cgb *CollarGroupBy) IntX(ctx context.Context) int
- func (cgb *CollarGroupBy) Ints(ctx context.Context) ([]int, error)
- func (cgb *CollarGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CollarGroupBy) Scan(ctx context.Context, v interface{}) error
- func (cgb *CollarGroupBy) ScanX(ctx context.Context, v interface{})
- func (cgb *CollarGroupBy) String(ctx context.Context) (_ string, err error)
- func (cgb *CollarGroupBy) StringX(ctx context.Context) string
- func (cgb *CollarGroupBy) Strings(ctx context.Context) ([]string, error)
- func (cgb *CollarGroupBy) StringsX(ctx context.Context) []string
- type CollarMutation
- func (m *CollarMutation) AddField(name string, value ent.Value) error
- func (m *CollarMutation) AddedEdges() []string
- func (m *CollarMutation) AddedField(name string) (ent.Value, bool)
- func (m *CollarMutation) AddedFields() []string
- func (m *CollarMutation) AddedIDs(name string) []ent.Value
- func (m *CollarMutation) ClearEdge(name string) error
- func (m *CollarMutation) ClearField(name string) error
- func (m *CollarMutation) ClearPet()
- func (m *CollarMutation) ClearedEdges() []string
- func (m *CollarMutation) ClearedFields() []string
- func (m CollarMutation) Client() *Client
- func (m *CollarMutation) Color() (r collar.Color, exists bool)
- func (m *CollarMutation) EdgeCleared(name string) bool
- func (m *CollarMutation) Field(name string) (ent.Value, bool)
- func (m *CollarMutation) FieldCleared(name string) bool
- func (m *CollarMutation) Fields() []string
- func (m *CollarMutation) ID() (id int, exists bool)
- func (m *CollarMutation) OldColor(ctx context.Context) (v collar.Color, err error)
- func (m *CollarMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CollarMutation) Op() Op
- func (m *CollarMutation) PetCleared() bool
- func (m *CollarMutation) PetID() (id string, exists bool)
- func (m *CollarMutation) PetIDs() (ids []string)
- func (m *CollarMutation) RemovedEdges() []string
- func (m *CollarMutation) RemovedIDs(name string) []ent.Value
- func (m *CollarMutation) ResetColor()
- func (m *CollarMutation) ResetEdge(name string) error
- func (m *CollarMutation) ResetField(name string) error
- func (m *CollarMutation) ResetPet()
- func (m *CollarMutation) SetColor(c collar.Color)
- func (m *CollarMutation) SetField(name string, value ent.Value) error
- func (m *CollarMutation) SetPetID(id string)
- func (m CollarMutation) Tx() (*Tx, error)
- func (m *CollarMutation) Type() string
- func (m *CollarMutation) Where(ps ...predicate.Collar)
- type CollarQuery
- func (cq *CollarQuery) All(ctx context.Context) ([]*Collar, error)
- func (cq *CollarQuery) AllX(ctx context.Context) []*Collar
- func (cq *CollarQuery) Clone() *CollarQuery
- func (cq *CollarQuery) Count(ctx context.Context) (int, error)
- func (cq *CollarQuery) CountX(ctx context.Context) int
- func (cq *CollarQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CollarQuery) ExistX(ctx context.Context) bool
- func (cq *CollarQuery) First(ctx context.Context) (*Collar, error)
- func (cq *CollarQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CollarQuery) FirstIDX(ctx context.Context) int
- func (cq *CollarQuery) FirstX(ctx context.Context) *Collar
- func (cq *CollarQuery) GroupBy(field string, fields ...string) *CollarGroupBy
- func (cq *CollarQuery) IDs(ctx context.Context) ([]int, error)
- func (cq *CollarQuery) IDsX(ctx context.Context) []int
- func (cq *CollarQuery) Limit(limit int) *CollarQuery
- func (cq *CollarQuery) Offset(offset int) *CollarQuery
- func (cq *CollarQuery) Only(ctx context.Context) (*Collar, error)
- func (cq *CollarQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CollarQuery) OnlyIDX(ctx context.Context) int
- func (cq *CollarQuery) OnlyX(ctx context.Context) *Collar
- func (cq *CollarQuery) Order(o ...OrderFunc) *CollarQuery
- func (cq *CollarQuery) QueryPet() *PetQuery
- func (cq *CollarQuery) Select(fields ...string) *CollarSelect
- func (cq *CollarQuery) Unique(unique bool) *CollarQuery
- func (cq *CollarQuery) Where(ps ...predicate.Collar) *CollarQuery
- func (cq *CollarQuery) WithPet(opts ...func(*PetQuery)) *CollarQuery
- type CollarSelect
- func (cs *CollarSelect) Bool(ctx context.Context) (_ bool, err error)
- func (cs *CollarSelect) BoolX(ctx context.Context) bool
- func (cs *CollarSelect) Bools(ctx context.Context) ([]bool, error)
- func (cs *CollarSelect) BoolsX(ctx context.Context) []bool
- func (cs *CollarSelect) Float64(ctx context.Context) (_ float64, err error)
- func (cs *CollarSelect) Float64X(ctx context.Context) float64
- func (cs *CollarSelect) Float64s(ctx context.Context) ([]float64, error)
- func (cs *CollarSelect) Float64sX(ctx context.Context) []float64
- func (cs *CollarSelect) Int(ctx context.Context) (_ int, err error)
- func (cs *CollarSelect) IntX(ctx context.Context) int
- func (cs *CollarSelect) Ints(ctx context.Context) ([]int, error)
- func (cs *CollarSelect) IntsX(ctx context.Context) []int
- func (cs *CollarSelect) Scan(ctx context.Context, v interface{}) error
- func (cs *CollarSelect) ScanX(ctx context.Context, v interface{})
- func (cs *CollarSelect) String(ctx context.Context) (_ string, err error)
- func (cs *CollarSelect) StringX(ctx context.Context) string
- func (cs *CollarSelect) Strings(ctx context.Context) ([]string, error)
- func (cs *CollarSelect) StringsX(ctx context.Context) []string
- type CollarUpdate
- func (cu *CollarUpdate) ClearPet() *CollarUpdate
- func (cu *CollarUpdate) Exec(ctx context.Context) error
- func (cu *CollarUpdate) ExecX(ctx context.Context)
- func (cu *CollarUpdate) Mutation() *CollarMutation
- func (cu *CollarUpdate) Save(ctx context.Context) (int, error)
- func (cu *CollarUpdate) SaveX(ctx context.Context) int
- func (cu *CollarUpdate) SetColor(c collar.Color) *CollarUpdate
- func (cu *CollarUpdate) SetNillablePetID(id *string) *CollarUpdate
- func (cu *CollarUpdate) SetPet(p *Pet) *CollarUpdate
- func (cu *CollarUpdate) SetPetID(id string) *CollarUpdate
- func (cu *CollarUpdate) Where(ps ...predicate.Collar) *CollarUpdate
- type CollarUpdateOne
- func (cuo *CollarUpdateOne) ClearPet() *CollarUpdateOne
- func (cuo *CollarUpdateOne) Exec(ctx context.Context) error
- func (cuo *CollarUpdateOne) ExecX(ctx context.Context)
- func (cuo *CollarUpdateOne) Mutation() *CollarMutation
- func (cuo *CollarUpdateOne) Save(ctx context.Context) (*Collar, error)
- func (cuo *CollarUpdateOne) SaveX(ctx context.Context) *Collar
- func (cuo *CollarUpdateOne) Select(field string, fields ...string) *CollarUpdateOne
- func (cuo *CollarUpdateOne) SetColor(c collar.Color) *CollarUpdateOne
- func (cuo *CollarUpdateOne) SetNillablePetID(id *string) *CollarUpdateOne
- func (cuo *CollarUpdateOne) SetPet(p *Pet) *CollarUpdateOne
- func (cuo *CollarUpdateOne) SetPetID(id string) *CollarUpdateOne
- type Collars
- 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 Owner
- type OwnerClient
- func (c *OwnerClient) Create() *OwnerCreate
- func (c *OwnerClient) CreateBulk(builders ...*OwnerCreate) *OwnerCreateBulk
- func (c *OwnerClient) Delete() *OwnerDelete
- func (c *OwnerClient) DeleteOne(o *Owner) *OwnerDeleteOne
- func (c *OwnerClient) DeleteOneID(id uuid.UUID) *OwnerDeleteOne
- func (c *OwnerClient) Get(ctx context.Context, id uuid.UUID) (*Owner, error)
- func (c *OwnerClient) GetX(ctx context.Context, id uuid.UUID) *Owner
- func (c *OwnerClient) Hooks() []Hook
- func (c *OwnerClient) Query() *OwnerQuery
- func (c *OwnerClient) QueryPets(o *Owner) *PetQuery
- func (c *OwnerClient) Update() *OwnerUpdate
- func (c *OwnerClient) UpdateOne(o *Owner) *OwnerUpdateOne
- func (c *OwnerClient) UpdateOneID(id uuid.UUID) *OwnerUpdateOne
- func (c *OwnerClient) Use(hooks ...Hook)
- type OwnerCreate
- func (oc *OwnerCreate) AddPetIDs(ids ...string) *OwnerCreate
- func (oc *OwnerCreate) AddPets(p ...*Pet) *OwnerCreate
- func (oc *OwnerCreate) Exec(ctx context.Context) error
- func (oc *OwnerCreate) ExecX(ctx context.Context)
- func (oc *OwnerCreate) Mutation() *OwnerMutation
- func (oc *OwnerCreate) Save(ctx context.Context) (*Owner, error)
- func (oc *OwnerCreate) SaveX(ctx context.Context) *Owner
- func (oc *OwnerCreate) SetAge(i int) *OwnerCreate
- func (oc *OwnerCreate) SetID(u uuid.UUID) *OwnerCreate
- func (oc *OwnerCreate) SetName(s string) *OwnerCreate
- type OwnerCreateBulk
- type OwnerDelete
- type OwnerDeleteOne
- type OwnerEdges
- type OwnerGroupBy
- func (ogb *OwnerGroupBy) Aggregate(fns ...AggregateFunc) *OwnerGroupBy
- func (ogb *OwnerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ogb *OwnerGroupBy) BoolX(ctx context.Context) bool
- func (ogb *OwnerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ogb *OwnerGroupBy) BoolsX(ctx context.Context) []bool
- func (ogb *OwnerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ogb *OwnerGroupBy) Float64X(ctx context.Context) float64
- func (ogb *OwnerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ogb *OwnerGroupBy) Float64sX(ctx context.Context) []float64
- func (ogb *OwnerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ogb *OwnerGroupBy) IntX(ctx context.Context) int
- func (ogb *OwnerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ogb *OwnerGroupBy) IntsX(ctx context.Context) []int
- func (ogb *OwnerGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ogb *OwnerGroupBy) ScanX(ctx context.Context, v interface{})
- func (ogb *OwnerGroupBy) String(ctx context.Context) (_ string, err error)
- func (ogb *OwnerGroupBy) StringX(ctx context.Context) string
- func (ogb *OwnerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ogb *OwnerGroupBy) StringsX(ctx context.Context) []string
- type OwnerMutation
- func (m *OwnerMutation) AddAge(i int)
- func (m *OwnerMutation) AddField(name string, value ent.Value) error
- func (m *OwnerMutation) AddPetIDs(ids ...string)
- func (m *OwnerMutation) AddedAge() (r int, exists bool)
- func (m *OwnerMutation) AddedEdges() []string
- func (m *OwnerMutation) AddedField(name string) (ent.Value, bool)
- func (m *OwnerMutation) AddedFields() []string
- func (m *OwnerMutation) AddedIDs(name string) []ent.Value
- func (m *OwnerMutation) Age() (r int, exists bool)
- func (m *OwnerMutation) ClearEdge(name string) error
- func (m *OwnerMutation) ClearField(name string) error
- func (m *OwnerMutation) ClearPets()
- func (m *OwnerMutation) ClearedEdges() []string
- func (m *OwnerMutation) ClearedFields() []string
- func (m OwnerMutation) Client() *Client
- func (m *OwnerMutation) EdgeCleared(name string) bool
- func (m *OwnerMutation) Field(name string) (ent.Value, bool)
- func (m *OwnerMutation) FieldCleared(name string) bool
- func (m *OwnerMutation) Fields() []string
- func (m *OwnerMutation) ID() (id uuid.UUID, exists bool)
- func (m *OwnerMutation) Name() (r string, exists bool)
- func (m *OwnerMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *OwnerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OwnerMutation) OldName(ctx context.Context) (v string, err error)
- func (m *OwnerMutation) Op() Op
- func (m *OwnerMutation) PetsCleared() bool
- func (m *OwnerMutation) PetsIDs() (ids []string)
- func (m *OwnerMutation) RemovePetIDs(ids ...string)
- func (m *OwnerMutation) RemovedEdges() []string
- func (m *OwnerMutation) RemovedIDs(name string) []ent.Value
- func (m *OwnerMutation) RemovedPetsIDs() (ids []string)
- func (m *OwnerMutation) ResetAge()
- func (m *OwnerMutation) ResetEdge(name string) error
- func (m *OwnerMutation) ResetField(name string) error
- func (m *OwnerMutation) ResetName()
- func (m *OwnerMutation) ResetPets()
- func (m *OwnerMutation) SetAge(i int)
- func (m *OwnerMutation) SetField(name string, value ent.Value) error
- func (m *OwnerMutation) SetID(id uuid.UUID)
- func (m *OwnerMutation) SetName(s string)
- func (m OwnerMutation) Tx() (*Tx, error)
- func (m *OwnerMutation) Type() string
- func (m *OwnerMutation) Where(ps ...predicate.Owner)
- type OwnerQuery
- func (oq *OwnerQuery) All(ctx context.Context) ([]*Owner, error)
- func (oq *OwnerQuery) AllX(ctx context.Context) []*Owner
- func (oq *OwnerQuery) Clone() *OwnerQuery
- func (oq *OwnerQuery) Count(ctx context.Context) (int, error)
- func (oq *OwnerQuery) CountX(ctx context.Context) int
- func (oq *OwnerQuery) Exist(ctx context.Context) (bool, error)
- func (oq *OwnerQuery) ExistX(ctx context.Context) bool
- func (oq *OwnerQuery) First(ctx context.Context) (*Owner, error)
- func (oq *OwnerQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (oq *OwnerQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (oq *OwnerQuery) FirstX(ctx context.Context) *Owner
- func (oq *OwnerQuery) GroupBy(field string, fields ...string) *OwnerGroupBy
- func (oq *OwnerQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (oq *OwnerQuery) IDsX(ctx context.Context) []uuid.UUID
- func (oq *OwnerQuery) Limit(limit int) *OwnerQuery
- func (oq *OwnerQuery) Offset(offset int) *OwnerQuery
- func (oq *OwnerQuery) Only(ctx context.Context) (*Owner, error)
- func (oq *OwnerQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (oq *OwnerQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (oq *OwnerQuery) OnlyX(ctx context.Context) *Owner
- func (oq *OwnerQuery) Order(o ...OrderFunc) *OwnerQuery
- func (oq *OwnerQuery) QueryPets() *PetQuery
- func (oq *OwnerQuery) Select(fields ...string) *OwnerSelect
- func (oq *OwnerQuery) Unique(unique bool) *OwnerQuery
- func (oq *OwnerQuery) Where(ps ...predicate.Owner) *OwnerQuery
- func (oq *OwnerQuery) WithPets(opts ...func(*PetQuery)) *OwnerQuery
- type OwnerSelect
- func (os *OwnerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (os *OwnerSelect) BoolX(ctx context.Context) bool
- func (os *OwnerSelect) Bools(ctx context.Context) ([]bool, error)
- func (os *OwnerSelect) BoolsX(ctx context.Context) []bool
- func (os *OwnerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (os *OwnerSelect) Float64X(ctx context.Context) float64
- func (os *OwnerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (os *OwnerSelect) Float64sX(ctx context.Context) []float64
- func (os *OwnerSelect) Int(ctx context.Context) (_ int, err error)
- func (os *OwnerSelect) IntX(ctx context.Context) int
- func (os *OwnerSelect) Ints(ctx context.Context) ([]int, error)
- func (os *OwnerSelect) IntsX(ctx context.Context) []int
- func (os *OwnerSelect) Scan(ctx context.Context, v interface{}) error
- func (os *OwnerSelect) ScanX(ctx context.Context, v interface{})
- func (os *OwnerSelect) String(ctx context.Context) (_ string, err error)
- func (os *OwnerSelect) StringX(ctx context.Context) string
- func (os *OwnerSelect) Strings(ctx context.Context) ([]string, error)
- func (os *OwnerSelect) StringsX(ctx context.Context) []string
- type OwnerUpdate
- func (ou *OwnerUpdate) AddAge(i int) *OwnerUpdate
- func (ou *OwnerUpdate) AddPetIDs(ids ...string) *OwnerUpdate
- func (ou *OwnerUpdate) AddPets(p ...*Pet) *OwnerUpdate
- func (ou *OwnerUpdate) ClearPets() *OwnerUpdate
- func (ou *OwnerUpdate) Exec(ctx context.Context) error
- func (ou *OwnerUpdate) ExecX(ctx context.Context)
- func (ou *OwnerUpdate) Mutation() *OwnerMutation
- func (ou *OwnerUpdate) RemovePetIDs(ids ...string) *OwnerUpdate
- func (ou *OwnerUpdate) RemovePets(p ...*Pet) *OwnerUpdate
- func (ou *OwnerUpdate) Save(ctx context.Context) (int, error)
- func (ou *OwnerUpdate) SaveX(ctx context.Context) int
- func (ou *OwnerUpdate) SetAge(i int) *OwnerUpdate
- func (ou *OwnerUpdate) SetName(s string) *OwnerUpdate
- func (ou *OwnerUpdate) Where(ps ...predicate.Owner) *OwnerUpdate
- type OwnerUpdateOne
- func (ouo *OwnerUpdateOne) AddAge(i int) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) AddPetIDs(ids ...string) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) AddPets(p ...*Pet) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) ClearPets() *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) Exec(ctx context.Context) error
- func (ouo *OwnerUpdateOne) ExecX(ctx context.Context)
- func (ouo *OwnerUpdateOne) Mutation() *OwnerMutation
- func (ouo *OwnerUpdateOne) RemovePetIDs(ids ...string) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) RemovePets(p ...*Pet) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) Save(ctx context.Context) (*Owner, error)
- func (ouo *OwnerUpdateOne) SaveX(ctx context.Context) *Owner
- func (ouo *OwnerUpdateOne) Select(field string, fields ...string) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) SetAge(i int) *OwnerUpdateOne
- func (ouo *OwnerUpdateOne) SetName(s string) *OwnerUpdateOne
- type Owners
- type Pet
- 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 string) *PetDeleteOne
- func (c *PetClient) Get(ctx context.Context, id string) (*Pet, error)
- func (c *PetClient) GetX(ctx context.Context, id string) *Pet
- func (c *PetClient) Hooks() []Hook
- func (c *PetClient) Query() *PetQuery
- func (c *PetClient) QueryCategories(pe *Pet) *CategoryQuery
- func (c *PetClient) QueryCollar(pe *Pet) *CollarQuery
- func (c *PetClient) QueryFriends(pe *Pet) *PetQuery
- func (c *PetClient) QueryOwner(pe *Pet) *OwnerQuery
- func (c *PetClient) Update() *PetUpdate
- func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
- func (c *PetClient) UpdateOneID(id string) *PetUpdateOne
- func (c *PetClient) Use(hooks ...Hook)
- type PetCreate
- func (pc *PetCreate) AddCategories(c ...*Category) *PetCreate
- func (pc *PetCreate) AddCategoryIDs(ids ...uint64) *PetCreate
- func (pc *PetCreate) AddFriendIDs(ids ...string) *PetCreate
- func (pc *PetCreate) AddFriends(p ...*Pet) *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) SetAge(i int) *PetCreate
- func (pc *PetCreate) SetCollar(c *Collar) *PetCreate
- func (pc *PetCreate) SetCollarID(id int) *PetCreate
- func (pc *PetCreate) SetID(s string) *PetCreate
- func (pc *PetCreate) SetName(s string) *PetCreate
- func (pc *PetCreate) SetNillableCollarID(id *int) *PetCreate
- func (pc *PetCreate) SetNillableID(s *string) *PetCreate
- func (pc *PetCreate) SetNillableOwnerID(id *uuid.UUID) *PetCreate
- func (pc *PetCreate) SetOwner(o *Owner) *PetCreate
- func (pc *PetCreate) SetOwnerID(id uuid.UUID) *PetCreate
- type PetCreateBulk
- type PetDelete
- type PetDeleteOne
- type PetEdges
- 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) AddAge(i int)
- func (m *PetMutation) AddCategoryIDs(ids ...uint64)
- func (m *PetMutation) AddField(name string, value ent.Value) error
- func (m *PetMutation) AddFriendIDs(ids ...string)
- func (m *PetMutation) AddedAge() (r int, exists bool)
- func (m *PetMutation) AddedEdges() []string
- func (m *PetMutation) AddedField(name string) (ent.Value, bool)
- func (m *PetMutation) AddedFields() []string
- func (m *PetMutation) AddedIDs(name string) []ent.Value
- func (m *PetMutation) Age() (r int, exists bool)
- func (m *PetMutation) CategoriesCleared() bool
- func (m *PetMutation) CategoriesIDs() (ids []uint64)
- func (m *PetMutation) ClearCategories()
- func (m *PetMutation) ClearCollar()
- func (m *PetMutation) ClearEdge(name string) error
- func (m *PetMutation) ClearField(name string) error
- func (m *PetMutation) ClearFriends()
- func (m *PetMutation) ClearOwner()
- func (m *PetMutation) ClearedEdges() []string
- func (m *PetMutation) ClearedFields() []string
- func (m PetMutation) Client() *Client
- func (m *PetMutation) CollarCleared() bool
- func (m *PetMutation) CollarID() (id int, exists bool)
- func (m *PetMutation) CollarIDs() (ids []int)
- 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 []string)
- func (m *PetMutation) ID() (id string, exists bool)
- func (m *PetMutation) Name() (r string, exists bool)
- func (m *PetMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PetMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PetMutation) Op() Op
- func (m *PetMutation) OwnerCleared() bool
- func (m *PetMutation) OwnerID() (id uuid.UUID, exists bool)
- func (m *PetMutation) OwnerIDs() (ids []uuid.UUID)
- func (m *PetMutation) RemoveCategoryIDs(ids ...uint64)
- func (m *PetMutation) RemoveFriendIDs(ids ...string)
- func (m *PetMutation) RemovedCategoriesIDs() (ids []uint64)
- func (m *PetMutation) RemovedEdges() []string
- func (m *PetMutation) RemovedFriendsIDs() (ids []string)
- func (m *PetMutation) RemovedIDs(name string) []ent.Value
- func (m *PetMutation) ResetAge()
- func (m *PetMutation) ResetCategories()
- func (m *PetMutation) ResetCollar()
- func (m *PetMutation) ResetEdge(name string) error
- func (m *PetMutation) ResetField(name string) error
- func (m *PetMutation) ResetFriends()
- func (m *PetMutation) ResetName()
- func (m *PetMutation) ResetOwner()
- func (m *PetMutation) SetAge(i int)
- func (m *PetMutation) SetCollarID(id int)
- func (m *PetMutation) SetField(name string, value ent.Value) error
- func (m *PetMutation) SetID(id string)
- func (m *PetMutation) SetName(s string)
- func (m *PetMutation) SetOwnerID(id uuid.UUID)
- func (m PetMutation) Tx() (*Tx, error)
- func (m *PetMutation) Type() string
- 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 string, err error)
- func (pq *PetQuery) FirstIDX(ctx context.Context) string
- func (pq *PetQuery) FirstX(ctx context.Context) *Pet
- func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
- func (pq *PetQuery) IDs(ctx context.Context) ([]string, error)
- func (pq *PetQuery) IDsX(ctx context.Context) []string
- 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 string, err error)
- func (pq *PetQuery) OnlyIDX(ctx context.Context) string
- func (pq *PetQuery) OnlyX(ctx context.Context) *Pet
- func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery
- func (pq *PetQuery) QueryCategories() *CategoryQuery
- func (pq *PetQuery) QueryCollar() *CollarQuery
- func (pq *PetQuery) QueryFriends() *PetQuery
- func (pq *PetQuery) QueryOwner() *OwnerQuery
- 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) WithCategories(opts ...func(*CategoryQuery)) *PetQuery
- func (pq *PetQuery) WithCollar(opts ...func(*CollarQuery)) *PetQuery
- func (pq *PetQuery) WithFriends(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithOwner(opts ...func(*OwnerQuery)) *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) AddAge(i int) *PetUpdate
- func (pu *PetUpdate) AddCategories(c ...*Category) *PetUpdate
- func (pu *PetUpdate) AddCategoryIDs(ids ...uint64) *PetUpdate
- func (pu *PetUpdate) AddFriendIDs(ids ...string) *PetUpdate
- func (pu *PetUpdate) AddFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) ClearCategories() *PetUpdate
- func (pu *PetUpdate) ClearCollar() *PetUpdate
- func (pu *PetUpdate) ClearFriends() *PetUpdate
- func (pu *PetUpdate) ClearOwner() *PetUpdate
- func (pu *PetUpdate) Exec(ctx context.Context) error
- func (pu *PetUpdate) ExecX(ctx context.Context)
- func (pu *PetUpdate) Mutation() *PetMutation
- func (pu *PetUpdate) RemoveCategories(c ...*Category) *PetUpdate
- func (pu *PetUpdate) RemoveCategoryIDs(ids ...uint64) *PetUpdate
- func (pu *PetUpdate) RemoveFriendIDs(ids ...string) *PetUpdate
- func (pu *PetUpdate) RemoveFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) Save(ctx context.Context) (int, error)
- func (pu *PetUpdate) SaveX(ctx context.Context) int
- func (pu *PetUpdate) SetAge(i int) *PetUpdate
- func (pu *PetUpdate) SetCollar(c *Collar) *PetUpdate
- func (pu *PetUpdate) SetCollarID(id int) *PetUpdate
- func (pu *PetUpdate) SetName(s string) *PetUpdate
- func (pu *PetUpdate) SetNillableCollarID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableOwnerID(id *uuid.UUID) *PetUpdate
- func (pu *PetUpdate) SetOwner(o *Owner) *PetUpdate
- func (pu *PetUpdate) SetOwnerID(id uuid.UUID) *PetUpdate
- func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate
- type PetUpdateOne
- func (puo *PetUpdateOne) AddAge(i int) *PetUpdateOne
- func (puo *PetUpdateOne) AddCategories(c ...*Category) *PetUpdateOne
- func (puo *PetUpdateOne) AddCategoryIDs(ids ...uint64) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriendIDs(ids ...string) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriends(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) ClearCategories() *PetUpdateOne
- func (puo *PetUpdateOne) ClearCollar() *PetUpdateOne
- func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
- func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
- func (puo *PetUpdateOne) Exec(ctx context.Context) error
- func (puo *PetUpdateOne) ExecX(ctx context.Context)
- func (puo *PetUpdateOne) Mutation() *PetMutation
- func (puo *PetUpdateOne) RemoveCategories(c ...*Category) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveCategoryIDs(ids ...uint64) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriendIDs(ids ...string) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriends(p ...*Pet) *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) SetAge(i int) *PetUpdateOne
- func (puo *PetUpdateOne) SetCollar(c *Collar) *PetUpdateOne
- func (puo *PetUpdateOne) SetCollarID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableCollarID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableOwnerID(id *uuid.UUID) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwner(o *Owner) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwnerID(id uuid.UUID) *PetUpdateOne
- type Pets
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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. TypeCategory = "Category" TypeCollar = "Collar" TypeOwner = "Owner" TypePet = "Pet" )
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 Category ¶
type Category struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CategoryQuery when eager-loading is set. Edges CategoryEdges `json:"edges"` // contains filtered or unexported fields }
Category is the model entity for the Category schema.
func (*Category) Unwrap ¶
Unwrap unwraps the Category 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 (*Category) Update ¶
func (c *Category) Update() *CategoryUpdateOne
Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.
type CategoryClient ¶
type CategoryClient struct {
// contains filtered or unexported fields
}
CategoryClient is a client for the Category schema.
func NewCategoryClient ¶
func NewCategoryClient(c config) *CategoryClient
NewCategoryClient returns a client for the Category from the given config.
func (*CategoryClient) Create ¶
func (c *CategoryClient) Create() *CategoryCreate
Create returns a create builder for Category.
func (*CategoryClient) CreateBulk ¶
func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
CreateBulk returns a builder for creating a bulk of Category entities.
func (*CategoryClient) Delete ¶
func (c *CategoryClient) Delete() *CategoryDelete
Delete returns a delete builder for Category.
func (*CategoryClient) DeleteOne ¶
func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CategoryClient) DeleteOneID ¶
func (c *CategoryClient) DeleteOneID(id uint64) *CategoryDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CategoryClient) GetX ¶
func (c *CategoryClient) GetX(ctx context.Context, id uint64) *Category
GetX is like Get, but panics if an error occurs.
func (*CategoryClient) Hooks ¶
func (c *CategoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CategoryClient) Query ¶
func (c *CategoryClient) Query() *CategoryQuery
Query returns a query builder for Category.
func (*CategoryClient) QueryPets ¶
func (c *CategoryClient) QueryPets(ca *Category) *PetQuery
QueryPets queries the pets edge of a Category.
func (*CategoryClient) Update ¶
func (c *CategoryClient) Update() *CategoryUpdate
Update returns an update builder for Category.
func (*CategoryClient) UpdateOne ¶
func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CategoryClient) UpdateOneID ¶
func (c *CategoryClient) UpdateOneID(id uint64) *CategoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CategoryClient) Use ¶
func (c *CategoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.
type CategoryCreate ¶
type CategoryCreate struct {
// contains filtered or unexported fields
}
CategoryCreate is the builder for creating a Category entity.
func (*CategoryCreate) AddPetIDs ¶
func (cc *CategoryCreate) AddPetIDs(ids ...string) *CategoryCreate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryCreate) AddPets ¶
func (cc *CategoryCreate) AddPets(p ...*Pet) *CategoryCreate
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryCreate) Exec ¶
func (cc *CategoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreate) ExecX ¶
func (cc *CategoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryCreate) Mutation ¶
func (cc *CategoryCreate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryCreate) Save ¶
func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
Save creates the Category in the database.
func (*CategoryCreate) SaveX ¶
func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
SaveX calls Save and panics if Save returns an error.
func (*CategoryCreate) SetID ¶
func (cc *CategoryCreate) SetID(u uint64) *CategoryCreate
SetID sets the "id" field.
func (*CategoryCreate) SetName ¶
func (cc *CategoryCreate) SetName(s string) *CategoryCreate
SetName sets the "name" field.
type CategoryCreateBulk ¶
type CategoryCreateBulk struct {
// contains filtered or unexported fields
}
CategoryCreateBulk is the builder for creating many Category entities in bulk.
func (*CategoryCreateBulk) Exec ¶
func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreateBulk) ExecX ¶
func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CategoryDelete ¶
type CategoryDelete struct {
// contains filtered or unexported fields
}
CategoryDelete is the builder for deleting a Category entity.
func (*CategoryDelete) Exec ¶
func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CategoryDelete) ExecX ¶
func (cd *CategoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDelete) Where ¶
func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete
Where appends a list predicates to the CategoryDelete builder.
type CategoryDeleteOne ¶
type CategoryDeleteOne struct {
// contains filtered or unexported fields
}
CategoryDeleteOne is the builder for deleting a single Category entity.
func (*CategoryDeleteOne) Exec ¶
func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CategoryDeleteOne) ExecX ¶
func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CategoryEdges ¶
type CategoryEdges struct { // Pets holds the value of the pets edge. Pets []*Pet `json:"pets,omitempty"` // contains filtered or unexported fields }
CategoryEdges holds the relations/edges for other nodes in the graph.
func (CategoryEdges) PetsOrErr ¶
func (e CategoryEdges) PetsOrErr() ([]*Pet, error)
PetsOrErr returns the Pets value or an error if the edge was not loaded in eager-loading.
type CategoryGroupBy ¶
type CategoryGroupBy struct {
// contains filtered or unexported fields
}
CategoryGroupBy is the group-by builder for Category entities.
func (*CategoryGroupBy) Aggregate ¶
func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CategoryGroupBy) Bool ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) BoolX ¶
func (cgb *CategoryGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CategoryGroupBy) Bools ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) BoolsX ¶
func (cgb *CategoryGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CategoryGroupBy) Float64 ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) Float64X ¶
func (cgb *CategoryGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CategoryGroupBy) Float64s ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) Float64sX ¶
func (cgb *CategoryGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CategoryGroupBy) Int ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) IntX ¶
func (cgb *CategoryGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CategoryGroupBy) Ints ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) IntsX ¶
func (cgb *CategoryGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CategoryGroupBy) Scan ¶
func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CategoryGroupBy) ScanX ¶
func (cgb *CategoryGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CategoryGroupBy) String ¶
func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) StringX ¶
func (cgb *CategoryGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CategoryMutation ¶
type CategoryMutation struct {
// contains filtered or unexported fields
}
CategoryMutation represents an operation that mutates the Category nodes in the graph.
func (*CategoryMutation) AddField ¶
func (m *CategoryMutation) 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 (*CategoryMutation) AddPetIDs ¶
func (m *CategoryMutation) AddPetIDs(ids ...string)
AddPetIDs adds the "pets" edge to the Pet entity by ids.
func (*CategoryMutation) AddedEdges ¶
func (m *CategoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CategoryMutation) AddedField ¶
func (m *CategoryMutation) 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 (*CategoryMutation) AddedFields ¶
func (m *CategoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CategoryMutation) AddedIDs ¶
func (m *CategoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CategoryMutation) ClearEdge ¶
func (m *CategoryMutation) 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 (*CategoryMutation) ClearField ¶
func (m *CategoryMutation) 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 (*CategoryMutation) ClearPets ¶
func (m *CategoryMutation) ClearPets()
ClearPets clears the "pets" edge to the Pet entity.
func (*CategoryMutation) ClearedEdges ¶
func (m *CategoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CategoryMutation) ClearedFields ¶
func (m *CategoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CategoryMutation) Client ¶
func (m CategoryMutation) 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 (*CategoryMutation) EdgeCleared ¶
func (m *CategoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CategoryMutation) Field ¶
func (m *CategoryMutation) 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 (*CategoryMutation) FieldCleared ¶
func (m *CategoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CategoryMutation) Fields ¶
func (m *CategoryMutation) 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 (*CategoryMutation) ID ¶
func (m *CategoryMutation) ID() (id uint64, 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 (*CategoryMutation) Name ¶
func (m *CategoryMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CategoryMutation) 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 (*CategoryMutation) OldName ¶
func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Category entity. If the Category 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 (*CategoryMutation) PetsCleared ¶
func (m *CategoryMutation) PetsCleared() bool
PetsCleared reports if the "pets" edge to the Pet entity was cleared.
func (*CategoryMutation) PetsIDs ¶
func (m *CategoryMutation) PetsIDs() (ids []string)
PetsIDs returns the "pets" edge IDs in the mutation.
func (*CategoryMutation) RemovePetIDs ¶
func (m *CategoryMutation) RemovePetIDs(ids ...string)
RemovePetIDs removes the "pets" edge to the Pet entity by IDs.
func (*CategoryMutation) RemovedEdges ¶
func (m *CategoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CategoryMutation) RemovedIDs ¶
func (m *CategoryMutation) 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 (*CategoryMutation) RemovedPetsIDs ¶
func (m *CategoryMutation) RemovedPetsIDs() (ids []string)
RemovedPets returns the removed IDs of the "pets" edge to the Pet entity.
func (*CategoryMutation) ResetEdge ¶
func (m *CategoryMutation) 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 (*CategoryMutation) ResetField ¶
func (m *CategoryMutation) 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 (*CategoryMutation) ResetName ¶
func (m *CategoryMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CategoryMutation) ResetPets ¶
func (m *CategoryMutation) ResetPets()
ResetPets resets all changes to the "pets" edge.
func (*CategoryMutation) SetField ¶
func (m *CategoryMutation) 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 (*CategoryMutation) SetID ¶
func (m *CategoryMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Category entities.
func (*CategoryMutation) SetName ¶
func (m *CategoryMutation) SetName(s string)
SetName sets the "name" field.
func (CategoryMutation) Tx ¶
func (m CategoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CategoryMutation) Type ¶
func (m *CategoryMutation) Type() string
Type returns the node type of this mutation (Category).
func (*CategoryMutation) Where ¶
func (m *CategoryMutation) Where(ps ...predicate.Category)
Where appends a list predicates to the CategoryMutation builder.
type CategoryQuery ¶
type CategoryQuery struct {
// contains filtered or unexported fields
}
CategoryQuery is the builder for querying Category entities.
func (*CategoryQuery) All ¶
func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
All executes the query and returns a list of Categories.
func (*CategoryQuery) AllX ¶
func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
AllX is like All, but panics if an error occurs.
func (*CategoryQuery) Clone ¶
func (cq *CategoryQuery) Clone() *CategoryQuery
Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CategoryQuery) Count ¶
func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CategoryQuery) CountX ¶
func (cq *CategoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CategoryQuery) Exist ¶
func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CategoryQuery) ExistX ¶
func (cq *CategoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CategoryQuery) First ¶
func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.
func (*CategoryQuery) FirstID ¶
func (cq *CategoryQuery) FirstID(ctx context.Context) (id uint64, err error)
FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.
func (*CategoryQuery) FirstIDX ¶
func (cq *CategoryQuery) FirstIDX(ctx context.Context) uint64
FirstIDX is like FirstID, but panics if an error occurs.
func (*CategoryQuery) FirstX ¶
func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
FirstX is like First, but panics if an error occurs.
func (*CategoryQuery) GroupBy ¶
func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Category.Query(). GroupBy(category.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CategoryQuery) IDs ¶
func (cq *CategoryQuery) IDs(ctx context.Context) ([]uint64, error)
IDs executes the query and returns a list of Category IDs.
func (*CategoryQuery) IDsX ¶
func (cq *CategoryQuery) IDsX(ctx context.Context) []uint64
IDsX is like IDs, but panics if an error occurs.
func (*CategoryQuery) Limit ¶
func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
Limit adds a limit step to the query.
func (*CategoryQuery) Offset ¶
func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
Offset adds an offset step to the query.
func (*CategoryQuery) Only ¶
func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Category entity is not found. Returns a *NotFoundError when no Category entities are found.
func (*CategoryQuery) OnlyID ¶
func (cq *CategoryQuery) OnlyID(ctx context.Context) (id uint64, err error)
OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when exactly one Category ID is not found. Returns a *NotFoundError when no entities are found.
func (*CategoryQuery) OnlyIDX ¶
func (cq *CategoryQuery) OnlyIDX(ctx context.Context) uint64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CategoryQuery) OnlyX ¶
func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
OnlyX is like Only, but panics if an error occurs.
func (*CategoryQuery) Order ¶
func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
Order adds an order step to the query.
func (*CategoryQuery) QueryPets ¶
func (cq *CategoryQuery) QueryPets() *PetQuery
QueryPets chains the current query on the "pets" edge.
func (*CategoryQuery) Select ¶
func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
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 { Name string `json:"name,omitempty"` } client.Category.Query(). Select(category.FieldName). Scan(ctx, &v)
func (*CategoryQuery) Unique ¶
func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
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 (*CategoryQuery) Where ¶
func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
Where adds a new predicate for the CategoryQuery builder.
func (*CategoryQuery) WithPets ¶
func (cq *CategoryQuery) WithPets(opts ...func(*PetQuery)) *CategoryQuery
WithPets tells the query-builder to eager-load the nodes that are connected to the "pets" edge. The optional arguments are used to configure the query builder of the edge.
type CategorySelect ¶
type CategorySelect struct { *CategoryQuery // contains filtered or unexported fields }
CategorySelect is the builder for selecting fields of Category entities.
func (*CategorySelect) Bool ¶
func (cs *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategorySelect) BoolX ¶
func (cs *CategorySelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CategorySelect) Bools ¶
func (cs *CategorySelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategorySelect) BoolsX ¶
func (cs *CategorySelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CategorySelect) Float64 ¶
func (cs *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64X ¶
func (cs *CategorySelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CategorySelect) Float64s ¶
func (cs *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64sX ¶
func (cs *CategorySelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CategorySelect) Int ¶
func (cs *CategorySelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategorySelect) IntX ¶
func (cs *CategorySelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CategorySelect) Ints ¶
func (cs *CategorySelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategorySelect) IntsX ¶
func (cs *CategorySelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CategorySelect) Scan ¶
func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*CategorySelect) ScanX ¶
func (cs *CategorySelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CategorySelect) String ¶
func (cs *CategorySelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*CategorySelect) StringX ¶
func (cs *CategorySelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CategoryUpdate ¶
type CategoryUpdate struct {
// contains filtered or unexported fields
}
CategoryUpdate is the builder for updating Category entities.
func (*CategoryUpdate) AddPetIDs ¶
func (cu *CategoryUpdate) AddPetIDs(ids ...string) *CategoryUpdate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryUpdate) AddPets ¶
func (cu *CategoryUpdate) AddPets(p ...*Pet) *CategoryUpdate
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryUpdate) ClearPets ¶
func (cu *CategoryUpdate) ClearPets() *CategoryUpdate
ClearPets clears all "pets" edges to the Pet entity.
func (*CategoryUpdate) Exec ¶
func (cu *CategoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpdate) ExecX ¶
func (cu *CategoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdate) Mutation ¶
func (cu *CategoryUpdate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdate) RemovePetIDs ¶
func (cu *CategoryUpdate) RemovePetIDs(ids ...string) *CategoryUpdate
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*CategoryUpdate) RemovePets ¶
func (cu *CategoryUpdate) RemovePets(p ...*Pet) *CategoryUpdate
RemovePets removes "pets" edges to Pet entities.
func (*CategoryUpdate) Save ¶
func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CategoryUpdate) SaveX ¶
func (cu *CategoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdate) SetName ¶
func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
SetName sets the "name" field.
func (*CategoryUpdate) Where ¶
func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
Where appends a list predicates to the CategoryUpdate builder.
type CategoryUpdateOne ¶
type CategoryUpdateOne struct {
// contains filtered or unexported fields
}
CategoryUpdateOne is the builder for updating a single Category entity.
func (*CategoryUpdateOne) AddPetIDs ¶
func (cuo *CategoryUpdateOne) AddPetIDs(ids ...string) *CategoryUpdateOne
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryUpdateOne) AddPets ¶
func (cuo *CategoryUpdateOne) AddPets(p ...*Pet) *CategoryUpdateOne
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryUpdateOne) ClearPets ¶
func (cuo *CategoryUpdateOne) ClearPets() *CategoryUpdateOne
ClearPets clears all "pets" edges to the Pet entity.
func (*CategoryUpdateOne) Exec ¶
func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CategoryUpdateOne) ExecX ¶
func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdateOne) Mutation ¶
func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdateOne) RemovePetIDs ¶
func (cuo *CategoryUpdateOne) RemovePetIDs(ids ...string) *CategoryUpdateOne
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*CategoryUpdateOne) RemovePets ¶
func (cuo *CategoryUpdateOne) RemovePets(p ...*Pet) *CategoryUpdateOne
RemovePets removes "pets" edges to Pet entities.
func (*CategoryUpdateOne) Save ¶
func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
Save executes the query and returns the updated Category entity.
func (*CategoryUpdateOne) SaveX ¶
func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdateOne) Select ¶
func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CategoryUpdateOne) SetName ¶
func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
SetName sets the "name" field.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Category is the client for interacting with the Category builders. Category *CategoryClient // Collar is the client for interacting with the Collar builders. Collar *CollarClient // Owner is the client for interacting with the Owner builders. Owner *OwnerClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // 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(). Category. Query(). Count(ctx)
type Collar ¶
type Collar struct { // ID of the ent. ID int `json:"id,omitempty"` // Color holds the value of the "color" field. Color collar.Color `json:"color,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CollarQuery when eager-loading is set. Edges CollarEdges `json:"edges"` // contains filtered or unexported fields }
Collar is the model entity for the Collar schema.
func (*Collar) Unwrap ¶
Unwrap unwraps the Collar 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 (*Collar) Update ¶
func (c *Collar) Update() *CollarUpdateOne
Update returns a builder for updating this Collar. Note that you need to call Collar.Unwrap() before calling this method if this Collar was returned from a transaction, and the transaction was committed or rolled back.
type CollarClient ¶
type CollarClient struct {
// contains filtered or unexported fields
}
CollarClient is a client for the Collar schema.
func NewCollarClient ¶
func NewCollarClient(c config) *CollarClient
NewCollarClient returns a client for the Collar from the given config.
func (*CollarClient) Create ¶
func (c *CollarClient) Create() *CollarCreate
Create returns a create builder for Collar.
func (*CollarClient) CreateBulk ¶
func (c *CollarClient) CreateBulk(builders ...*CollarCreate) *CollarCreateBulk
CreateBulk returns a builder for creating a bulk of Collar entities.
func (*CollarClient) Delete ¶
func (c *CollarClient) Delete() *CollarDelete
Delete returns a delete builder for Collar.
func (*CollarClient) DeleteOne ¶
func (c *CollarClient) DeleteOne(co *Collar) *CollarDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CollarClient) DeleteOneID ¶
func (c *CollarClient) DeleteOneID(id int) *CollarDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CollarClient) GetX ¶
func (c *CollarClient) GetX(ctx context.Context, id int) *Collar
GetX is like Get, but panics if an error occurs.
func (*CollarClient) Query ¶
func (c *CollarClient) Query() *CollarQuery
Query returns a query builder for Collar.
func (*CollarClient) QueryPet ¶
func (c *CollarClient) QueryPet(co *Collar) *PetQuery
QueryPet queries the pet edge of a Collar.
func (*CollarClient) Update ¶
func (c *CollarClient) Update() *CollarUpdate
Update returns an update builder for Collar.
func (*CollarClient) UpdateOne ¶
func (c *CollarClient) UpdateOne(co *Collar) *CollarUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CollarClient) UpdateOneID ¶
func (c *CollarClient) UpdateOneID(id int) *CollarUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CollarClient) Use ¶
func (c *CollarClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `collar.Hooks(f(g(h())))`.
type CollarCreate ¶
type CollarCreate struct {
// contains filtered or unexported fields
}
CollarCreate is the builder for creating a Collar entity.
func (*CollarCreate) Exec ¶
func (cc *CollarCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CollarCreate) ExecX ¶
func (cc *CollarCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CollarCreate) Mutation ¶
func (cc *CollarCreate) Mutation() *CollarMutation
Mutation returns the CollarMutation object of the builder.
func (*CollarCreate) Save ¶
func (cc *CollarCreate) Save(ctx context.Context) (*Collar, error)
Save creates the Collar in the database.
func (*CollarCreate) SaveX ¶
func (cc *CollarCreate) SaveX(ctx context.Context) *Collar
SaveX calls Save and panics if Save returns an error.
func (*CollarCreate) SetColor ¶
func (cc *CollarCreate) SetColor(c collar.Color) *CollarCreate
SetColor sets the "color" field.
func (*CollarCreate) SetNillablePetID ¶
func (cc *CollarCreate) SetNillablePetID(id *string) *CollarCreate
SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.
func (*CollarCreate) SetPet ¶
func (cc *CollarCreate) SetPet(p *Pet) *CollarCreate
SetPet sets the "pet" edge to the Pet entity.
func (*CollarCreate) SetPetID ¶
func (cc *CollarCreate) SetPetID(id string) *CollarCreate
SetPetID sets the "pet" edge to the Pet entity by ID.
type CollarCreateBulk ¶
type CollarCreateBulk struct {
// contains filtered or unexported fields
}
CollarCreateBulk is the builder for creating many Collar entities in bulk.
func (*CollarCreateBulk) Exec ¶
func (ccb *CollarCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CollarCreateBulk) ExecX ¶
func (ccb *CollarCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CollarDelete ¶
type CollarDelete struct {
// contains filtered or unexported fields
}
CollarDelete is the builder for deleting a Collar entity.
func (*CollarDelete) Exec ¶
func (cd *CollarDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CollarDelete) ExecX ¶
func (cd *CollarDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CollarDelete) Where ¶
func (cd *CollarDelete) Where(ps ...predicate.Collar) *CollarDelete
Where appends a list predicates to the CollarDelete builder.
type CollarDeleteOne ¶
type CollarDeleteOne struct {
// contains filtered or unexported fields
}
CollarDeleteOne is the builder for deleting a single Collar entity.
func (*CollarDeleteOne) Exec ¶
func (cdo *CollarDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CollarDeleteOne) ExecX ¶
func (cdo *CollarDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CollarEdges ¶
type CollarEdges struct { // Pet holds the value of the pet edge. Pet *Pet `json:"pet,omitempty"` // contains filtered or unexported fields }
CollarEdges holds the relations/edges for other nodes in the graph.
func (CollarEdges) PetOrErr ¶
func (e CollarEdges) PetOrErr() (*Pet, error)
PetOrErr returns the Pet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CollarGroupBy ¶
type CollarGroupBy struct {
// contains filtered or unexported fields
}
CollarGroupBy is the group-by builder for Collar entities.
func (*CollarGroupBy) Aggregate ¶
func (cgb *CollarGroupBy) Aggregate(fns ...AggregateFunc) *CollarGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CollarGroupBy) Bool ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) BoolX ¶
func (cgb *CollarGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CollarGroupBy) Bools ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) BoolsX ¶
func (cgb *CollarGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CollarGroupBy) Float64 ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) Float64X ¶
func (cgb *CollarGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CollarGroupBy) Float64s ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) Float64sX ¶
func (cgb *CollarGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CollarGroupBy) Int ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) IntX ¶
func (cgb *CollarGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CollarGroupBy) Ints ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) IntsX ¶
func (cgb *CollarGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CollarGroupBy) Scan ¶
func (cgb *CollarGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CollarGroupBy) ScanX ¶
func (cgb *CollarGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CollarGroupBy) String ¶
func (cgb *CollarGroupBy) 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 (*CollarGroupBy) StringX ¶
func (cgb *CollarGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CollarMutation ¶
type CollarMutation struct {
// contains filtered or unexported fields
}
CollarMutation represents an operation that mutates the Collar nodes in the graph.
func (*CollarMutation) AddField ¶
func (m *CollarMutation) 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 (*CollarMutation) AddedEdges ¶
func (m *CollarMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CollarMutation) AddedField ¶
func (m *CollarMutation) 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 (*CollarMutation) AddedFields ¶
func (m *CollarMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CollarMutation) AddedIDs ¶
func (m *CollarMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CollarMutation) ClearEdge ¶
func (m *CollarMutation) 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 (*CollarMutation) ClearField ¶
func (m *CollarMutation) 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 (*CollarMutation) ClearPet ¶
func (m *CollarMutation) ClearPet()
ClearPet clears the "pet" edge to the Pet entity.
func (*CollarMutation) ClearedEdges ¶
func (m *CollarMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CollarMutation) ClearedFields ¶
func (m *CollarMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CollarMutation) Client ¶
func (m CollarMutation) 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 (*CollarMutation) Color ¶
func (m *CollarMutation) Color() (r collar.Color, exists bool)
Color returns the value of the "color" field in the mutation.
func (*CollarMutation) EdgeCleared ¶
func (m *CollarMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CollarMutation) Field ¶
func (m *CollarMutation) 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 (*CollarMutation) FieldCleared ¶
func (m *CollarMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CollarMutation) Fields ¶
func (m *CollarMutation) 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 (*CollarMutation) ID ¶
func (m *CollarMutation) 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 (*CollarMutation) OldColor ¶
OldColor returns the old "color" field's value of the Collar entity. If the Collar 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 (*CollarMutation) 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 (*CollarMutation) PetCleared ¶
func (m *CollarMutation) PetCleared() bool
PetCleared reports if the "pet" edge to the Pet entity was cleared.
func (*CollarMutation) PetID ¶
func (m *CollarMutation) PetID() (id string, exists bool)
PetID returns the "pet" edge ID in the mutation.
func (*CollarMutation) PetIDs ¶
func (m *CollarMutation) PetIDs() (ids []string)
PetIDs returns the "pet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PetID instead. It exists only for internal usage by the builders.
func (*CollarMutation) RemovedEdges ¶
func (m *CollarMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CollarMutation) RemovedIDs ¶
func (m *CollarMutation) 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 (*CollarMutation) ResetColor ¶
func (m *CollarMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*CollarMutation) ResetEdge ¶
func (m *CollarMutation) 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 (*CollarMutation) ResetField ¶
func (m *CollarMutation) 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 (*CollarMutation) ResetPet ¶
func (m *CollarMutation) ResetPet()
ResetPet resets all changes to the "pet" edge.
func (*CollarMutation) SetColor ¶
func (m *CollarMutation) SetColor(c collar.Color)
SetColor sets the "color" field.
func (*CollarMutation) SetField ¶
func (m *CollarMutation) 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 (*CollarMutation) SetPetID ¶
func (m *CollarMutation) SetPetID(id string)
SetPetID sets the "pet" edge to the Pet entity by id.
func (CollarMutation) Tx ¶
func (m CollarMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CollarMutation) Type ¶
func (m *CollarMutation) Type() string
Type returns the node type of this mutation (Collar).
func (*CollarMutation) Where ¶
func (m *CollarMutation) Where(ps ...predicate.Collar)
Where appends a list predicates to the CollarMutation builder.
type CollarQuery ¶
type CollarQuery struct {
// contains filtered or unexported fields
}
CollarQuery is the builder for querying Collar entities.
func (*CollarQuery) All ¶
func (cq *CollarQuery) All(ctx context.Context) ([]*Collar, error)
All executes the query and returns a list of Collars.
func (*CollarQuery) AllX ¶
func (cq *CollarQuery) AllX(ctx context.Context) []*Collar
AllX is like All, but panics if an error occurs.
func (*CollarQuery) Clone ¶
func (cq *CollarQuery) Clone() *CollarQuery
Clone returns a duplicate of the CollarQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CollarQuery) Count ¶
func (cq *CollarQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CollarQuery) CountX ¶
func (cq *CollarQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CollarQuery) Exist ¶
func (cq *CollarQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CollarQuery) ExistX ¶
func (cq *CollarQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CollarQuery) First ¶
func (cq *CollarQuery) First(ctx context.Context) (*Collar, error)
First returns the first Collar entity from the query. Returns a *NotFoundError when no Collar was found.
func (*CollarQuery) FirstID ¶
func (cq *CollarQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Collar ID from the query. Returns a *NotFoundError when no Collar ID was found.
func (*CollarQuery) FirstIDX ¶
func (cq *CollarQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CollarQuery) FirstX ¶
func (cq *CollarQuery) FirstX(ctx context.Context) *Collar
FirstX is like First, but panics if an error occurs.
func (*CollarQuery) GroupBy ¶
func (cq *CollarQuery) GroupBy(field string, fields ...string) *CollarGroupBy
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 collar.Color `json:"color,omitempty"` Count int `json:"count,omitempty"` } client.Collar.Query(). GroupBy(collar.FieldColor). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CollarQuery) IDs ¶
func (cq *CollarQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Collar IDs.
func (*CollarQuery) IDsX ¶
func (cq *CollarQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CollarQuery) Limit ¶
func (cq *CollarQuery) Limit(limit int) *CollarQuery
Limit adds a limit step to the query.
func (*CollarQuery) Offset ¶
func (cq *CollarQuery) Offset(offset int) *CollarQuery
Offset adds an offset step to the query.
func (*CollarQuery) Only ¶
func (cq *CollarQuery) Only(ctx context.Context) (*Collar, error)
Only returns a single Collar entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Collar entity is not found. Returns a *NotFoundError when no Collar entities are found.
func (*CollarQuery) OnlyID ¶
func (cq *CollarQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Collar ID in the query. Returns a *NotSingularError when exactly one Collar ID is not found. Returns a *NotFoundError when no entities are found.
func (*CollarQuery) OnlyIDX ¶
func (cq *CollarQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CollarQuery) OnlyX ¶
func (cq *CollarQuery) OnlyX(ctx context.Context) *Collar
OnlyX is like Only, but panics if an error occurs.
func (*CollarQuery) Order ¶
func (cq *CollarQuery) Order(o ...OrderFunc) *CollarQuery
Order adds an order step to the query.
func (*CollarQuery) QueryPet ¶
func (cq *CollarQuery) QueryPet() *PetQuery
QueryPet chains the current query on the "pet" edge.
func (*CollarQuery) Select ¶
func (cq *CollarQuery) Select(fields ...string) *CollarSelect
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 collar.Color `json:"color,omitempty"` } client.Collar.Query(). Select(collar.FieldColor). Scan(ctx, &v)
func (*CollarQuery) Unique ¶
func (cq *CollarQuery) Unique(unique bool) *CollarQuery
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 (*CollarQuery) Where ¶
func (cq *CollarQuery) Where(ps ...predicate.Collar) *CollarQuery
Where adds a new predicate for the CollarQuery builder.
func (*CollarQuery) WithPet ¶
func (cq *CollarQuery) WithPet(opts ...func(*PetQuery)) *CollarQuery
WithPet tells the query-builder to eager-load the nodes that are connected to the "pet" edge. The optional arguments are used to configure the query builder of the edge.
type CollarSelect ¶
type CollarSelect struct { *CollarQuery // contains filtered or unexported fields }
CollarSelect is the builder for selecting fields of Collar entities.
func (*CollarSelect) Bool ¶
func (cs *CollarSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CollarSelect) BoolX ¶
func (cs *CollarSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CollarSelect) Bools ¶
func (cs *CollarSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CollarSelect) BoolsX ¶
func (cs *CollarSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CollarSelect) Float64 ¶
func (cs *CollarSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CollarSelect) Float64X ¶
func (cs *CollarSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CollarSelect) Float64s ¶
func (cs *CollarSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CollarSelect) Float64sX ¶
func (cs *CollarSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CollarSelect) Int ¶
func (cs *CollarSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CollarSelect) IntX ¶
func (cs *CollarSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CollarSelect) Ints ¶
func (cs *CollarSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CollarSelect) IntsX ¶
func (cs *CollarSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CollarSelect) Scan ¶
func (cs *CollarSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*CollarSelect) ScanX ¶
func (cs *CollarSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CollarSelect) String ¶
func (cs *CollarSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*CollarSelect) StringX ¶
func (cs *CollarSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CollarUpdate ¶
type CollarUpdate struct {
// contains filtered or unexported fields
}
CollarUpdate is the builder for updating Collar entities.
func (*CollarUpdate) ClearPet ¶
func (cu *CollarUpdate) ClearPet() *CollarUpdate
ClearPet clears the "pet" edge to the Pet entity.
func (*CollarUpdate) Exec ¶
func (cu *CollarUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CollarUpdate) ExecX ¶
func (cu *CollarUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CollarUpdate) Mutation ¶
func (cu *CollarUpdate) Mutation() *CollarMutation
Mutation returns the CollarMutation object of the builder.
func (*CollarUpdate) Save ¶
func (cu *CollarUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CollarUpdate) SaveX ¶
func (cu *CollarUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CollarUpdate) SetColor ¶
func (cu *CollarUpdate) SetColor(c collar.Color) *CollarUpdate
SetColor sets the "color" field.
func (*CollarUpdate) SetNillablePetID ¶
func (cu *CollarUpdate) SetNillablePetID(id *string) *CollarUpdate
SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.
func (*CollarUpdate) SetPet ¶
func (cu *CollarUpdate) SetPet(p *Pet) *CollarUpdate
SetPet sets the "pet" edge to the Pet entity.
func (*CollarUpdate) SetPetID ¶
func (cu *CollarUpdate) SetPetID(id string) *CollarUpdate
SetPetID sets the "pet" edge to the Pet entity by ID.
func (*CollarUpdate) Where ¶
func (cu *CollarUpdate) Where(ps ...predicate.Collar) *CollarUpdate
Where appends a list predicates to the CollarUpdate builder.
type CollarUpdateOne ¶
type CollarUpdateOne struct {
// contains filtered or unexported fields
}
CollarUpdateOne is the builder for updating a single Collar entity.
func (*CollarUpdateOne) ClearPet ¶
func (cuo *CollarUpdateOne) ClearPet() *CollarUpdateOne
ClearPet clears the "pet" edge to the Pet entity.
func (*CollarUpdateOne) Exec ¶
func (cuo *CollarUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CollarUpdateOne) ExecX ¶
func (cuo *CollarUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CollarUpdateOne) Mutation ¶
func (cuo *CollarUpdateOne) Mutation() *CollarMutation
Mutation returns the CollarMutation object of the builder.
func (*CollarUpdateOne) Save ¶
func (cuo *CollarUpdateOne) Save(ctx context.Context) (*Collar, error)
Save executes the query and returns the updated Collar entity.
func (*CollarUpdateOne) SaveX ¶
func (cuo *CollarUpdateOne) SaveX(ctx context.Context) *Collar
SaveX is like Save, but panics if an error occurs.
func (*CollarUpdateOne) Select ¶
func (cuo *CollarUpdateOne) Select(field string, fields ...string) *CollarUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CollarUpdateOne) SetColor ¶
func (cuo *CollarUpdateOne) SetColor(c collar.Color) *CollarUpdateOne
SetColor sets the "color" field.
func (*CollarUpdateOne) SetNillablePetID ¶
func (cuo *CollarUpdateOne) SetNillablePetID(id *string) *CollarUpdateOne
SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.
func (*CollarUpdateOne) SetPet ¶
func (cuo *CollarUpdateOne) SetPet(p *Pet) *CollarUpdateOne
SetPet sets the "pet" edge to the Pet entity.
func (*CollarUpdateOne) SetPetID ¶
func (cuo *CollarUpdateOne) SetPetID(id string) *CollarUpdateOne
SetPetID sets the "pet" edge to the Pet entity by ID.
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 Owner ¶
type Owner struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OwnerQuery when eager-loading is set. Edges OwnerEdges `json:"edges"` // contains filtered or unexported fields }
Owner is the model entity for the Owner schema.
func (*Owner) Unwrap ¶
Unwrap unwraps the Owner 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 (*Owner) Update ¶
func (o *Owner) Update() *OwnerUpdateOne
Update returns a builder for updating this Owner. Note that you need to call Owner.Unwrap() before calling this method if this Owner was returned from a transaction, and the transaction was committed or rolled back.
type OwnerClient ¶
type OwnerClient struct {
// contains filtered or unexported fields
}
OwnerClient is a client for the Owner schema.
func NewOwnerClient ¶
func NewOwnerClient(c config) *OwnerClient
NewOwnerClient returns a client for the Owner from the given config.
func (*OwnerClient) Create ¶
func (c *OwnerClient) Create() *OwnerCreate
Create returns a create builder for Owner.
func (*OwnerClient) CreateBulk ¶
func (c *OwnerClient) CreateBulk(builders ...*OwnerCreate) *OwnerCreateBulk
CreateBulk returns a builder for creating a bulk of Owner entities.
func (*OwnerClient) Delete ¶
func (c *OwnerClient) Delete() *OwnerDelete
Delete returns a delete builder for Owner.
func (*OwnerClient) DeleteOne ¶
func (c *OwnerClient) DeleteOne(o *Owner) *OwnerDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*OwnerClient) DeleteOneID ¶
func (c *OwnerClient) DeleteOneID(id uuid.UUID) *OwnerDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*OwnerClient) Query ¶
func (c *OwnerClient) Query() *OwnerQuery
Query returns a query builder for Owner.
func (*OwnerClient) QueryPets ¶
func (c *OwnerClient) QueryPets(o *Owner) *PetQuery
QueryPets queries the pets edge of a Owner.
func (*OwnerClient) Update ¶
func (c *OwnerClient) Update() *OwnerUpdate
Update returns an update builder for Owner.
func (*OwnerClient) UpdateOne ¶
func (c *OwnerClient) UpdateOne(o *Owner) *OwnerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OwnerClient) UpdateOneID ¶
func (c *OwnerClient) UpdateOneID(id uuid.UUID) *OwnerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OwnerClient) Use ¶
func (c *OwnerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `owner.Hooks(f(g(h())))`.
type OwnerCreate ¶
type OwnerCreate struct {
// contains filtered or unexported fields
}
OwnerCreate is the builder for creating a Owner entity.
func (*OwnerCreate) AddPetIDs ¶
func (oc *OwnerCreate) AddPetIDs(ids ...string) *OwnerCreate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*OwnerCreate) AddPets ¶
func (oc *OwnerCreate) AddPets(p ...*Pet) *OwnerCreate
AddPets adds the "pets" edges to the Pet entity.
func (*OwnerCreate) Exec ¶
func (oc *OwnerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OwnerCreate) ExecX ¶
func (oc *OwnerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OwnerCreate) Mutation ¶
func (oc *OwnerCreate) Mutation() *OwnerMutation
Mutation returns the OwnerMutation object of the builder.
func (*OwnerCreate) Save ¶
func (oc *OwnerCreate) Save(ctx context.Context) (*Owner, error)
Save creates the Owner in the database.
func (*OwnerCreate) SaveX ¶
func (oc *OwnerCreate) SaveX(ctx context.Context) *Owner
SaveX calls Save and panics if Save returns an error.
func (*OwnerCreate) SetAge ¶
func (oc *OwnerCreate) SetAge(i int) *OwnerCreate
SetAge sets the "age" field.
func (*OwnerCreate) SetID ¶
func (oc *OwnerCreate) SetID(u uuid.UUID) *OwnerCreate
SetID sets the "id" field.
func (*OwnerCreate) SetName ¶
func (oc *OwnerCreate) SetName(s string) *OwnerCreate
SetName sets the "name" field.
type OwnerCreateBulk ¶
type OwnerCreateBulk struct {
// contains filtered or unexported fields
}
OwnerCreateBulk is the builder for creating many Owner entities in bulk.
func (*OwnerCreateBulk) Exec ¶
func (ocb *OwnerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OwnerCreateBulk) ExecX ¶
func (ocb *OwnerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type OwnerDelete ¶
type OwnerDelete struct {
// contains filtered or unexported fields
}
OwnerDelete is the builder for deleting a Owner entity.
func (*OwnerDelete) Exec ¶
func (od *OwnerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OwnerDelete) ExecX ¶
func (od *OwnerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OwnerDelete) Where ¶
func (od *OwnerDelete) Where(ps ...predicate.Owner) *OwnerDelete
Where appends a list predicates to the OwnerDelete builder.
type OwnerDeleteOne ¶
type OwnerDeleteOne struct {
// contains filtered or unexported fields
}
OwnerDeleteOne is the builder for deleting a single Owner entity.
func (*OwnerDeleteOne) Exec ¶
func (odo *OwnerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OwnerDeleteOne) ExecX ¶
func (odo *OwnerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type OwnerEdges ¶
type OwnerEdges struct { // Pets holds the value of the pets edge. Pets []*Pet `json:"pets,omitempty"` // contains filtered or unexported fields }
OwnerEdges holds the relations/edges for other nodes in the graph.
func (OwnerEdges) PetsOrErr ¶
func (e OwnerEdges) PetsOrErr() ([]*Pet, error)
PetsOrErr returns the Pets value or an error if the edge was not loaded in eager-loading.
type OwnerGroupBy ¶
type OwnerGroupBy struct {
// contains filtered or unexported fields
}
OwnerGroupBy is the group-by builder for Owner entities.
func (*OwnerGroupBy) Aggregate ¶
func (ogb *OwnerGroupBy) Aggregate(fns ...AggregateFunc) *OwnerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OwnerGroupBy) Bool ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) BoolX ¶
func (ogb *OwnerGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*OwnerGroupBy) Bools ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) BoolsX ¶
func (ogb *OwnerGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*OwnerGroupBy) Float64 ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) Float64X ¶
func (ogb *OwnerGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*OwnerGroupBy) Float64s ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) Float64sX ¶
func (ogb *OwnerGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*OwnerGroupBy) Int ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) IntX ¶
func (ogb *OwnerGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*OwnerGroupBy) Ints ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) IntsX ¶
func (ogb *OwnerGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*OwnerGroupBy) Scan ¶
func (ogb *OwnerGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*OwnerGroupBy) ScanX ¶
func (ogb *OwnerGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*OwnerGroupBy) String ¶
func (ogb *OwnerGroupBy) 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 (*OwnerGroupBy) StringX ¶
func (ogb *OwnerGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type OwnerMutation ¶
type OwnerMutation struct {
// contains filtered or unexported fields
}
OwnerMutation represents an operation that mutates the Owner nodes in the graph.
func (*OwnerMutation) AddAge ¶
func (m *OwnerMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*OwnerMutation) AddField ¶
func (m *OwnerMutation) 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 (*OwnerMutation) AddPetIDs ¶
func (m *OwnerMutation) AddPetIDs(ids ...string)
AddPetIDs adds the "pets" edge to the Pet entity by ids.
func (*OwnerMutation) AddedAge ¶
func (m *OwnerMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*OwnerMutation) AddedEdges ¶
func (m *OwnerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OwnerMutation) AddedField ¶
func (m *OwnerMutation) 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 (*OwnerMutation) AddedFields ¶
func (m *OwnerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OwnerMutation) AddedIDs ¶
func (m *OwnerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OwnerMutation) Age ¶
func (m *OwnerMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*OwnerMutation) ClearEdge ¶
func (m *OwnerMutation) 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 (*OwnerMutation) ClearField ¶
func (m *OwnerMutation) 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 (*OwnerMutation) ClearPets ¶
func (m *OwnerMutation) ClearPets()
ClearPets clears the "pets" edge to the Pet entity.
func (*OwnerMutation) ClearedEdges ¶
func (m *OwnerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OwnerMutation) ClearedFields ¶
func (m *OwnerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OwnerMutation) Client ¶
func (m OwnerMutation) 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 (*OwnerMutation) EdgeCleared ¶
func (m *OwnerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OwnerMutation) Field ¶
func (m *OwnerMutation) 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 (*OwnerMutation) FieldCleared ¶
func (m *OwnerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OwnerMutation) Fields ¶
func (m *OwnerMutation) 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 (*OwnerMutation) ID ¶
func (m *OwnerMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*OwnerMutation) Name ¶
func (m *OwnerMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*OwnerMutation) OldAge ¶
func (m *OwnerMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the Owner entity. If the Owner 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 (*OwnerMutation) 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 (*OwnerMutation) OldName ¶
func (m *OwnerMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Owner entity. If the Owner 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 (*OwnerMutation) PetsCleared ¶
func (m *OwnerMutation) PetsCleared() bool
PetsCleared reports if the "pets" edge to the Pet entity was cleared.
func (*OwnerMutation) PetsIDs ¶
func (m *OwnerMutation) PetsIDs() (ids []string)
PetsIDs returns the "pets" edge IDs in the mutation.
func (*OwnerMutation) RemovePetIDs ¶
func (m *OwnerMutation) RemovePetIDs(ids ...string)
RemovePetIDs removes the "pets" edge to the Pet entity by IDs.
func (*OwnerMutation) RemovedEdges ¶
func (m *OwnerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OwnerMutation) RemovedIDs ¶
func (m *OwnerMutation) 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 (*OwnerMutation) RemovedPetsIDs ¶
func (m *OwnerMutation) RemovedPetsIDs() (ids []string)
RemovedPets returns the removed IDs of the "pets" edge to the Pet entity.
func (*OwnerMutation) ResetAge ¶
func (m *OwnerMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*OwnerMutation) ResetEdge ¶
func (m *OwnerMutation) 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 (*OwnerMutation) ResetField ¶
func (m *OwnerMutation) 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 (*OwnerMutation) ResetName ¶
func (m *OwnerMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*OwnerMutation) ResetPets ¶
func (m *OwnerMutation) ResetPets()
ResetPets resets all changes to the "pets" edge.
func (*OwnerMutation) SetField ¶
func (m *OwnerMutation) 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 (*OwnerMutation) SetID ¶
func (m *OwnerMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Owner entities.
func (*OwnerMutation) SetName ¶
func (m *OwnerMutation) SetName(s string)
SetName sets the "name" field.
func (OwnerMutation) Tx ¶
func (m OwnerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OwnerMutation) Type ¶
func (m *OwnerMutation) Type() string
Type returns the node type of this mutation (Owner).
func (*OwnerMutation) Where ¶
func (m *OwnerMutation) Where(ps ...predicate.Owner)
Where appends a list predicates to the OwnerMutation builder.
type OwnerQuery ¶
type OwnerQuery struct {
// contains filtered or unexported fields
}
OwnerQuery is the builder for querying Owner entities.
func (*OwnerQuery) All ¶
func (oq *OwnerQuery) All(ctx context.Context) ([]*Owner, error)
All executes the query and returns a list of Owners.
func (*OwnerQuery) AllX ¶
func (oq *OwnerQuery) AllX(ctx context.Context) []*Owner
AllX is like All, but panics if an error occurs.
func (*OwnerQuery) Clone ¶
func (oq *OwnerQuery) Clone() *OwnerQuery
Clone returns a duplicate of the OwnerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OwnerQuery) Count ¶
func (oq *OwnerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OwnerQuery) CountX ¶
func (oq *OwnerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OwnerQuery) Exist ¶
func (oq *OwnerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OwnerQuery) ExistX ¶
func (oq *OwnerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OwnerQuery) First ¶
func (oq *OwnerQuery) First(ctx context.Context) (*Owner, error)
First returns the first Owner entity from the query. Returns a *NotFoundError when no Owner was found.
func (*OwnerQuery) FirstID ¶
FirstID returns the first Owner ID from the query. Returns a *NotFoundError when no Owner ID was found.
func (*OwnerQuery) FirstIDX ¶
func (oq *OwnerQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*OwnerQuery) FirstX ¶
func (oq *OwnerQuery) FirstX(ctx context.Context) *Owner
FirstX is like First, but panics if an error occurs.
func (*OwnerQuery) GroupBy ¶
func (oq *OwnerQuery) GroupBy(field string, fields ...string) *OwnerGroupBy
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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Owner.Query(). GroupBy(owner.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OwnerQuery) IDsX ¶
func (oq *OwnerQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*OwnerQuery) Limit ¶
func (oq *OwnerQuery) Limit(limit int) *OwnerQuery
Limit adds a limit step to the query.
func (*OwnerQuery) Offset ¶
func (oq *OwnerQuery) Offset(offset int) *OwnerQuery
Offset adds an offset step to the query.
func (*OwnerQuery) Only ¶
func (oq *OwnerQuery) Only(ctx context.Context) (*Owner, error)
Only returns a single Owner entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Owner entity is not found. Returns a *NotFoundError when no Owner entities are found.
func (*OwnerQuery) OnlyID ¶
OnlyID is like Only, but returns the only Owner ID in the query. Returns a *NotSingularError when exactly one Owner ID is not found. Returns a *NotFoundError when no entities are found.
func (*OwnerQuery) OnlyIDX ¶
func (oq *OwnerQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OwnerQuery) OnlyX ¶
func (oq *OwnerQuery) OnlyX(ctx context.Context) *Owner
OnlyX is like Only, but panics if an error occurs.
func (*OwnerQuery) Order ¶
func (oq *OwnerQuery) Order(o ...OrderFunc) *OwnerQuery
Order adds an order step to the query.
func (*OwnerQuery) QueryPets ¶
func (oq *OwnerQuery) QueryPets() *PetQuery
QueryPets chains the current query on the "pets" edge.
func (*OwnerQuery) Select ¶
func (oq *OwnerQuery) Select(fields ...string) *OwnerSelect
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 { Name string `json:"name,omitempty"` } client.Owner.Query(). Select(owner.FieldName). Scan(ctx, &v)
func (*OwnerQuery) Unique ¶
func (oq *OwnerQuery) Unique(unique bool) *OwnerQuery
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 (*OwnerQuery) Where ¶
func (oq *OwnerQuery) Where(ps ...predicate.Owner) *OwnerQuery
Where adds a new predicate for the OwnerQuery builder.
func (*OwnerQuery) WithPets ¶
func (oq *OwnerQuery) WithPets(opts ...func(*PetQuery)) *OwnerQuery
WithPets tells the query-builder to eager-load the nodes that are connected to the "pets" edge. The optional arguments are used to configure the query builder of the edge.
type OwnerSelect ¶
type OwnerSelect struct { *OwnerQuery // contains filtered or unexported fields }
OwnerSelect is the builder for selecting fields of Owner entities.
func (*OwnerSelect) Bool ¶
func (os *OwnerSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) BoolX ¶
func (os *OwnerSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*OwnerSelect) Bools ¶
func (os *OwnerSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) BoolsX ¶
func (os *OwnerSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*OwnerSelect) Float64 ¶
func (os *OwnerSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) Float64X ¶
func (os *OwnerSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*OwnerSelect) Float64s ¶
func (os *OwnerSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) Float64sX ¶
func (os *OwnerSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*OwnerSelect) Int ¶
func (os *OwnerSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) IntX ¶
func (os *OwnerSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*OwnerSelect) Ints ¶
func (os *OwnerSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) IntsX ¶
func (os *OwnerSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*OwnerSelect) Scan ¶
func (os *OwnerSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*OwnerSelect) ScanX ¶
func (os *OwnerSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*OwnerSelect) String ¶
func (os *OwnerSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*OwnerSelect) StringX ¶
func (os *OwnerSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type OwnerUpdate ¶
type OwnerUpdate struct {
// contains filtered or unexported fields
}
OwnerUpdate is the builder for updating Owner entities.
func (*OwnerUpdate) AddAge ¶
func (ou *OwnerUpdate) AddAge(i int) *OwnerUpdate
AddAge adds i to the "age" field.
func (*OwnerUpdate) AddPetIDs ¶
func (ou *OwnerUpdate) AddPetIDs(ids ...string) *OwnerUpdate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*OwnerUpdate) AddPets ¶
func (ou *OwnerUpdate) AddPets(p ...*Pet) *OwnerUpdate
AddPets adds the "pets" edges to the Pet entity.
func (*OwnerUpdate) ClearPets ¶
func (ou *OwnerUpdate) ClearPets() *OwnerUpdate
ClearPets clears all "pets" edges to the Pet entity.
func (*OwnerUpdate) Exec ¶
func (ou *OwnerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OwnerUpdate) ExecX ¶
func (ou *OwnerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OwnerUpdate) Mutation ¶
func (ou *OwnerUpdate) Mutation() *OwnerMutation
Mutation returns the OwnerMutation object of the builder.
func (*OwnerUpdate) RemovePetIDs ¶
func (ou *OwnerUpdate) RemovePetIDs(ids ...string) *OwnerUpdate
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*OwnerUpdate) RemovePets ¶
func (ou *OwnerUpdate) RemovePets(p ...*Pet) *OwnerUpdate
RemovePets removes "pets" edges to Pet entities.
func (*OwnerUpdate) Save ¶
func (ou *OwnerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OwnerUpdate) SaveX ¶
func (ou *OwnerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OwnerUpdate) SetAge ¶
func (ou *OwnerUpdate) SetAge(i int) *OwnerUpdate
SetAge sets the "age" field.
func (*OwnerUpdate) SetName ¶
func (ou *OwnerUpdate) SetName(s string) *OwnerUpdate
SetName sets the "name" field.
func (*OwnerUpdate) Where ¶
func (ou *OwnerUpdate) Where(ps ...predicate.Owner) *OwnerUpdate
Where appends a list predicates to the OwnerUpdate builder.
type OwnerUpdateOne ¶
type OwnerUpdateOne struct {
// contains filtered or unexported fields
}
OwnerUpdateOne is the builder for updating a single Owner entity.
func (*OwnerUpdateOne) AddAge ¶
func (ouo *OwnerUpdateOne) AddAge(i int) *OwnerUpdateOne
AddAge adds i to the "age" field.
func (*OwnerUpdateOne) AddPetIDs ¶
func (ouo *OwnerUpdateOne) AddPetIDs(ids ...string) *OwnerUpdateOne
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*OwnerUpdateOne) AddPets ¶
func (ouo *OwnerUpdateOne) AddPets(p ...*Pet) *OwnerUpdateOne
AddPets adds the "pets" edges to the Pet entity.
func (*OwnerUpdateOne) ClearPets ¶
func (ouo *OwnerUpdateOne) ClearPets() *OwnerUpdateOne
ClearPets clears all "pets" edges to the Pet entity.
func (*OwnerUpdateOne) Exec ¶
func (ouo *OwnerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OwnerUpdateOne) ExecX ¶
func (ouo *OwnerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OwnerUpdateOne) Mutation ¶
func (ouo *OwnerUpdateOne) Mutation() *OwnerMutation
Mutation returns the OwnerMutation object of the builder.
func (*OwnerUpdateOne) RemovePetIDs ¶
func (ouo *OwnerUpdateOne) RemovePetIDs(ids ...string) *OwnerUpdateOne
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*OwnerUpdateOne) RemovePets ¶
func (ouo *OwnerUpdateOne) RemovePets(p ...*Pet) *OwnerUpdateOne
RemovePets removes "pets" edges to Pet entities.
func (*OwnerUpdateOne) Save ¶
func (ouo *OwnerUpdateOne) Save(ctx context.Context) (*Owner, error)
Save executes the query and returns the updated Owner entity.
func (*OwnerUpdateOne) SaveX ¶
func (ouo *OwnerUpdateOne) SaveX(ctx context.Context) *Owner
SaveX is like Save, but panics if an error occurs.
func (*OwnerUpdateOne) Select ¶
func (ouo *OwnerUpdateOne) Select(field string, fields ...string) *OwnerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OwnerUpdateOne) SetAge ¶
func (ouo *OwnerUpdateOne) SetAge(i int) *OwnerUpdateOne
SetAge sets the "age" field.
func (*OwnerUpdateOne) SetName ¶
func (ouo *OwnerUpdateOne) SetName(s string) *OwnerUpdateOne
SetName sets the "name" field.
type Pet ¶
type Pet struct { // ID of the ent. ID string `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,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) QueryCategories ¶
func (pe *Pet) QueryCategories() *CategoryQuery
QueryCategories queries the "categories" edge of the Pet entity.
func (*Pet) QueryCollar ¶
func (pe *Pet) QueryCollar() *CollarQuery
QueryCollar queries the "collar" edge of the Pet entity.
func (*Pet) QueryFriends ¶
QueryFriends queries the "friends" edge of the Pet entity.
func (*Pet) QueryOwner ¶
func (pe *Pet) QueryOwner() *OwnerQuery
QueryOwner queries the "owner" 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 string) *PetDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PetClient) QueryCategories ¶
func (c *PetClient) QueryCategories(pe *Pet) *CategoryQuery
QueryCategories queries the categories edge of a Pet.
func (*PetClient) QueryCollar ¶
func (c *PetClient) QueryCollar(pe *Pet) *CollarQuery
QueryCollar queries the collar edge of a Pet.
func (*PetClient) QueryFriends ¶
QueryFriends queries the friends edge of a Pet.
func (*PetClient) QueryOwner ¶
func (c *PetClient) QueryOwner(pe *Pet) *OwnerQuery
QueryOwner queries the owner 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 string) *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) AddCategories ¶
AddCategories adds the "categories" edges to the Category entity.
func (*PetCreate) AddCategoryIDs ¶
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
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) Mutation ¶
func (pc *PetCreate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetCreate) SetCollarID ¶
SetCollarID sets the "collar" edge to the Collar entity by ID.
func (*PetCreate) SetNillableCollarID ¶
SetNillableCollarID sets the "collar" edge to the Collar entity by ID if the given value is not nil.
func (*PetCreate) SetNillableID ¶
SetNillableID sets the "id" field if the given value is not nil.
func (*PetCreate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the Owner entity by ID if the given value is not nil.
type PetCreateBulk ¶
type PetCreateBulk struct {
// contains filtered or unexported fields
}
PetCreateBulk is the builder for creating many Pet entities in bulk.
func (*PetCreateBulk) Exec ¶
func (pcb *PetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PetCreateBulk) ExecX ¶
func (pcb *PetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetDelete ¶
type PetDelete struct {
// contains filtered or unexported fields
}
PetDelete is the builder for deleting a Pet entity.
func (*PetDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type PetDeleteOne ¶
type PetDeleteOne struct {
// contains filtered or unexported fields
}
PetDeleteOne is the builder for deleting a single Pet entity.
func (*PetDeleteOne) Exec ¶
func (pdo *PetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PetDeleteOne) ExecX ¶
func (pdo *PetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetEdges ¶
type PetEdges struct { // Collar holds the value of the collar edge. Collar *Collar `json:"collar,omitempty"` // Categories holds the value of the categories edge. Categories []*Category `json:"categories,omitempty"` // Owner holds the value of the owner edge. Owner *Owner `json:"owner,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) CategoriesOrErr ¶
CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading.
func (PetEdges) CollarOrErr ¶
CollarOrErr returns the Collar value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PetEdges) FriendsOrErr ¶
FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.
func (PetEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type 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) AddCategoryIDs ¶
func (m *PetMutation) AddCategoryIDs(ids ...uint64)
AddCategoryIDs adds the "categories" edge to the Category 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 ...string)
AddFriendIDs adds the "friends" edge to the Pet entity by ids.
func (*PetMutation) AddedAge ¶
func (m *PetMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
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) 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) Age ¶
func (m *PetMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*PetMutation) CategoriesCleared ¶
func (m *PetMutation) CategoriesCleared() bool
CategoriesCleared reports if the "categories" edge to the Category entity was cleared.
func (*PetMutation) CategoriesIDs ¶
func (m *PetMutation) CategoriesIDs() (ids []uint64)
CategoriesIDs returns the "categories" edge IDs in the mutation.
func (*PetMutation) ClearCategories ¶
func (m *PetMutation) ClearCategories()
ClearCategories clears the "categories" edge to the Category entity.
func (*PetMutation) ClearCollar ¶
func (m *PetMutation) ClearCollar()
ClearCollar clears the "collar" edge to the Collar 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) ClearOwner ¶
func (m *PetMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Owner entity.
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) CollarCleared ¶
func (m *PetMutation) CollarCleared() bool
CollarCleared reports if the "collar" edge to the Collar entity was cleared.
func (*PetMutation) CollarID ¶
func (m *PetMutation) CollarID() (id int, exists bool)
CollarID returns the "collar" edge ID in the mutation.
func (*PetMutation) CollarIDs ¶
func (m *PetMutation) CollarIDs() (ids []int)
CollarIDs returns the "collar" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CollarID instead. It exists only for internal usage by the builders.
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 []string)
FriendsIDs returns the "friends" edge IDs in the mutation.
func (*PetMutation) ID ¶
func (m *PetMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PetMutation) Name ¶
func (m *PetMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PetMutation) OldAge ¶
func (m *PetMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" 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) 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) OwnerCleared ¶
func (m *PetMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Owner entity was cleared.
func (*PetMutation) OwnerID ¶
func (m *PetMutation) OwnerID() (id uuid.UUID, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*PetMutation) OwnerIDs ¶
func (m *PetMutation) OwnerIDs() (ids []uuid.UUID)
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 (*PetMutation) RemoveCategoryIDs ¶
func (m *PetMutation) RemoveCategoryIDs(ids ...uint64)
RemoveCategoryIDs removes the "categories" edge to the Category entity by IDs.
func (*PetMutation) RemoveFriendIDs ¶
func (m *PetMutation) RemoveFriendIDs(ids ...string)
RemoveFriendIDs removes the "friends" edge to the Pet entity by IDs.
func (*PetMutation) RemovedCategoriesIDs ¶
func (m *PetMutation) RemovedCategoriesIDs() (ids []uint64)
RemovedCategories returns the removed IDs of the "categories" edge to the Category 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 []string)
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) ResetAge ¶
func (m *PetMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*PetMutation) ResetCategories ¶
func (m *PetMutation) ResetCategories()
ResetCategories resets all changes to the "categories" edge.
func (*PetMutation) ResetCollar ¶
func (m *PetMutation) ResetCollar()
ResetCollar resets all changes to the "collar" edge.
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) ResetName ¶
func (m *PetMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PetMutation) ResetOwner ¶
func (m *PetMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*PetMutation) SetCollarID ¶
func (m *PetMutation) SetCollarID(id int)
SetCollarID sets the "collar" edge to the Collar entity by id.
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) SetID ¶
func (m *PetMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Pet entities.
func (*PetMutation) SetName ¶
func (m *PetMutation) SetName(s string)
SetName sets the "name" field.
func (*PetMutation) SetOwnerID ¶
func (m *PetMutation) SetOwnerID(id uuid.UUID)
SetOwnerID sets the "owner" edge to the Owner entity by id.
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) 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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Pet.Query(). GroupBy(pet.FieldName). 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) QueryCategories ¶
func (pq *PetQuery) QueryCategories() *CategoryQuery
QueryCategories chains the current query on the "categories" edge.
func (*PetQuery) QueryCollar ¶
func (pq *PetQuery) QueryCollar() *CollarQuery
QueryCollar chains the current query on the "collar" edge.
func (*PetQuery) QueryFriends ¶
QueryFriends chains the current query on the "friends" edge.
func (*PetQuery) QueryOwner ¶
func (pq *PetQuery) QueryOwner() *OwnerQuery
QueryOwner chains the current query on the "owner" 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 { Name string `json:"name,omitempty"` } client.Pet.Query(). Select(pet.FieldName). 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) WithCategories ¶
func (pq *PetQuery) WithCategories(opts ...func(*CategoryQuery)) *PetQuery
WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithCollar ¶
func (pq *PetQuery) WithCollar(opts ...func(*CollarQuery)) *PetQuery
WithCollar tells the query-builder to eager-load the nodes that are connected to the "collar" 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) WithOwner ¶
func (pq *PetQuery) WithOwner(opts ...func(*OwnerQuery)) *PetQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" 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) AddCategories ¶
AddCategories adds the "categories" edges to the Category entity.
func (*PetUpdate) AddCategoryIDs ¶
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
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) ClearCategories ¶
ClearCategories clears all "categories" edges to the Category entity.
func (*PetUpdate) ClearCollar ¶
ClearCollar clears the "collar" edge to the Collar entity.
func (*PetUpdate) ClearFriends ¶
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdate) ClearOwner ¶
ClearOwner clears the "owner" edge to the Owner entity.
func (*PetUpdate) Mutation ¶
func (pu *PetUpdate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdate) RemoveCategories ¶
RemoveCategories removes "categories" edges to Category entities.
func (*PetUpdate) RemoveCategoryIDs ¶
RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.
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) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*PetUpdate) SetCollarID ¶
SetCollarID sets the "collar" edge to the Collar entity by ID.
func (*PetUpdate) SetNillableCollarID ¶
SetNillableCollarID sets the "collar" edge to the Collar entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the Owner entity by ID if the given value is not nil.
func (*PetUpdate) SetOwnerID ¶
SetOwnerID sets the "owner" edge to the Owner 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) AddAge ¶
func (puo *PetUpdateOne) AddAge(i int) *PetUpdateOne
AddAge adds i to the "age" field.
func (*PetUpdateOne) AddCategories ¶
func (puo *PetUpdateOne) AddCategories(c ...*Category) *PetUpdateOne
AddCategories adds the "categories" edges to the Category entity.
func (*PetUpdateOne) AddCategoryIDs ¶
func (puo *PetUpdateOne) AddCategoryIDs(ids ...uint64) *PetUpdateOne
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
func (*PetUpdateOne) AddFriendIDs ¶
func (puo *PetUpdateOne) AddFriendIDs(ids ...string) *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) ClearCategories ¶
func (puo *PetUpdateOne) ClearCategories() *PetUpdateOne
ClearCategories clears all "categories" edges to the Category entity.
func (*PetUpdateOne) ClearCollar ¶
func (puo *PetUpdateOne) ClearCollar() *PetUpdateOne
ClearCollar clears the "collar" edge to the Collar entity.
func (*PetUpdateOne) ClearFriends ¶
func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdateOne) ClearOwner ¶
func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
ClearOwner clears the "owner" edge to the Owner entity.
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) RemoveCategories ¶
func (puo *PetUpdateOne) RemoveCategories(c ...*Category) *PetUpdateOne
RemoveCategories removes "categories" edges to Category entities.
func (*PetUpdateOne) RemoveCategoryIDs ¶
func (puo *PetUpdateOne) RemoveCategoryIDs(ids ...uint64) *PetUpdateOne
RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.
func (*PetUpdateOne) RemoveFriendIDs ¶
func (puo *PetUpdateOne) RemoveFriendIDs(ids ...string) *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) 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) SetAge ¶
func (puo *PetUpdateOne) SetAge(i int) *PetUpdateOne
SetAge sets the "age" field.
func (*PetUpdateOne) SetCollar ¶
func (puo *PetUpdateOne) SetCollar(c *Collar) *PetUpdateOne
SetCollar sets the "collar" edge to the Collar entity.
func (*PetUpdateOne) SetCollarID ¶
func (puo *PetUpdateOne) SetCollarID(id int) *PetUpdateOne
SetCollarID sets the "collar" edge to the Collar entity by ID.
func (*PetUpdateOne) SetName ¶
func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
SetName sets the "name" field.
func (*PetUpdateOne) SetNillableCollarID ¶
func (puo *PetUpdateOne) SetNillableCollarID(id *int) *PetUpdateOne
SetNillableCollarID sets the "collar" edge to the Collar entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableOwnerID ¶
func (puo *PetUpdateOne) SetNillableOwnerID(id *uuid.UUID) *PetUpdateOne
SetNillableOwnerID sets the "owner" edge to the Owner entity by ID if the given value is not nil.
func (*PetUpdateOne) SetOwner ¶
func (puo *PetUpdateOne) SetOwner(o *Owner) *PetUpdateOne
SetOwner sets the "owner" edge to the Owner entity.
func (*PetUpdateOne) SetOwnerID ¶
func (puo *PetUpdateOne) SetOwnerID(id uuid.UUID) *PetUpdateOne
SetOwnerID sets the "owner" edge to the Owner entity by ID.
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 Tx ¶
type Tx struct { // Category is the client for interacting with the Category builders. Category *CategoryClient // Collar is the client for interacting with the Collar builders. Collar *CollarClient // Owner is the client for interacting with the Owner builders. Owner *OwnerClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // 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 ¶
- category.go
- category_create.go
- category_delete.go
- category_query.go
- category_update.go
- client.go
- collar.go
- collar_create.go
- collar_delete.go
- collar_query.go
- collar_update.go
- config.go
- context.go
- ent.go
- generate.go
- mutation.go
- owner.go
- owner_create.go
- owner_delete.go
- owner_query.go
- owner_update.go
- pet.go
- pet_create.go
- pet_delete.go
- pet_query.go
- pet_update.go
- runtime.go
- tx.go