Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Breed
- type BreedClient
- func (c *BreedClient) Create() *BreedCreate
- func (c *BreedClient) CreateBulk(builders ...*BreedCreate) *BreedCreateBulk
- func (c *BreedClient) Delete() *BreedDelete
- func (c *BreedClient) DeleteOne(b *Breed) *BreedDeleteOne
- func (c *BreedClient) DeleteOneID(id uuid.UUID) *BreedDeleteOne
- func (c *BreedClient) Get(ctx context.Context, id uuid.UUID) (*Breed, error)
- func (c *BreedClient) GetX(ctx context.Context, id uuid.UUID) *Breed
- func (c *BreedClient) Hooks() []Hook
- func (c *BreedClient) Intercept(interceptors ...Interceptor)
- func (c *BreedClient) Interceptors() []Interceptor
- func (c *BreedClient) MapCreateBulk(slice any, setFunc func(*BreedCreate, int)) *BreedCreateBulk
- func (c *BreedClient) Query() *BreedQuery
- func (c *BreedClient) QueryCats(b *Breed) *CatQuery
- func (c *BreedClient) Update() *BreedUpdate
- func (c *BreedClient) UpdateOne(b *Breed) *BreedUpdateOne
- func (c *BreedClient) UpdateOneID(id uuid.UUID) *BreedUpdateOne
- func (c *BreedClient) Use(hooks ...Hook)
- type BreedCreate
- func (bc *BreedCreate) AddCatIDs(ids ...uuid.UUID) *BreedCreate
- func (bc *BreedCreate) AddCats(c ...*Cat) *BreedCreate
- func (bc *BreedCreate) Exec(ctx context.Context) error
- func (bc *BreedCreate) ExecX(ctx context.Context)
- func (bc *BreedCreate) Mutation() *BreedMutation
- func (bc *BreedCreate) Save(ctx context.Context) (*Breed, error)
- func (bc *BreedCreate) SaveX(ctx context.Context) *Breed
- func (bc *BreedCreate) SetCreateTime(t time.Time) *BreedCreate
- func (bc *BreedCreate) SetDeletedTime(t time.Time) *BreedCreate
- func (bc *BreedCreate) SetID(u uuid.UUID) *BreedCreate
- func (bc *BreedCreate) SetName(s string) *BreedCreate
- func (bc *BreedCreate) SetNillableCreateTime(t *time.Time) *BreedCreate
- func (bc *BreedCreate) SetNillableDeletedTime(t *time.Time) *BreedCreate
- func (bc *BreedCreate) SetNillableID(u *uuid.UUID) *BreedCreate
- func (bc *BreedCreate) SetNillableUpdateTime(t *time.Time) *BreedCreate
- func (bc *BreedCreate) SetUpdateTime(t time.Time) *BreedCreate
- type BreedCreateBulk
- type BreedDelete
- type BreedDeleteOne
- type BreedEdges
- type BreedGroupBy
- func (bgb *BreedGroupBy) Aggregate(fns ...AggregateFunc) *BreedGroupBy
- func (s *BreedGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BreedGroupBy) BoolX(ctx context.Context) bool
- func (s *BreedGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BreedGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BreedGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BreedGroupBy) Float64X(ctx context.Context) float64
- func (s *BreedGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BreedGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BreedGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BreedGroupBy) IntX(ctx context.Context) int
- func (s *BreedGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BreedGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BreedGroupBy) Scan(ctx context.Context, v any) error
- func (s *BreedGroupBy) ScanX(ctx context.Context, v any)
- func (s *BreedGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BreedGroupBy) StringX(ctx context.Context) string
- func (s *BreedGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BreedGroupBy) StringsX(ctx context.Context) []string
- type BreedMutation
- func (m *BreedMutation) AddCatIDs(ids ...uuid.UUID)
- func (m *BreedMutation) AddField(name string, value ent.Value) error
- func (m *BreedMutation) AddedEdges() []string
- func (m *BreedMutation) AddedField(name string) (ent.Value, bool)
- func (m *BreedMutation) AddedFields() []string
- func (m *BreedMutation) AddedIDs(name string) []ent.Value
- func (m *BreedMutation) CatsCleared() bool
- func (m *BreedMutation) CatsIDs() (ids []uuid.UUID)
- func (m *BreedMutation) ClearCats()
- func (m *BreedMutation) ClearDeletedTime()
- func (m *BreedMutation) ClearEdge(name string) error
- func (m *BreedMutation) ClearField(name string) error
- func (m *BreedMutation) ClearedEdges() []string
- func (m *BreedMutation) ClearedFields() []string
- func (m BreedMutation) Client() *Client
- func (m *BreedMutation) CreateTime() (r time.Time, exists bool)
- func (m *BreedMutation) DeletedTime() (r time.Time, exists bool)
- func (m *BreedMutation) DeletedTimeCleared() bool
- func (m *BreedMutation) EdgeCleared(name string) bool
- func (m *BreedMutation) Field(name string) (ent.Value, bool)
- func (m *BreedMutation) FieldCleared(name string) bool
- func (m *BreedMutation) Fields() []string
- func (m *BreedMutation) ID() (id uuid.UUID, exists bool)
- func (m *BreedMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *BreedMutation) Name() (r string, exists bool)
- func (m *BreedMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *BreedMutation) OldDeletedTime(ctx context.Context) (v *time.Time, err error)
- func (m *BreedMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BreedMutation) OldName(ctx context.Context) (v string, err error)
- func (m *BreedMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *BreedMutation) Op() Op
- func (m *BreedMutation) RemoveCatIDs(ids ...uuid.UUID)
- func (m *BreedMutation) RemovedCatsIDs() (ids []uuid.UUID)
- func (m *BreedMutation) RemovedEdges() []string
- func (m *BreedMutation) RemovedIDs(name string) []ent.Value
- func (m *BreedMutation) ResetCats()
- func (m *BreedMutation) ResetCreateTime()
- func (m *BreedMutation) ResetDeletedTime()
- func (m *BreedMutation) ResetEdge(name string) error
- func (m *BreedMutation) ResetField(name string) error
- func (m *BreedMutation) ResetName()
- func (m *BreedMutation) ResetUpdateTime()
- func (m *BreedMutation) SetCreateTime(t time.Time)
- func (m *BreedMutation) SetDeletedTime(t time.Time)
- func (m *BreedMutation) SetField(name string, value ent.Value) error
- func (m *BreedMutation) SetID(id uuid.UUID)
- func (m *BreedMutation) SetName(s string)
- func (m *BreedMutation) SetOp(op Op)
- func (m *BreedMutation) SetUpdateTime(t time.Time)
- func (m BreedMutation) Tx() (*Tx, error)
- func (m *BreedMutation) Type() string
- func (m *BreedMutation) UpdateTime() (r time.Time, exists bool)
- func (m *BreedMutation) Where(ps ...predicate.Breed)
- func (m *BreedMutation) WhereP(ps ...func(*sql.Selector))
- type BreedQuery
- func (bq *BreedQuery) Aggregate(fns ...AggregateFunc) *BreedSelect
- func (bq *BreedQuery) All(ctx context.Context) ([]*Breed, error)
- func (bq *BreedQuery) AllX(ctx context.Context) []*Breed
- func (bq *BreedQuery) Clone() *BreedQuery
- func (bq *BreedQuery) Count(ctx context.Context) (int, error)
- func (bq *BreedQuery) CountX(ctx context.Context) int
- func (bq *BreedQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BreedQuery) ExistX(ctx context.Context) bool
- func (bq *BreedQuery) First(ctx context.Context) (*Breed, error)
- func (bq *BreedQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BreedQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (bq *BreedQuery) FirstX(ctx context.Context) *Breed
- func (bq *BreedQuery) GroupBy(field string, fields ...string) *BreedGroupBy
- func (bq *BreedQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (bq *BreedQuery) IDsX(ctx context.Context) []uuid.UUID
- func (bq *BreedQuery) Limit(limit int) *BreedQuery
- func (bq *BreedQuery) Offset(offset int) *BreedQuery
- func (bq *BreedQuery) Only(ctx context.Context) (*Breed, error)
- func (bq *BreedQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BreedQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (bq *BreedQuery) OnlyX(ctx context.Context) *Breed
- func (bq *BreedQuery) Order(o ...breed.OrderOption) *BreedQuery
- func (bq *BreedQuery) QueryCats() *CatQuery
- func (bq *BreedQuery) Select(fields ...string) *BreedSelect
- func (bq *BreedQuery) Unique(unique bool) *BreedQuery
- func (bq *BreedQuery) Where(ps ...predicate.Breed) *BreedQuery
- func (bq *BreedQuery) WithCats(opts ...func(*CatQuery)) *BreedQuery
- type BreedSelect
- func (bs *BreedSelect) Aggregate(fns ...AggregateFunc) *BreedSelect
- func (s *BreedSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BreedSelect) BoolX(ctx context.Context) bool
- func (s *BreedSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BreedSelect) BoolsX(ctx context.Context) []bool
- func (s *BreedSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BreedSelect) Float64X(ctx context.Context) float64
- func (s *BreedSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BreedSelect) Float64sX(ctx context.Context) []float64
- func (s *BreedSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BreedSelect) IntX(ctx context.Context) int
- func (s *BreedSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BreedSelect) IntsX(ctx context.Context) []int
- func (bs *BreedSelect) Scan(ctx context.Context, v any) error
- func (s *BreedSelect) ScanX(ctx context.Context, v any)
- func (s *BreedSelect) String(ctx context.Context) (_ string, err error)
- func (s *BreedSelect) StringX(ctx context.Context) string
- func (s *BreedSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BreedSelect) StringsX(ctx context.Context) []string
- type BreedUpdate
- func (bu *BreedUpdate) AddCatIDs(ids ...uuid.UUID) *BreedUpdate
- func (bu *BreedUpdate) AddCats(c ...*Cat) *BreedUpdate
- func (bu *BreedUpdate) ClearCats() *BreedUpdate
- func (bu *BreedUpdate) ClearDeletedTime() *BreedUpdate
- func (bu *BreedUpdate) Exec(ctx context.Context) error
- func (bu *BreedUpdate) ExecX(ctx context.Context)
- func (bu *BreedUpdate) Mutation() *BreedMutation
- func (bu *BreedUpdate) RemoveCatIDs(ids ...uuid.UUID) *BreedUpdate
- func (bu *BreedUpdate) RemoveCats(c ...*Cat) *BreedUpdate
- func (bu *BreedUpdate) Save(ctx context.Context) (int, error)
- func (bu *BreedUpdate) SaveX(ctx context.Context) int
- func (bu *BreedUpdate) SetDeletedTime(t time.Time) *BreedUpdate
- func (bu *BreedUpdate) SetName(s string) *BreedUpdate
- func (bu *BreedUpdate) SetNillableDeletedTime(t *time.Time) *BreedUpdate
- func (bu *BreedUpdate) SetNillableName(s *string) *BreedUpdate
- func (bu *BreedUpdate) SetUpdateTime(t time.Time) *BreedUpdate
- func (bu *BreedUpdate) Where(ps ...predicate.Breed) *BreedUpdate
- type BreedUpdateOne
- func (buo *BreedUpdateOne) AddCatIDs(ids ...uuid.UUID) *BreedUpdateOne
- func (buo *BreedUpdateOne) AddCats(c ...*Cat) *BreedUpdateOne
- func (buo *BreedUpdateOne) ClearCats() *BreedUpdateOne
- func (buo *BreedUpdateOne) ClearDeletedTime() *BreedUpdateOne
- func (buo *BreedUpdateOne) Exec(ctx context.Context) error
- func (buo *BreedUpdateOne) ExecX(ctx context.Context)
- func (buo *BreedUpdateOne) Mutation() *BreedMutation
- func (buo *BreedUpdateOne) RemoveCatIDs(ids ...uuid.UUID) *BreedUpdateOne
- func (buo *BreedUpdateOne) RemoveCats(c ...*Cat) *BreedUpdateOne
- func (buo *BreedUpdateOne) Save(ctx context.Context) (*Breed, error)
- func (buo *BreedUpdateOne) SaveX(ctx context.Context) *Breed
- func (buo *BreedUpdateOne) Select(field string, fields ...string) *BreedUpdateOne
- func (buo *BreedUpdateOne) SetDeletedTime(t time.Time) *BreedUpdateOne
- func (buo *BreedUpdateOne) SetName(s string) *BreedUpdateOne
- func (buo *BreedUpdateOne) SetNillableDeletedTime(t *time.Time) *BreedUpdateOne
- func (buo *BreedUpdateOne) SetNillableName(s *string) *BreedUpdateOne
- func (buo *BreedUpdateOne) SetUpdateTime(t time.Time) *BreedUpdateOne
- func (buo *BreedUpdateOne) Where(ps ...predicate.Breed) *BreedUpdateOne
- type Breeds
- type Cat
- type CatClient
- func (c *CatClient) Create() *CatCreate
- func (c *CatClient) CreateBulk(builders ...*CatCreate) *CatCreateBulk
- func (c *CatClient) Delete() *CatDelete
- func (c *CatClient) DeleteOne(ca *Cat) *CatDeleteOne
- func (c *CatClient) DeleteOneID(id uuid.UUID) *CatDeleteOne
- func (c *CatClient) Get(ctx context.Context, id uuid.UUID) (*Cat, error)
- func (c *CatClient) GetX(ctx context.Context, id uuid.UUID) *Cat
- func (c *CatClient) Hooks() []Hook
- func (c *CatClient) Intercept(interceptors ...Interceptor)
- func (c *CatClient) Interceptors() []Interceptor
- func (c *CatClient) MapCreateBulk(slice any, setFunc func(*CatCreate, int)) *CatCreateBulk
- func (c *CatClient) Query() *CatQuery
- func (c *CatClient) QueryBreed(ca *Cat) *BreedQuery
- func (c *CatClient) QueryKittens(ca *Cat) *KittenQuery
- func (c *CatClient) Update() *CatUpdate
- func (c *CatClient) UpdateOne(ca *Cat) *CatUpdateOne
- func (c *CatClient) UpdateOneID(id uuid.UUID) *CatUpdateOne
- func (c *CatClient) Use(hooks ...Hook)
- type CatCreate
- func (cc *CatCreate) AddKittenIDs(ids ...uuid.UUID) *CatCreate
- func (cc *CatCreate) AddKittens(k ...*Kitten) *CatCreate
- func (cc *CatCreate) Exec(ctx context.Context) error
- func (cc *CatCreate) ExecX(ctx context.Context)
- func (cc *CatCreate) Mutation() *CatMutation
- func (cc *CatCreate) Save(ctx context.Context) (*Cat, error)
- func (cc *CatCreate) SaveX(ctx context.Context) *Cat
- func (cc *CatCreate) SetBreed(b *Breed) *CatCreate
- func (cc *CatCreate) SetBreedID(u uuid.UUID) *CatCreate
- func (cc *CatCreate) SetCreateTime(t time.Time) *CatCreate
- func (cc *CatCreate) SetDateFrom(t time.Time) *CatCreate
- func (cc *CatCreate) SetDeletedTime(t time.Time) *CatCreate
- func (cc *CatCreate) SetID(u uuid.UUID) *CatCreate
- func (cc *CatCreate) SetName(s string) *CatCreate
- func (cc *CatCreate) SetNillableCreateTime(t *time.Time) *CatCreate
- func (cc *CatCreate) SetNillableDeletedTime(t *time.Time) *CatCreate
- func (cc *CatCreate) SetNillableID(u *uuid.UUID) *CatCreate
- func (cc *CatCreate) SetNillableUpdateTime(t *time.Time) *CatCreate
- func (cc *CatCreate) SetOtherType(ct cat.OtherType) *CatCreate
- func (cc *CatCreate) SetSpeed(i int64) *CatCreate
- func (cc *CatCreate) SetType(c cat.Type) *CatCreate
- func (cc *CatCreate) SetUpdateTime(t time.Time) *CatCreate
- type CatCreateBulk
- type CatDelete
- type CatDeleteOne
- type CatEdges
- type CatGroupBy
- func (cgb *CatGroupBy) Aggregate(fns ...AggregateFunc) *CatGroupBy
- func (s *CatGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CatGroupBy) BoolX(ctx context.Context) bool
- func (s *CatGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CatGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CatGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CatGroupBy) Float64X(ctx context.Context) float64
- func (s *CatGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CatGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CatGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CatGroupBy) IntX(ctx context.Context) int
- func (s *CatGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CatGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CatGroupBy) Scan(ctx context.Context, v any) error
- func (s *CatGroupBy) ScanX(ctx context.Context, v any)
- func (s *CatGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CatGroupBy) StringX(ctx context.Context) string
- func (s *CatGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CatGroupBy) StringsX(ctx context.Context) []string
- type CatMutation
- func (m *CatMutation) AddField(name string, value ent.Value) error
- func (m *CatMutation) AddKittenIDs(ids ...uuid.UUID)
- func (m *CatMutation) AddSpeed(i int64)
- func (m *CatMutation) AddedEdges() []string
- func (m *CatMutation) AddedField(name string) (ent.Value, bool)
- func (m *CatMutation) AddedFields() []string
- func (m *CatMutation) AddedIDs(name string) []ent.Value
- func (m *CatMutation) AddedSpeed() (r int64, exists bool)
- func (m *CatMutation) BreedCleared() bool
- func (m *CatMutation) BreedID() (r uuid.UUID, exists bool)
- func (m *CatMutation) BreedIDs() (ids []uuid.UUID)
- func (m *CatMutation) ClearBreed()
- func (m *CatMutation) ClearDeletedTime()
- func (m *CatMutation) ClearEdge(name string) error
- func (m *CatMutation) ClearField(name string) error
- func (m *CatMutation) ClearKittens()
- func (m *CatMutation) ClearedEdges() []string
- func (m *CatMutation) ClearedFields() []string
- func (m CatMutation) Client() *Client
- func (m *CatMutation) CreateTime() (r time.Time, exists bool)
- func (m *CatMutation) DateFrom() (r time.Time, exists bool)
- func (m *CatMutation) DeletedTime() (r time.Time, exists bool)
- func (m *CatMutation) DeletedTimeCleared() bool
- func (m *CatMutation) EdgeCleared(name string) bool
- func (m *CatMutation) Field(name string) (ent.Value, bool)
- func (m *CatMutation) FieldCleared(name string) bool
- func (m *CatMutation) Fields() []string
- func (m *CatMutation) GetType() (r cat.Type, exists bool)
- func (m *CatMutation) ID() (id uuid.UUID, exists bool)
- func (m *CatMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *CatMutation) KittensCleared() bool
- func (m *CatMutation) KittensIDs() (ids []uuid.UUID)
- func (m *CatMutation) Name() (r string, exists bool)
- func (m *CatMutation) OldBreedID(ctx context.Context) (v uuid.UUID, err error)
- func (m *CatMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *CatMutation) OldDateFrom(ctx context.Context) (v time.Time, err error)
- func (m *CatMutation) OldDeletedTime(ctx context.Context) (v *time.Time, err error)
- func (m *CatMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CatMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CatMutation) OldOtherType(ctx context.Context) (v cat.OtherType, err error)
- func (m *CatMutation) OldSpeed(ctx context.Context) (v int64, err error)
- func (m *CatMutation) OldType(ctx context.Context) (v cat.Type, err error)
- func (m *CatMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *CatMutation) Op() Op
- func (m *CatMutation) OtherType() (r cat.OtherType, exists bool)
- func (m *CatMutation) RemoveKittenIDs(ids ...uuid.UUID)
- func (m *CatMutation) RemovedEdges() []string
- func (m *CatMutation) RemovedIDs(name string) []ent.Value
- func (m *CatMutation) RemovedKittensIDs() (ids []uuid.UUID)
- func (m *CatMutation) ResetBreed()
- func (m *CatMutation) ResetBreedID()
- func (m *CatMutation) ResetCreateTime()
- func (m *CatMutation) ResetDateFrom()
- func (m *CatMutation) ResetDeletedTime()
- func (m *CatMutation) ResetEdge(name string) error
- func (m *CatMutation) ResetField(name string) error
- func (m *CatMutation) ResetKittens()
- func (m *CatMutation) ResetName()
- func (m *CatMutation) ResetOtherType()
- func (m *CatMutation) ResetSpeed()
- func (m *CatMutation) ResetType()
- func (m *CatMutation) ResetUpdateTime()
- func (m *CatMutation) SetBreedID(u uuid.UUID)
- func (m *CatMutation) SetCreateTime(t time.Time)
- func (m *CatMutation) SetDateFrom(t time.Time)
- func (m *CatMutation) SetDeletedTime(t time.Time)
- func (m *CatMutation) SetField(name string, value ent.Value) error
- func (m *CatMutation) SetID(id uuid.UUID)
- func (m *CatMutation) SetName(s string)
- func (m *CatMutation) SetOp(op Op)
- func (m *CatMutation) SetOtherType(ct cat.OtherType)
- func (m *CatMutation) SetSpeed(i int64)
- func (m *CatMutation) SetType(c cat.Type)
- func (m *CatMutation) SetUpdateTime(t time.Time)
- func (m *CatMutation) Speed() (r int64, exists bool)
- func (m CatMutation) Tx() (*Tx, error)
- func (m *CatMutation) Type() string
- func (m *CatMutation) UpdateTime() (r time.Time, exists bool)
- func (m *CatMutation) Where(ps ...predicate.Cat)
- func (m *CatMutation) WhereP(ps ...func(*sql.Selector))
- type CatQuery
- func (cq *CatQuery) Aggregate(fns ...AggregateFunc) *CatSelect
- func (cq *CatQuery) All(ctx context.Context) ([]*Cat, error)
- func (cq *CatQuery) AllX(ctx context.Context) []*Cat
- func (cq *CatQuery) Clone() *CatQuery
- func (cq *CatQuery) Count(ctx context.Context) (int, error)
- func (cq *CatQuery) CountX(ctx context.Context) int
- func (cq *CatQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CatQuery) ExistX(ctx context.Context) bool
- func (cq *CatQuery) First(ctx context.Context) (*Cat, error)
- func (cq *CatQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CatQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (cq *CatQuery) FirstX(ctx context.Context) *Cat
- func (cq *CatQuery) GroupBy(field string, fields ...string) *CatGroupBy
- func (cq *CatQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (cq *CatQuery) IDsX(ctx context.Context) []uuid.UUID
- func (cq *CatQuery) Limit(limit int) *CatQuery
- func (cq *CatQuery) Offset(offset int) *CatQuery
- func (cq *CatQuery) Only(ctx context.Context) (*Cat, error)
- func (cq *CatQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CatQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (cq *CatQuery) OnlyX(ctx context.Context) *Cat
- func (cq *CatQuery) Order(o ...cat.OrderOption) *CatQuery
- func (cq *CatQuery) QueryBreed() *BreedQuery
- func (cq *CatQuery) QueryKittens() *KittenQuery
- func (cq *CatQuery) Select(fields ...string) *CatSelect
- func (cq *CatQuery) Unique(unique bool) *CatQuery
- func (cq *CatQuery) Where(ps ...predicate.Cat) *CatQuery
- func (cq *CatQuery) WithBreed(opts ...func(*BreedQuery)) *CatQuery
- func (cq *CatQuery) WithKittens(opts ...func(*KittenQuery)) *CatQuery
- type CatSelect
- func (cs *CatSelect) Aggregate(fns ...AggregateFunc) *CatSelect
- func (s *CatSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CatSelect) BoolX(ctx context.Context) bool
- func (s *CatSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CatSelect) BoolsX(ctx context.Context) []bool
- func (s *CatSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CatSelect) Float64X(ctx context.Context) float64
- func (s *CatSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CatSelect) Float64sX(ctx context.Context) []float64
- func (s *CatSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CatSelect) IntX(ctx context.Context) int
- func (s *CatSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CatSelect) IntsX(ctx context.Context) []int
- func (cs *CatSelect) Scan(ctx context.Context, v any) error
- func (s *CatSelect) ScanX(ctx context.Context, v any)
- func (s *CatSelect) String(ctx context.Context) (_ string, err error)
- func (s *CatSelect) StringX(ctx context.Context) string
- func (s *CatSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CatSelect) StringsX(ctx context.Context) []string
- type CatUpdate
- func (cu *CatUpdate) AddKittenIDs(ids ...uuid.UUID) *CatUpdate
- func (cu *CatUpdate) AddKittens(k ...*Kitten) *CatUpdate
- func (cu *CatUpdate) AddSpeed(i int64) *CatUpdate
- func (cu *CatUpdate) ClearBreed() *CatUpdate
- func (cu *CatUpdate) ClearDeletedTime() *CatUpdate
- func (cu *CatUpdate) ClearKittens() *CatUpdate
- func (cu *CatUpdate) Exec(ctx context.Context) error
- func (cu *CatUpdate) ExecX(ctx context.Context)
- func (cu *CatUpdate) Mutation() *CatMutation
- func (cu *CatUpdate) RemoveKittenIDs(ids ...uuid.UUID) *CatUpdate
- func (cu *CatUpdate) RemoveKittens(k ...*Kitten) *CatUpdate
- func (cu *CatUpdate) Save(ctx context.Context) (int, error)
- func (cu *CatUpdate) SaveX(ctx context.Context) int
- func (cu *CatUpdate) SetBreed(b *Breed) *CatUpdate
- func (cu *CatUpdate) SetBreedID(u uuid.UUID) *CatUpdate
- func (cu *CatUpdate) SetDateFrom(t time.Time) *CatUpdate
- func (cu *CatUpdate) SetDeletedTime(t time.Time) *CatUpdate
- func (cu *CatUpdate) SetName(s string) *CatUpdate
- func (cu *CatUpdate) SetNillableBreedID(u *uuid.UUID) *CatUpdate
- func (cu *CatUpdate) SetNillableDateFrom(t *time.Time) *CatUpdate
- func (cu *CatUpdate) SetNillableDeletedTime(t *time.Time) *CatUpdate
- func (cu *CatUpdate) SetNillableName(s *string) *CatUpdate
- func (cu *CatUpdate) SetNillableOtherType(ct *cat.OtherType) *CatUpdate
- func (cu *CatUpdate) SetNillableSpeed(i *int64) *CatUpdate
- func (cu *CatUpdate) SetNillableType(c *cat.Type) *CatUpdate
- func (cu *CatUpdate) SetOtherType(ct cat.OtherType) *CatUpdate
- func (cu *CatUpdate) SetSpeed(i int64) *CatUpdate
- func (cu *CatUpdate) SetType(c cat.Type) *CatUpdate
- func (cu *CatUpdate) SetUpdateTime(t time.Time) *CatUpdate
- func (cu *CatUpdate) Where(ps ...predicate.Cat) *CatUpdate
- type CatUpdateOne
- func (cuo *CatUpdateOne) AddKittenIDs(ids ...uuid.UUID) *CatUpdateOne
- func (cuo *CatUpdateOne) AddKittens(k ...*Kitten) *CatUpdateOne
- func (cuo *CatUpdateOne) AddSpeed(i int64) *CatUpdateOne
- func (cuo *CatUpdateOne) ClearBreed() *CatUpdateOne
- func (cuo *CatUpdateOne) ClearDeletedTime() *CatUpdateOne
- func (cuo *CatUpdateOne) ClearKittens() *CatUpdateOne
- func (cuo *CatUpdateOne) Exec(ctx context.Context) error
- func (cuo *CatUpdateOne) ExecX(ctx context.Context)
- func (cuo *CatUpdateOne) Mutation() *CatMutation
- func (cuo *CatUpdateOne) RemoveKittenIDs(ids ...uuid.UUID) *CatUpdateOne
- func (cuo *CatUpdateOne) RemoveKittens(k ...*Kitten) *CatUpdateOne
- func (cuo *CatUpdateOne) Save(ctx context.Context) (*Cat, error)
- func (cuo *CatUpdateOne) SaveX(ctx context.Context) *Cat
- func (cuo *CatUpdateOne) Select(field string, fields ...string) *CatUpdateOne
- func (cuo *CatUpdateOne) SetBreed(b *Breed) *CatUpdateOne
- func (cuo *CatUpdateOne) SetBreedID(u uuid.UUID) *CatUpdateOne
- func (cuo *CatUpdateOne) SetDateFrom(t time.Time) *CatUpdateOne
- func (cuo *CatUpdateOne) SetDeletedTime(t time.Time) *CatUpdateOne
- func (cuo *CatUpdateOne) SetName(s string) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableBreedID(u *uuid.UUID) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableDateFrom(t *time.Time) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableDeletedTime(t *time.Time) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableName(s *string) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableOtherType(ct *cat.OtherType) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableSpeed(i *int64) *CatUpdateOne
- func (cuo *CatUpdateOne) SetNillableType(c *cat.Type) *CatUpdateOne
- func (cuo *CatUpdateOne) SetOtherType(ct cat.OtherType) *CatUpdateOne
- func (cuo *CatUpdateOne) SetSpeed(i int64) *CatUpdateOne
- func (cuo *CatUpdateOne) SetType(c cat.Type) *CatUpdateOne
- func (cuo *CatUpdateOne) SetUpdateTime(t time.Time) *CatUpdateOne
- func (cuo *CatUpdateOne) Where(ps ...predicate.Cat) *CatUpdateOne
- type Cats
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type FatherCat
- type FatherCatClient
- func (c *FatherCatClient) Create() *FatherCatCreate
- func (c *FatherCatClient) CreateBulk(builders ...*FatherCatCreate) *FatherCatCreateBulk
- func (c *FatherCatClient) Delete() *FatherCatDelete
- func (c *FatherCatClient) DeleteOne(fc *FatherCat) *FatherCatDeleteOne
- func (c *FatherCatClient) DeleteOneID(id uuid.UUID) *FatherCatDeleteOne
- func (c *FatherCatClient) Get(ctx context.Context, id uuid.UUID) (*FatherCat, error)
- func (c *FatherCatClient) GetX(ctx context.Context, id uuid.UUID) *FatherCat
- func (c *FatherCatClient) Hooks() []Hook
- func (c *FatherCatClient) Intercept(interceptors ...Interceptor)
- func (c *FatherCatClient) Interceptors() []Interceptor
- func (c *FatherCatClient) MapCreateBulk(slice any, setFunc func(*FatherCatCreate, int)) *FatherCatCreateBulk
- func (c *FatherCatClient) Query() *FatherCatQuery
- func (c *FatherCatClient) Update() *FatherCatUpdate
- func (c *FatherCatClient) UpdateOne(fc *FatherCat) *FatherCatUpdateOne
- func (c *FatherCatClient) UpdateOneID(id uuid.UUID) *FatherCatUpdateOne
- func (c *FatherCatClient) Use(hooks ...Hook)
- type FatherCatCreate
- func (fcc *FatherCatCreate) Exec(ctx context.Context) error
- func (fcc *FatherCatCreate) ExecX(ctx context.Context)
- func (fcc *FatherCatCreate) Mutation() *FatherCatMutation
- func (fcc *FatherCatCreate) Save(ctx context.Context) (*FatherCat, error)
- func (fcc *FatherCatCreate) SaveX(ctx context.Context) *FatherCat
- func (fcc *FatherCatCreate) SetCreateTime(t time.Time) *FatherCatCreate
- func (fcc *FatherCatCreate) SetDeletedTime(t time.Time) *FatherCatCreate
- func (fcc *FatherCatCreate) SetID(u uuid.UUID) *FatherCatCreate
- func (fcc *FatherCatCreate) SetName(s string) *FatherCatCreate
- func (fcc *FatherCatCreate) SetNillableCreateTime(t *time.Time) *FatherCatCreate
- func (fcc *FatherCatCreate) SetNillableDeletedTime(t *time.Time) *FatherCatCreate
- func (fcc *FatherCatCreate) SetNillableID(u *uuid.UUID) *FatherCatCreate
- func (fcc *FatherCatCreate) SetNillableUpdateTime(t *time.Time) *FatherCatCreate
- func (fcc *FatherCatCreate) SetUpdateTime(t time.Time) *FatherCatCreate
- type FatherCatCreateBulk
- type FatherCatDelete
- type FatherCatDeleteOne
- type FatherCatGroupBy
- func (fcgb *FatherCatGroupBy) Aggregate(fns ...AggregateFunc) *FatherCatGroupBy
- func (s *FatherCatGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FatherCatGroupBy) BoolX(ctx context.Context) bool
- func (s *FatherCatGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FatherCatGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FatherCatGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FatherCatGroupBy) Float64X(ctx context.Context) float64
- func (s *FatherCatGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FatherCatGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FatherCatGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FatherCatGroupBy) IntX(ctx context.Context) int
- func (s *FatherCatGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FatherCatGroupBy) IntsX(ctx context.Context) []int
- func (fcgb *FatherCatGroupBy) Scan(ctx context.Context, v any) error
- func (s *FatherCatGroupBy) ScanX(ctx context.Context, v any)
- func (s *FatherCatGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FatherCatGroupBy) StringX(ctx context.Context) string
- func (s *FatherCatGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FatherCatGroupBy) StringsX(ctx context.Context) []string
- type FatherCatMutation
- func (m *FatherCatMutation) AddField(name string, value ent.Value) error
- func (m *FatherCatMutation) AddedEdges() []string
- func (m *FatherCatMutation) AddedField(name string) (ent.Value, bool)
- func (m *FatherCatMutation) AddedFields() []string
- func (m *FatherCatMutation) AddedIDs(name string) []ent.Value
- func (m *FatherCatMutation) ClearDeletedTime()
- func (m *FatherCatMutation) ClearEdge(name string) error
- func (m *FatherCatMutation) ClearField(name string) error
- func (m *FatherCatMutation) ClearedEdges() []string
- func (m *FatherCatMutation) ClearedFields() []string
- func (m FatherCatMutation) Client() *Client
- func (m *FatherCatMutation) CreateTime() (r time.Time, exists bool)
- func (m *FatherCatMutation) DeletedTime() (r time.Time, exists bool)
- func (m *FatherCatMutation) DeletedTimeCleared() bool
- func (m *FatherCatMutation) EdgeCleared(name string) bool
- func (m *FatherCatMutation) Field(name string) (ent.Value, bool)
- func (m *FatherCatMutation) FieldCleared(name string) bool
- func (m *FatherCatMutation) Fields() []string
- func (m *FatherCatMutation) ID() (id uuid.UUID, exists bool)
- func (m *FatherCatMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *FatherCatMutation) Name() (r string, exists bool)
- func (m *FatherCatMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *FatherCatMutation) OldDeletedTime(ctx context.Context) (v *time.Time, err error)
- func (m *FatherCatMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FatherCatMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FatherCatMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *FatherCatMutation) Op() Op
- func (m *FatherCatMutation) RemovedEdges() []string
- func (m *FatherCatMutation) RemovedIDs(name string) []ent.Value
- func (m *FatherCatMutation) ResetCreateTime()
- func (m *FatherCatMutation) ResetDeletedTime()
- func (m *FatherCatMutation) ResetEdge(name string) error
- func (m *FatherCatMutation) ResetField(name string) error
- func (m *FatherCatMutation) ResetName()
- func (m *FatherCatMutation) ResetUpdateTime()
- func (m *FatherCatMutation) SetCreateTime(t time.Time)
- func (m *FatherCatMutation) SetDeletedTime(t time.Time)
- func (m *FatherCatMutation) SetField(name string, value ent.Value) error
- func (m *FatherCatMutation) SetID(id uuid.UUID)
- func (m *FatherCatMutation) SetName(s string)
- func (m *FatherCatMutation) SetOp(op Op)
- func (m *FatherCatMutation) SetUpdateTime(t time.Time)
- func (m FatherCatMutation) Tx() (*Tx, error)
- func (m *FatherCatMutation) Type() string
- func (m *FatherCatMutation) UpdateTime() (r time.Time, exists bool)
- func (m *FatherCatMutation) Where(ps ...predicate.FatherCat)
- func (m *FatherCatMutation) WhereP(ps ...func(*sql.Selector))
- type FatherCatQuery
- func (fcq *FatherCatQuery) Aggregate(fns ...AggregateFunc) *FatherCatSelect
- func (fcq *FatherCatQuery) All(ctx context.Context) ([]*FatherCat, error)
- func (fcq *FatherCatQuery) AllX(ctx context.Context) []*FatherCat
- func (fcq *FatherCatQuery) Clone() *FatherCatQuery
- func (fcq *FatherCatQuery) Count(ctx context.Context) (int, error)
- func (fcq *FatherCatQuery) CountX(ctx context.Context) int
- func (fcq *FatherCatQuery) Exist(ctx context.Context) (bool, error)
- func (fcq *FatherCatQuery) ExistX(ctx context.Context) bool
- func (fcq *FatherCatQuery) First(ctx context.Context) (*FatherCat, error)
- func (fcq *FatherCatQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (fcq *FatherCatQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (fcq *FatherCatQuery) FirstX(ctx context.Context) *FatherCat
- func (fcq *FatherCatQuery) GroupBy(field string, fields ...string) *FatherCatGroupBy
- func (fcq *FatherCatQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (fcq *FatherCatQuery) IDsX(ctx context.Context) []uuid.UUID
- func (fcq *FatherCatQuery) Limit(limit int) *FatherCatQuery
- func (fcq *FatherCatQuery) Offset(offset int) *FatherCatQuery
- func (fcq *FatherCatQuery) Only(ctx context.Context) (*FatherCat, error)
- func (fcq *FatherCatQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (fcq *FatherCatQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (fcq *FatherCatQuery) OnlyX(ctx context.Context) *FatherCat
- func (fcq *FatherCatQuery) Order(o ...fathercat.OrderOption) *FatherCatQuery
- func (fcq *FatherCatQuery) Select(fields ...string) *FatherCatSelect
- func (fcq *FatherCatQuery) Unique(unique bool) *FatherCatQuery
- func (fcq *FatherCatQuery) Where(ps ...predicate.FatherCat) *FatherCatQuery
- type FatherCatSelect
- func (fcs *FatherCatSelect) Aggregate(fns ...AggregateFunc) *FatherCatSelect
- func (s *FatherCatSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FatherCatSelect) BoolX(ctx context.Context) bool
- func (s *FatherCatSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FatherCatSelect) BoolsX(ctx context.Context) []bool
- func (s *FatherCatSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FatherCatSelect) Float64X(ctx context.Context) float64
- func (s *FatherCatSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FatherCatSelect) Float64sX(ctx context.Context) []float64
- func (s *FatherCatSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FatherCatSelect) IntX(ctx context.Context) int
- func (s *FatherCatSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FatherCatSelect) IntsX(ctx context.Context) []int
- func (fcs *FatherCatSelect) Scan(ctx context.Context, v any) error
- func (s *FatherCatSelect) ScanX(ctx context.Context, v any)
- func (s *FatherCatSelect) String(ctx context.Context) (_ string, err error)
- func (s *FatherCatSelect) StringX(ctx context.Context) string
- func (s *FatherCatSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FatherCatSelect) StringsX(ctx context.Context) []string
- type FatherCatUpdate
- func (fcu *FatherCatUpdate) ClearDeletedTime() *FatherCatUpdate
- func (fcu *FatherCatUpdate) Exec(ctx context.Context) error
- func (fcu *FatherCatUpdate) ExecX(ctx context.Context)
- func (fcu *FatherCatUpdate) Mutation() *FatherCatMutation
- func (fcu *FatherCatUpdate) Save(ctx context.Context) (int, error)
- func (fcu *FatherCatUpdate) SaveX(ctx context.Context) int
- func (fcu *FatherCatUpdate) SetDeletedTime(t time.Time) *FatherCatUpdate
- func (fcu *FatherCatUpdate) SetName(s string) *FatherCatUpdate
- func (fcu *FatherCatUpdate) SetNillableDeletedTime(t *time.Time) *FatherCatUpdate
- func (fcu *FatherCatUpdate) SetNillableName(s *string) *FatherCatUpdate
- func (fcu *FatherCatUpdate) SetUpdateTime(t time.Time) *FatherCatUpdate
- func (fcu *FatherCatUpdate) Where(ps ...predicate.FatherCat) *FatherCatUpdate
- type FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) ClearDeletedTime() *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) Exec(ctx context.Context) error
- func (fcuo *FatherCatUpdateOne) ExecX(ctx context.Context)
- func (fcuo *FatherCatUpdateOne) Mutation() *FatherCatMutation
- func (fcuo *FatherCatUpdateOne) Save(ctx context.Context) (*FatherCat, error)
- func (fcuo *FatherCatUpdateOne) SaveX(ctx context.Context) *FatherCat
- func (fcuo *FatherCatUpdateOne) Select(field string, fields ...string) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) SetDeletedTime(t time.Time) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) SetName(s string) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) SetNillableDeletedTime(t *time.Time) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) SetNillableName(s *string) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) SetUpdateTime(t time.Time) *FatherCatUpdateOne
- func (fcuo *FatherCatUpdateOne) Where(ps ...predicate.FatherCat) *FatherCatUpdateOne
- type FatherCats
- type Hook
- type InterceptFunc
- type Interceptor
- type Kitten
- type KittenClient
- func (c *KittenClient) Create() *KittenCreate
- func (c *KittenClient) CreateBulk(builders ...*KittenCreate) *KittenCreateBulk
- func (c *KittenClient) Delete() *KittenDelete
- func (c *KittenClient) DeleteOne(k *Kitten) *KittenDeleteOne
- func (c *KittenClient) DeleteOneID(id uuid.UUID) *KittenDeleteOne
- func (c *KittenClient) Get(ctx context.Context, id uuid.UUID) (*Kitten, error)
- func (c *KittenClient) GetX(ctx context.Context, id uuid.UUID) *Kitten
- func (c *KittenClient) Hooks() []Hook
- func (c *KittenClient) Intercept(interceptors ...Interceptor)
- func (c *KittenClient) Interceptors() []Interceptor
- func (c *KittenClient) MapCreateBulk(slice any, setFunc func(*KittenCreate, int)) *KittenCreateBulk
- func (c *KittenClient) Query() *KittenQuery
- func (c *KittenClient) QueryMother(k *Kitten) *CatQuery
- func (c *KittenClient) Update() *KittenUpdate
- func (c *KittenClient) UpdateOne(k *Kitten) *KittenUpdateOne
- func (c *KittenClient) UpdateOneID(id uuid.UUID) *KittenUpdateOne
- func (c *KittenClient) Use(hooks ...Hook)
- type KittenCreate
- func (kc *KittenCreate) Exec(ctx context.Context) error
- func (kc *KittenCreate) ExecX(ctx context.Context)
- func (kc *KittenCreate) Mutation() *KittenMutation
- func (kc *KittenCreate) Save(ctx context.Context) (*Kitten, error)
- func (kc *KittenCreate) SaveX(ctx context.Context) *Kitten
- func (kc *KittenCreate) SetCreateTime(t time.Time) *KittenCreate
- func (kc *KittenCreate) SetDeletedTime(t time.Time) *KittenCreate
- func (kc *KittenCreate) SetID(u uuid.UUID) *KittenCreate
- func (kc *KittenCreate) SetMother(c *Cat) *KittenCreate
- func (kc *KittenCreate) SetMotherID(u uuid.UUID) *KittenCreate
- func (kc *KittenCreate) SetName(s string) *KittenCreate
- func (kc *KittenCreate) SetNillableCreateTime(t *time.Time) *KittenCreate
- func (kc *KittenCreate) SetNillableDeletedTime(t *time.Time) *KittenCreate
- func (kc *KittenCreate) SetNillableID(u *uuid.UUID) *KittenCreate
- func (kc *KittenCreate) SetNillableUpdateTime(t *time.Time) *KittenCreate
- func (kc *KittenCreate) SetUpdateTime(t time.Time) *KittenCreate
- type KittenCreateBulk
- type KittenDelete
- type KittenDeleteOne
- type KittenEdges
- type KittenGroupBy
- func (kgb *KittenGroupBy) Aggregate(fns ...AggregateFunc) *KittenGroupBy
- func (s *KittenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *KittenGroupBy) BoolX(ctx context.Context) bool
- func (s *KittenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *KittenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *KittenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *KittenGroupBy) Float64X(ctx context.Context) float64
- func (s *KittenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *KittenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *KittenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *KittenGroupBy) IntX(ctx context.Context) int
- func (s *KittenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *KittenGroupBy) IntsX(ctx context.Context) []int
- func (kgb *KittenGroupBy) Scan(ctx context.Context, v any) error
- func (s *KittenGroupBy) ScanX(ctx context.Context, v any)
- func (s *KittenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *KittenGroupBy) StringX(ctx context.Context) string
- func (s *KittenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *KittenGroupBy) StringsX(ctx context.Context) []string
- type KittenMutation
- func (m *KittenMutation) AddField(name string, value ent.Value) error
- func (m *KittenMutation) AddedEdges() []string
- func (m *KittenMutation) AddedField(name string) (ent.Value, bool)
- func (m *KittenMutation) AddedFields() []string
- func (m *KittenMutation) AddedIDs(name string) []ent.Value
- func (m *KittenMutation) ClearDeletedTime()
- func (m *KittenMutation) ClearEdge(name string) error
- func (m *KittenMutation) ClearField(name string) error
- func (m *KittenMutation) ClearMother()
- func (m *KittenMutation) ClearedEdges() []string
- func (m *KittenMutation) ClearedFields() []string
- func (m KittenMutation) Client() *Client
- func (m *KittenMutation) CreateTime() (r time.Time, exists bool)
- func (m *KittenMutation) DeletedTime() (r time.Time, exists bool)
- func (m *KittenMutation) DeletedTimeCleared() bool
- func (m *KittenMutation) EdgeCleared(name string) bool
- func (m *KittenMutation) Field(name string) (ent.Value, bool)
- func (m *KittenMutation) FieldCleared(name string) bool
- func (m *KittenMutation) Fields() []string
- func (m *KittenMutation) ID() (id uuid.UUID, exists bool)
- func (m *KittenMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *KittenMutation) MotherCleared() bool
- func (m *KittenMutation) MotherID() (r uuid.UUID, exists bool)
- func (m *KittenMutation) MotherIDs() (ids []uuid.UUID)
- func (m *KittenMutation) Name() (r string, exists bool)
- func (m *KittenMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *KittenMutation) OldDeletedTime(ctx context.Context) (v *time.Time, err error)
- func (m *KittenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *KittenMutation) OldMotherID(ctx context.Context) (v uuid.UUID, err error)
- func (m *KittenMutation) OldName(ctx context.Context) (v string, err error)
- func (m *KittenMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *KittenMutation) Op() Op
- func (m *KittenMutation) RemovedEdges() []string
- func (m *KittenMutation) RemovedIDs(name string) []ent.Value
- func (m *KittenMutation) ResetCreateTime()
- func (m *KittenMutation) ResetDeletedTime()
- func (m *KittenMutation) ResetEdge(name string) error
- func (m *KittenMutation) ResetField(name string) error
- func (m *KittenMutation) ResetMother()
- func (m *KittenMutation) ResetMotherID()
- func (m *KittenMutation) ResetName()
- func (m *KittenMutation) ResetUpdateTime()
- func (m *KittenMutation) SetCreateTime(t time.Time)
- func (m *KittenMutation) SetDeletedTime(t time.Time)
- func (m *KittenMutation) SetField(name string, value ent.Value) error
- func (m *KittenMutation) SetID(id uuid.UUID)
- func (m *KittenMutation) SetMotherID(u uuid.UUID)
- func (m *KittenMutation) SetName(s string)
- func (m *KittenMutation) SetOp(op Op)
- func (m *KittenMutation) SetUpdateTime(t time.Time)
- func (m KittenMutation) Tx() (*Tx, error)
- func (m *KittenMutation) Type() string
- func (m *KittenMutation) UpdateTime() (r time.Time, exists bool)
- func (m *KittenMutation) Where(ps ...predicate.Kitten)
- func (m *KittenMutation) WhereP(ps ...func(*sql.Selector))
- type KittenQuery
- func (kq *KittenQuery) Aggregate(fns ...AggregateFunc) *KittenSelect
- func (kq *KittenQuery) All(ctx context.Context) ([]*Kitten, error)
- func (kq *KittenQuery) AllX(ctx context.Context) []*Kitten
- func (kq *KittenQuery) Clone() *KittenQuery
- func (kq *KittenQuery) Count(ctx context.Context) (int, error)
- func (kq *KittenQuery) CountX(ctx context.Context) int
- func (kq *KittenQuery) Exist(ctx context.Context) (bool, error)
- func (kq *KittenQuery) ExistX(ctx context.Context) bool
- func (kq *KittenQuery) First(ctx context.Context) (*Kitten, error)
- func (kq *KittenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (kq *KittenQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (kq *KittenQuery) FirstX(ctx context.Context) *Kitten
- func (kq *KittenQuery) GroupBy(field string, fields ...string) *KittenGroupBy
- func (kq *KittenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (kq *KittenQuery) IDsX(ctx context.Context) []uuid.UUID
- func (kq *KittenQuery) Limit(limit int) *KittenQuery
- func (kq *KittenQuery) Offset(offset int) *KittenQuery
- func (kq *KittenQuery) Only(ctx context.Context) (*Kitten, error)
- func (kq *KittenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (kq *KittenQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (kq *KittenQuery) OnlyX(ctx context.Context) *Kitten
- func (kq *KittenQuery) Order(o ...kitten.OrderOption) *KittenQuery
- func (kq *KittenQuery) QueryMother() *CatQuery
- func (kq *KittenQuery) Select(fields ...string) *KittenSelect
- func (kq *KittenQuery) Unique(unique bool) *KittenQuery
- func (kq *KittenQuery) Where(ps ...predicate.Kitten) *KittenQuery
- func (kq *KittenQuery) WithMother(opts ...func(*CatQuery)) *KittenQuery
- type KittenSelect
- func (ks *KittenSelect) Aggregate(fns ...AggregateFunc) *KittenSelect
- func (s *KittenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *KittenSelect) BoolX(ctx context.Context) bool
- func (s *KittenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *KittenSelect) BoolsX(ctx context.Context) []bool
- func (s *KittenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *KittenSelect) Float64X(ctx context.Context) float64
- func (s *KittenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *KittenSelect) Float64sX(ctx context.Context) []float64
- func (s *KittenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *KittenSelect) IntX(ctx context.Context) int
- func (s *KittenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *KittenSelect) IntsX(ctx context.Context) []int
- func (ks *KittenSelect) Scan(ctx context.Context, v any) error
- func (s *KittenSelect) ScanX(ctx context.Context, v any)
- func (s *KittenSelect) String(ctx context.Context) (_ string, err error)
- func (s *KittenSelect) StringX(ctx context.Context) string
- func (s *KittenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *KittenSelect) StringsX(ctx context.Context) []string
- type KittenUpdate
- func (ku *KittenUpdate) ClearDeletedTime() *KittenUpdate
- func (ku *KittenUpdate) ClearMother() *KittenUpdate
- func (ku *KittenUpdate) Exec(ctx context.Context) error
- func (ku *KittenUpdate) ExecX(ctx context.Context)
- func (ku *KittenUpdate) Mutation() *KittenMutation
- func (ku *KittenUpdate) Save(ctx context.Context) (int, error)
- func (ku *KittenUpdate) SaveX(ctx context.Context) int
- func (ku *KittenUpdate) SetDeletedTime(t time.Time) *KittenUpdate
- func (ku *KittenUpdate) SetMother(c *Cat) *KittenUpdate
- func (ku *KittenUpdate) SetMotherID(u uuid.UUID) *KittenUpdate
- func (ku *KittenUpdate) SetName(s string) *KittenUpdate
- func (ku *KittenUpdate) SetNillableDeletedTime(t *time.Time) *KittenUpdate
- func (ku *KittenUpdate) SetNillableMotherID(u *uuid.UUID) *KittenUpdate
- func (ku *KittenUpdate) SetNillableName(s *string) *KittenUpdate
- func (ku *KittenUpdate) SetUpdateTime(t time.Time) *KittenUpdate
- func (ku *KittenUpdate) Where(ps ...predicate.Kitten) *KittenUpdate
- type KittenUpdateOne
- func (kuo *KittenUpdateOne) ClearDeletedTime() *KittenUpdateOne
- func (kuo *KittenUpdateOne) ClearMother() *KittenUpdateOne
- func (kuo *KittenUpdateOne) Exec(ctx context.Context) error
- func (kuo *KittenUpdateOne) ExecX(ctx context.Context)
- func (kuo *KittenUpdateOne) Mutation() *KittenMutation
- func (kuo *KittenUpdateOne) Save(ctx context.Context) (*Kitten, error)
- func (kuo *KittenUpdateOne) SaveX(ctx context.Context) *Kitten
- func (kuo *KittenUpdateOne) Select(field string, fields ...string) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetDeletedTime(t time.Time) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetMother(c *Cat) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetMotherID(u uuid.UUID) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetName(s string) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetNillableDeletedTime(t *time.Time) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetNillableMotherID(u *uuid.UUID) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetNillableName(s *string) *KittenUpdateOne
- func (kuo *KittenUpdateOne) SetUpdateTime(t time.Time) *KittenUpdateOne
- func (kuo *KittenUpdateOne) Where(ps ...predicate.Kitten) *KittenUpdateOne
- type Kittens
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- 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. TypeBreed = "Breed" TypeCat = "Cat" TypeFatherCat = "FatherCat" TypeKitten = "Kitten" )
Variables ¶
var ErrTxStarted = errors.New("gen: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(gen.As(gen.Sum(field1), "sum_field1"), (gen.As(gen.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 Breed ¶
type Breed struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // DeletedTime holds the value of the "deleted_time" field. DeletedTime *time.Time `json:"deleted_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,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 BreedQuery when eager-loading is set. Edges BreedEdges `json:"edges"` // contains filtered or unexported fields }
Breed is the model entity for the Breed schema.
func (*Breed) Unwrap ¶
Unwrap unwraps the Breed 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 (*Breed) Update ¶
func (b *Breed) Update() *BreedUpdateOne
Update returns a builder for updating this Breed. Note that you need to call Breed.Unwrap() before calling this method if this Breed was returned from a transaction, and the transaction was committed or rolled back.
type BreedClient ¶
type BreedClient struct {
// contains filtered or unexported fields
}
BreedClient is a client for the Breed schema.
func NewBreedClient ¶
func NewBreedClient(c config) *BreedClient
NewBreedClient returns a client for the Breed from the given config.
func (*BreedClient) Create ¶
func (c *BreedClient) Create() *BreedCreate
Create returns a builder for creating a Breed entity.
func (*BreedClient) CreateBulk ¶
func (c *BreedClient) CreateBulk(builders ...*BreedCreate) *BreedCreateBulk
CreateBulk returns a builder for creating a bulk of Breed entities.
func (*BreedClient) Delete ¶
func (c *BreedClient) Delete() *BreedDelete
Delete returns a delete builder for Breed.
func (*BreedClient) DeleteOne ¶
func (c *BreedClient) DeleteOne(b *Breed) *BreedDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BreedClient) DeleteOneID ¶
func (c *BreedClient) DeleteOneID(id uuid.UUID) *BreedDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BreedClient) Intercept ¶
func (c *BreedClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `breed.Intercept(f(g(h())))`.
func (*BreedClient) Interceptors ¶
func (c *BreedClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BreedClient) MapCreateBulk ¶
func (c *BreedClient) MapCreateBulk(slice any, setFunc func(*BreedCreate, int)) *BreedCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*BreedClient) Query ¶
func (c *BreedClient) Query() *BreedQuery
Query returns a query builder for Breed.
func (*BreedClient) QueryCats ¶
func (c *BreedClient) QueryCats(b *Breed) *CatQuery
QueryCats queries the cats edge of a Breed.
func (*BreedClient) Update ¶
func (c *BreedClient) Update() *BreedUpdate
Update returns an update builder for Breed.
func (*BreedClient) UpdateOne ¶
func (c *BreedClient) UpdateOne(b *Breed) *BreedUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BreedClient) UpdateOneID ¶
func (c *BreedClient) UpdateOneID(id uuid.UUID) *BreedUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BreedClient) Use ¶
func (c *BreedClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `breed.Hooks(f(g(h())))`.
type BreedCreate ¶
type BreedCreate struct {
// contains filtered or unexported fields
}
BreedCreate is the builder for creating a Breed entity.
func (*BreedCreate) AddCatIDs ¶
func (bc *BreedCreate) AddCatIDs(ids ...uuid.UUID) *BreedCreate
AddCatIDs adds the "cats" edge to the Cat entity by IDs.
func (*BreedCreate) AddCats ¶
func (bc *BreedCreate) AddCats(c ...*Cat) *BreedCreate
AddCats adds the "cats" edges to the Cat entity.
func (*BreedCreate) Exec ¶
func (bc *BreedCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BreedCreate) ExecX ¶
func (bc *BreedCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BreedCreate) Mutation ¶
func (bc *BreedCreate) Mutation() *BreedMutation
Mutation returns the BreedMutation object of the builder.
func (*BreedCreate) Save ¶
func (bc *BreedCreate) Save(ctx context.Context) (*Breed, error)
Save creates the Breed in the database.
func (*BreedCreate) SaveX ¶
func (bc *BreedCreate) SaveX(ctx context.Context) *Breed
SaveX calls Save and panics if Save returns an error.
func (*BreedCreate) SetCreateTime ¶
func (bc *BreedCreate) SetCreateTime(t time.Time) *BreedCreate
SetCreateTime sets the "create_time" field.
func (*BreedCreate) SetDeletedTime ¶
func (bc *BreedCreate) SetDeletedTime(t time.Time) *BreedCreate
SetDeletedTime sets the "deleted_time" field.
func (*BreedCreate) SetID ¶
func (bc *BreedCreate) SetID(u uuid.UUID) *BreedCreate
SetID sets the "id" field.
func (*BreedCreate) SetName ¶
func (bc *BreedCreate) SetName(s string) *BreedCreate
SetName sets the "name" field.
func (*BreedCreate) SetNillableCreateTime ¶
func (bc *BreedCreate) SetNillableCreateTime(t *time.Time) *BreedCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*BreedCreate) SetNillableDeletedTime ¶
func (bc *BreedCreate) SetNillableDeletedTime(t *time.Time) *BreedCreate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*BreedCreate) SetNillableID ¶
func (bc *BreedCreate) SetNillableID(u *uuid.UUID) *BreedCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*BreedCreate) SetNillableUpdateTime ¶
func (bc *BreedCreate) SetNillableUpdateTime(t *time.Time) *BreedCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*BreedCreate) SetUpdateTime ¶
func (bc *BreedCreate) SetUpdateTime(t time.Time) *BreedCreate
SetUpdateTime sets the "update_time" field.
type BreedCreateBulk ¶
type BreedCreateBulk struct {
// contains filtered or unexported fields
}
BreedCreateBulk is the builder for creating many Breed entities in bulk.
func (*BreedCreateBulk) Exec ¶
func (bcb *BreedCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BreedCreateBulk) ExecX ¶
func (bcb *BreedCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BreedDelete ¶
type BreedDelete struct {
// contains filtered or unexported fields
}
BreedDelete is the builder for deleting a Breed entity.
func (*BreedDelete) Exec ¶
func (bd *BreedDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BreedDelete) ExecX ¶
func (bd *BreedDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BreedDelete) Where ¶
func (bd *BreedDelete) Where(ps ...predicate.Breed) *BreedDelete
Where appends a list predicates to the BreedDelete builder.
type BreedDeleteOne ¶
type BreedDeleteOne struct {
// contains filtered or unexported fields
}
BreedDeleteOne is the builder for deleting a single Breed entity.
func (*BreedDeleteOne) Exec ¶
func (bdo *BreedDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BreedDeleteOne) ExecX ¶
func (bdo *BreedDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BreedDeleteOne) Where ¶
func (bdo *BreedDeleteOne) Where(ps ...predicate.Breed) *BreedDeleteOne
Where appends a list predicates to the BreedDelete builder.
type BreedEdges ¶
type BreedEdges struct { // Cats holds the value of the cats edge. Cats []*Cat `json:"cats,omitempty"` // contains filtered or unexported fields }
BreedEdges holds the relations/edges for other nodes in the graph.
func (BreedEdges) CatsOrErr ¶
func (e BreedEdges) CatsOrErr() ([]*Cat, error)
CatsOrErr returns the Cats value or an error if the edge was not loaded in eager-loading.
type BreedGroupBy ¶
type BreedGroupBy struct {
// contains filtered or unexported fields
}
BreedGroupBy is the group-by builder for Breed entities.
func (*BreedGroupBy) Aggregate ¶
func (bgb *BreedGroupBy) Aggregate(fns ...AggregateFunc) *BreedGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BreedGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BreedGroupBy) Scan ¶
func (bgb *BreedGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BreedGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BreedMutation ¶
type BreedMutation struct {
// contains filtered or unexported fields
}
BreedMutation represents an operation that mutates the Breed nodes in the graph.
func (*BreedMutation) AddCatIDs ¶
func (m *BreedMutation) AddCatIDs(ids ...uuid.UUID)
AddCatIDs adds the "cats" edge to the Cat entity by ids.
func (*BreedMutation) AddField ¶
func (m *BreedMutation) 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 (*BreedMutation) AddedEdges ¶
func (m *BreedMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BreedMutation) AddedField ¶
func (m *BreedMutation) 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 (*BreedMutation) AddedFields ¶
func (m *BreedMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BreedMutation) AddedIDs ¶
func (m *BreedMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BreedMutation) CatsCleared ¶
func (m *BreedMutation) CatsCleared() bool
CatsCleared reports if the "cats" edge to the Cat entity was cleared.
func (*BreedMutation) CatsIDs ¶
func (m *BreedMutation) CatsIDs() (ids []uuid.UUID)
CatsIDs returns the "cats" edge IDs in the mutation.
func (*BreedMutation) ClearCats ¶
func (m *BreedMutation) ClearCats()
ClearCats clears the "cats" edge to the Cat entity.
func (*BreedMutation) ClearDeletedTime ¶
func (m *BreedMutation) ClearDeletedTime()
ClearDeletedTime clears the value of the "deleted_time" field.
func (*BreedMutation) ClearEdge ¶
func (m *BreedMutation) 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 (*BreedMutation) ClearField ¶
func (m *BreedMutation) 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 (*BreedMutation) ClearedEdges ¶
func (m *BreedMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BreedMutation) ClearedFields ¶
func (m *BreedMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BreedMutation) Client ¶
func (m BreedMutation) 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 (*BreedMutation) CreateTime ¶
func (m *BreedMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*BreedMutation) DeletedTime ¶
func (m *BreedMutation) DeletedTime() (r time.Time, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*BreedMutation) DeletedTimeCleared ¶
func (m *BreedMutation) DeletedTimeCleared() bool
DeletedTimeCleared returns if the "deleted_time" field was cleared in this mutation.
func (*BreedMutation) EdgeCleared ¶
func (m *BreedMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BreedMutation) Field ¶
func (m *BreedMutation) 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 (*BreedMutation) FieldCleared ¶
func (m *BreedMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BreedMutation) Fields ¶
func (m *BreedMutation) 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 (*BreedMutation) ID ¶
func (m *BreedMutation) 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 (*BreedMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BreedMutation) Name ¶
func (m *BreedMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*BreedMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Breed entity. If the Breed 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 (*BreedMutation) OldDeletedTime ¶
OldDeletedTime returns the old "deleted_time" field's value of the Breed entity. If the Breed 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 (*BreedMutation) 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 (*BreedMutation) OldName ¶
func (m *BreedMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Breed entity. If the Breed 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 (*BreedMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Breed entity. If the Breed 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 (*BreedMutation) RemoveCatIDs ¶
func (m *BreedMutation) RemoveCatIDs(ids ...uuid.UUID)
RemoveCatIDs removes the "cats" edge to the Cat entity by IDs.
func (*BreedMutation) RemovedCatsIDs ¶
func (m *BreedMutation) RemovedCatsIDs() (ids []uuid.UUID)
RemovedCats returns the removed IDs of the "cats" edge to the Cat entity.
func (*BreedMutation) RemovedEdges ¶
func (m *BreedMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BreedMutation) RemovedIDs ¶
func (m *BreedMutation) 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 (*BreedMutation) ResetCats ¶
func (m *BreedMutation) ResetCats()
ResetCats resets all changes to the "cats" edge.
func (*BreedMutation) ResetCreateTime ¶
func (m *BreedMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*BreedMutation) ResetDeletedTime ¶
func (m *BreedMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*BreedMutation) ResetEdge ¶
func (m *BreedMutation) 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 (*BreedMutation) ResetField ¶
func (m *BreedMutation) 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 (*BreedMutation) ResetName ¶
func (m *BreedMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*BreedMutation) ResetUpdateTime ¶
func (m *BreedMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*BreedMutation) SetCreateTime ¶
func (m *BreedMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*BreedMutation) SetDeletedTime ¶
func (m *BreedMutation) SetDeletedTime(t time.Time)
SetDeletedTime sets the "deleted_time" field.
func (*BreedMutation) SetField ¶
func (m *BreedMutation) 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 (*BreedMutation) SetID ¶
func (m *BreedMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Breed entities.
func (*BreedMutation) SetName ¶
func (m *BreedMutation) SetName(s string)
SetName sets the "name" field.
func (*BreedMutation) SetOp ¶
func (m *BreedMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BreedMutation) SetUpdateTime ¶
func (m *BreedMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (BreedMutation) Tx ¶
func (m BreedMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BreedMutation) Type ¶
func (m *BreedMutation) Type() string
Type returns the node type of this mutation (Breed).
func (*BreedMutation) UpdateTime ¶
func (m *BreedMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*BreedMutation) Where ¶
func (m *BreedMutation) Where(ps ...predicate.Breed)
Where appends a list predicates to the BreedMutation builder.
func (*BreedMutation) WhereP ¶
func (m *BreedMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BreedMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BreedQuery ¶
type BreedQuery struct {
// contains filtered or unexported fields
}
BreedQuery is the builder for querying Breed entities.
func (*BreedQuery) Aggregate ¶
func (bq *BreedQuery) Aggregate(fns ...AggregateFunc) *BreedSelect
Aggregate returns a BreedSelect configured with the given aggregations.
func (*BreedQuery) All ¶
func (bq *BreedQuery) All(ctx context.Context) ([]*Breed, error)
All executes the query and returns a list of Breeds.
func (*BreedQuery) AllX ¶
func (bq *BreedQuery) AllX(ctx context.Context) []*Breed
AllX is like All, but panics if an error occurs.
func (*BreedQuery) Clone ¶
func (bq *BreedQuery) Clone() *BreedQuery
Clone returns a duplicate of the BreedQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BreedQuery) Count ¶
func (bq *BreedQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BreedQuery) CountX ¶
func (bq *BreedQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BreedQuery) Exist ¶
func (bq *BreedQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BreedQuery) ExistX ¶
func (bq *BreedQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BreedQuery) First ¶
func (bq *BreedQuery) First(ctx context.Context) (*Breed, error)
First returns the first Breed entity from the query. Returns a *NotFoundError when no Breed was found.
func (*BreedQuery) FirstID ¶
FirstID returns the first Breed ID from the query. Returns a *NotFoundError when no Breed ID was found.
func (*BreedQuery) FirstIDX ¶
func (bq *BreedQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*BreedQuery) FirstX ¶
func (bq *BreedQuery) FirstX(ctx context.Context) *Breed
FirstX is like First, but panics if an error occurs.
func (*BreedQuery) GroupBy ¶
func (bq *BreedQuery) GroupBy(field string, fields ...string) *BreedGroupBy
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` Count int `json:"count,omitempty"` } client.Breed.Query(). GroupBy(breed.FieldDeletedTime). Aggregate(gen.Count()). Scan(ctx, &v)
func (*BreedQuery) IDsX ¶
func (bq *BreedQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*BreedQuery) Limit ¶
func (bq *BreedQuery) Limit(limit int) *BreedQuery
Limit the number of records to be returned by this query.
func (*BreedQuery) Offset ¶
func (bq *BreedQuery) Offset(offset int) *BreedQuery
Offset to start from.
func (*BreedQuery) Only ¶
func (bq *BreedQuery) Only(ctx context.Context) (*Breed, error)
Only returns a single Breed entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Breed entity is found. Returns a *NotFoundError when no Breed entities are found.
func (*BreedQuery) OnlyID ¶
OnlyID is like Only, but returns the only Breed ID in the query. Returns a *NotSingularError when more than one Breed ID is found. Returns a *NotFoundError when no entities are found.
func (*BreedQuery) OnlyIDX ¶
func (bq *BreedQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BreedQuery) OnlyX ¶
func (bq *BreedQuery) OnlyX(ctx context.Context) *Breed
OnlyX is like Only, but panics if an error occurs.
func (*BreedQuery) Order ¶
func (bq *BreedQuery) Order(o ...breed.OrderOption) *BreedQuery
Order specifies how the records should be ordered.
func (*BreedQuery) QueryCats ¶
func (bq *BreedQuery) QueryCats() *CatQuery
QueryCats chains the current query on the "cats" edge.
func (*BreedQuery) Select ¶
func (bq *BreedQuery) Select(fields ...string) *BreedSelect
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` } client.Breed.Query(). Select(breed.FieldDeletedTime). Scan(ctx, &v)
func (*BreedQuery) Unique ¶
func (bq *BreedQuery) Unique(unique bool) *BreedQuery
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 (*BreedQuery) Where ¶
func (bq *BreedQuery) Where(ps ...predicate.Breed) *BreedQuery
Where adds a new predicate for the BreedQuery builder.
func (*BreedQuery) WithCats ¶
func (bq *BreedQuery) WithCats(opts ...func(*CatQuery)) *BreedQuery
WithCats tells the query-builder to eager-load the nodes that are connected to the "cats" edge. The optional arguments are used to configure the query builder of the edge.
type BreedSelect ¶
type BreedSelect struct { *BreedQuery // contains filtered or unexported fields }
BreedSelect is the builder for selecting fields of Breed entities.
func (*BreedSelect) Aggregate ¶
func (bs *BreedSelect) Aggregate(fns ...AggregateFunc) *BreedSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BreedSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BreedSelect) Scan ¶
func (bs *BreedSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BreedSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BreedUpdate ¶
type BreedUpdate struct {
// contains filtered or unexported fields
}
BreedUpdate is the builder for updating Breed entities.
func (*BreedUpdate) AddCatIDs ¶
func (bu *BreedUpdate) AddCatIDs(ids ...uuid.UUID) *BreedUpdate
AddCatIDs adds the "cats" edge to the Cat entity by IDs.
func (*BreedUpdate) AddCats ¶
func (bu *BreedUpdate) AddCats(c ...*Cat) *BreedUpdate
AddCats adds the "cats" edges to the Cat entity.
func (*BreedUpdate) ClearCats ¶
func (bu *BreedUpdate) ClearCats() *BreedUpdate
ClearCats clears all "cats" edges to the Cat entity.
func (*BreedUpdate) ClearDeletedTime ¶
func (bu *BreedUpdate) ClearDeletedTime() *BreedUpdate
ClearDeletedTime clears the value of the "deleted_time" field.
func (*BreedUpdate) Exec ¶
func (bu *BreedUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BreedUpdate) ExecX ¶
func (bu *BreedUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BreedUpdate) Mutation ¶
func (bu *BreedUpdate) Mutation() *BreedMutation
Mutation returns the BreedMutation object of the builder.
func (*BreedUpdate) RemoveCatIDs ¶
func (bu *BreedUpdate) RemoveCatIDs(ids ...uuid.UUID) *BreedUpdate
RemoveCatIDs removes the "cats" edge to Cat entities by IDs.
func (*BreedUpdate) RemoveCats ¶
func (bu *BreedUpdate) RemoveCats(c ...*Cat) *BreedUpdate
RemoveCats removes "cats" edges to Cat entities.
func (*BreedUpdate) Save ¶
func (bu *BreedUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BreedUpdate) SaveX ¶
func (bu *BreedUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BreedUpdate) SetDeletedTime ¶
func (bu *BreedUpdate) SetDeletedTime(t time.Time) *BreedUpdate
SetDeletedTime sets the "deleted_time" field.
func (*BreedUpdate) SetName ¶
func (bu *BreedUpdate) SetName(s string) *BreedUpdate
SetName sets the "name" field.
func (*BreedUpdate) SetNillableDeletedTime ¶
func (bu *BreedUpdate) SetNillableDeletedTime(t *time.Time) *BreedUpdate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*BreedUpdate) SetNillableName ¶
func (bu *BreedUpdate) SetNillableName(s *string) *BreedUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*BreedUpdate) SetUpdateTime ¶
func (bu *BreedUpdate) SetUpdateTime(t time.Time) *BreedUpdate
SetUpdateTime sets the "update_time" field.
func (*BreedUpdate) Where ¶
func (bu *BreedUpdate) Where(ps ...predicate.Breed) *BreedUpdate
Where appends a list predicates to the BreedUpdate builder.
type BreedUpdateOne ¶
type BreedUpdateOne struct {
// contains filtered or unexported fields
}
BreedUpdateOne is the builder for updating a single Breed entity.
func (*BreedUpdateOne) AddCatIDs ¶
func (buo *BreedUpdateOne) AddCatIDs(ids ...uuid.UUID) *BreedUpdateOne
AddCatIDs adds the "cats" edge to the Cat entity by IDs.
func (*BreedUpdateOne) AddCats ¶
func (buo *BreedUpdateOne) AddCats(c ...*Cat) *BreedUpdateOne
AddCats adds the "cats" edges to the Cat entity.
func (*BreedUpdateOne) ClearCats ¶
func (buo *BreedUpdateOne) ClearCats() *BreedUpdateOne
ClearCats clears all "cats" edges to the Cat entity.
func (*BreedUpdateOne) ClearDeletedTime ¶
func (buo *BreedUpdateOne) ClearDeletedTime() *BreedUpdateOne
ClearDeletedTime clears the value of the "deleted_time" field.
func (*BreedUpdateOne) Exec ¶
func (buo *BreedUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BreedUpdateOne) ExecX ¶
func (buo *BreedUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BreedUpdateOne) Mutation ¶
func (buo *BreedUpdateOne) Mutation() *BreedMutation
Mutation returns the BreedMutation object of the builder.
func (*BreedUpdateOne) RemoveCatIDs ¶
func (buo *BreedUpdateOne) RemoveCatIDs(ids ...uuid.UUID) *BreedUpdateOne
RemoveCatIDs removes the "cats" edge to Cat entities by IDs.
func (*BreedUpdateOne) RemoveCats ¶
func (buo *BreedUpdateOne) RemoveCats(c ...*Cat) *BreedUpdateOne
RemoveCats removes "cats" edges to Cat entities.
func (*BreedUpdateOne) Save ¶
func (buo *BreedUpdateOne) Save(ctx context.Context) (*Breed, error)
Save executes the query and returns the updated Breed entity.
func (*BreedUpdateOne) SaveX ¶
func (buo *BreedUpdateOne) SaveX(ctx context.Context) *Breed
SaveX is like Save, but panics if an error occurs.
func (*BreedUpdateOne) Select ¶
func (buo *BreedUpdateOne) Select(field string, fields ...string) *BreedUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BreedUpdateOne) SetDeletedTime ¶
func (buo *BreedUpdateOne) SetDeletedTime(t time.Time) *BreedUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*BreedUpdateOne) SetName ¶
func (buo *BreedUpdateOne) SetName(s string) *BreedUpdateOne
SetName sets the "name" field.
func (*BreedUpdateOne) SetNillableDeletedTime ¶
func (buo *BreedUpdateOne) SetNillableDeletedTime(t *time.Time) *BreedUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*BreedUpdateOne) SetNillableName ¶
func (buo *BreedUpdateOne) SetNillableName(s *string) *BreedUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*BreedUpdateOne) SetUpdateTime ¶
func (buo *BreedUpdateOne) SetUpdateTime(t time.Time) *BreedUpdateOne
SetUpdateTime sets the "update_time" field.
func (*BreedUpdateOne) Where ¶
func (buo *BreedUpdateOne) Where(ps ...predicate.Breed) *BreedUpdateOne
Where appends a list predicates to the BreedUpdate builder.
type Cat ¶
type Cat struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // DeletedTime holds the value of the "deleted_time" field. DeletedTime *time.Time `json:"deleted_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Идентификатор локации BreedID uuid.UUID `json:"breed_id,omitempty"` // Speed holds the value of the "speed" field. Speed int64 `json:"speed,omitempty"` // Дата начала DateFrom time.Time `json:"date_from,omitempty"` // Тип Type cat.Type `json:"type,omitempty"` // Другой тип OtherType cat.OtherType `json:"other_type,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CatQuery when eager-loading is set. Edges CatEdges `json:"edges"` // PhantomField defined by template. PhantomField string `json:"phantom_field,omitempty"` // contains filtered or unexported fields }
Cat is the model entity for the Cat schema.
func (*Cat) QueryBreed ¶
func (c *Cat) QueryBreed() *BreedQuery
QueryBreed queries the "breed" edge of the Cat entity.
func (*Cat) QueryKittens ¶
func (c *Cat) QueryKittens() *KittenQuery
QueryKittens queries the "kittens" edge of the Cat entity.
func (*Cat) Unwrap ¶
Unwrap unwraps the Cat 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 (*Cat) Update ¶
func (c *Cat) Update() *CatUpdateOne
Update returns a builder for updating this Cat. Note that you need to call Cat.Unwrap() before calling this method if this Cat was returned from a transaction, and the transaction was committed or rolled back.
type CatClient ¶
type CatClient struct {
// contains filtered or unexported fields
}
CatClient is a client for the Cat schema.
func NewCatClient ¶
func NewCatClient(c config) *CatClient
NewCatClient returns a client for the Cat from the given config.
func (*CatClient) CreateBulk ¶
func (c *CatClient) CreateBulk(builders ...*CatCreate) *CatCreateBulk
CreateBulk returns a builder for creating a bulk of Cat entities.
func (*CatClient) DeleteOne ¶
func (c *CatClient) DeleteOne(ca *Cat) *CatDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CatClient) DeleteOneID ¶
func (c *CatClient) DeleteOneID(id uuid.UUID) *CatDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CatClient) Intercept ¶
func (c *CatClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cat.Intercept(f(g(h())))`.
func (*CatClient) Interceptors ¶
func (c *CatClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CatClient) MapCreateBulk ¶
func (c *CatClient) MapCreateBulk(slice any, setFunc func(*CatCreate, int)) *CatCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CatClient) QueryBreed ¶
func (c *CatClient) QueryBreed(ca *Cat) *BreedQuery
QueryBreed queries the breed edge of a Cat.
func (*CatClient) QueryKittens ¶
func (c *CatClient) QueryKittens(ca *Cat) *KittenQuery
QueryKittens queries the kittens edge of a Cat.
func (*CatClient) UpdateOne ¶
func (c *CatClient) UpdateOne(ca *Cat) *CatUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CatClient) UpdateOneID ¶
func (c *CatClient) UpdateOneID(id uuid.UUID) *CatUpdateOne
UpdateOneID returns an update builder for the given id.
type CatCreate ¶
type CatCreate struct {
// contains filtered or unexported fields
}
CatCreate is the builder for creating a Cat entity.
func (*CatCreate) AddKittenIDs ¶
AddKittenIDs adds the "kittens" edge to the Kitten entity by IDs.
func (*CatCreate) AddKittens ¶
AddKittens adds the "kittens" edges to the Kitten entity.
func (*CatCreate) Mutation ¶
func (cc *CatCreate) Mutation() *CatMutation
Mutation returns the CatMutation object of the builder.
func (*CatCreate) SetBreedID ¶
SetBreedID sets the "breed_id" field.
func (*CatCreate) SetCreateTime ¶
SetCreateTime sets the "create_time" field.
func (*CatCreate) SetDateFrom ¶
SetDateFrom sets the "date_from" field.
func (*CatCreate) SetDeletedTime ¶
SetDeletedTime sets the "deleted_time" field.
func (*CatCreate) SetNillableCreateTime ¶
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*CatCreate) SetNillableDeletedTime ¶
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*CatCreate) SetNillableID ¶
SetNillableID sets the "id" field if the given value is not nil.
func (*CatCreate) SetNillableUpdateTime ¶
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*CatCreate) SetOtherType ¶
SetOtherType sets the "other_type" field.
type CatCreateBulk ¶
type CatCreateBulk struct {
// contains filtered or unexported fields
}
CatCreateBulk is the builder for creating many Cat entities in bulk.
func (*CatCreateBulk) Exec ¶
func (ccb *CatCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CatCreateBulk) ExecX ¶
func (ccb *CatCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CatDelete ¶
type CatDelete struct {
// contains filtered or unexported fields
}
CatDelete is the builder for deleting a Cat entity.
func (*CatDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type CatDeleteOne ¶
type CatDeleteOne struct {
// contains filtered or unexported fields
}
CatDeleteOne is the builder for deleting a single Cat entity.
func (*CatDeleteOne) Exec ¶
func (cdo *CatDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CatDeleteOne) ExecX ¶
func (cdo *CatDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CatDeleteOne) Where ¶
func (cdo *CatDeleteOne) Where(ps ...predicate.Cat) *CatDeleteOne
Where appends a list predicates to the CatDelete builder.
type CatEdges ¶
type CatEdges struct { // Kittens holds the value of the kittens edge. Kittens []*Kitten `json:"kittens,omitempty"` // Breed holds the value of the breed edge. Breed *Breed `json:"breed,omitempty"` // contains filtered or unexported fields }
CatEdges holds the relations/edges for other nodes in the graph.
func (CatEdges) BreedOrErr ¶
BreedOrErr returns the Breed value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CatEdges) KittensOrErr ¶
KittensOrErr returns the Kittens value or an error if the edge was not loaded in eager-loading.
type CatGroupBy ¶
type CatGroupBy struct {
// contains filtered or unexported fields
}
CatGroupBy is the group-by builder for Cat entities.
func (*CatGroupBy) Aggregate ¶
func (cgb *CatGroupBy) Aggregate(fns ...AggregateFunc) *CatGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CatGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CatGroupBy) Scan ¶
func (cgb *CatGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CatGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CatMutation ¶
type CatMutation struct {
// contains filtered or unexported fields
}
CatMutation represents an operation that mutates the Cat nodes in the graph.
func (*CatMutation) AddField ¶
func (m *CatMutation) 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 (*CatMutation) AddKittenIDs ¶
func (m *CatMutation) AddKittenIDs(ids ...uuid.UUID)
AddKittenIDs adds the "kittens" edge to the Kitten entity by ids.
func (*CatMutation) AddSpeed ¶
func (m *CatMutation) AddSpeed(i int64)
AddSpeed adds i to the "speed" field.
func (*CatMutation) AddedEdges ¶
func (m *CatMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CatMutation) AddedField ¶
func (m *CatMutation) 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 (*CatMutation) AddedFields ¶
func (m *CatMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CatMutation) AddedIDs ¶
func (m *CatMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CatMutation) AddedSpeed ¶
func (m *CatMutation) AddedSpeed() (r int64, exists bool)
AddedSpeed returns the value that was added to the "speed" field in this mutation.
func (*CatMutation) BreedCleared ¶
func (m *CatMutation) BreedCleared() bool
BreedCleared reports if the "breed" edge to the Breed entity was cleared.
func (*CatMutation) BreedID ¶
func (m *CatMutation) BreedID() (r uuid.UUID, exists bool)
BreedID returns the value of the "breed_id" field in the mutation.
func (*CatMutation) BreedIDs ¶
func (m *CatMutation) BreedIDs() (ids []uuid.UUID)
BreedIDs returns the "breed" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BreedID instead. It exists only for internal usage by the builders.
func (*CatMutation) ClearBreed ¶
func (m *CatMutation) ClearBreed()
ClearBreed clears the "breed" edge to the Breed entity.
func (*CatMutation) ClearDeletedTime ¶
func (m *CatMutation) ClearDeletedTime()
ClearDeletedTime clears the value of the "deleted_time" field.
func (*CatMutation) ClearEdge ¶
func (m *CatMutation) 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 (*CatMutation) ClearField ¶
func (m *CatMutation) 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 (*CatMutation) ClearKittens ¶
func (m *CatMutation) ClearKittens()
ClearKittens clears the "kittens" edge to the Kitten entity.
func (*CatMutation) ClearedEdges ¶
func (m *CatMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CatMutation) ClearedFields ¶
func (m *CatMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CatMutation) Client ¶
func (m CatMutation) 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 (*CatMutation) CreateTime ¶
func (m *CatMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*CatMutation) DateFrom ¶
func (m *CatMutation) DateFrom() (r time.Time, exists bool)
DateFrom returns the value of the "date_from" field in the mutation.
func (*CatMutation) DeletedTime ¶
func (m *CatMutation) DeletedTime() (r time.Time, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*CatMutation) DeletedTimeCleared ¶
func (m *CatMutation) DeletedTimeCleared() bool
DeletedTimeCleared returns if the "deleted_time" field was cleared in this mutation.
func (*CatMutation) EdgeCleared ¶
func (m *CatMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CatMutation) Field ¶
func (m *CatMutation) 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 (*CatMutation) FieldCleared ¶
func (m *CatMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CatMutation) Fields ¶
func (m *CatMutation) 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 (*CatMutation) GetType ¶
func (m *CatMutation) GetType() (r cat.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*CatMutation) ID ¶
func (m *CatMutation) 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 (*CatMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CatMutation) KittensCleared ¶
func (m *CatMutation) KittensCleared() bool
KittensCleared reports if the "kittens" edge to the Kitten entity was cleared.
func (*CatMutation) KittensIDs ¶
func (m *CatMutation) KittensIDs() (ids []uuid.UUID)
KittensIDs returns the "kittens" edge IDs in the mutation.
func (*CatMutation) Name ¶
func (m *CatMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CatMutation) OldBreedID ¶
OldBreedID returns the old "breed_id" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldDateFrom ¶
OldDateFrom returns the old "date_from" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldDeletedTime ¶
OldDeletedTime returns the old "deleted_time" field's value of the Cat entity. If the Cat 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 (*CatMutation) 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 (*CatMutation) OldName ¶
func (m *CatMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldOtherType ¶
OldOtherType returns the old "other_type" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldSpeed ¶
func (m *CatMutation) OldSpeed(ctx context.Context) (v int64, err error)
OldSpeed returns the old "speed" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldType ¶
OldType returns the old "type" field's value of the Cat entity. If the Cat 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 (*CatMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Cat entity. If the Cat 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 (*CatMutation) OtherType ¶
func (m *CatMutation) OtherType() (r cat.OtherType, exists bool)
OtherType returns the value of the "other_type" field in the mutation.
func (*CatMutation) RemoveKittenIDs ¶
func (m *CatMutation) RemoveKittenIDs(ids ...uuid.UUID)
RemoveKittenIDs removes the "kittens" edge to the Kitten entity by IDs.
func (*CatMutation) RemovedEdges ¶
func (m *CatMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CatMutation) RemovedIDs ¶
func (m *CatMutation) 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 (*CatMutation) RemovedKittensIDs ¶
func (m *CatMutation) RemovedKittensIDs() (ids []uuid.UUID)
RemovedKittens returns the removed IDs of the "kittens" edge to the Kitten entity.
func (*CatMutation) ResetBreed ¶
func (m *CatMutation) ResetBreed()
ResetBreed resets all changes to the "breed" edge.
func (*CatMutation) ResetBreedID ¶
func (m *CatMutation) ResetBreedID()
ResetBreedID resets all changes to the "breed_id" field.
func (*CatMutation) ResetCreateTime ¶
func (m *CatMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*CatMutation) ResetDateFrom ¶
func (m *CatMutation) ResetDateFrom()
ResetDateFrom resets all changes to the "date_from" field.
func (*CatMutation) ResetDeletedTime ¶
func (m *CatMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*CatMutation) ResetEdge ¶
func (m *CatMutation) 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 (*CatMutation) ResetField ¶
func (m *CatMutation) 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 (*CatMutation) ResetKittens ¶
func (m *CatMutation) ResetKittens()
ResetKittens resets all changes to the "kittens" edge.
func (*CatMutation) ResetName ¶
func (m *CatMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CatMutation) ResetOtherType ¶
func (m *CatMutation) ResetOtherType()
ResetOtherType resets all changes to the "other_type" field.
func (*CatMutation) ResetSpeed ¶
func (m *CatMutation) ResetSpeed()
ResetSpeed resets all changes to the "speed" field.
func (*CatMutation) ResetType ¶
func (m *CatMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*CatMutation) ResetUpdateTime ¶
func (m *CatMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*CatMutation) SetBreedID ¶
func (m *CatMutation) SetBreedID(u uuid.UUID)
SetBreedID sets the "breed_id" field.
func (*CatMutation) SetCreateTime ¶
func (m *CatMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*CatMutation) SetDateFrom ¶
func (m *CatMutation) SetDateFrom(t time.Time)
SetDateFrom sets the "date_from" field.
func (*CatMutation) SetDeletedTime ¶
func (m *CatMutation) SetDeletedTime(t time.Time)
SetDeletedTime sets the "deleted_time" field.
func (*CatMutation) SetField ¶
func (m *CatMutation) 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 (*CatMutation) SetID ¶
func (m *CatMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Cat entities.
func (*CatMutation) SetName ¶
func (m *CatMutation) SetName(s string)
SetName sets the "name" field.
func (*CatMutation) SetOp ¶
func (m *CatMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CatMutation) SetOtherType ¶
func (m *CatMutation) SetOtherType(ct cat.OtherType)
SetOtherType sets the "other_type" field.
func (*CatMutation) SetSpeed ¶
func (m *CatMutation) SetSpeed(i int64)
SetSpeed sets the "speed" field.
func (*CatMutation) SetType ¶
func (m *CatMutation) SetType(c cat.Type)
SetType sets the "type" field.
func (*CatMutation) SetUpdateTime ¶
func (m *CatMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*CatMutation) Speed ¶
func (m *CatMutation) Speed() (r int64, exists bool)
Speed returns the value of the "speed" field in the mutation.
func (CatMutation) Tx ¶
func (m CatMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CatMutation) Type ¶
func (m *CatMutation) Type() string
Type returns the node type of this mutation (Cat).
func (*CatMutation) UpdateTime ¶
func (m *CatMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*CatMutation) Where ¶
func (m *CatMutation) Where(ps ...predicate.Cat)
Where appends a list predicates to the CatMutation builder.
func (*CatMutation) WhereP ¶
func (m *CatMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CatMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CatQuery ¶
type CatQuery struct {
// contains filtered or unexported fields
}
CatQuery is the builder for querying Cat entities.
func (*CatQuery) Aggregate ¶
func (cq *CatQuery) Aggregate(fns ...AggregateFunc) *CatSelect
Aggregate returns a CatSelect configured with the given aggregations.
func (*CatQuery) Clone ¶
Clone returns a duplicate of the CatQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CatQuery) First ¶
First returns the first Cat entity from the query. Returns a *NotFoundError when no Cat was found.
func (*CatQuery) FirstID ¶
FirstID returns the first Cat ID from the query. Returns a *NotFoundError when no Cat ID was found.
func (*CatQuery) GroupBy ¶
func (cq *CatQuery) GroupBy(field string, fields ...string) *CatGroupBy
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` Count int `json:"count,omitempty"` } client.Cat.Query(). GroupBy(cat.FieldDeletedTime). Aggregate(gen.Count()). Scan(ctx, &v)
func (*CatQuery) Only ¶
Only returns a single Cat entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Cat entity is found. Returns a *NotFoundError when no Cat entities are found.
func (*CatQuery) OnlyID ¶
OnlyID is like Only, but returns the only Cat ID in the query. Returns a *NotSingularError when more than one Cat ID is found. Returns a *NotFoundError when no entities are found.
func (*CatQuery) Order ¶
func (cq *CatQuery) Order(o ...cat.OrderOption) *CatQuery
Order specifies how the records should be ordered.
func (*CatQuery) QueryBreed ¶
func (cq *CatQuery) QueryBreed() *BreedQuery
QueryBreed chains the current query on the "breed" edge.
func (*CatQuery) QueryKittens ¶
func (cq *CatQuery) QueryKittens() *KittenQuery
QueryKittens chains the current query on the "kittens" edge.
func (*CatQuery) 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 { DeletedTime time.Time `json:"deleted_time,omitempty"` } client.Cat.Query(). Select(cat.FieldDeletedTime). Scan(ctx, &v)
func (*CatQuery) 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 (*CatQuery) WithBreed ¶
func (cq *CatQuery) WithBreed(opts ...func(*BreedQuery)) *CatQuery
WithBreed tells the query-builder to eager-load the nodes that are connected to the "breed" edge. The optional arguments are used to configure the query builder of the edge.
func (*CatQuery) WithKittens ¶
func (cq *CatQuery) WithKittens(opts ...func(*KittenQuery)) *CatQuery
WithKittens tells the query-builder to eager-load the nodes that are connected to the "kittens" edge. The optional arguments are used to configure the query builder of the edge.
type CatSelect ¶
type CatSelect struct { *CatQuery // contains filtered or unexported fields }
CatSelect is the builder for selecting fields of Cat entities.
func (*CatSelect) Aggregate ¶
func (cs *CatSelect) Aggregate(fns ...AggregateFunc) *CatSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CatSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CatSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CatSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CatSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CatSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CatSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CatSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CatUpdate ¶
type CatUpdate struct {
// contains filtered or unexported fields
}
CatUpdate is the builder for updating Cat entities.
func (*CatUpdate) AddKittenIDs ¶
AddKittenIDs adds the "kittens" edge to the Kitten entity by IDs.
func (*CatUpdate) AddKittens ¶
AddKittens adds the "kittens" edges to the Kitten entity.
func (*CatUpdate) ClearBreed ¶
ClearBreed clears the "breed" edge to the Breed entity.
func (*CatUpdate) ClearDeletedTime ¶
ClearDeletedTime clears the value of the "deleted_time" field.
func (*CatUpdate) ClearKittens ¶
ClearKittens clears all "kittens" edges to the Kitten entity.
func (*CatUpdate) Mutation ¶
func (cu *CatUpdate) Mutation() *CatMutation
Mutation returns the CatMutation object of the builder.
func (*CatUpdate) RemoveKittenIDs ¶
RemoveKittenIDs removes the "kittens" edge to Kitten entities by IDs.
func (*CatUpdate) RemoveKittens ¶
RemoveKittens removes "kittens" edges to Kitten entities.
func (*CatUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*CatUpdate) SetBreedID ¶
SetBreedID sets the "breed_id" field.
func (*CatUpdate) SetDateFrom ¶
SetDateFrom sets the "date_from" field.
func (*CatUpdate) SetDeletedTime ¶
SetDeletedTime sets the "deleted_time" field.
func (*CatUpdate) SetNillableBreedID ¶
SetNillableBreedID sets the "breed_id" field if the given value is not nil.
func (*CatUpdate) SetNillableDateFrom ¶
SetNillableDateFrom sets the "date_from" field if the given value is not nil.
func (*CatUpdate) SetNillableDeletedTime ¶
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*CatUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*CatUpdate) SetNillableOtherType ¶
SetNillableOtherType sets the "other_type" field if the given value is not nil.
func (*CatUpdate) SetNillableSpeed ¶
SetNillableSpeed sets the "speed" field if the given value is not nil.
func (*CatUpdate) SetNillableType ¶
SetNillableType sets the "type" field if the given value is not nil.
func (*CatUpdate) SetOtherType ¶
SetOtherType sets the "other_type" field.
func (*CatUpdate) SetUpdateTime ¶
SetUpdateTime sets the "update_time" field.
type CatUpdateOne ¶
type CatUpdateOne struct {
// contains filtered or unexported fields
}
CatUpdateOne is the builder for updating a single Cat entity.
func (*CatUpdateOne) AddKittenIDs ¶
func (cuo *CatUpdateOne) AddKittenIDs(ids ...uuid.UUID) *CatUpdateOne
AddKittenIDs adds the "kittens" edge to the Kitten entity by IDs.
func (*CatUpdateOne) AddKittens ¶
func (cuo *CatUpdateOne) AddKittens(k ...*Kitten) *CatUpdateOne
AddKittens adds the "kittens" edges to the Kitten entity.
func (*CatUpdateOne) AddSpeed ¶
func (cuo *CatUpdateOne) AddSpeed(i int64) *CatUpdateOne
AddSpeed adds i to the "speed" field.
func (*CatUpdateOne) ClearBreed ¶
func (cuo *CatUpdateOne) ClearBreed() *CatUpdateOne
ClearBreed clears the "breed" edge to the Breed entity.
func (*CatUpdateOne) ClearDeletedTime ¶
func (cuo *CatUpdateOne) ClearDeletedTime() *CatUpdateOne
ClearDeletedTime clears the value of the "deleted_time" field.
func (*CatUpdateOne) ClearKittens ¶
func (cuo *CatUpdateOne) ClearKittens() *CatUpdateOne
ClearKittens clears all "kittens" edges to the Kitten entity.
func (*CatUpdateOne) Exec ¶
func (cuo *CatUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CatUpdateOne) ExecX ¶
func (cuo *CatUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CatUpdateOne) Mutation ¶
func (cuo *CatUpdateOne) Mutation() *CatMutation
Mutation returns the CatMutation object of the builder.
func (*CatUpdateOne) RemoveKittenIDs ¶
func (cuo *CatUpdateOne) RemoveKittenIDs(ids ...uuid.UUID) *CatUpdateOne
RemoveKittenIDs removes the "kittens" edge to Kitten entities by IDs.
func (*CatUpdateOne) RemoveKittens ¶
func (cuo *CatUpdateOne) RemoveKittens(k ...*Kitten) *CatUpdateOne
RemoveKittens removes "kittens" edges to Kitten entities.
func (*CatUpdateOne) Save ¶
func (cuo *CatUpdateOne) Save(ctx context.Context) (*Cat, error)
Save executes the query and returns the updated Cat entity.
func (*CatUpdateOne) SaveX ¶
func (cuo *CatUpdateOne) SaveX(ctx context.Context) *Cat
SaveX is like Save, but panics if an error occurs.
func (*CatUpdateOne) Select ¶
func (cuo *CatUpdateOne) Select(field string, fields ...string) *CatUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CatUpdateOne) SetBreed ¶
func (cuo *CatUpdateOne) SetBreed(b *Breed) *CatUpdateOne
SetBreed sets the "breed" edge to the Breed entity.
func (*CatUpdateOne) SetBreedID ¶
func (cuo *CatUpdateOne) SetBreedID(u uuid.UUID) *CatUpdateOne
SetBreedID sets the "breed_id" field.
func (*CatUpdateOne) SetDateFrom ¶
func (cuo *CatUpdateOne) SetDateFrom(t time.Time) *CatUpdateOne
SetDateFrom sets the "date_from" field.
func (*CatUpdateOne) SetDeletedTime ¶
func (cuo *CatUpdateOne) SetDeletedTime(t time.Time) *CatUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*CatUpdateOne) SetName ¶
func (cuo *CatUpdateOne) SetName(s string) *CatUpdateOne
SetName sets the "name" field.
func (*CatUpdateOne) SetNillableBreedID ¶
func (cuo *CatUpdateOne) SetNillableBreedID(u *uuid.UUID) *CatUpdateOne
SetNillableBreedID sets the "breed_id" field if the given value is not nil.
func (*CatUpdateOne) SetNillableDateFrom ¶
func (cuo *CatUpdateOne) SetNillableDateFrom(t *time.Time) *CatUpdateOne
SetNillableDateFrom sets the "date_from" field if the given value is not nil.
func (*CatUpdateOne) SetNillableDeletedTime ¶
func (cuo *CatUpdateOne) SetNillableDeletedTime(t *time.Time) *CatUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*CatUpdateOne) SetNillableName ¶
func (cuo *CatUpdateOne) SetNillableName(s *string) *CatUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*CatUpdateOne) SetNillableOtherType ¶
func (cuo *CatUpdateOne) SetNillableOtherType(ct *cat.OtherType) *CatUpdateOne
SetNillableOtherType sets the "other_type" field if the given value is not nil.
func (*CatUpdateOne) SetNillableSpeed ¶
func (cuo *CatUpdateOne) SetNillableSpeed(i *int64) *CatUpdateOne
SetNillableSpeed sets the "speed" field if the given value is not nil.
func (*CatUpdateOne) SetNillableType ¶
func (cuo *CatUpdateOne) SetNillableType(c *cat.Type) *CatUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*CatUpdateOne) SetOtherType ¶
func (cuo *CatUpdateOne) SetOtherType(ct cat.OtherType) *CatUpdateOne
SetOtherType sets the "other_type" field.
func (*CatUpdateOne) SetSpeed ¶
func (cuo *CatUpdateOne) SetSpeed(i int64) *CatUpdateOne
SetSpeed sets the "speed" field.
func (*CatUpdateOne) SetType ¶
func (cuo *CatUpdateOne) SetType(c cat.Type) *CatUpdateOne
SetType sets the "type" field.
func (*CatUpdateOne) SetUpdateTime ¶
func (cuo *CatUpdateOne) SetUpdateTime(t time.Time) *CatUpdateOne
SetUpdateTime sets the "update_time" field.
func (*CatUpdateOne) Where ¶
func (cuo *CatUpdateOne) Where(ps ...predicate.Cat) *CatUpdateOne
Where appends a list predicates to the CatUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Breed is the client for interacting with the Breed builders. Breed *BreedClient // Cat is the client for interacting with the Cat builders. Cat *CatClient // FatherCat is the client for interacting with the FatherCat builders. FatherCat *FatherCatClient // Kitten is the client for interacting with the Kitten builders. Kitten *KittenClient // 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(). Breed. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type FatherCat ¶
type FatherCat struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // DeletedTime holds the value of the "deleted_time" field. DeletedTime *time.Time `json:"deleted_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // contains filtered or unexported fields }
FatherCat is the model entity for the FatherCat schema.
func (*FatherCat) Unwrap ¶
Unwrap unwraps the FatherCat 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 (*FatherCat) Update ¶
func (fc *FatherCat) Update() *FatherCatUpdateOne
Update returns a builder for updating this FatherCat. Note that you need to call FatherCat.Unwrap() before calling this method if this FatherCat was returned from a transaction, and the transaction was committed or rolled back.
type FatherCatClient ¶
type FatherCatClient struct {
// contains filtered or unexported fields
}
FatherCatClient is a client for the FatherCat schema.
func NewFatherCatClient ¶
func NewFatherCatClient(c config) *FatherCatClient
NewFatherCatClient returns a client for the FatherCat from the given config.
func (*FatherCatClient) Create ¶
func (c *FatherCatClient) Create() *FatherCatCreate
Create returns a builder for creating a FatherCat entity.
func (*FatherCatClient) CreateBulk ¶
func (c *FatherCatClient) CreateBulk(builders ...*FatherCatCreate) *FatherCatCreateBulk
CreateBulk returns a builder for creating a bulk of FatherCat entities.
func (*FatherCatClient) Delete ¶
func (c *FatherCatClient) Delete() *FatherCatDelete
Delete returns a delete builder for FatherCat.
func (*FatherCatClient) DeleteOne ¶
func (c *FatherCatClient) DeleteOne(fc *FatherCat) *FatherCatDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FatherCatClient) DeleteOneID ¶
func (c *FatherCatClient) DeleteOneID(id uuid.UUID) *FatherCatDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FatherCatClient) Hooks ¶
func (c *FatherCatClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FatherCatClient) Intercept ¶
func (c *FatherCatClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `fathercat.Intercept(f(g(h())))`.
func (*FatherCatClient) Interceptors ¶
func (c *FatherCatClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FatherCatClient) MapCreateBulk ¶
func (c *FatherCatClient) MapCreateBulk(slice any, setFunc func(*FatherCatCreate, int)) *FatherCatCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*FatherCatClient) Query ¶
func (c *FatherCatClient) Query() *FatherCatQuery
Query returns a query builder for FatherCat.
func (*FatherCatClient) Update ¶
func (c *FatherCatClient) Update() *FatherCatUpdate
Update returns an update builder for FatherCat.
func (*FatherCatClient) UpdateOne ¶
func (c *FatherCatClient) UpdateOne(fc *FatherCat) *FatherCatUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FatherCatClient) UpdateOneID ¶
func (c *FatherCatClient) UpdateOneID(id uuid.UUID) *FatherCatUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FatherCatClient) Use ¶
func (c *FatherCatClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `fathercat.Hooks(f(g(h())))`.
type FatherCatCreate ¶
type FatherCatCreate struct {
// contains filtered or unexported fields
}
FatherCatCreate is the builder for creating a FatherCat entity.
func (*FatherCatCreate) Exec ¶
func (fcc *FatherCatCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FatherCatCreate) ExecX ¶
func (fcc *FatherCatCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FatherCatCreate) Mutation ¶
func (fcc *FatherCatCreate) Mutation() *FatherCatMutation
Mutation returns the FatherCatMutation object of the builder.
func (*FatherCatCreate) Save ¶
func (fcc *FatherCatCreate) Save(ctx context.Context) (*FatherCat, error)
Save creates the FatherCat in the database.
func (*FatherCatCreate) SaveX ¶
func (fcc *FatherCatCreate) SaveX(ctx context.Context) *FatherCat
SaveX calls Save and panics if Save returns an error.
func (*FatherCatCreate) SetCreateTime ¶
func (fcc *FatherCatCreate) SetCreateTime(t time.Time) *FatherCatCreate
SetCreateTime sets the "create_time" field.
func (*FatherCatCreate) SetDeletedTime ¶
func (fcc *FatherCatCreate) SetDeletedTime(t time.Time) *FatherCatCreate
SetDeletedTime sets the "deleted_time" field.
func (*FatherCatCreate) SetID ¶
func (fcc *FatherCatCreate) SetID(u uuid.UUID) *FatherCatCreate
SetID sets the "id" field.
func (*FatherCatCreate) SetName ¶
func (fcc *FatherCatCreate) SetName(s string) *FatherCatCreate
SetName sets the "name" field.
func (*FatherCatCreate) SetNillableCreateTime ¶
func (fcc *FatherCatCreate) SetNillableCreateTime(t *time.Time) *FatherCatCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*FatherCatCreate) SetNillableDeletedTime ¶
func (fcc *FatherCatCreate) SetNillableDeletedTime(t *time.Time) *FatherCatCreate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*FatherCatCreate) SetNillableID ¶
func (fcc *FatherCatCreate) SetNillableID(u *uuid.UUID) *FatherCatCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*FatherCatCreate) SetNillableUpdateTime ¶
func (fcc *FatherCatCreate) SetNillableUpdateTime(t *time.Time) *FatherCatCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*FatherCatCreate) SetUpdateTime ¶
func (fcc *FatherCatCreate) SetUpdateTime(t time.Time) *FatherCatCreate
SetUpdateTime sets the "update_time" field.
type FatherCatCreateBulk ¶
type FatherCatCreateBulk struct {
// contains filtered or unexported fields
}
FatherCatCreateBulk is the builder for creating many FatherCat entities in bulk.
func (*FatherCatCreateBulk) Exec ¶
func (fccb *FatherCatCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FatherCatCreateBulk) ExecX ¶
func (fccb *FatherCatCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FatherCatDelete ¶
type FatherCatDelete struct {
// contains filtered or unexported fields
}
FatherCatDelete is the builder for deleting a FatherCat entity.
func (*FatherCatDelete) Exec ¶
func (fcd *FatherCatDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FatherCatDelete) ExecX ¶
func (fcd *FatherCatDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FatherCatDelete) Where ¶
func (fcd *FatherCatDelete) Where(ps ...predicate.FatherCat) *FatherCatDelete
Where appends a list predicates to the FatherCatDelete builder.
type FatherCatDeleteOne ¶
type FatherCatDeleteOne struct {
// contains filtered or unexported fields
}
FatherCatDeleteOne is the builder for deleting a single FatherCat entity.
func (*FatherCatDeleteOne) Exec ¶
func (fcdo *FatherCatDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FatherCatDeleteOne) ExecX ¶
func (fcdo *FatherCatDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FatherCatDeleteOne) Where ¶
func (fcdo *FatherCatDeleteOne) Where(ps ...predicate.FatherCat) *FatherCatDeleteOne
Where appends a list predicates to the FatherCatDelete builder.
type FatherCatGroupBy ¶
type FatherCatGroupBy struct {
// contains filtered or unexported fields
}
FatherCatGroupBy is the group-by builder for FatherCat entities.
func (*FatherCatGroupBy) Aggregate ¶
func (fcgb *FatherCatGroupBy) Aggregate(fns ...AggregateFunc) *FatherCatGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FatherCatGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FatherCatGroupBy) Scan ¶
func (fcgb *FatherCatGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FatherCatGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FatherCatMutation ¶
type FatherCatMutation struct {
// contains filtered or unexported fields
}
FatherCatMutation represents an operation that mutates the FatherCat nodes in the graph.
func (*FatherCatMutation) AddField ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) AddedEdges ¶
func (m *FatherCatMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FatherCatMutation) AddedField ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) AddedFields ¶
func (m *FatherCatMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FatherCatMutation) AddedIDs ¶
func (m *FatherCatMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FatherCatMutation) ClearDeletedTime ¶
func (m *FatherCatMutation) ClearDeletedTime()
ClearDeletedTime clears the value of the "deleted_time" field.
func (*FatherCatMutation) ClearEdge ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ClearField ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ClearedEdges ¶
func (m *FatherCatMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FatherCatMutation) ClearedFields ¶
func (m *FatherCatMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FatherCatMutation) Client ¶
func (m FatherCatMutation) 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 (*FatherCatMutation) CreateTime ¶
func (m *FatherCatMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*FatherCatMutation) DeletedTime ¶
func (m *FatherCatMutation) DeletedTime() (r time.Time, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*FatherCatMutation) DeletedTimeCleared ¶
func (m *FatherCatMutation) DeletedTimeCleared() bool
DeletedTimeCleared returns if the "deleted_time" field was cleared in this mutation.
func (*FatherCatMutation) EdgeCleared ¶
func (m *FatherCatMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FatherCatMutation) Field ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) FieldCleared ¶
func (m *FatherCatMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FatherCatMutation) Fields ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ID ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FatherCatMutation) Name ¶
func (m *FatherCatMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FatherCatMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the FatherCat entity. If the FatherCat 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 (*FatherCatMutation) OldDeletedTime ¶
OldDeletedTime returns the old "deleted_time" field's value of the FatherCat entity. If the FatherCat 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 (*FatherCatMutation) 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 (*FatherCatMutation) OldName ¶
func (m *FatherCatMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the FatherCat entity. If the FatherCat 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 (*FatherCatMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the FatherCat entity. If the FatherCat 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 (*FatherCatMutation) RemovedEdges ¶
func (m *FatherCatMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FatherCatMutation) RemovedIDs ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ResetCreateTime ¶
func (m *FatherCatMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*FatherCatMutation) ResetDeletedTime ¶
func (m *FatherCatMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*FatherCatMutation) ResetEdge ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ResetField ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) ResetName ¶
func (m *FatherCatMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FatherCatMutation) ResetUpdateTime ¶
func (m *FatherCatMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*FatherCatMutation) SetCreateTime ¶
func (m *FatherCatMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*FatherCatMutation) SetDeletedTime ¶
func (m *FatherCatMutation) SetDeletedTime(t time.Time)
SetDeletedTime sets the "deleted_time" field.
func (*FatherCatMutation) SetField ¶
func (m *FatherCatMutation) 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 (*FatherCatMutation) SetID ¶
func (m *FatherCatMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of FatherCat entities.
func (*FatherCatMutation) SetName ¶
func (m *FatherCatMutation) SetName(s string)
SetName sets the "name" field.
func (*FatherCatMutation) SetOp ¶
func (m *FatherCatMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FatherCatMutation) SetUpdateTime ¶
func (m *FatherCatMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (FatherCatMutation) Tx ¶
func (m FatherCatMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FatherCatMutation) Type ¶
func (m *FatherCatMutation) Type() string
Type returns the node type of this mutation (FatherCat).
func (*FatherCatMutation) UpdateTime ¶
func (m *FatherCatMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*FatherCatMutation) Where ¶
func (m *FatherCatMutation) Where(ps ...predicate.FatherCat)
Where appends a list predicates to the FatherCatMutation builder.
func (*FatherCatMutation) WhereP ¶
func (m *FatherCatMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FatherCatMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FatherCatQuery ¶
type FatherCatQuery struct {
// contains filtered or unexported fields
}
FatherCatQuery is the builder for querying FatherCat entities.
func (*FatherCatQuery) Aggregate ¶
func (fcq *FatherCatQuery) Aggregate(fns ...AggregateFunc) *FatherCatSelect
Aggregate returns a FatherCatSelect configured with the given aggregations.
func (*FatherCatQuery) All ¶
func (fcq *FatherCatQuery) All(ctx context.Context) ([]*FatherCat, error)
All executes the query and returns a list of FatherCats.
func (*FatherCatQuery) AllX ¶
func (fcq *FatherCatQuery) AllX(ctx context.Context) []*FatherCat
AllX is like All, but panics if an error occurs.
func (*FatherCatQuery) Clone ¶
func (fcq *FatherCatQuery) Clone() *FatherCatQuery
Clone returns a duplicate of the FatherCatQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FatherCatQuery) Count ¶
func (fcq *FatherCatQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FatherCatQuery) CountX ¶
func (fcq *FatherCatQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FatherCatQuery) Exist ¶
func (fcq *FatherCatQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FatherCatQuery) ExistX ¶
func (fcq *FatherCatQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FatherCatQuery) First ¶
func (fcq *FatherCatQuery) First(ctx context.Context) (*FatherCat, error)
First returns the first FatherCat entity from the query. Returns a *NotFoundError when no FatherCat was found.
func (*FatherCatQuery) FirstID ¶
FirstID returns the first FatherCat ID from the query. Returns a *NotFoundError when no FatherCat ID was found.
func (*FatherCatQuery) FirstIDX ¶
func (fcq *FatherCatQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*FatherCatQuery) FirstX ¶
func (fcq *FatherCatQuery) FirstX(ctx context.Context) *FatherCat
FirstX is like First, but panics if an error occurs.
func (*FatherCatQuery) GroupBy ¶
func (fcq *FatherCatQuery) GroupBy(field string, fields ...string) *FatherCatGroupBy
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` Count int `json:"count,omitempty"` } client.FatherCat.Query(). GroupBy(fathercat.FieldDeletedTime). Aggregate(gen.Count()). Scan(ctx, &v)
func (*FatherCatQuery) IDsX ¶
func (fcq *FatherCatQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*FatherCatQuery) Limit ¶
func (fcq *FatherCatQuery) Limit(limit int) *FatherCatQuery
Limit the number of records to be returned by this query.
func (*FatherCatQuery) Offset ¶
func (fcq *FatherCatQuery) Offset(offset int) *FatherCatQuery
Offset to start from.
func (*FatherCatQuery) Only ¶
func (fcq *FatherCatQuery) Only(ctx context.Context) (*FatherCat, error)
Only returns a single FatherCat entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FatherCat entity is found. Returns a *NotFoundError when no FatherCat entities are found.
func (*FatherCatQuery) OnlyID ¶
OnlyID is like Only, but returns the only FatherCat ID in the query. Returns a *NotSingularError when more than one FatherCat ID is found. Returns a *NotFoundError when no entities are found.
func (*FatherCatQuery) OnlyIDX ¶
func (fcq *FatherCatQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FatherCatQuery) OnlyX ¶
func (fcq *FatherCatQuery) OnlyX(ctx context.Context) *FatherCat
OnlyX is like Only, but panics if an error occurs.
func (*FatherCatQuery) Order ¶
func (fcq *FatherCatQuery) Order(o ...fathercat.OrderOption) *FatherCatQuery
Order specifies how the records should be ordered.
func (*FatherCatQuery) Select ¶
func (fcq *FatherCatQuery) Select(fields ...string) *FatherCatSelect
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` } client.FatherCat.Query(). Select(fathercat.FieldDeletedTime). Scan(ctx, &v)
func (*FatherCatQuery) Unique ¶
func (fcq *FatherCatQuery) Unique(unique bool) *FatherCatQuery
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 (*FatherCatQuery) Where ¶
func (fcq *FatherCatQuery) Where(ps ...predicate.FatherCat) *FatherCatQuery
Where adds a new predicate for the FatherCatQuery builder.
type FatherCatSelect ¶
type FatherCatSelect struct { *FatherCatQuery // contains filtered or unexported fields }
FatherCatSelect is the builder for selecting fields of FatherCat entities.
func (*FatherCatSelect) Aggregate ¶
func (fcs *FatherCatSelect) Aggregate(fns ...AggregateFunc) *FatherCatSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FatherCatSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FatherCatSelect) Scan ¶
func (fcs *FatherCatSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FatherCatSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FatherCatUpdate ¶
type FatherCatUpdate struct {
// contains filtered or unexported fields
}
FatherCatUpdate is the builder for updating FatherCat entities.
func (*FatherCatUpdate) ClearDeletedTime ¶
func (fcu *FatherCatUpdate) ClearDeletedTime() *FatherCatUpdate
ClearDeletedTime clears the value of the "deleted_time" field.
func (*FatherCatUpdate) Exec ¶
func (fcu *FatherCatUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FatherCatUpdate) ExecX ¶
func (fcu *FatherCatUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FatherCatUpdate) Mutation ¶
func (fcu *FatherCatUpdate) Mutation() *FatherCatMutation
Mutation returns the FatherCatMutation object of the builder.
func (*FatherCatUpdate) Save ¶
func (fcu *FatherCatUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FatherCatUpdate) SaveX ¶
func (fcu *FatherCatUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FatherCatUpdate) SetDeletedTime ¶
func (fcu *FatherCatUpdate) SetDeletedTime(t time.Time) *FatherCatUpdate
SetDeletedTime sets the "deleted_time" field.
func (*FatherCatUpdate) SetName ¶
func (fcu *FatherCatUpdate) SetName(s string) *FatherCatUpdate
SetName sets the "name" field.
func (*FatherCatUpdate) SetNillableDeletedTime ¶
func (fcu *FatherCatUpdate) SetNillableDeletedTime(t *time.Time) *FatherCatUpdate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*FatherCatUpdate) SetNillableName ¶
func (fcu *FatherCatUpdate) SetNillableName(s *string) *FatherCatUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*FatherCatUpdate) SetUpdateTime ¶
func (fcu *FatherCatUpdate) SetUpdateTime(t time.Time) *FatherCatUpdate
SetUpdateTime sets the "update_time" field.
func (*FatherCatUpdate) Where ¶
func (fcu *FatherCatUpdate) Where(ps ...predicate.FatherCat) *FatherCatUpdate
Where appends a list predicates to the FatherCatUpdate builder.
type FatherCatUpdateOne ¶
type FatherCatUpdateOne struct {
// contains filtered or unexported fields
}
FatherCatUpdateOne is the builder for updating a single FatherCat entity.
func (*FatherCatUpdateOne) ClearDeletedTime ¶
func (fcuo *FatherCatUpdateOne) ClearDeletedTime() *FatherCatUpdateOne
ClearDeletedTime clears the value of the "deleted_time" field.
func (*FatherCatUpdateOne) Exec ¶
func (fcuo *FatherCatUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FatherCatUpdateOne) ExecX ¶
func (fcuo *FatherCatUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FatherCatUpdateOne) Mutation ¶
func (fcuo *FatherCatUpdateOne) Mutation() *FatherCatMutation
Mutation returns the FatherCatMutation object of the builder.
func (*FatherCatUpdateOne) Save ¶
func (fcuo *FatherCatUpdateOne) Save(ctx context.Context) (*FatherCat, error)
Save executes the query and returns the updated FatherCat entity.
func (*FatherCatUpdateOne) SaveX ¶
func (fcuo *FatherCatUpdateOne) SaveX(ctx context.Context) *FatherCat
SaveX is like Save, but panics if an error occurs.
func (*FatherCatUpdateOne) Select ¶
func (fcuo *FatherCatUpdateOne) Select(field string, fields ...string) *FatherCatUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FatherCatUpdateOne) SetDeletedTime ¶
func (fcuo *FatherCatUpdateOne) SetDeletedTime(t time.Time) *FatherCatUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*FatherCatUpdateOne) SetName ¶
func (fcuo *FatherCatUpdateOne) SetName(s string) *FatherCatUpdateOne
SetName sets the "name" field.
func (*FatherCatUpdateOne) SetNillableDeletedTime ¶
func (fcuo *FatherCatUpdateOne) SetNillableDeletedTime(t *time.Time) *FatherCatUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*FatherCatUpdateOne) SetNillableName ¶
func (fcuo *FatherCatUpdateOne) SetNillableName(s *string) *FatherCatUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*FatherCatUpdateOne) SetUpdateTime ¶
func (fcuo *FatherCatUpdateOne) SetUpdateTime(t time.Time) *FatherCatUpdateOne
SetUpdateTime sets the "update_time" field.
func (*FatherCatUpdateOne) Where ¶
func (fcuo *FatherCatUpdateOne) Where(ps ...predicate.FatherCat) *FatherCatUpdateOne
Where appends a list predicates to the FatherCatUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type Kitten ¶
type Kitten struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // DeletedTime holds the value of the "deleted_time" field. DeletedTime *time.Time `json:"deleted_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // MotherID holds the value of the "mother_id" field. MotherID uuid.UUID `json:"mother_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the KittenQuery when eager-loading is set. Edges KittenEdges `json:"edges"` // contains filtered or unexported fields }
Kitten is the model entity for the Kitten schema.
func (*Kitten) QueryMother ¶
QueryMother queries the "mother" edge of the Kitten entity.
func (*Kitten) Unwrap ¶
Unwrap unwraps the Kitten 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 (*Kitten) Update ¶
func (k *Kitten) Update() *KittenUpdateOne
Update returns a builder for updating this Kitten. Note that you need to call Kitten.Unwrap() before calling this method if this Kitten was returned from a transaction, and the transaction was committed or rolled back.
type KittenClient ¶
type KittenClient struct {
// contains filtered or unexported fields
}
KittenClient is a client for the Kitten schema.
func NewKittenClient ¶
func NewKittenClient(c config) *KittenClient
NewKittenClient returns a client for the Kitten from the given config.
func (*KittenClient) Create ¶
func (c *KittenClient) Create() *KittenCreate
Create returns a builder for creating a Kitten entity.
func (*KittenClient) CreateBulk ¶
func (c *KittenClient) CreateBulk(builders ...*KittenCreate) *KittenCreateBulk
CreateBulk returns a builder for creating a bulk of Kitten entities.
func (*KittenClient) Delete ¶
func (c *KittenClient) Delete() *KittenDelete
Delete returns a delete builder for Kitten.
func (*KittenClient) DeleteOne ¶
func (c *KittenClient) DeleteOne(k *Kitten) *KittenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*KittenClient) DeleteOneID ¶
func (c *KittenClient) DeleteOneID(id uuid.UUID) *KittenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*KittenClient) Intercept ¶
func (c *KittenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `kitten.Intercept(f(g(h())))`.
func (*KittenClient) Interceptors ¶
func (c *KittenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*KittenClient) MapCreateBulk ¶
func (c *KittenClient) MapCreateBulk(slice any, setFunc func(*KittenCreate, int)) *KittenCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*KittenClient) Query ¶
func (c *KittenClient) Query() *KittenQuery
Query returns a query builder for Kitten.
func (*KittenClient) QueryMother ¶
func (c *KittenClient) QueryMother(k *Kitten) *CatQuery
QueryMother queries the mother edge of a Kitten.
func (*KittenClient) Update ¶
func (c *KittenClient) Update() *KittenUpdate
Update returns an update builder for Kitten.
func (*KittenClient) UpdateOne ¶
func (c *KittenClient) UpdateOne(k *Kitten) *KittenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*KittenClient) UpdateOneID ¶
func (c *KittenClient) UpdateOneID(id uuid.UUID) *KittenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*KittenClient) Use ¶
func (c *KittenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `kitten.Hooks(f(g(h())))`.
type KittenCreate ¶
type KittenCreate struct {
// contains filtered or unexported fields
}
KittenCreate is the builder for creating a Kitten entity.
func (*KittenCreate) Exec ¶
func (kc *KittenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*KittenCreate) ExecX ¶
func (kc *KittenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KittenCreate) Mutation ¶
func (kc *KittenCreate) Mutation() *KittenMutation
Mutation returns the KittenMutation object of the builder.
func (*KittenCreate) Save ¶
func (kc *KittenCreate) Save(ctx context.Context) (*Kitten, error)
Save creates the Kitten in the database.
func (*KittenCreate) SaveX ¶
func (kc *KittenCreate) SaveX(ctx context.Context) *Kitten
SaveX calls Save and panics if Save returns an error.
func (*KittenCreate) SetCreateTime ¶
func (kc *KittenCreate) SetCreateTime(t time.Time) *KittenCreate
SetCreateTime sets the "create_time" field.
func (*KittenCreate) SetDeletedTime ¶
func (kc *KittenCreate) SetDeletedTime(t time.Time) *KittenCreate
SetDeletedTime sets the "deleted_time" field.
func (*KittenCreate) SetID ¶
func (kc *KittenCreate) SetID(u uuid.UUID) *KittenCreate
SetID sets the "id" field.
func (*KittenCreate) SetMother ¶
func (kc *KittenCreate) SetMother(c *Cat) *KittenCreate
SetMother sets the "mother" edge to the Cat entity.
func (*KittenCreate) SetMotherID ¶
func (kc *KittenCreate) SetMotherID(u uuid.UUID) *KittenCreate
SetMotherID sets the "mother_id" field.
func (*KittenCreate) SetName ¶
func (kc *KittenCreate) SetName(s string) *KittenCreate
SetName sets the "name" field.
func (*KittenCreate) SetNillableCreateTime ¶
func (kc *KittenCreate) SetNillableCreateTime(t *time.Time) *KittenCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*KittenCreate) SetNillableDeletedTime ¶
func (kc *KittenCreate) SetNillableDeletedTime(t *time.Time) *KittenCreate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*KittenCreate) SetNillableID ¶
func (kc *KittenCreate) SetNillableID(u *uuid.UUID) *KittenCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*KittenCreate) SetNillableUpdateTime ¶
func (kc *KittenCreate) SetNillableUpdateTime(t *time.Time) *KittenCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*KittenCreate) SetUpdateTime ¶
func (kc *KittenCreate) SetUpdateTime(t time.Time) *KittenCreate
SetUpdateTime sets the "update_time" field.
type KittenCreateBulk ¶
type KittenCreateBulk struct {
// contains filtered or unexported fields
}
KittenCreateBulk is the builder for creating many Kitten entities in bulk.
func (*KittenCreateBulk) Exec ¶
func (kcb *KittenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*KittenCreateBulk) ExecX ¶
func (kcb *KittenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type KittenDelete ¶
type KittenDelete struct {
// contains filtered or unexported fields
}
KittenDelete is the builder for deleting a Kitten entity.
func (*KittenDelete) Exec ¶
func (kd *KittenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*KittenDelete) ExecX ¶
func (kd *KittenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*KittenDelete) Where ¶
func (kd *KittenDelete) Where(ps ...predicate.Kitten) *KittenDelete
Where appends a list predicates to the KittenDelete builder.
type KittenDeleteOne ¶
type KittenDeleteOne struct {
// contains filtered or unexported fields
}
KittenDeleteOne is the builder for deleting a single Kitten entity.
func (*KittenDeleteOne) Exec ¶
func (kdo *KittenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*KittenDeleteOne) ExecX ¶
func (kdo *KittenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KittenDeleteOne) Where ¶
func (kdo *KittenDeleteOne) Where(ps ...predicate.Kitten) *KittenDeleteOne
Where appends a list predicates to the KittenDelete builder.
type KittenEdges ¶
type KittenEdges struct { // Mother holds the value of the mother edge. Mother *Cat `json:"mother,omitempty"` // contains filtered or unexported fields }
KittenEdges holds the relations/edges for other nodes in the graph.
func (KittenEdges) MotherOrErr ¶
func (e KittenEdges) MotherOrErr() (*Cat, error)
MotherOrErr returns the Mother value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type KittenGroupBy ¶
type KittenGroupBy struct {
// contains filtered or unexported fields
}
KittenGroupBy is the group-by builder for Kitten entities.
func (*KittenGroupBy) Aggregate ¶
func (kgb *KittenGroupBy) Aggregate(fns ...AggregateFunc) *KittenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*KittenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KittenGroupBy) Scan ¶
func (kgb *KittenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KittenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KittenMutation ¶
type KittenMutation struct {
// contains filtered or unexported fields
}
KittenMutation represents an operation that mutates the Kitten nodes in the graph.
func (*KittenMutation) AddField ¶
func (m *KittenMutation) 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 (*KittenMutation) AddedEdges ¶
func (m *KittenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*KittenMutation) AddedField ¶
func (m *KittenMutation) 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 (*KittenMutation) AddedFields ¶
func (m *KittenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*KittenMutation) AddedIDs ¶
func (m *KittenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*KittenMutation) ClearDeletedTime ¶
func (m *KittenMutation) ClearDeletedTime()
ClearDeletedTime clears the value of the "deleted_time" field.
func (*KittenMutation) ClearEdge ¶
func (m *KittenMutation) 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 (*KittenMutation) ClearField ¶
func (m *KittenMutation) 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 (*KittenMutation) ClearMother ¶
func (m *KittenMutation) ClearMother()
ClearMother clears the "mother" edge to the Cat entity.
func (*KittenMutation) ClearedEdges ¶
func (m *KittenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*KittenMutation) ClearedFields ¶
func (m *KittenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (KittenMutation) Client ¶
func (m KittenMutation) 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 (*KittenMutation) CreateTime ¶
func (m *KittenMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*KittenMutation) DeletedTime ¶
func (m *KittenMutation) DeletedTime() (r time.Time, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*KittenMutation) DeletedTimeCleared ¶
func (m *KittenMutation) DeletedTimeCleared() bool
DeletedTimeCleared returns if the "deleted_time" field was cleared in this mutation.
func (*KittenMutation) EdgeCleared ¶
func (m *KittenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*KittenMutation) Field ¶
func (m *KittenMutation) 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 (*KittenMutation) FieldCleared ¶
func (m *KittenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*KittenMutation) Fields ¶
func (m *KittenMutation) 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 (*KittenMutation) ID ¶
func (m *KittenMutation) 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 (*KittenMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*KittenMutation) MotherCleared ¶
func (m *KittenMutation) MotherCleared() bool
MotherCleared reports if the "mother" edge to the Cat entity was cleared.
func (*KittenMutation) MotherID ¶
func (m *KittenMutation) MotherID() (r uuid.UUID, exists bool)
MotherID returns the value of the "mother_id" field in the mutation.
func (*KittenMutation) MotherIDs ¶
func (m *KittenMutation) MotherIDs() (ids []uuid.UUID)
MotherIDs returns the "mother" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MotherID instead. It exists only for internal usage by the builders.
func (*KittenMutation) Name ¶
func (m *KittenMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*KittenMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Kitten entity. If the Kitten 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 (*KittenMutation) OldDeletedTime ¶
OldDeletedTime returns the old "deleted_time" field's value of the Kitten entity. If the Kitten 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 (*KittenMutation) 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 (*KittenMutation) OldMotherID ¶
OldMotherID returns the old "mother_id" field's value of the Kitten entity. If the Kitten 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 (*KittenMutation) OldName ¶
func (m *KittenMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Kitten entity. If the Kitten 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 (*KittenMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Kitten entity. If the Kitten 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 (*KittenMutation) RemovedEdges ¶
func (m *KittenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*KittenMutation) RemovedIDs ¶
func (m *KittenMutation) 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 (*KittenMutation) ResetCreateTime ¶
func (m *KittenMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*KittenMutation) ResetDeletedTime ¶
func (m *KittenMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*KittenMutation) ResetEdge ¶
func (m *KittenMutation) 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 (*KittenMutation) ResetField ¶
func (m *KittenMutation) 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 (*KittenMutation) ResetMother ¶
func (m *KittenMutation) ResetMother()
ResetMother resets all changes to the "mother" edge.
func (*KittenMutation) ResetMotherID ¶
func (m *KittenMutation) ResetMotherID()
ResetMotherID resets all changes to the "mother_id" field.
func (*KittenMutation) ResetName ¶
func (m *KittenMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*KittenMutation) ResetUpdateTime ¶
func (m *KittenMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*KittenMutation) SetCreateTime ¶
func (m *KittenMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*KittenMutation) SetDeletedTime ¶
func (m *KittenMutation) SetDeletedTime(t time.Time)
SetDeletedTime sets the "deleted_time" field.
func (*KittenMutation) SetField ¶
func (m *KittenMutation) 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 (*KittenMutation) SetID ¶
func (m *KittenMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Kitten entities.
func (*KittenMutation) SetMotherID ¶
func (m *KittenMutation) SetMotherID(u uuid.UUID)
SetMotherID sets the "mother_id" field.
func (*KittenMutation) SetName ¶
func (m *KittenMutation) SetName(s string)
SetName sets the "name" field.
func (*KittenMutation) SetOp ¶
func (m *KittenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*KittenMutation) SetUpdateTime ¶
func (m *KittenMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (KittenMutation) Tx ¶
func (m KittenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*KittenMutation) Type ¶
func (m *KittenMutation) Type() string
Type returns the node type of this mutation (Kitten).
func (*KittenMutation) UpdateTime ¶
func (m *KittenMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*KittenMutation) Where ¶
func (m *KittenMutation) Where(ps ...predicate.Kitten)
Where appends a list predicates to the KittenMutation builder.
func (*KittenMutation) WhereP ¶
func (m *KittenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the KittenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type KittenQuery ¶
type KittenQuery struct {
// contains filtered or unexported fields
}
KittenQuery is the builder for querying Kitten entities.
func (*KittenQuery) Aggregate ¶
func (kq *KittenQuery) Aggregate(fns ...AggregateFunc) *KittenSelect
Aggregate returns a KittenSelect configured with the given aggregations.
func (*KittenQuery) All ¶
func (kq *KittenQuery) All(ctx context.Context) ([]*Kitten, error)
All executes the query and returns a list of Kittens.
func (*KittenQuery) AllX ¶
func (kq *KittenQuery) AllX(ctx context.Context) []*Kitten
AllX is like All, but panics if an error occurs.
func (*KittenQuery) Clone ¶
func (kq *KittenQuery) Clone() *KittenQuery
Clone returns a duplicate of the KittenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*KittenQuery) Count ¶
func (kq *KittenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*KittenQuery) CountX ¶
func (kq *KittenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*KittenQuery) Exist ¶
func (kq *KittenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*KittenQuery) ExistX ¶
func (kq *KittenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*KittenQuery) First ¶
func (kq *KittenQuery) First(ctx context.Context) (*Kitten, error)
First returns the first Kitten entity from the query. Returns a *NotFoundError when no Kitten was found.
func (*KittenQuery) FirstID ¶
FirstID returns the first Kitten ID from the query. Returns a *NotFoundError when no Kitten ID was found.
func (*KittenQuery) FirstIDX ¶
func (kq *KittenQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*KittenQuery) FirstX ¶
func (kq *KittenQuery) FirstX(ctx context.Context) *Kitten
FirstX is like First, but panics if an error occurs.
func (*KittenQuery) GroupBy ¶
func (kq *KittenQuery) GroupBy(field string, fields ...string) *KittenGroupBy
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` Count int `json:"count,omitempty"` } client.Kitten.Query(). GroupBy(kitten.FieldDeletedTime). Aggregate(gen.Count()). Scan(ctx, &v)
func (*KittenQuery) IDsX ¶
func (kq *KittenQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*KittenQuery) Limit ¶
func (kq *KittenQuery) Limit(limit int) *KittenQuery
Limit the number of records to be returned by this query.
func (*KittenQuery) Offset ¶
func (kq *KittenQuery) Offset(offset int) *KittenQuery
Offset to start from.
func (*KittenQuery) Only ¶
func (kq *KittenQuery) Only(ctx context.Context) (*Kitten, error)
Only returns a single Kitten entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Kitten entity is found. Returns a *NotFoundError when no Kitten entities are found.
func (*KittenQuery) OnlyID ¶
OnlyID is like Only, but returns the only Kitten ID in the query. Returns a *NotSingularError when more than one Kitten ID is found. Returns a *NotFoundError when no entities are found.
func (*KittenQuery) OnlyIDX ¶
func (kq *KittenQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*KittenQuery) OnlyX ¶
func (kq *KittenQuery) OnlyX(ctx context.Context) *Kitten
OnlyX is like Only, but panics if an error occurs.
func (*KittenQuery) Order ¶
func (kq *KittenQuery) Order(o ...kitten.OrderOption) *KittenQuery
Order specifies how the records should be ordered.
func (*KittenQuery) QueryMother ¶
func (kq *KittenQuery) QueryMother() *CatQuery
QueryMother chains the current query on the "mother" edge.
func (*KittenQuery) Select ¶
func (kq *KittenQuery) Select(fields ...string) *KittenSelect
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 { DeletedTime time.Time `json:"deleted_time,omitempty"` } client.Kitten.Query(). Select(kitten.FieldDeletedTime). Scan(ctx, &v)
func (*KittenQuery) Unique ¶
func (kq *KittenQuery) Unique(unique bool) *KittenQuery
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 (*KittenQuery) Where ¶
func (kq *KittenQuery) Where(ps ...predicate.Kitten) *KittenQuery
Where adds a new predicate for the KittenQuery builder.
func (*KittenQuery) WithMother ¶
func (kq *KittenQuery) WithMother(opts ...func(*CatQuery)) *KittenQuery
WithMother tells the query-builder to eager-load the nodes that are connected to the "mother" edge. The optional arguments are used to configure the query builder of the edge.
type KittenSelect ¶
type KittenSelect struct { *KittenQuery // contains filtered or unexported fields }
KittenSelect is the builder for selecting fields of Kitten entities.
func (*KittenSelect) Aggregate ¶
func (ks *KittenSelect) Aggregate(fns ...AggregateFunc) *KittenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*KittenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KittenSelect) Scan ¶
func (ks *KittenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KittenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KittenUpdate ¶
type KittenUpdate struct {
// contains filtered or unexported fields
}
KittenUpdate is the builder for updating Kitten entities.
func (*KittenUpdate) ClearDeletedTime ¶
func (ku *KittenUpdate) ClearDeletedTime() *KittenUpdate
ClearDeletedTime clears the value of the "deleted_time" field.
func (*KittenUpdate) ClearMother ¶
func (ku *KittenUpdate) ClearMother() *KittenUpdate
ClearMother clears the "mother" edge to the Cat entity.
func (*KittenUpdate) Exec ¶
func (ku *KittenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*KittenUpdate) ExecX ¶
func (ku *KittenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KittenUpdate) Mutation ¶
func (ku *KittenUpdate) Mutation() *KittenMutation
Mutation returns the KittenMutation object of the builder.
func (*KittenUpdate) Save ¶
func (ku *KittenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*KittenUpdate) SaveX ¶
func (ku *KittenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*KittenUpdate) SetDeletedTime ¶
func (ku *KittenUpdate) SetDeletedTime(t time.Time) *KittenUpdate
SetDeletedTime sets the "deleted_time" field.
func (*KittenUpdate) SetMother ¶
func (ku *KittenUpdate) SetMother(c *Cat) *KittenUpdate
SetMother sets the "mother" edge to the Cat entity.
func (*KittenUpdate) SetMotherID ¶
func (ku *KittenUpdate) SetMotherID(u uuid.UUID) *KittenUpdate
SetMotherID sets the "mother_id" field.
func (*KittenUpdate) SetName ¶
func (ku *KittenUpdate) SetName(s string) *KittenUpdate
SetName sets the "name" field.
func (*KittenUpdate) SetNillableDeletedTime ¶
func (ku *KittenUpdate) SetNillableDeletedTime(t *time.Time) *KittenUpdate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*KittenUpdate) SetNillableMotherID ¶
func (ku *KittenUpdate) SetNillableMotherID(u *uuid.UUID) *KittenUpdate
SetNillableMotherID sets the "mother_id" field if the given value is not nil.
func (*KittenUpdate) SetNillableName ¶
func (ku *KittenUpdate) SetNillableName(s *string) *KittenUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*KittenUpdate) SetUpdateTime ¶
func (ku *KittenUpdate) SetUpdateTime(t time.Time) *KittenUpdate
SetUpdateTime sets the "update_time" field.
func (*KittenUpdate) Where ¶
func (ku *KittenUpdate) Where(ps ...predicate.Kitten) *KittenUpdate
Where appends a list predicates to the KittenUpdate builder.
type KittenUpdateOne ¶
type KittenUpdateOne struct {
// contains filtered or unexported fields
}
KittenUpdateOne is the builder for updating a single Kitten entity.
func (*KittenUpdateOne) ClearDeletedTime ¶
func (kuo *KittenUpdateOne) ClearDeletedTime() *KittenUpdateOne
ClearDeletedTime clears the value of the "deleted_time" field.
func (*KittenUpdateOne) ClearMother ¶
func (kuo *KittenUpdateOne) ClearMother() *KittenUpdateOne
ClearMother clears the "mother" edge to the Cat entity.
func (*KittenUpdateOne) Exec ¶
func (kuo *KittenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*KittenUpdateOne) ExecX ¶
func (kuo *KittenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KittenUpdateOne) Mutation ¶
func (kuo *KittenUpdateOne) Mutation() *KittenMutation
Mutation returns the KittenMutation object of the builder.
func (*KittenUpdateOne) Save ¶
func (kuo *KittenUpdateOne) Save(ctx context.Context) (*Kitten, error)
Save executes the query and returns the updated Kitten entity.
func (*KittenUpdateOne) SaveX ¶
func (kuo *KittenUpdateOne) SaveX(ctx context.Context) *Kitten
SaveX is like Save, but panics if an error occurs.
func (*KittenUpdateOne) Select ¶
func (kuo *KittenUpdateOne) Select(field string, fields ...string) *KittenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*KittenUpdateOne) SetDeletedTime ¶
func (kuo *KittenUpdateOne) SetDeletedTime(t time.Time) *KittenUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*KittenUpdateOne) SetMother ¶
func (kuo *KittenUpdateOne) SetMother(c *Cat) *KittenUpdateOne
SetMother sets the "mother" edge to the Cat entity.
func (*KittenUpdateOne) SetMotherID ¶
func (kuo *KittenUpdateOne) SetMotherID(u uuid.UUID) *KittenUpdateOne
SetMotherID sets the "mother_id" field.
func (*KittenUpdateOne) SetName ¶
func (kuo *KittenUpdateOne) SetName(s string) *KittenUpdateOne
SetName sets the "name" field.
func (*KittenUpdateOne) SetNillableDeletedTime ¶
func (kuo *KittenUpdateOne) SetNillableDeletedTime(t *time.Time) *KittenUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*KittenUpdateOne) SetNillableMotherID ¶
func (kuo *KittenUpdateOne) SetNillableMotherID(u *uuid.UUID) *KittenUpdateOne
SetNillableMotherID sets the "mother_id" field if the given value is not nil.
func (*KittenUpdateOne) SetNillableName ¶
func (kuo *KittenUpdateOne) SetNillableName(s *string) *KittenUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*KittenUpdateOne) SetUpdateTime ¶
func (kuo *KittenUpdateOne) SetUpdateTime(t time.Time) *KittenUpdateOne
SetUpdateTime sets the "update_time" field.
func (*KittenUpdateOne) Where ¶
func (kuo *KittenUpdateOne) Where(ps ...predicate.Kitten) *KittenUpdateOne
Where appends a list predicates to the KittenUpdate builder.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Breed is the client for interacting with the Breed builders. Breed *BreedClient // Cat is the client for interacting with the Cat builders. Cat *CatClient // FatherCat is the client for interacting with the FatherCat builders. FatherCat *FatherCatClient // Kitten is the client for interacting with the Kitten builders. Kitten *KittenClient // 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 or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- breed.go
- breed_create.go
- breed_delete.go
- breed_query.go
- breed_update.go
- cat.go
- cat_create.go
- cat_delete.go
- cat_query.go
- cat_update.go
- client.go
- ent.go
- fathercat.go
- fathercat_create.go
- fathercat_delete.go
- fathercat_query.go
- fathercat_update.go
- kitten.go
- kitten_create.go
- kitten_delete.go
- kitten_query.go
- kitten_update.go
- mutation.go
- runtime.go
- tx.go