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 Categories
- type Category
- type CategoryClient
- func (c *CategoryClient) Create() *CategoryCreate
- func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
- func (c *CategoryClient) Delete() *CategoryDelete
- func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
- func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
- func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error)
- func (c *CategoryClient) GetX(ctx context.Context, id int) *Category
- func (c *CategoryClient) Hooks() []Hook
- func (c *CategoryClient) Intercept(interceptors ...Interceptor)
- func (c *CategoryClient) Interceptors() []Interceptor
- func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk
- func (c *CategoryClient) Query() *CategoryQuery
- func (c *CategoryClient) QueryPets(ca *Category) *PetQuery
- func (c *CategoryClient) Update() *CategoryUpdate
- func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
- func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne
- func (c *CategoryClient) Use(hooks ...Hook)
- type CategoryCreate
- func (cc *CategoryCreate) AddPetIDs(ids ...int) *CategoryCreate
- func (cc *CategoryCreate) AddPets(p ...*Pet) *CategoryCreate
- func (cc *CategoryCreate) Exec(ctx context.Context) error
- func (cc *CategoryCreate) ExecX(ctx context.Context)
- func (cc *CategoryCreate) Mutation() *CategoryMutation
- func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
- func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
- func (cc *CategoryCreate) SetCreatedAt(t time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetInts(i []int) *CategoryCreate
- func (cc *CategoryCreate) SetName(s string) *CategoryCreate
- func (cc *CategoryCreate) SetNillable(s string) *CategoryCreate
- func (cc *CategoryCreate) SetNillableCreatedAt(t *time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetNillableNillable(s *string) *CategoryCreate
- func (cc *CategoryCreate) SetNillableSkipInSpec(s *string) *CategoryCreate
- func (cc *CategoryCreate) SetNillableUpdatedAt(t *time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetReadonly(s string) *CategoryCreate
- func (cc *CategoryCreate) SetSkipInSpec(s string) *CategoryCreate
- func (cc *CategoryCreate) SetStrings(s []string) *CategoryCreate
- func (cc *CategoryCreate) SetUpdatedAt(t time.Time) *CategoryCreate
- type CategoryCreateBulk
- type CategoryDelete
- type CategoryDeleteOne
- type CategoryEdges
- type CategoryGroupBy
- func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
- func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategoryGroupBy) BoolX(ctx context.Context) bool
- func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategoryGroupBy) Float64X(ctx context.Context) float64
- func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CategoryGroupBy) IntX(ctx context.Context) int
- func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CategoryGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error
- func (s *CategoryGroupBy) ScanX(ctx context.Context, v any)
- func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CategoryGroupBy) StringX(ctx context.Context) string
- func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CategoryGroupBy) StringsX(ctx context.Context) []string
- type CategoryMutation
- func (m *CategoryMutation) AddField(name string, value ent.Value) error
- func (m *CategoryMutation) AddPetIDs(ids ...int)
- func (m *CategoryMutation) AddedEdges() []string
- func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoryMutation) AddedFields() []string
- func (m *CategoryMutation) AddedIDs(name string) []ent.Value
- func (m *CategoryMutation) AppendInts(i []int)
- func (m *CategoryMutation) AppendStrings(s []string)
- func (m *CategoryMutation) AppendedInts() ([]int, bool)
- func (m *CategoryMutation) AppendedStrings() ([]string, bool)
- func (m *CategoryMutation) ClearEdge(name string) error
- func (m *CategoryMutation) ClearField(name string) error
- func (m *CategoryMutation) ClearInts()
- func (m *CategoryMutation) ClearPets()
- func (m *CategoryMutation) ClearSkipInSpec()
- func (m *CategoryMutation) ClearStrings()
- func (m *CategoryMutation) ClearedEdges() []string
- func (m *CategoryMutation) ClearedFields() []string
- func (m CategoryMutation) Client() *Client
- func (m *CategoryMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CategoryMutation) EdgeCleared(name string) bool
- func (m *CategoryMutation) Field(name string) (ent.Value, bool)
- func (m *CategoryMutation) FieldCleared(name string) bool
- func (m *CategoryMutation) Fields() []string
- func (m *CategoryMutation) ID() (id int, exists bool)
- func (m *CategoryMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CategoryMutation) Ints() (r []int, exists bool)
- func (m *CategoryMutation) IntsCleared() bool
- func (m *CategoryMutation) Name() (r string, exists bool)
- func (m *CategoryMutation) Nillable() (r string, exists bool)
- func (m *CategoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoryMutation) OldInts(ctx context.Context) (v []int, err error)
- func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) OldNillable(ctx context.Context) (v *string, err error)
- func (m *CategoryMutation) OldReadonly(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) OldSkipInSpec(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) OldStrings(ctx context.Context) (v []string, err error)
- func (m *CategoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoryMutation) Op() Op
- func (m *CategoryMutation) PetsCleared() bool
- func (m *CategoryMutation) PetsIDs() (ids []int)
- func (m *CategoryMutation) Readonly() (r string, exists bool)
- func (m *CategoryMutation) RemovePetIDs(ids ...int)
- func (m *CategoryMutation) RemovedEdges() []string
- func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoryMutation) RemovedPetsIDs() (ids []int)
- func (m *CategoryMutation) ResetCreatedAt()
- func (m *CategoryMutation) ResetEdge(name string) error
- func (m *CategoryMutation) ResetField(name string) error
- func (m *CategoryMutation) ResetInts()
- func (m *CategoryMutation) ResetName()
- func (m *CategoryMutation) ResetNillable()
- func (m *CategoryMutation) ResetPets()
- func (m *CategoryMutation) ResetReadonly()
- func (m *CategoryMutation) ResetSkipInSpec()
- func (m *CategoryMutation) ResetStrings()
- func (m *CategoryMutation) ResetUpdatedAt()
- func (m *CategoryMutation) SetCreatedAt(t time.Time)
- func (m *CategoryMutation) SetField(name string, value ent.Value) error
- func (m *CategoryMutation) SetInts(i []int)
- func (m *CategoryMutation) SetName(s string)
- func (m *CategoryMutation) SetNillable(s string)
- func (m *CategoryMutation) SetOp(op Op)
- func (m *CategoryMutation) SetReadonly(s string)
- func (m *CategoryMutation) SetSkipInSpec(s string)
- func (m *CategoryMutation) SetStrings(s []string)
- func (m *CategoryMutation) SetUpdatedAt(t time.Time)
- func (m *CategoryMutation) SkipInSpec() (r string, exists bool)
- func (m *CategoryMutation) SkipInSpecCleared() bool
- func (m *CategoryMutation) Strings() (r []string, exists bool)
- func (m *CategoryMutation) StringsCleared() bool
- func (m CategoryMutation) Tx() (*Tx, error)
- func (m *CategoryMutation) Type() string
- func (m *CategoryMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CategoryMutation) Where(ps ...predicate.Category)
- func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))
- type CategoryQuery
- func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect
- func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
- func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
- func (cq *CategoryQuery) Clone() *CategoryQuery
- func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoryQuery) CountX(ctx context.Context) int
- func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoryQuery) ExistX(ctx context.Context) bool
- func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) FirstIDX(ctx context.Context) int
- func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
- func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
- func (cq *CategoryQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CategoryQuery) IDsX(ctx context.Context) []int
- func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
- func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
- func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int
- func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
- func (cq *CategoryQuery) Order(o ...category.OrderOption) *CategoryQuery
- func (cq *CategoryQuery) QueryPets() *PetQuery
- func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
- func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
- func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
- func (cq *CategoryQuery) WithPets(opts ...func(*PetQuery)) *CategoryQuery
- type CategorySelect
- func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect
- func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategorySelect) BoolX(ctx context.Context) bool
- func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CategorySelect) BoolsX(ctx context.Context) []bool
- func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategorySelect) Float64X(ctx context.Context) float64
- func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategorySelect) Float64sX(ctx context.Context) []float64
- func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)
- func (s *CategorySelect) IntX(ctx context.Context) int
- func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)
- func (s *CategorySelect) IntsX(ctx context.Context) []int
- func (cs *CategorySelect) Scan(ctx context.Context, v any) error
- func (s *CategorySelect) ScanX(ctx context.Context, v any)
- func (s *CategorySelect) String(ctx context.Context) (_ string, err error)
- func (s *CategorySelect) StringX(ctx context.Context) string
- func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)
- func (s *CategorySelect) StringsX(ctx context.Context) []string
- type CategoryUpdate
- func (cu *CategoryUpdate) AddPetIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) AddPets(p ...*Pet) *CategoryUpdate
- func (cu *CategoryUpdate) AppendInts(i []int) *CategoryUpdate
- func (cu *CategoryUpdate) AppendStrings(s []string) *CategoryUpdate
- func (cu *CategoryUpdate) ClearInts() *CategoryUpdate
- func (cu *CategoryUpdate) ClearPets() *CategoryUpdate
- func (cu *CategoryUpdate) ClearSkipInSpec() *CategoryUpdate
- func (cu *CategoryUpdate) ClearStrings() *CategoryUpdate
- func (cu *CategoryUpdate) Exec(ctx context.Context) error
- func (cu *CategoryUpdate) ExecX(ctx context.Context)
- func (cu *CategoryUpdate) Mutation() *CategoryMutation
- func (cu *CategoryUpdate) RemovePetIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) RemovePets(p ...*Pet) *CategoryUpdate
- func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoryUpdate) SaveX(ctx context.Context) int
- func (cu *CategoryUpdate) SetInts(i []int) *CategoryUpdate
- func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillable(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableName(s *string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableNillable(s *string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableReadonly(s *string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableSkipInSpec(s *string) *CategoryUpdate
- func (cu *CategoryUpdate) SetReadonly(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetSkipInSpec(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetStrings(s []string) *CategoryUpdate
- func (cu *CategoryUpdate) SetUpdatedAt(t time.Time) *CategoryUpdate
- func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
- type CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddPetIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddPets(p ...*Pet) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AppendInts(i []int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AppendStrings(s []string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearInts() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearPets() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearSkipInSpec() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearStrings() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
- func (cuo *CategoryUpdateOne) RemovePetIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) RemovePets(p ...*Pet) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
- func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
- func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetInts(i []int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillable(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableName(s *string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableNillable(s *string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableReadonly(s *string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableSkipInSpec(s *string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetReadonly(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetSkipInSpec(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetStrings(s []string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Where(ps ...predicate.Category) *CategoryUpdateOne
- 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 Follows
- type FollowsClient
- func (c *FollowsClient) Create() *FollowsCreate
- func (c *FollowsClient) CreateBulk(builders ...*FollowsCreate) *FollowsCreateBulk
- func (c *FollowsClient) Delete() *FollowsDelete
- func (c *FollowsClient) Hooks() []Hook
- func (c *FollowsClient) Intercept(interceptors ...Interceptor)
- func (c *FollowsClient) Interceptors() []Interceptor
- func (c *FollowsClient) MapCreateBulk(slice any, setFunc func(*FollowsCreate, int)) *FollowsCreateBulk
- func (c *FollowsClient) Query() *FollowsQuery
- func (c *FollowsClient) QueryPet(f *Follows) *PetQuery
- func (c *FollowsClient) QueryUser(f *Follows) *UserQuery
- func (c *FollowsClient) Update() *FollowsUpdate
- func (c *FollowsClient) UpdateOne(f *Follows) *FollowsUpdateOne
- func (c *FollowsClient) Use(hooks ...Hook)
- type FollowsCreate
- func (fc *FollowsCreate) Exec(ctx context.Context) error
- func (fc *FollowsCreate) ExecX(ctx context.Context)
- func (fc *FollowsCreate) Mutation() *FollowsMutation
- func (fc *FollowsCreate) Save(ctx context.Context) (*Follows, error)
- func (fc *FollowsCreate) SaveX(ctx context.Context) *Follows
- func (fc *FollowsCreate) SetFollowedAt(t time.Time) *FollowsCreate
- func (fc *FollowsCreate) SetNillableFollowedAt(t *time.Time) *FollowsCreate
- func (fc *FollowsCreate) SetPet(p *Pet) *FollowsCreate
- func (fc *FollowsCreate) SetPetID(i int) *FollowsCreate
- func (fc *FollowsCreate) SetUser(u *User) *FollowsCreate
- func (fc *FollowsCreate) SetUserID(i int) *FollowsCreate
- type FollowsCreateBulk
- type FollowsDelete
- type FollowsDeleteOne
- type FollowsEdges
- type FollowsGroupBy
- func (fgb *FollowsGroupBy) Aggregate(fns ...AggregateFunc) *FollowsGroupBy
- func (s *FollowsGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FollowsGroupBy) BoolX(ctx context.Context) bool
- func (s *FollowsGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FollowsGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FollowsGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FollowsGroupBy) Float64X(ctx context.Context) float64
- func (s *FollowsGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FollowsGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FollowsGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FollowsGroupBy) IntX(ctx context.Context) int
- func (s *FollowsGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FollowsGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FollowsGroupBy) Scan(ctx context.Context, v any) error
- func (s *FollowsGroupBy) ScanX(ctx context.Context, v any)
- func (s *FollowsGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FollowsGroupBy) StringX(ctx context.Context) string
- func (s *FollowsGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FollowsGroupBy) StringsX(ctx context.Context) []string
- type FollowsMutation
- func (m *FollowsMutation) AddField(name string, value ent.Value) error
- func (m *FollowsMutation) AddedEdges() []string
- func (m *FollowsMutation) AddedField(name string) (ent.Value, bool)
- func (m *FollowsMutation) AddedFields() []string
- func (m *FollowsMutation) AddedIDs(name string) []ent.Value
- func (m *FollowsMutation) ClearEdge(name string) error
- func (m *FollowsMutation) ClearField(name string) error
- func (m *FollowsMutation) ClearPet()
- func (m *FollowsMutation) ClearUser()
- func (m *FollowsMutation) ClearedEdges() []string
- func (m *FollowsMutation) ClearedFields() []string
- func (m FollowsMutation) Client() *Client
- func (m *FollowsMutation) EdgeCleared(name string) bool
- func (m *FollowsMutation) Field(name string) (ent.Value, bool)
- func (m *FollowsMutation) FieldCleared(name string) bool
- func (m *FollowsMutation) Fields() []string
- func (m *FollowsMutation) FollowedAt() (r time.Time, exists bool)
- func (m *FollowsMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FollowsMutation) Op() Op
- func (m *FollowsMutation) PetCleared() bool
- func (m *FollowsMutation) PetID() (r int, exists bool)
- func (m *FollowsMutation) PetIDs() (ids []int)
- func (m *FollowsMutation) RemovedEdges() []string
- func (m *FollowsMutation) RemovedIDs(name string) []ent.Value
- func (m *FollowsMutation) ResetEdge(name string) error
- func (m *FollowsMutation) ResetField(name string) error
- func (m *FollowsMutation) ResetFollowedAt()
- func (m *FollowsMutation) ResetPet()
- func (m *FollowsMutation) ResetPetID()
- func (m *FollowsMutation) ResetUser()
- func (m *FollowsMutation) ResetUserID()
- func (m *FollowsMutation) SetField(name string, value ent.Value) error
- func (m *FollowsMutation) SetFollowedAt(t time.Time)
- func (m *FollowsMutation) SetOp(op Op)
- func (m *FollowsMutation) SetPetID(i int)
- func (m *FollowsMutation) SetUserID(i int)
- func (m FollowsMutation) Tx() (*Tx, error)
- func (m *FollowsMutation) Type() string
- func (m *FollowsMutation) UserCleared() bool
- func (m *FollowsMutation) UserID() (r int, exists bool)
- func (m *FollowsMutation) UserIDs() (ids []int)
- func (m *FollowsMutation) Where(ps ...predicate.Follows)
- func (m *FollowsMutation) WhereP(ps ...func(*sql.Selector))
- type FollowsQuery
- func (fq *FollowsQuery) Aggregate(fns ...AggregateFunc) *FollowsSelect
- func (fq *FollowsQuery) All(ctx context.Context) ([]*Follows, error)
- func (fq *FollowsQuery) AllX(ctx context.Context) []*Follows
- func (fq *FollowsQuery) Clone() *FollowsQuery
- func (fq *FollowsQuery) Count(ctx context.Context) (int, error)
- func (fq *FollowsQuery) CountX(ctx context.Context) int
- func (fq *FollowsQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FollowsQuery) ExistX(ctx context.Context) bool
- func (fq *FollowsQuery) First(ctx context.Context) (*Follows, error)
- func (fq *FollowsQuery) FirstX(ctx context.Context) *Follows
- func (fq *FollowsQuery) GroupBy(field string, fields ...string) *FollowsGroupBy
- func (fq *FollowsQuery) Limit(limit int) *FollowsQuery
- func (fq *FollowsQuery) Offset(offset int) *FollowsQuery
- func (fq *FollowsQuery) Only(ctx context.Context) (*Follows, error)
- func (fq *FollowsQuery) OnlyX(ctx context.Context) *Follows
- func (fq *FollowsQuery) Order(o ...follows.OrderOption) *FollowsQuery
- func (fq *FollowsQuery) QueryPet() *PetQuery
- func (fq *FollowsQuery) QueryUser() *UserQuery
- func (fq *FollowsQuery) Select(fields ...string) *FollowsSelect
- func (fq *FollowsQuery) Unique(unique bool) *FollowsQuery
- func (fq *FollowsQuery) Where(ps ...predicate.Follows) *FollowsQuery
- func (fq *FollowsQuery) WithPet(opts ...func(*PetQuery)) *FollowsQuery
- func (fq *FollowsQuery) WithUser(opts ...func(*UserQuery)) *FollowsQuery
- type FollowsSelect
- func (fs *FollowsSelect) Aggregate(fns ...AggregateFunc) *FollowsSelect
- func (s *FollowsSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FollowsSelect) BoolX(ctx context.Context) bool
- func (s *FollowsSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FollowsSelect) BoolsX(ctx context.Context) []bool
- func (s *FollowsSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FollowsSelect) Float64X(ctx context.Context) float64
- func (s *FollowsSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FollowsSelect) Float64sX(ctx context.Context) []float64
- func (s *FollowsSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FollowsSelect) IntX(ctx context.Context) int
- func (s *FollowsSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FollowsSelect) IntsX(ctx context.Context) []int
- func (fs *FollowsSelect) Scan(ctx context.Context, v any) error
- func (s *FollowsSelect) ScanX(ctx context.Context, v any)
- func (s *FollowsSelect) String(ctx context.Context) (_ string, err error)
- func (s *FollowsSelect) StringX(ctx context.Context) string
- func (s *FollowsSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FollowsSelect) StringsX(ctx context.Context) []string
- type FollowsSlice
- type FollowsUpdate
- func (fu *FollowsUpdate) ClearPet() *FollowsUpdate
- func (fu *FollowsUpdate) ClearUser() *FollowsUpdate
- func (fu *FollowsUpdate) Exec(ctx context.Context) error
- func (fu *FollowsUpdate) ExecX(ctx context.Context)
- func (fu *FollowsUpdate) Mutation() *FollowsMutation
- func (fu *FollowsUpdate) Save(ctx context.Context) (int, error)
- func (fu *FollowsUpdate) SaveX(ctx context.Context) int
- func (fu *FollowsUpdate) SetFollowedAt(t time.Time) *FollowsUpdate
- func (fu *FollowsUpdate) SetNillableFollowedAt(t *time.Time) *FollowsUpdate
- func (fu *FollowsUpdate) SetNillablePetID(i *int) *FollowsUpdate
- func (fu *FollowsUpdate) SetNillableUserID(i *int) *FollowsUpdate
- func (fu *FollowsUpdate) SetPet(p *Pet) *FollowsUpdate
- func (fu *FollowsUpdate) SetPetID(i int) *FollowsUpdate
- func (fu *FollowsUpdate) SetUser(u *User) *FollowsUpdate
- func (fu *FollowsUpdate) SetUserID(i int) *FollowsUpdate
- func (fu *FollowsUpdate) Where(ps ...predicate.Follows) *FollowsUpdate
- type FollowsUpdateOne
- func (fuo *FollowsUpdateOne) ClearPet() *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) ClearUser() *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) Exec(ctx context.Context) error
- func (fuo *FollowsUpdateOne) ExecX(ctx context.Context)
- func (fuo *FollowsUpdateOne) Mutation() *FollowsMutation
- func (fuo *FollowsUpdateOne) Save(ctx context.Context) (*Follows, error)
- func (fuo *FollowsUpdateOne) SaveX(ctx context.Context) *Follows
- func (fuo *FollowsUpdateOne) Select(field string, fields ...string) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetFollowedAt(t time.Time) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetNillableFollowedAt(t *time.Time) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetNillablePetID(i *int) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetNillableUserID(i *int) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetPet(p *Pet) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetPetID(i int) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetUser(u *User) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) SetUserID(i int) *FollowsUpdateOne
- func (fuo *FollowsUpdateOne) Where(ps ...predicate.Follows) *FollowsUpdateOne
- type Friendship
- type FriendshipClient
- func (c *FriendshipClient) Create() *FriendshipCreate
- func (c *FriendshipClient) CreateBulk(builders ...*FriendshipCreate) *FriendshipCreateBulk
- func (c *FriendshipClient) Delete() *FriendshipDelete
- func (c *FriendshipClient) DeleteOne(f *Friendship) *FriendshipDeleteOne
- func (c *FriendshipClient) DeleteOneID(id int) *FriendshipDeleteOne
- func (c *FriendshipClient) Get(ctx context.Context, id int) (*Friendship, error)
- func (c *FriendshipClient) GetX(ctx context.Context, id int) *Friendship
- func (c *FriendshipClient) Hooks() []Hook
- func (c *FriendshipClient) Intercept(interceptors ...Interceptor)
- func (c *FriendshipClient) Interceptors() []Interceptor
- func (c *FriendshipClient) MapCreateBulk(slice any, setFunc func(*FriendshipCreate, int)) *FriendshipCreateBulk
- func (c *FriendshipClient) Query() *FriendshipQuery
- func (c *FriendshipClient) QueryFriend(f *Friendship) *UserQuery
- func (c *FriendshipClient) QueryUser(f *Friendship) *UserQuery
- func (c *FriendshipClient) Update() *FriendshipUpdate
- func (c *FriendshipClient) UpdateOne(f *Friendship) *FriendshipUpdateOne
- func (c *FriendshipClient) UpdateOneID(id int) *FriendshipUpdateOne
- func (c *FriendshipClient) Use(hooks ...Hook)
- type FriendshipCreate
- func (fc *FriendshipCreate) Exec(ctx context.Context) error
- func (fc *FriendshipCreate) ExecX(ctx context.Context)
- func (fc *FriendshipCreate) Mutation() *FriendshipMutation
- func (fc *FriendshipCreate) Save(ctx context.Context) (*Friendship, error)
- func (fc *FriendshipCreate) SaveX(ctx context.Context) *Friendship
- func (fc *FriendshipCreate) SetCreatedAt(t time.Time) *FriendshipCreate
- func (fc *FriendshipCreate) SetFriend(u *User) *FriendshipCreate
- func (fc *FriendshipCreate) SetFriendID(i int) *FriendshipCreate
- func (fc *FriendshipCreate) SetNillableCreatedAt(t *time.Time) *FriendshipCreate
- func (fc *FriendshipCreate) SetUser(u *User) *FriendshipCreate
- func (fc *FriendshipCreate) SetUserID(i int) *FriendshipCreate
- type FriendshipCreateBulk
- type FriendshipDelete
- type FriendshipDeleteOne
- type FriendshipEdges
- type FriendshipGroupBy
- func (fgb *FriendshipGroupBy) Aggregate(fns ...AggregateFunc) *FriendshipGroupBy
- func (s *FriendshipGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FriendshipGroupBy) BoolX(ctx context.Context) bool
- func (s *FriendshipGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FriendshipGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FriendshipGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FriendshipGroupBy) Float64X(ctx context.Context) float64
- func (s *FriendshipGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FriendshipGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FriendshipGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FriendshipGroupBy) IntX(ctx context.Context) int
- func (s *FriendshipGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FriendshipGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FriendshipGroupBy) Scan(ctx context.Context, v any) error
- func (s *FriendshipGroupBy) ScanX(ctx context.Context, v any)
- func (s *FriendshipGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FriendshipGroupBy) StringX(ctx context.Context) string
- func (s *FriendshipGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FriendshipGroupBy) StringsX(ctx context.Context) []string
- type FriendshipMutation
- func (m *FriendshipMutation) AddField(name string, value ent.Value) error
- func (m *FriendshipMutation) AddedEdges() []string
- func (m *FriendshipMutation) AddedField(name string) (ent.Value, bool)
- func (m *FriendshipMutation) AddedFields() []string
- func (m *FriendshipMutation) AddedIDs(name string) []ent.Value
- func (m *FriendshipMutation) ClearEdge(name string) error
- func (m *FriendshipMutation) ClearField(name string) error
- func (m *FriendshipMutation) ClearFriend()
- func (m *FriendshipMutation) ClearUser()
- func (m *FriendshipMutation) ClearedEdges() []string
- func (m *FriendshipMutation) ClearedFields() []string
- func (m FriendshipMutation) Client() *Client
- func (m *FriendshipMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FriendshipMutation) EdgeCleared(name string) bool
- func (m *FriendshipMutation) Field(name string) (ent.Value, bool)
- func (m *FriendshipMutation) FieldCleared(name string) bool
- func (m *FriendshipMutation) Fields() []string
- func (m *FriendshipMutation) FriendCleared() bool
- func (m *FriendshipMutation) FriendID() (r int, exists bool)
- func (m *FriendshipMutation) FriendIDs() (ids []int)
- func (m *FriendshipMutation) ID() (id int, exists bool)
- func (m *FriendshipMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FriendshipMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FriendshipMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FriendshipMutation) OldFriendID(ctx context.Context) (v int, err error)
- func (m *FriendshipMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *FriendshipMutation) Op() Op
- func (m *FriendshipMutation) RemovedEdges() []string
- func (m *FriendshipMutation) RemovedIDs(name string) []ent.Value
- func (m *FriendshipMutation) ResetCreatedAt()
- func (m *FriendshipMutation) ResetEdge(name string) error
- func (m *FriendshipMutation) ResetField(name string) error
- func (m *FriendshipMutation) ResetFriend()
- func (m *FriendshipMutation) ResetFriendID()
- func (m *FriendshipMutation) ResetUser()
- func (m *FriendshipMutation) ResetUserID()
- func (m *FriendshipMutation) SetCreatedAt(t time.Time)
- func (m *FriendshipMutation) SetField(name string, value ent.Value) error
- func (m *FriendshipMutation) SetFriendID(i int)
- func (m *FriendshipMutation) SetOp(op Op)
- func (m *FriendshipMutation) SetUserID(i int)
- func (m FriendshipMutation) Tx() (*Tx, error)
- func (m *FriendshipMutation) Type() string
- func (m *FriendshipMutation) UserCleared() bool
- func (m *FriendshipMutation) UserID() (r int, exists bool)
- func (m *FriendshipMutation) UserIDs() (ids []int)
- func (m *FriendshipMutation) Where(ps ...predicate.Friendship)
- func (m *FriendshipMutation) WhereP(ps ...func(*sql.Selector))
- type FriendshipQuery
- func (fq *FriendshipQuery) Aggregate(fns ...AggregateFunc) *FriendshipSelect
- func (fq *FriendshipQuery) All(ctx context.Context) ([]*Friendship, error)
- func (fq *FriendshipQuery) AllX(ctx context.Context) []*Friendship
- func (fq *FriendshipQuery) Clone() *FriendshipQuery
- func (fq *FriendshipQuery) Count(ctx context.Context) (int, error)
- func (fq *FriendshipQuery) CountX(ctx context.Context) int
- func (fq *FriendshipQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FriendshipQuery) ExistX(ctx context.Context) bool
- func (fq *FriendshipQuery) First(ctx context.Context) (*Friendship, error)
- func (fq *FriendshipQuery) FirstID(ctx context.Context) (id int, err error)
- func (fq *FriendshipQuery) FirstIDX(ctx context.Context) int
- func (fq *FriendshipQuery) FirstX(ctx context.Context) *Friendship
- func (fq *FriendshipQuery) GroupBy(field string, fields ...string) *FriendshipGroupBy
- func (fq *FriendshipQuery) IDs(ctx context.Context) (ids []int, err error)
- func (fq *FriendshipQuery) IDsX(ctx context.Context) []int
- func (fq *FriendshipQuery) Limit(limit int) *FriendshipQuery
- func (fq *FriendshipQuery) Offset(offset int) *FriendshipQuery
- func (fq *FriendshipQuery) Only(ctx context.Context) (*Friendship, error)
- func (fq *FriendshipQuery) OnlyID(ctx context.Context) (id int, err error)
- func (fq *FriendshipQuery) OnlyIDX(ctx context.Context) int
- func (fq *FriendshipQuery) OnlyX(ctx context.Context) *Friendship
- func (fq *FriendshipQuery) Order(o ...friendship.OrderOption) *FriendshipQuery
- func (fq *FriendshipQuery) QueryFriend() *UserQuery
- func (fq *FriendshipQuery) QueryUser() *UserQuery
- func (fq *FriendshipQuery) Select(fields ...string) *FriendshipSelect
- func (fq *FriendshipQuery) Unique(unique bool) *FriendshipQuery
- func (fq *FriendshipQuery) Where(ps ...predicate.Friendship) *FriendshipQuery
- func (fq *FriendshipQuery) WithFriend(opts ...func(*UserQuery)) *FriendshipQuery
- func (fq *FriendshipQuery) WithUser(opts ...func(*UserQuery)) *FriendshipQuery
- type FriendshipSelect
- func (fs *FriendshipSelect) Aggregate(fns ...AggregateFunc) *FriendshipSelect
- func (s *FriendshipSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FriendshipSelect) BoolX(ctx context.Context) bool
- func (s *FriendshipSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FriendshipSelect) BoolsX(ctx context.Context) []bool
- func (s *FriendshipSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FriendshipSelect) Float64X(ctx context.Context) float64
- func (s *FriendshipSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FriendshipSelect) Float64sX(ctx context.Context) []float64
- func (s *FriendshipSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FriendshipSelect) IntX(ctx context.Context) int
- func (s *FriendshipSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FriendshipSelect) IntsX(ctx context.Context) []int
- func (fs *FriendshipSelect) Scan(ctx context.Context, v any) error
- func (s *FriendshipSelect) ScanX(ctx context.Context, v any)
- func (s *FriendshipSelect) String(ctx context.Context) (_ string, err error)
- func (s *FriendshipSelect) StringX(ctx context.Context) string
- func (s *FriendshipSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FriendshipSelect) StringsX(ctx context.Context) []string
- type FriendshipUpdate
- func (fu *FriendshipUpdate) ClearFriend() *FriendshipUpdate
- func (fu *FriendshipUpdate) ClearUser() *FriendshipUpdate
- func (fu *FriendshipUpdate) Exec(ctx context.Context) error
- func (fu *FriendshipUpdate) ExecX(ctx context.Context)
- func (fu *FriendshipUpdate) Mutation() *FriendshipMutation
- func (fu *FriendshipUpdate) Save(ctx context.Context) (int, error)
- func (fu *FriendshipUpdate) SaveX(ctx context.Context) int
- func (fu *FriendshipUpdate) SetCreatedAt(t time.Time) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetFriend(u *User) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetFriendID(i int) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetNillableCreatedAt(t *time.Time) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetNillableFriendID(i *int) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetNillableUserID(i *int) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetUser(u *User) *FriendshipUpdate
- func (fu *FriendshipUpdate) SetUserID(i int) *FriendshipUpdate
- func (fu *FriendshipUpdate) Where(ps ...predicate.Friendship) *FriendshipUpdate
- type FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) ClearFriend() *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) ClearUser() *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) Exec(ctx context.Context) error
- func (fuo *FriendshipUpdateOne) ExecX(ctx context.Context)
- func (fuo *FriendshipUpdateOne) Mutation() *FriendshipMutation
- func (fuo *FriendshipUpdateOne) Save(ctx context.Context) (*Friendship, error)
- func (fuo *FriendshipUpdateOne) SaveX(ctx context.Context) *Friendship
- func (fuo *FriendshipUpdateOne) Select(field string, fields ...string) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetCreatedAt(t time.Time) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetFriend(u *User) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetFriendID(i int) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetNillableCreatedAt(t *time.Time) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetNillableFriendID(i *int) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetNillableUserID(i *int) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetUser(u *User) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) SetUserID(i int) *FriendshipUpdateOne
- func (fuo *FriendshipUpdateOne) Where(ps ...predicate.Friendship) *FriendshipUpdateOne
- type Friendships
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Pet
- func (pe *Pet) QueryCategories() *CategoryQuery
- func (pe *Pet) QueryFollowedBy() *UserQuery
- func (pe *Pet) QueryFollowing() *FollowsQuery
- func (pe *Pet) QueryFriends() *PetQuery
- func (pe *Pet) QueryOwner() *UserQuery
- func (pe *Pet) String() string
- func (pe *Pet) Unwrap() *Pet
- func (pe *Pet) Update() *PetUpdateOne
- func (pe *Pet) Value(name string) (ent.Value, error)
- type PetClient
- func (c *PetClient) Create() *PetCreate
- func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
- func (c *PetClient) Delete() *PetDelete
- func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
- func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
- func (c *PetClient) Get(ctx context.Context, id int) (*Pet, error)
- func (c *PetClient) GetX(ctx context.Context, id int) *Pet
- func (c *PetClient) Hooks() []Hook
- func (c *PetClient) Intercept(interceptors ...Interceptor)
- func (c *PetClient) Interceptors() []Interceptor
- func (c *PetClient) MapCreateBulk(slice any, setFunc func(*PetCreate, int)) *PetCreateBulk
- func (c *PetClient) Query() *PetQuery
- func (c *PetClient) QueryCategories(pe *Pet) *CategoryQuery
- func (c *PetClient) QueryFollowedBy(pe *Pet) *UserQuery
- func (c *PetClient) QueryFollowing(pe *Pet) *FollowsQuery
- func (c *PetClient) QueryFriends(pe *Pet) *PetQuery
- func (c *PetClient) QueryOwner(pe *Pet) *UserQuery
- func (c *PetClient) Update() *PetUpdate
- func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
- func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
- func (c *PetClient) Use(hooks ...Hook)
- type PetCreate
- func (pc *PetCreate) AddCategories(c ...*Category) *PetCreate
- func (pc *PetCreate) AddCategoryIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddFollowedBy(u ...*User) *PetCreate
- func (pc *PetCreate) AddFollowedByIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddFriendIDs(ids ...int) *PetCreate
- func (pc *PetCreate) AddFriends(p ...*Pet) *PetCreate
- func (pc *PetCreate) Exec(ctx context.Context) error
- func (pc *PetCreate) ExecX(ctx context.Context)
- func (pc *PetCreate) Mutation() *PetMutation
- func (pc *PetCreate) Save(ctx context.Context) (*Pet, error)
- func (pc *PetCreate) SaveX(ctx context.Context) *Pet
- func (pc *PetCreate) SetAge(i int) *PetCreate
- func (pc *PetCreate) SetID(i int) *PetCreate
- func (pc *PetCreate) SetName(s string) *PetCreate
- func (pc *PetCreate) SetNicknames(s []string) *PetCreate
- func (pc *PetCreate) SetNillableOwnerID(id *int) *PetCreate
- func (pc *PetCreate) SetOwner(u *User) *PetCreate
- func (pc *PetCreate) SetOwnerID(id int) *PetCreate
- func (pc *PetCreate) SetType(pe pet.Type) *PetCreate
- type PetCreateBulk
- type PetDelete
- type PetDeleteOne
- type PetEdges
- type PetGroupBy
- func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
- func (s *PetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PetGroupBy) BoolX(ctx context.Context) bool
- func (s *PetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PetGroupBy) Float64X(ctx context.Context) float64
- func (s *PetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PetGroupBy) IntX(ctx context.Context) int
- func (s *PetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PetGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PetGroupBy) Scan(ctx context.Context, v any) error
- func (s *PetGroupBy) ScanX(ctx context.Context, v any)
- func (s *PetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PetGroupBy) StringX(ctx context.Context) string
- func (s *PetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PetGroupBy) StringsX(ctx context.Context) []string
- type PetMutation
- func (m *PetMutation) AddAge(i int)
- func (m *PetMutation) AddCategoryIDs(ids ...int)
- func (m *PetMutation) AddField(name string, value ent.Value) error
- func (m *PetMutation) AddFollowedByIDs(ids ...int)
- func (m *PetMutation) AddFriendIDs(ids ...int)
- func (m *PetMutation) AddedAge() (r int, exists bool)
- func (m *PetMutation) AddedEdges() []string
- func (m *PetMutation) AddedField(name string) (ent.Value, bool)
- func (m *PetMutation) AddedFields() []string
- func (m *PetMutation) AddedIDs(name string) []ent.Value
- func (m *PetMutation) Age() (r int, exists bool)
- func (m *PetMutation) AppendNicknames(s []string)
- func (m *PetMutation) AppendedNicknames() ([]string, bool)
- func (m *PetMutation) CategoriesCleared() bool
- func (m *PetMutation) CategoriesIDs() (ids []int)
- func (m *PetMutation) ClearCategories()
- func (m *PetMutation) ClearEdge(name string) error
- func (m *PetMutation) ClearField(name string) error
- func (m *PetMutation) ClearFollowedBy()
- func (m *PetMutation) ClearFriends()
- func (m *PetMutation) ClearNicknames()
- func (m *PetMutation) ClearOwner()
- func (m *PetMutation) ClearedEdges() []string
- func (m *PetMutation) ClearedFields() []string
- func (m PetMutation) Client() *Client
- func (m *PetMutation) EdgeCleared(name string) bool
- func (m *PetMutation) Field(name string) (ent.Value, bool)
- func (m *PetMutation) FieldCleared(name string) bool
- func (m *PetMutation) Fields() []string
- func (m *PetMutation) FollowedByCleared() bool
- func (m *PetMutation) FollowedByIDs() (ids []int)
- func (m *PetMutation) FriendsCleared() bool
- func (m *PetMutation) FriendsIDs() (ids []int)
- func (m *PetMutation) GetType() (r pet.Type, exists bool)
- func (m *PetMutation) ID() (id int, exists bool)
- func (m *PetMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PetMutation) Name() (r string, exists bool)
- func (m *PetMutation) Nicknames() (r []string, exists bool)
- func (m *PetMutation) NicknamesCleared() bool
- func (m *PetMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PetMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PetMutation) OldNicknames(ctx context.Context) (v []string, err error)
- func (m *PetMutation) OldType(ctx context.Context) (v pet.Type, err error)
- func (m *PetMutation) Op() Op
- func (m *PetMutation) OwnerCleared() bool
- func (m *PetMutation) OwnerID() (id int, exists bool)
- func (m *PetMutation) OwnerIDs() (ids []int)
- func (m *PetMutation) RemoveCategoryIDs(ids ...int)
- func (m *PetMutation) RemoveFollowedByIDs(ids ...int)
- func (m *PetMutation) RemoveFriendIDs(ids ...int)
- func (m *PetMutation) RemovedCategoriesIDs() (ids []int)
- func (m *PetMutation) RemovedEdges() []string
- func (m *PetMutation) RemovedFollowedByIDs() (ids []int)
- func (m *PetMutation) RemovedFriendsIDs() (ids []int)
- func (m *PetMutation) RemovedIDs(name string) []ent.Value
- func (m *PetMutation) ResetAge()
- func (m *PetMutation) ResetCategories()
- func (m *PetMutation) ResetEdge(name string) error
- func (m *PetMutation) ResetField(name string) error
- func (m *PetMutation) ResetFollowedBy()
- func (m *PetMutation) ResetFriends()
- func (m *PetMutation) ResetName()
- func (m *PetMutation) ResetNicknames()
- func (m *PetMutation) ResetOwner()
- func (m *PetMutation) ResetType()
- func (m *PetMutation) SetAge(i int)
- func (m *PetMutation) SetField(name string, value ent.Value) error
- func (m *PetMutation) SetID(id int)
- func (m *PetMutation) SetName(s string)
- func (m *PetMutation) SetNicknames(s []string)
- func (m *PetMutation) SetOp(op Op)
- func (m *PetMutation) SetOwnerID(id int)
- func (m *PetMutation) SetType(pe pet.Type)
- func (m PetMutation) Tx() (*Tx, error)
- func (m *PetMutation) Type() string
- func (m *PetMutation) Where(ps ...predicate.Pet)
- func (m *PetMutation) WhereP(ps ...func(*sql.Selector))
- type PetQuery
- func (pq *PetQuery) Aggregate(fns ...AggregateFunc) *PetSelect
- func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error)
- func (pq *PetQuery) AllX(ctx context.Context) []*Pet
- func (pq *PetQuery) Clone() *PetQuery
- func (pq *PetQuery) Count(ctx context.Context) (int, error)
- func (pq *PetQuery) CountX(ctx context.Context) int
- func (pq *PetQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PetQuery) ExistX(ctx context.Context) bool
- func (pq *PetQuery) First(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) FirstIDX(ctx context.Context) int
- func (pq *PetQuery) FirstX(ctx context.Context) *Pet
- func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
- func (pq *PetQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *PetQuery) IDsX(ctx context.Context) []int
- func (pq *PetQuery) Limit(limit int) *PetQuery
- func (pq *PetQuery) Offset(offset int) *PetQuery
- func (pq *PetQuery) Only(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) OnlyIDX(ctx context.Context) int
- func (pq *PetQuery) OnlyX(ctx context.Context) *Pet
- func (pq *PetQuery) Order(o ...pet.OrderOption) *PetQuery
- func (pq *PetQuery) QueryCategories() *CategoryQuery
- func (pq *PetQuery) QueryFollowedBy() *UserQuery
- func (pq *PetQuery) QueryFollowing() *FollowsQuery
- func (pq *PetQuery) QueryFriends() *PetQuery
- func (pq *PetQuery) QueryOwner() *UserQuery
- func (pq *PetQuery) Select(fields ...string) *PetSelect
- func (pq *PetQuery) Unique(unique bool) *PetQuery
- func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery
- func (pq *PetQuery) WithCategories(opts ...func(*CategoryQuery)) *PetQuery
- func (pq *PetQuery) WithFollowedBy(opts ...func(*UserQuery)) *PetQuery
- func (pq *PetQuery) WithFollowing(opts ...func(*FollowsQuery)) *PetQuery
- func (pq *PetQuery) WithFriends(opts ...func(*PetQuery)) *PetQuery
- func (pq *PetQuery) WithOwner(opts ...func(*UserQuery)) *PetQuery
- type PetSelect
- func (ps *PetSelect) Aggregate(fns ...AggregateFunc) *PetSelect
- func (s *PetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PetSelect) BoolX(ctx context.Context) bool
- func (s *PetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PetSelect) BoolsX(ctx context.Context) []bool
- func (s *PetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PetSelect) Float64X(ctx context.Context) float64
- func (s *PetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PetSelect) Float64sX(ctx context.Context) []float64
- func (s *PetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PetSelect) IntX(ctx context.Context) int
- func (s *PetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PetSelect) IntsX(ctx context.Context) []int
- func (ps *PetSelect) Scan(ctx context.Context, v any) error
- func (s *PetSelect) ScanX(ctx context.Context, v any)
- func (s *PetSelect) String(ctx context.Context) (_ string, err error)
- func (s *PetSelect) StringX(ctx context.Context) string
- func (s *PetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PetSelect) StringsX(ctx context.Context) []string
- type PetUpdate
- func (pu *PetUpdate) AddAge(i int) *PetUpdate
- func (pu *PetUpdate) AddCategories(c ...*Category) *PetUpdate
- func (pu *PetUpdate) AddCategoryIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddFollowedBy(u ...*User) *PetUpdate
- func (pu *PetUpdate) AddFollowedByIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddFriendIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) AddFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) AppendNicknames(s []string) *PetUpdate
- func (pu *PetUpdate) ClearCategories() *PetUpdate
- func (pu *PetUpdate) ClearFollowedBy() *PetUpdate
- func (pu *PetUpdate) ClearFriends() *PetUpdate
- func (pu *PetUpdate) ClearNicknames() *PetUpdate
- func (pu *PetUpdate) ClearOwner() *PetUpdate
- func (pu *PetUpdate) Exec(ctx context.Context) error
- func (pu *PetUpdate) ExecX(ctx context.Context)
- func (pu *PetUpdate) Mutation() *PetMutation
- func (pu *PetUpdate) RemoveCategories(c ...*Category) *PetUpdate
- func (pu *PetUpdate) RemoveCategoryIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemoveFollowedBy(u ...*User) *PetUpdate
- func (pu *PetUpdate) RemoveFollowedByIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemoveFriendIDs(ids ...int) *PetUpdate
- func (pu *PetUpdate) RemoveFriends(p ...*Pet) *PetUpdate
- func (pu *PetUpdate) Save(ctx context.Context) (int, error)
- func (pu *PetUpdate) SaveX(ctx context.Context) int
- func (pu *PetUpdate) SetAge(i int) *PetUpdate
- func (pu *PetUpdate) SetName(s string) *PetUpdate
- func (pu *PetUpdate) SetNicknames(s []string) *PetUpdate
- func (pu *PetUpdate) SetNillableAge(i *int) *PetUpdate
- func (pu *PetUpdate) SetNillableName(s *string) *PetUpdate
- func (pu *PetUpdate) SetNillableOwnerID(id *int) *PetUpdate
- func (pu *PetUpdate) SetNillableType(pe *pet.Type) *PetUpdate
- func (pu *PetUpdate) SetOwner(u *User) *PetUpdate
- func (pu *PetUpdate) SetOwnerID(id int) *PetUpdate
- func (pu *PetUpdate) SetType(pe pet.Type) *PetUpdate
- func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate
- type PetUpdateOne
- func (puo *PetUpdateOne) AddAge(i int) *PetUpdateOne
- func (puo *PetUpdateOne) AddCategories(c ...*Category) *PetUpdateOne
- func (puo *PetUpdateOne) AddCategoryIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddFollowedBy(u ...*User) *PetUpdateOne
- func (puo *PetUpdateOne) AddFollowedByIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriendIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) AddFriends(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) AppendNicknames(s []string) *PetUpdateOne
- func (puo *PetUpdateOne) ClearCategories() *PetUpdateOne
- func (puo *PetUpdateOne) ClearFollowedBy() *PetUpdateOne
- func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
- func (puo *PetUpdateOne) ClearNicknames() *PetUpdateOne
- func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
- func (puo *PetUpdateOne) Exec(ctx context.Context) error
- func (puo *PetUpdateOne) ExecX(ctx context.Context)
- func (puo *PetUpdateOne) Mutation() *PetMutation
- func (puo *PetUpdateOne) RemoveCategories(c ...*Category) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveCategoryIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFollowedBy(u ...*User) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFollowedByIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriendIDs(ids ...int) *PetUpdateOne
- func (puo *PetUpdateOne) RemoveFriends(p ...*Pet) *PetUpdateOne
- func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
- func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
- func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
- func (puo *PetUpdateOne) SetAge(i int) *PetUpdateOne
- func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNicknames(s []string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableAge(i *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableName(s *string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableOwnerID(id *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableType(pe *pet.Type) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwnerID(id int) *PetUpdateOne
- func (puo *PetUpdateOne) SetType(pe pet.Type) *PetUpdateOne
- func (puo *PetUpdateOne) Where(ps ...predicate.Pet) *PetUpdateOne
- type Pets
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Settings
- type SettingsClient
- func (c *SettingsClient) Create() *SettingsCreate
- func (c *SettingsClient) CreateBulk(builders ...*SettingsCreate) *SettingsCreateBulk
- func (c *SettingsClient) Delete() *SettingsDelete
- func (c *SettingsClient) DeleteOne(s *Settings) *SettingsDeleteOne
- func (c *SettingsClient) DeleteOneID(id int) *SettingsDeleteOne
- func (c *SettingsClient) Get(ctx context.Context, id int) (*Settings, error)
- func (c *SettingsClient) GetX(ctx context.Context, id int) *Settings
- func (c *SettingsClient) Hooks() []Hook
- func (c *SettingsClient) Intercept(interceptors ...Interceptor)
- func (c *SettingsClient) Interceptors() []Interceptor
- func (c *SettingsClient) MapCreateBulk(slice any, setFunc func(*SettingsCreate, int)) *SettingsCreateBulk
- func (c *SettingsClient) Query() *SettingsQuery
- func (c *SettingsClient) QueryAdmins(s *Settings) *UserQuery
- func (c *SettingsClient) Update() *SettingsUpdate
- func (c *SettingsClient) UpdateOne(s *Settings) *SettingsUpdateOne
- func (c *SettingsClient) UpdateOneID(id int) *SettingsUpdateOne
- func (c *SettingsClient) Use(hooks ...Hook)
- type SettingsCreate
- func (sc *SettingsCreate) AddAdminIDs(ids ...int) *SettingsCreate
- func (sc *SettingsCreate) AddAdmins(u ...*User) *SettingsCreate
- func (sc *SettingsCreate) Exec(ctx context.Context) error
- func (sc *SettingsCreate) ExecX(ctx context.Context)
- func (sc *SettingsCreate) Mutation() *SettingsMutation
- func (sc *SettingsCreate) Save(ctx context.Context) (*Settings, error)
- func (sc *SettingsCreate) SaveX(ctx context.Context) *Settings
- func (sc *SettingsCreate) SetCreatedAt(t time.Time) *SettingsCreate
- func (sc *SettingsCreate) SetGlobalBanner(s string) *SettingsCreate
- func (sc *SettingsCreate) SetNillableCreatedAt(t *time.Time) *SettingsCreate
- func (sc *SettingsCreate) SetNillableGlobalBanner(s *string) *SettingsCreate
- func (sc *SettingsCreate) SetNillableUpdatedAt(t *time.Time) *SettingsCreate
- func (sc *SettingsCreate) SetUpdatedAt(t time.Time) *SettingsCreate
- type SettingsCreateBulk
- type SettingsDelete
- type SettingsDeleteOne
- type SettingsEdges
- type SettingsGroupBy
- func (sgb *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy
- func (s *SettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SettingsGroupBy) BoolX(ctx context.Context) bool
- func (s *SettingsGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SettingsGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SettingsGroupBy) Float64X(ctx context.Context) float64
- func (s *SettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SettingsGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SettingsGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SettingsGroupBy) IntX(ctx context.Context) int
- func (s *SettingsGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SettingsGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SettingsGroupBy) Scan(ctx context.Context, v any) error
- func (s *SettingsGroupBy) ScanX(ctx context.Context, v any)
- func (s *SettingsGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SettingsGroupBy) StringX(ctx context.Context) string
- func (s *SettingsGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SettingsGroupBy) StringsX(ctx context.Context) []string
- type SettingsMutation
- func (m *SettingsMutation) AddAdminIDs(ids ...int)
- func (m *SettingsMutation) AddField(name string, value ent.Value) error
- func (m *SettingsMutation) AddedEdges() []string
- func (m *SettingsMutation) AddedField(name string) (ent.Value, bool)
- func (m *SettingsMutation) AddedFields() []string
- func (m *SettingsMutation) AddedIDs(name string) []ent.Value
- func (m *SettingsMutation) AdminsCleared() bool
- func (m *SettingsMutation) AdminsIDs() (ids []int)
- func (m *SettingsMutation) ClearAdmins()
- func (m *SettingsMutation) ClearEdge(name string) error
- func (m *SettingsMutation) ClearField(name string) error
- func (m *SettingsMutation) ClearGlobalBanner()
- func (m *SettingsMutation) ClearedEdges() []string
- func (m *SettingsMutation) ClearedFields() []string
- func (m SettingsMutation) Client() *Client
- func (m *SettingsMutation) CreatedAt() (r time.Time, exists bool)
- func (m *SettingsMutation) EdgeCleared(name string) bool
- func (m *SettingsMutation) Field(name string) (ent.Value, bool)
- func (m *SettingsMutation) FieldCleared(name string) bool
- func (m *SettingsMutation) Fields() []string
- func (m *SettingsMutation) GlobalBanner() (r string, exists bool)
- func (m *SettingsMutation) GlobalBannerCleared() bool
- func (m *SettingsMutation) ID() (id int, exists bool)
- func (m *SettingsMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SettingsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SettingsMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SettingsMutation) OldGlobalBanner(ctx context.Context) (v *string, err error)
- func (m *SettingsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SettingsMutation) Op() Op
- func (m *SettingsMutation) RemoveAdminIDs(ids ...int)
- func (m *SettingsMutation) RemovedAdminsIDs() (ids []int)
- func (m *SettingsMutation) RemovedEdges() []string
- func (m *SettingsMutation) RemovedIDs(name string) []ent.Value
- func (m *SettingsMutation) ResetAdmins()
- func (m *SettingsMutation) ResetCreatedAt()
- func (m *SettingsMutation) ResetEdge(name string) error
- func (m *SettingsMutation) ResetField(name string) error
- func (m *SettingsMutation) ResetGlobalBanner()
- func (m *SettingsMutation) ResetUpdatedAt()
- func (m *SettingsMutation) SetCreatedAt(t time.Time)
- func (m *SettingsMutation) SetField(name string, value ent.Value) error
- func (m *SettingsMutation) SetGlobalBanner(s string)
- func (m *SettingsMutation) SetOp(op Op)
- func (m *SettingsMutation) SetUpdatedAt(t time.Time)
- func (m SettingsMutation) Tx() (*Tx, error)
- func (m *SettingsMutation) Type() string
- func (m *SettingsMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *SettingsMutation) Where(ps ...predicate.Settings)
- func (m *SettingsMutation) WhereP(ps ...func(*sql.Selector))
- type SettingsQuery
- func (sq *SettingsQuery) Aggregate(fns ...AggregateFunc) *SettingsSelect
- func (sq *SettingsQuery) All(ctx context.Context) ([]*Settings, error)
- func (sq *SettingsQuery) AllX(ctx context.Context) []*Settings
- func (sq *SettingsQuery) Clone() *SettingsQuery
- func (sq *SettingsQuery) Count(ctx context.Context) (int, error)
- func (sq *SettingsQuery) CountX(ctx context.Context) int
- func (sq *SettingsQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SettingsQuery) ExistX(ctx context.Context) bool
- func (sq *SettingsQuery) First(ctx context.Context) (*Settings, error)
- func (sq *SettingsQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SettingsQuery) FirstIDX(ctx context.Context) int
- func (sq *SettingsQuery) FirstX(ctx context.Context) *Settings
- func (sq *SettingsQuery) GroupBy(field string, fields ...string) *SettingsGroupBy
- func (sq *SettingsQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SettingsQuery) IDsX(ctx context.Context) []int
- func (sq *SettingsQuery) Limit(limit int) *SettingsQuery
- func (sq *SettingsQuery) Offset(offset int) *SettingsQuery
- func (sq *SettingsQuery) Only(ctx context.Context) (*Settings, error)
- func (sq *SettingsQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SettingsQuery) OnlyIDX(ctx context.Context) int
- func (sq *SettingsQuery) OnlyX(ctx context.Context) *Settings
- func (sq *SettingsQuery) Order(o ...settings.OrderOption) *SettingsQuery
- func (sq *SettingsQuery) QueryAdmins() *UserQuery
- func (sq *SettingsQuery) Select(fields ...string) *SettingsSelect
- func (sq *SettingsQuery) Unique(unique bool) *SettingsQuery
- func (sq *SettingsQuery) Where(ps ...predicate.Settings) *SettingsQuery
- func (sq *SettingsQuery) WithAdmins(opts ...func(*UserQuery)) *SettingsQuery
- type SettingsSelect
- func (ss *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect
- func (s *SettingsSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SettingsSelect) BoolX(ctx context.Context) bool
- func (s *SettingsSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SettingsSelect) BoolsX(ctx context.Context) []bool
- func (s *SettingsSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SettingsSelect) Float64X(ctx context.Context) float64
- func (s *SettingsSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SettingsSelect) Float64sX(ctx context.Context) []float64
- func (s *SettingsSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SettingsSelect) IntX(ctx context.Context) int
- func (s *SettingsSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SettingsSelect) IntsX(ctx context.Context) []int
- func (ss *SettingsSelect) Scan(ctx context.Context, v any) error
- func (s *SettingsSelect) ScanX(ctx context.Context, v any)
- func (s *SettingsSelect) String(ctx context.Context) (_ string, err error)
- func (s *SettingsSelect) StringX(ctx context.Context) string
- func (s *SettingsSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SettingsSelect) StringsX(ctx context.Context) []string
- type SettingsSlice
- type SettingsUpdate
- func (su *SettingsUpdate) AddAdminIDs(ids ...int) *SettingsUpdate
- func (su *SettingsUpdate) AddAdmins(u ...*User) *SettingsUpdate
- func (su *SettingsUpdate) ClearAdmins() *SettingsUpdate
- func (su *SettingsUpdate) ClearGlobalBanner() *SettingsUpdate
- func (su *SettingsUpdate) Exec(ctx context.Context) error
- func (su *SettingsUpdate) ExecX(ctx context.Context)
- func (su *SettingsUpdate) Mutation() *SettingsMutation
- func (su *SettingsUpdate) RemoveAdminIDs(ids ...int) *SettingsUpdate
- func (su *SettingsUpdate) RemoveAdmins(u ...*User) *SettingsUpdate
- func (su *SettingsUpdate) Save(ctx context.Context) (int, error)
- func (su *SettingsUpdate) SaveX(ctx context.Context) int
- func (su *SettingsUpdate) SetGlobalBanner(s string) *SettingsUpdate
- func (su *SettingsUpdate) SetNillableGlobalBanner(s *string) *SettingsUpdate
- func (su *SettingsUpdate) SetUpdatedAt(t time.Time) *SettingsUpdate
- func (su *SettingsUpdate) Where(ps ...predicate.Settings) *SettingsUpdate
- type SettingsUpdateOne
- func (suo *SettingsUpdateOne) AddAdminIDs(ids ...int) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) AddAdmins(u ...*User) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) ClearAdmins() *SettingsUpdateOne
- func (suo *SettingsUpdateOne) ClearGlobalBanner() *SettingsUpdateOne
- func (suo *SettingsUpdateOne) Exec(ctx context.Context) error
- func (suo *SettingsUpdateOne) ExecX(ctx context.Context)
- func (suo *SettingsUpdateOne) Mutation() *SettingsMutation
- func (suo *SettingsUpdateOne) RemoveAdminIDs(ids ...int) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) RemoveAdmins(u ...*User) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) Save(ctx context.Context) (*Settings, error)
- func (suo *SettingsUpdateOne) SaveX(ctx context.Context) *Settings
- func (suo *SettingsUpdateOne) Select(field string, fields ...string) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) SetGlobalBanner(s string) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) SetNillableGlobalBanner(s *string) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) SetUpdatedAt(t time.Time) *SettingsUpdateOne
- func (suo *SettingsUpdateOne) Where(ps ...predicate.Settings) *SettingsUpdateOne
- type Skipped
- type SkippedClient
- func (c *SkippedClient) Create() *SkippedCreate
- func (c *SkippedClient) CreateBulk(builders ...*SkippedCreate) *SkippedCreateBulk
- func (c *SkippedClient) Delete() *SkippedDelete
- func (c *SkippedClient) DeleteOne(s *Skipped) *SkippedDeleteOne
- func (c *SkippedClient) DeleteOneID(id int) *SkippedDeleteOne
- func (c *SkippedClient) Get(ctx context.Context, id int) (*Skipped, error)
- func (c *SkippedClient) GetX(ctx context.Context, id int) *Skipped
- func (c *SkippedClient) Hooks() []Hook
- func (c *SkippedClient) Intercept(interceptors ...Interceptor)
- func (c *SkippedClient) Interceptors() []Interceptor
- func (c *SkippedClient) MapCreateBulk(slice any, setFunc func(*SkippedCreate, int)) *SkippedCreateBulk
- func (c *SkippedClient) Query() *SkippedQuery
- func (c *SkippedClient) Update() *SkippedUpdate
- func (c *SkippedClient) UpdateOne(s *Skipped) *SkippedUpdateOne
- func (c *SkippedClient) UpdateOneID(id int) *SkippedUpdateOne
- func (c *SkippedClient) Use(hooks ...Hook)
- type SkippedCreate
- func (sc *SkippedCreate) Exec(ctx context.Context) error
- func (sc *SkippedCreate) ExecX(ctx context.Context)
- func (sc *SkippedCreate) Mutation() *SkippedMutation
- func (sc *SkippedCreate) Save(ctx context.Context) (*Skipped, error)
- func (sc *SkippedCreate) SaveX(ctx context.Context) *Skipped
- func (sc *SkippedCreate) SetName(s string) *SkippedCreate
- type SkippedCreateBulk
- type SkippedDelete
- type SkippedDeleteOne
- type SkippedGroupBy
- func (sgb *SkippedGroupBy) Aggregate(fns ...AggregateFunc) *SkippedGroupBy
- func (s *SkippedGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SkippedGroupBy) BoolX(ctx context.Context) bool
- func (s *SkippedGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SkippedGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SkippedGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SkippedGroupBy) Float64X(ctx context.Context) float64
- func (s *SkippedGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SkippedGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SkippedGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SkippedGroupBy) IntX(ctx context.Context) int
- func (s *SkippedGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SkippedGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SkippedGroupBy) Scan(ctx context.Context, v any) error
- func (s *SkippedGroupBy) ScanX(ctx context.Context, v any)
- func (s *SkippedGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SkippedGroupBy) StringX(ctx context.Context) string
- func (s *SkippedGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SkippedGroupBy) StringsX(ctx context.Context) []string
- type SkippedMutation
- func (m *SkippedMutation) AddField(name string, value ent.Value) error
- func (m *SkippedMutation) AddedEdges() []string
- func (m *SkippedMutation) AddedField(name string) (ent.Value, bool)
- func (m *SkippedMutation) AddedFields() []string
- func (m *SkippedMutation) AddedIDs(name string) []ent.Value
- func (m *SkippedMutation) ClearEdge(name string) error
- func (m *SkippedMutation) ClearField(name string) error
- func (m *SkippedMutation) ClearedEdges() []string
- func (m *SkippedMutation) ClearedFields() []string
- func (m SkippedMutation) Client() *Client
- func (m *SkippedMutation) EdgeCleared(name string) bool
- func (m *SkippedMutation) Field(name string) (ent.Value, bool)
- func (m *SkippedMutation) FieldCleared(name string) bool
- func (m *SkippedMutation) Fields() []string
- func (m *SkippedMutation) ID() (id int, exists bool)
- func (m *SkippedMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SkippedMutation) Name() (r string, exists bool)
- func (m *SkippedMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SkippedMutation) OldName(ctx context.Context) (v string, err error)
- func (m *SkippedMutation) Op() Op
- func (m *SkippedMutation) RemovedEdges() []string
- func (m *SkippedMutation) RemovedIDs(name string) []ent.Value
- func (m *SkippedMutation) ResetEdge(name string) error
- func (m *SkippedMutation) ResetField(name string) error
- func (m *SkippedMutation) ResetName()
- func (m *SkippedMutation) SetField(name string, value ent.Value) error
- func (m *SkippedMutation) SetName(s string)
- func (m *SkippedMutation) SetOp(op Op)
- func (m SkippedMutation) Tx() (*Tx, error)
- func (m *SkippedMutation) Type() string
- func (m *SkippedMutation) Where(ps ...predicate.Skipped)
- func (m *SkippedMutation) WhereP(ps ...func(*sql.Selector))
- type SkippedQuery
- func (sq *SkippedQuery) Aggregate(fns ...AggregateFunc) *SkippedSelect
- func (sq *SkippedQuery) All(ctx context.Context) ([]*Skipped, error)
- func (sq *SkippedQuery) AllX(ctx context.Context) []*Skipped
- func (sq *SkippedQuery) Clone() *SkippedQuery
- func (sq *SkippedQuery) Count(ctx context.Context) (int, error)
- func (sq *SkippedQuery) CountX(ctx context.Context) int
- func (sq *SkippedQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SkippedQuery) ExistX(ctx context.Context) bool
- func (sq *SkippedQuery) First(ctx context.Context) (*Skipped, error)
- func (sq *SkippedQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SkippedQuery) FirstIDX(ctx context.Context) int
- func (sq *SkippedQuery) FirstX(ctx context.Context) *Skipped
- func (sq *SkippedQuery) GroupBy(field string, fields ...string) *SkippedGroupBy
- func (sq *SkippedQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SkippedQuery) IDsX(ctx context.Context) []int
- func (sq *SkippedQuery) Limit(limit int) *SkippedQuery
- func (sq *SkippedQuery) Offset(offset int) *SkippedQuery
- func (sq *SkippedQuery) Only(ctx context.Context) (*Skipped, error)
- func (sq *SkippedQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SkippedQuery) OnlyIDX(ctx context.Context) int
- func (sq *SkippedQuery) OnlyX(ctx context.Context) *Skipped
- func (sq *SkippedQuery) Order(o ...skipped.OrderOption) *SkippedQuery
- func (sq *SkippedQuery) Select(fields ...string) *SkippedSelect
- func (sq *SkippedQuery) Unique(unique bool) *SkippedQuery
- func (sq *SkippedQuery) Where(ps ...predicate.Skipped) *SkippedQuery
- type SkippedSelect
- func (ss *SkippedSelect) Aggregate(fns ...AggregateFunc) *SkippedSelect
- func (s *SkippedSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SkippedSelect) BoolX(ctx context.Context) bool
- func (s *SkippedSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SkippedSelect) BoolsX(ctx context.Context) []bool
- func (s *SkippedSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SkippedSelect) Float64X(ctx context.Context) float64
- func (s *SkippedSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SkippedSelect) Float64sX(ctx context.Context) []float64
- func (s *SkippedSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SkippedSelect) IntX(ctx context.Context) int
- func (s *SkippedSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SkippedSelect) IntsX(ctx context.Context) []int
- func (ss *SkippedSelect) Scan(ctx context.Context, v any) error
- func (s *SkippedSelect) ScanX(ctx context.Context, v any)
- func (s *SkippedSelect) String(ctx context.Context) (_ string, err error)
- func (s *SkippedSelect) StringX(ctx context.Context) string
- func (s *SkippedSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SkippedSelect) StringsX(ctx context.Context) []string
- type SkippedUpdate
- func (su *SkippedUpdate) Exec(ctx context.Context) error
- func (su *SkippedUpdate) ExecX(ctx context.Context)
- func (su *SkippedUpdate) Mutation() *SkippedMutation
- func (su *SkippedUpdate) Save(ctx context.Context) (int, error)
- func (su *SkippedUpdate) SaveX(ctx context.Context) int
- func (su *SkippedUpdate) SetName(s string) *SkippedUpdate
- func (su *SkippedUpdate) SetNillableName(s *string) *SkippedUpdate
- func (su *SkippedUpdate) Where(ps ...predicate.Skipped) *SkippedUpdate
- type SkippedUpdateOne
- func (suo *SkippedUpdateOne) Exec(ctx context.Context) error
- func (suo *SkippedUpdateOne) ExecX(ctx context.Context)
- func (suo *SkippedUpdateOne) Mutation() *SkippedMutation
- func (suo *SkippedUpdateOne) Save(ctx context.Context) (*Skipped, error)
- func (suo *SkippedUpdateOne) SaveX(ctx context.Context) *Skipped
- func (suo *SkippedUpdateOne) Select(field string, fields ...string) *SkippedUpdateOne
- func (suo *SkippedUpdateOne) SetName(s string) *SkippedUpdateOne
- func (suo *SkippedUpdateOne) SetNillableName(s *string) *SkippedUpdateOne
- func (suo *SkippedUpdateOne) Where(ps ...predicate.Skipped) *SkippedUpdateOne
- type Skippeds
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryFollowedPets() *PetQuery
- func (u *User) QueryFollowing() *FollowsQuery
- func (u *User) QueryFriends() *UserQuery
- func (u *User) QueryFriendships() *FriendshipQuery
- func (u *User) QueryPets() *PetQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryFollowedPets(u *User) *PetQuery
- func (c *UserClient) QueryFollowing(u *User) *FollowsQuery
- func (c *UserClient) QueryFriends(u *User) *UserQuery
- func (c *UserClient) QueryFriendships(u *User) *FriendshipQuery
- func (c *UserClient) QueryPets(u *User) *PetQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddFollowedPetIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddFollowedPets(p ...*Pet) *UserCreate
- func (uc *UserCreate) AddFriendIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddFriends(u ...*User) *UserCreate
- func (uc *UserCreate) AddFriendshipIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddFriendships(f ...*Friendship) *UserCreate
- func (uc *UserCreate) AddPetIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddPets(p ...*Pet) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAvatar(b []byte) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetDescription(s string) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetEnabled(b bool) *UserCreate
- func (uc *UserCreate) SetGithubData(gi *github.User) *UserCreate
- func (uc *UserCreate) SetID(i int) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableDescription(s *string) *UserCreate
- func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
- func (uc *UserCreate) SetNillableEnabled(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableType(u *user.Type) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetPasswordHashed(s string) *UserCreate
- func (uc *UserCreate) SetProfileURL(sv *schema.ExampleValuer) *UserCreate
- func (uc *UserCreate) SetType(u user.Type) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddFollowedPetIDs(ids ...int)
- func (m *UserMutation) AddFriendIDs(ids ...int)
- func (m *UserMutation) AddFriendshipIDs(ids ...int)
- func (m *UserMutation) AddPetIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) Avatar() (r []byte, exists bool)
- func (m *UserMutation) AvatarCleared() bool
- func (m *UserMutation) ClearAvatar()
- func (m *UserMutation) ClearDescription()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEmail()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearFollowedPets()
- func (m *UserMutation) ClearFriends()
- func (m *UserMutation) ClearFriendships()
- func (m *UserMutation) ClearGithubData()
- func (m *UserMutation) ClearPets()
- func (m *UserMutation) ClearProfileURL()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Description() (r string, exists bool)
- func (m *UserMutation) DescriptionCleared() bool
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailCleared() bool
- func (m *UserMutation) Enabled() (r bool, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) FollowedPetsCleared() bool
- func (m *UserMutation) FollowedPetsIDs() (ids []int)
- func (m *UserMutation) FriendsCleared() bool
- func (m *UserMutation) FriendsIDs() (ids []int)
- func (m *UserMutation) FriendshipsCleared() bool
- func (m *UserMutation) FriendshipsIDs() (ids []int)
- func (m *UserMutation) GetType() (r user.Type, exists bool)
- func (m *UserMutation) GithubData() (r *github.User, exists bool)
- func (m *UserMutation) GithubDataCleared() bool
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldAvatar(ctx context.Context) (v *[]byte, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldDescription(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldEnabled(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldGithubData(ctx context.Context) (v *github.User, err error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPasswordHashed(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldProfileURL(ctx context.Context) (v *schema.ExampleValuer, err error)
- func (m *UserMutation) OldType(ctx context.Context) (v user.Type, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) PasswordHashed() (r string, exists bool)
- func (m *UserMutation) PetsCleared() bool
- func (m *UserMutation) PetsIDs() (ids []int)
- func (m *UserMutation) ProfileURL() (r *schema.ExampleValuer, exists bool)
- func (m *UserMutation) ProfileURLCleared() bool
- func (m *UserMutation) RemoveFollowedPetIDs(ids ...int)
- func (m *UserMutation) RemoveFriendIDs(ids ...int)
- func (m *UserMutation) RemoveFriendshipIDs(ids ...int)
- func (m *UserMutation) RemovePetIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedFollowedPetsIDs() (ids []int)
- func (m *UserMutation) RemovedFriendsIDs() (ids []int)
- func (m *UserMutation) RemovedFriendshipsIDs() (ids []int)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedPetsIDs() (ids []int)
- func (m *UserMutation) ResetAvatar()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetDescription()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetEnabled()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFollowedPets()
- func (m *UserMutation) ResetFriends()
- func (m *UserMutation) ResetFriendships()
- func (m *UserMutation) ResetGithubData()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetPasswordHashed()
- func (m *UserMutation) ResetPets()
- func (m *UserMutation) ResetProfileURL()
- func (m *UserMutation) ResetType()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) SetAvatar(b []byte)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetDescription(s string)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetEnabled(b bool)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetGithubData(gi *github.User)
- func (m *UserMutation) SetID(id int)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPasswordHashed(s string)
- func (m *UserMutation) SetProfileURL(sv *schema.ExampleValuer)
- func (m *UserMutation) SetType(u user.Type)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryFollowedPets() *PetQuery
- func (uq *UserQuery) QueryFollowing() *FollowsQuery
- func (uq *UserQuery) QueryFriends() *UserQuery
- func (uq *UserQuery) QueryFriendships() *FriendshipQuery
- func (uq *UserQuery) QueryPets() *PetQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithFollowedPets(opts ...func(*PetQuery)) *UserQuery
- func (uq *UserQuery) WithFollowing(opts ...func(*FollowsQuery)) *UserQuery
- func (uq *UserQuery) WithFriends(opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithFriendships(opts ...func(*FriendshipQuery)) *UserQuery
- func (uq *UserQuery) WithPets(opts ...func(*PetQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddFollowedPetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddFollowedPets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) AddFriendIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddFriends(u ...*User) *UserUpdate
- func (uu *UserUpdate) AddFriendshipIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddFriendships(f ...*Friendship) *UserUpdate
- func (uu *UserUpdate) AddPetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddPets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) ClearAvatar() *UserUpdate
- func (uu *UserUpdate) ClearDescription() *UserUpdate
- func (uu *UserUpdate) ClearEmail() *UserUpdate
- func (uu *UserUpdate) ClearFollowedPets() *UserUpdate
- func (uu *UserUpdate) ClearFriends() *UserUpdate
- func (uu *UserUpdate) ClearFriendships() *UserUpdate
- func (uu *UserUpdate) ClearGithubData() *UserUpdate
- func (uu *UserUpdate) ClearPets() *UserUpdate
- func (uu *UserUpdate) ClearProfileURL() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveFollowedPetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveFollowedPets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) RemoveFriendIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveFriends(u ...*User) *UserUpdate
- func (uu *UserUpdate) RemoveFriendshipIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveFriendships(f ...*Friendship) *UserUpdate
- func (uu *UserUpdate) RemovePetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemovePets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAvatar(b []byte) *UserUpdate
- func (uu *UserUpdate) SetDescription(s string) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetEnabled(b bool) *UserUpdate
- func (uu *UserUpdate) SetGithubData(gi *github.User) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableDescription(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEnabled(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePasswordHashed(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableType(u *user.Type) *UserUpdate
- func (uu *UserUpdate) SetPasswordHashed(s string) *UserUpdate
- func (uu *UserUpdate) SetProfileURL(sv *schema.ExampleValuer) *UserUpdate
- func (uu *UserUpdate) SetType(u user.Type) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowedPetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowedPets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFriendIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFriends(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFriendshipIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFriendships(f ...*Friendship) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearDescription() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFollowedPets() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFriends() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFriendships() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearGithubData() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPets() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearProfileURL() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveFollowedPetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFollowedPets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFriendIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFriends(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFriendshipIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFriendships(f ...*Friendship) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAvatar(b []byte) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDescription(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEnabled(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetGithubData(gi *github.User) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDescription(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEnabled(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePasswordHashed(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableType(u *user.Type) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPasswordHashed(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetProfileURL(sv *schema.ExampleValuer) *UserUpdateOne
- func (uuo *UserUpdateOne) SetType(u user.Type) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCategory = "Category" TypeFollows = "Follows" TypeFriendship = "Friendship" TypePet = "Pet" TypeSettings = "Settings" TypeSkipped = "Skipped" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Category ¶
type Category struct { // ID of the ent. ID int `json:"id,omitempty"` // Time in which the resource was initially created. CreatedAt time.Time `json:"created_at"` // Time that the resource was last updated. UpdatedAt time.Time `json:"updated_at"` // Name holds the value of the "name" field. Name string `json:"name"` // Readonly holds the value of the "readonly" field. Readonly string `json:"readonly"` // SkipInSpec holds the value of the "skip_in_spec" field. SkipInSpec string `json:"skip_in_spec"` // Nillable holds the value of the "nillable" field. Nillable *string `json:"nillable"` // Strings holds the value of the "strings" field. Strings []string `json:"strings"` // Ints holds the value of the "ints" field. Ints []int `json:"ints"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CategoryQuery when eager-loading is set. Edges CategoryEdges `json:"edges"` // contains filtered or unexported fields }
Category is the model entity for the Category schema.
func (*Category) Unwrap ¶
Unwrap unwraps the Category entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Category) Update ¶
func (c *Category) Update() *CategoryUpdateOne
Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.
type CategoryClient ¶
type CategoryClient struct {
// contains filtered or unexported fields
}
CategoryClient is a client for the Category schema.
func NewCategoryClient ¶
func NewCategoryClient(c config) *CategoryClient
NewCategoryClient returns a client for the Category from the given config.
func (*CategoryClient) Create ¶
func (c *CategoryClient) Create() *CategoryCreate
Create returns a builder for creating a Category entity.
func (*CategoryClient) CreateBulk ¶
func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
CreateBulk returns a builder for creating a bulk of Category entities.
func (*CategoryClient) Delete ¶
func (c *CategoryClient) Delete() *CategoryDelete
Delete returns a delete builder for Category.
func (*CategoryClient) DeleteOne ¶
func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CategoryClient) DeleteOneID ¶
func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CategoryClient) GetX ¶
func (c *CategoryClient) GetX(ctx context.Context, id int) *Category
GetX is like Get, but panics if an error occurs.
func (*CategoryClient) Hooks ¶
func (c *CategoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CategoryClient) Intercept ¶
func (c *CategoryClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `category.Intercept(f(g(h())))`.
func (*CategoryClient) Interceptors ¶
func (c *CategoryClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CategoryClient) MapCreateBulk ¶
func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk
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 (*CategoryClient) Query ¶
func (c *CategoryClient) Query() *CategoryQuery
Query returns a query builder for Category.
func (*CategoryClient) QueryPets ¶
func (c *CategoryClient) QueryPets(ca *Category) *PetQuery
QueryPets queries the pets edge of a Category.
func (*CategoryClient) Update ¶
func (c *CategoryClient) Update() *CategoryUpdate
Update returns an update builder for Category.
func (*CategoryClient) UpdateOne ¶
func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CategoryClient) UpdateOneID ¶
func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CategoryClient) Use ¶
func (c *CategoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.
type CategoryCreate ¶
type CategoryCreate struct {
// contains filtered or unexported fields
}
CategoryCreate is the builder for creating a Category entity.
func (*CategoryCreate) AddPetIDs ¶
func (cc *CategoryCreate) AddPetIDs(ids ...int) *CategoryCreate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryCreate) AddPets ¶
func (cc *CategoryCreate) AddPets(p ...*Pet) *CategoryCreate
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryCreate) Exec ¶
func (cc *CategoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreate) ExecX ¶
func (cc *CategoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryCreate) Mutation ¶
func (cc *CategoryCreate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryCreate) Save ¶
func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
Save creates the Category in the database.
func (*CategoryCreate) SaveX ¶
func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
SaveX calls Save and panics if Save returns an error.
func (*CategoryCreate) SetCreatedAt ¶
func (cc *CategoryCreate) SetCreatedAt(t time.Time) *CategoryCreate
SetCreatedAt sets the "created_at" field.
func (*CategoryCreate) SetInts ¶
func (cc *CategoryCreate) SetInts(i []int) *CategoryCreate
SetInts sets the "ints" field.
func (*CategoryCreate) SetName ¶
func (cc *CategoryCreate) SetName(s string) *CategoryCreate
SetName sets the "name" field.
func (*CategoryCreate) SetNillable ¶
func (cc *CategoryCreate) SetNillable(s string) *CategoryCreate
SetNillable sets the "nillable" field.
func (*CategoryCreate) SetNillableCreatedAt ¶
func (cc *CategoryCreate) SetNillableCreatedAt(t *time.Time) *CategoryCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CategoryCreate) SetNillableNillable ¶
func (cc *CategoryCreate) SetNillableNillable(s *string) *CategoryCreate
SetNillableNillable sets the "nillable" field if the given value is not nil.
func (*CategoryCreate) SetNillableSkipInSpec ¶
func (cc *CategoryCreate) SetNillableSkipInSpec(s *string) *CategoryCreate
SetNillableSkipInSpec sets the "skip_in_spec" field if the given value is not nil.
func (*CategoryCreate) SetNillableUpdatedAt ¶
func (cc *CategoryCreate) SetNillableUpdatedAt(t *time.Time) *CategoryCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CategoryCreate) SetReadonly ¶
func (cc *CategoryCreate) SetReadonly(s string) *CategoryCreate
SetReadonly sets the "readonly" field.
func (*CategoryCreate) SetSkipInSpec ¶
func (cc *CategoryCreate) SetSkipInSpec(s string) *CategoryCreate
SetSkipInSpec sets the "skip_in_spec" field.
func (*CategoryCreate) SetStrings ¶
func (cc *CategoryCreate) SetStrings(s []string) *CategoryCreate
SetStrings sets the "strings" field.
func (*CategoryCreate) SetUpdatedAt ¶
func (cc *CategoryCreate) SetUpdatedAt(t time.Time) *CategoryCreate
SetUpdatedAt sets the "updated_at" field.
type CategoryCreateBulk ¶
type CategoryCreateBulk struct {
// contains filtered or unexported fields
}
CategoryCreateBulk is the builder for creating many Category entities in bulk.
func (*CategoryCreateBulk) Exec ¶
func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreateBulk) ExecX ¶
func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CategoryDelete ¶
type CategoryDelete struct {
// contains filtered or unexported fields
}
CategoryDelete is the builder for deleting a Category entity.
func (*CategoryDelete) Exec ¶
func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CategoryDelete) ExecX ¶
func (cd *CategoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDelete) Where ¶
func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete
Where appends a list predicates to the CategoryDelete builder.
type CategoryDeleteOne ¶
type CategoryDeleteOne struct {
// contains filtered or unexported fields
}
CategoryDeleteOne is the builder for deleting a single Category entity.
func (*CategoryDeleteOne) Exec ¶
func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CategoryDeleteOne) ExecX ¶
func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDeleteOne) Where ¶
func (cdo *CategoryDeleteOne) Where(ps ...predicate.Category) *CategoryDeleteOne
Where appends a list predicates to the CategoryDelete builder.
type CategoryEdges ¶
type CategoryEdges struct { // Pets holds the value of the pets edge. Pets []*Pet `json:"pets,omitempty"` // contains filtered or unexported fields }
CategoryEdges holds the relations/edges for other nodes in the graph.
func (CategoryEdges) PetsOrErr ¶
func (e CategoryEdges) PetsOrErr() ([]*Pet, error)
PetsOrErr returns the Pets value or an error if the edge was not loaded in eager-loading.
type CategoryGroupBy ¶
type CategoryGroupBy struct {
// contains filtered or unexported fields
}
CategoryGroupBy is the group-by builder for Category entities.
func (*CategoryGroupBy) Aggregate ¶
func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CategoryGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Scan ¶
func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategoryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoryMutation ¶
type CategoryMutation struct {
// contains filtered or unexported fields
}
CategoryMutation represents an operation that mutates the Category nodes in the graph.
func (*CategoryMutation) AddField ¶
func (m *CategoryMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) AddPetIDs ¶
func (m *CategoryMutation) AddPetIDs(ids ...int)
AddPetIDs adds the "pets" edge to the Pet entity by ids.
func (*CategoryMutation) AddedEdges ¶
func (m *CategoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CategoryMutation) AddedField ¶
func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) AddedFields ¶
func (m *CategoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CategoryMutation) AddedIDs ¶
func (m *CategoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CategoryMutation) AppendInts ¶
func (m *CategoryMutation) AppendInts(i []int)
AppendInts adds i to the "ints" field.
func (*CategoryMutation) AppendStrings ¶
func (m *CategoryMutation) AppendStrings(s []string)
AppendStrings adds s to the "strings" field.
func (*CategoryMutation) AppendedInts ¶
func (m *CategoryMutation) AppendedInts() ([]int, bool)
AppendedInts returns the list of values that were appended to the "ints" field in this mutation.
func (*CategoryMutation) AppendedStrings ¶
func (m *CategoryMutation) AppendedStrings() ([]string, bool)
AppendedStrings returns the list of values that were appended to the "strings" field in this mutation.
func (*CategoryMutation) ClearEdge ¶
func (m *CategoryMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*CategoryMutation) ClearField ¶
func (m *CategoryMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ClearInts ¶
func (m *CategoryMutation) ClearInts()
ClearInts clears the value of the "ints" field.
func (*CategoryMutation) ClearPets ¶
func (m *CategoryMutation) ClearPets()
ClearPets clears the "pets" edge to the Pet entity.
func (*CategoryMutation) ClearSkipInSpec ¶
func (m *CategoryMutation) ClearSkipInSpec()
ClearSkipInSpec clears the value of the "skip_in_spec" field.
func (*CategoryMutation) ClearStrings ¶
func (m *CategoryMutation) ClearStrings()
ClearStrings clears the value of the "strings" field.
func (*CategoryMutation) ClearedEdges ¶
func (m *CategoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CategoryMutation) ClearedFields ¶
func (m *CategoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CategoryMutation) Client ¶
func (m CategoryMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*CategoryMutation) CreatedAt ¶
func (m *CategoryMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CategoryMutation) EdgeCleared ¶
func (m *CategoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CategoryMutation) Field ¶
func (m *CategoryMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) FieldCleared ¶
func (m *CategoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CategoryMutation) Fields ¶
func (m *CategoryMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*CategoryMutation) ID ¶
func (m *CategoryMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CategoryMutation) IDs ¶
func (m *CategoryMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CategoryMutation) Ints ¶
func (m *CategoryMutation) Ints() (r []int, exists bool)
Ints returns the value of the "ints" field in the mutation.
func (*CategoryMutation) IntsCleared ¶
func (m *CategoryMutation) IntsCleared() bool
IntsCleared returns if the "ints" field was cleared in this mutation.
func (*CategoryMutation) Name ¶
func (m *CategoryMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CategoryMutation) Nillable ¶
func (m *CategoryMutation) Nillable() (r string, exists bool)
Nillable returns the value of the "nillable" field in the mutation.
func (*CategoryMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*CategoryMutation) OldInts ¶
func (m *CategoryMutation) OldInts(ctx context.Context) (v []int, err error)
OldInts returns the old "ints" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldName ¶
func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldNillable ¶
func (m *CategoryMutation) OldNillable(ctx context.Context) (v *string, err error)
OldNillable returns the old "nillable" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldReadonly ¶
func (m *CategoryMutation) OldReadonly(ctx context.Context) (v string, err error)
OldReadonly returns the old "readonly" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldSkipInSpec ¶
func (m *CategoryMutation) OldSkipInSpec(ctx context.Context) (v string, err error)
OldSkipInSpec returns the old "skip_in_spec" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldStrings ¶
func (m *CategoryMutation) OldStrings(ctx context.Context) (v []string, err error)
OldStrings returns the old "strings" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) PetsCleared ¶
func (m *CategoryMutation) PetsCleared() bool
PetsCleared reports if the "pets" edge to the Pet entity was cleared.
func (*CategoryMutation) PetsIDs ¶
func (m *CategoryMutation) PetsIDs() (ids []int)
PetsIDs returns the "pets" edge IDs in the mutation.
func (*CategoryMutation) Readonly ¶
func (m *CategoryMutation) Readonly() (r string, exists bool)
Readonly returns the value of the "readonly" field in the mutation.
func (*CategoryMutation) RemovePetIDs ¶
func (m *CategoryMutation) RemovePetIDs(ids ...int)
RemovePetIDs removes the "pets" edge to the Pet entity by IDs.
func (*CategoryMutation) RemovedEdges ¶
func (m *CategoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CategoryMutation) RemovedIDs ¶
func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*CategoryMutation) RemovedPetsIDs ¶
func (m *CategoryMutation) RemovedPetsIDs() (ids []int)
RemovedPets returns the removed IDs of the "pets" edge to the Pet entity.
func (*CategoryMutation) ResetCreatedAt ¶
func (m *CategoryMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CategoryMutation) ResetEdge ¶
func (m *CategoryMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*CategoryMutation) ResetField ¶
func (m *CategoryMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ResetInts ¶
func (m *CategoryMutation) ResetInts()
ResetInts resets all changes to the "ints" field.
func (*CategoryMutation) ResetName ¶
func (m *CategoryMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CategoryMutation) ResetNillable ¶
func (m *CategoryMutation) ResetNillable()
ResetNillable resets all changes to the "nillable" field.
func (*CategoryMutation) ResetPets ¶
func (m *CategoryMutation) ResetPets()
ResetPets resets all changes to the "pets" edge.
func (*CategoryMutation) ResetReadonly ¶
func (m *CategoryMutation) ResetReadonly()
ResetReadonly resets all changes to the "readonly" field.
func (*CategoryMutation) ResetSkipInSpec ¶
func (m *CategoryMutation) ResetSkipInSpec()
ResetSkipInSpec resets all changes to the "skip_in_spec" field.
func (*CategoryMutation) ResetStrings ¶
func (m *CategoryMutation) ResetStrings()
ResetStrings resets all changes to the "strings" field.
func (*CategoryMutation) ResetUpdatedAt ¶
func (m *CategoryMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CategoryMutation) SetCreatedAt ¶
func (m *CategoryMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CategoryMutation) SetField ¶
func (m *CategoryMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) SetInts ¶
func (m *CategoryMutation) SetInts(i []int)
SetInts sets the "ints" field.
func (*CategoryMutation) SetName ¶
func (m *CategoryMutation) SetName(s string)
SetName sets the "name" field.
func (*CategoryMutation) SetNillable ¶
func (m *CategoryMutation) SetNillable(s string)
SetNillable sets the "nillable" field.
func (*CategoryMutation) SetOp ¶
func (m *CategoryMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CategoryMutation) SetReadonly ¶
func (m *CategoryMutation) SetReadonly(s string)
SetReadonly sets the "readonly" field.
func (*CategoryMutation) SetSkipInSpec ¶
func (m *CategoryMutation) SetSkipInSpec(s string)
SetSkipInSpec sets the "skip_in_spec" field.
func (*CategoryMutation) SetStrings ¶
func (m *CategoryMutation) SetStrings(s []string)
SetStrings sets the "strings" field.
func (*CategoryMutation) SetUpdatedAt ¶
func (m *CategoryMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CategoryMutation) SkipInSpec ¶
func (m *CategoryMutation) SkipInSpec() (r string, exists bool)
SkipInSpec returns the value of the "skip_in_spec" field in the mutation.
func (*CategoryMutation) SkipInSpecCleared ¶
func (m *CategoryMutation) SkipInSpecCleared() bool
SkipInSpecCleared returns if the "skip_in_spec" field was cleared in this mutation.
func (*CategoryMutation) Strings ¶
func (m *CategoryMutation) Strings() (r []string, exists bool)
Strings returns the value of the "strings" field in the mutation.
func (*CategoryMutation) StringsCleared ¶
func (m *CategoryMutation) StringsCleared() bool
StringsCleared returns if the "strings" field was cleared in this mutation.
func (CategoryMutation) Tx ¶
func (m CategoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CategoryMutation) Type ¶
func (m *CategoryMutation) Type() string
Type returns the node type of this mutation (Category).
func (*CategoryMutation) UpdatedAt ¶
func (m *CategoryMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CategoryMutation) Where ¶
func (m *CategoryMutation) Where(ps ...predicate.Category)
Where appends a list predicates to the CategoryMutation builder.
func (*CategoryMutation) WhereP ¶
func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CategoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CategoryQuery ¶
type CategoryQuery struct {
// contains filtered or unexported fields
}
CategoryQuery is the builder for querying Category entities.
func (*CategoryQuery) Aggregate ¶
func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect
Aggregate returns a CategorySelect configured with the given aggregations.
func (*CategoryQuery) All ¶
func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
All executes the query and returns a list of Categories.
func (*CategoryQuery) AllX ¶
func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
AllX is like All, but panics if an error occurs.
func (*CategoryQuery) Clone ¶
func (cq *CategoryQuery) Clone() *CategoryQuery
Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CategoryQuery) Count ¶
func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CategoryQuery) CountX ¶
func (cq *CategoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CategoryQuery) Exist ¶
func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CategoryQuery) ExistX ¶
func (cq *CategoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CategoryQuery) First ¶
func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.
func (*CategoryQuery) FirstID ¶
func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.
func (*CategoryQuery) FirstIDX ¶
func (cq *CategoryQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CategoryQuery) FirstX ¶
func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
FirstX is like First, but panics if an error occurs.
func (*CategoryQuery) GroupBy ¶
func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at"` Count int `json:"count,omitempty"` } client.Category.Query(). GroupBy(category.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CategoryQuery) IDs ¶
func (cq *CategoryQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Category IDs.
func (*CategoryQuery) IDsX ¶
func (cq *CategoryQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CategoryQuery) Limit ¶
func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
Limit the number of records to be returned by this query.
func (*CategoryQuery) Offset ¶
func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
Offset to start from.
func (*CategoryQuery) Only ¶
func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Category entity is found. Returns a *NotFoundError when no Category entities are found.
func (*CategoryQuery) OnlyID ¶
func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when more than one Category ID is found. Returns a *NotFoundError when no entities are found.
func (*CategoryQuery) OnlyIDX ¶
func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CategoryQuery) OnlyX ¶
func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
OnlyX is like Only, but panics if an error occurs.
func (*CategoryQuery) Order ¶
func (cq *CategoryQuery) Order(o ...category.OrderOption) *CategoryQuery
Order specifies how the records should be ordered.
func (*CategoryQuery) QueryPets ¶
func (cq *CategoryQuery) QueryPets() *PetQuery
QueryPets chains the current query on the "pets" edge.
func (*CategoryQuery) Select ¶
func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at"` } client.Category.Query(). Select(category.FieldCreatedAt). Scan(ctx, &v)
func (*CategoryQuery) Unique ¶
func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CategoryQuery) Where ¶
func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
Where adds a new predicate for the CategoryQuery builder.
func (*CategoryQuery) WithPets ¶
func (cq *CategoryQuery) WithPets(opts ...func(*PetQuery)) *CategoryQuery
WithPets tells the query-builder to eager-load the nodes that are connected to the "pets" edge. The optional arguments are used to configure the query builder of the edge.
type CategorySelect ¶
type CategorySelect struct { *CategoryQuery // contains filtered or unexported fields }
CategorySelect is the builder for selecting fields of Category entities.
func (*CategorySelect) Aggregate ¶
func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect
Aggregate adds the given aggregation functions to the selector query.
func (*CategorySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Scan ¶
func (cs *CategorySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategorySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoryUpdate ¶
type CategoryUpdate struct {
// contains filtered or unexported fields
}
CategoryUpdate is the builder for updating Category entities.
func (*CategoryUpdate) AddPetIDs ¶
func (cu *CategoryUpdate) AddPetIDs(ids ...int) *CategoryUpdate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryUpdate) AddPets ¶
func (cu *CategoryUpdate) AddPets(p ...*Pet) *CategoryUpdate
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryUpdate) AppendInts ¶
func (cu *CategoryUpdate) AppendInts(i []int) *CategoryUpdate
AppendInts appends i to the "ints" field.
func (*CategoryUpdate) AppendStrings ¶
func (cu *CategoryUpdate) AppendStrings(s []string) *CategoryUpdate
AppendStrings appends s to the "strings" field.
func (*CategoryUpdate) ClearInts ¶
func (cu *CategoryUpdate) ClearInts() *CategoryUpdate
ClearInts clears the value of the "ints" field.
func (*CategoryUpdate) ClearPets ¶
func (cu *CategoryUpdate) ClearPets() *CategoryUpdate
ClearPets clears all "pets" edges to the Pet entity.
func (*CategoryUpdate) ClearSkipInSpec ¶
func (cu *CategoryUpdate) ClearSkipInSpec() *CategoryUpdate
ClearSkipInSpec clears the value of the "skip_in_spec" field.
func (*CategoryUpdate) ClearStrings ¶
func (cu *CategoryUpdate) ClearStrings() *CategoryUpdate
ClearStrings clears the value of the "strings" field.
func (*CategoryUpdate) Exec ¶
func (cu *CategoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpdate) ExecX ¶
func (cu *CategoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdate) Mutation ¶
func (cu *CategoryUpdate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdate) RemovePetIDs ¶
func (cu *CategoryUpdate) RemovePetIDs(ids ...int) *CategoryUpdate
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*CategoryUpdate) RemovePets ¶
func (cu *CategoryUpdate) RemovePets(p ...*Pet) *CategoryUpdate
RemovePets removes "pets" edges to Pet entities.
func (*CategoryUpdate) Save ¶
func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CategoryUpdate) SaveX ¶
func (cu *CategoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdate) SetInts ¶
func (cu *CategoryUpdate) SetInts(i []int) *CategoryUpdate
SetInts sets the "ints" field.
func (*CategoryUpdate) SetName ¶
func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
SetName sets the "name" field.
func (*CategoryUpdate) SetNillable ¶
func (cu *CategoryUpdate) SetNillable(s string) *CategoryUpdate
SetNillable sets the "nillable" field.
func (*CategoryUpdate) SetNillableName ¶
func (cu *CategoryUpdate) SetNillableName(s *string) *CategoryUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoryUpdate) SetNillableNillable ¶
func (cu *CategoryUpdate) SetNillableNillable(s *string) *CategoryUpdate
SetNillableNillable sets the "nillable" field if the given value is not nil.
func (*CategoryUpdate) SetNillableReadonly ¶
func (cu *CategoryUpdate) SetNillableReadonly(s *string) *CategoryUpdate
SetNillableReadonly sets the "readonly" field if the given value is not nil.
func (*CategoryUpdate) SetNillableSkipInSpec ¶
func (cu *CategoryUpdate) SetNillableSkipInSpec(s *string) *CategoryUpdate
SetNillableSkipInSpec sets the "skip_in_spec" field if the given value is not nil.
func (*CategoryUpdate) SetReadonly ¶
func (cu *CategoryUpdate) SetReadonly(s string) *CategoryUpdate
SetReadonly sets the "readonly" field.
func (*CategoryUpdate) SetSkipInSpec ¶
func (cu *CategoryUpdate) SetSkipInSpec(s string) *CategoryUpdate
SetSkipInSpec sets the "skip_in_spec" field.
func (*CategoryUpdate) SetStrings ¶
func (cu *CategoryUpdate) SetStrings(s []string) *CategoryUpdate
SetStrings sets the "strings" field.
func (*CategoryUpdate) SetUpdatedAt ¶
func (cu *CategoryUpdate) SetUpdatedAt(t time.Time) *CategoryUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpdate) Where ¶
func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
Where appends a list predicates to the CategoryUpdate builder.
type CategoryUpdateOne ¶
type CategoryUpdateOne struct {
// contains filtered or unexported fields
}
CategoryUpdateOne is the builder for updating a single Category entity.
func (*CategoryUpdateOne) AddPetIDs ¶
func (cuo *CategoryUpdateOne) AddPetIDs(ids ...int) *CategoryUpdateOne
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*CategoryUpdateOne) AddPets ¶
func (cuo *CategoryUpdateOne) AddPets(p ...*Pet) *CategoryUpdateOne
AddPets adds the "pets" edges to the Pet entity.
func (*CategoryUpdateOne) AppendInts ¶
func (cuo *CategoryUpdateOne) AppendInts(i []int) *CategoryUpdateOne
AppendInts appends i to the "ints" field.
func (*CategoryUpdateOne) AppendStrings ¶
func (cuo *CategoryUpdateOne) AppendStrings(s []string) *CategoryUpdateOne
AppendStrings appends s to the "strings" field.
func (*CategoryUpdateOne) ClearInts ¶
func (cuo *CategoryUpdateOne) ClearInts() *CategoryUpdateOne
ClearInts clears the value of the "ints" field.
func (*CategoryUpdateOne) ClearPets ¶
func (cuo *CategoryUpdateOne) ClearPets() *CategoryUpdateOne
ClearPets clears all "pets" edges to the Pet entity.
func (*CategoryUpdateOne) ClearSkipInSpec ¶
func (cuo *CategoryUpdateOne) ClearSkipInSpec() *CategoryUpdateOne
ClearSkipInSpec clears the value of the "skip_in_spec" field.
func (*CategoryUpdateOne) ClearStrings ¶
func (cuo *CategoryUpdateOne) ClearStrings() *CategoryUpdateOne
ClearStrings clears the value of the "strings" field.
func (*CategoryUpdateOne) Exec ¶
func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CategoryUpdateOne) ExecX ¶
func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdateOne) Mutation ¶
func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdateOne) RemovePetIDs ¶
func (cuo *CategoryUpdateOne) RemovePetIDs(ids ...int) *CategoryUpdateOne
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*CategoryUpdateOne) RemovePets ¶
func (cuo *CategoryUpdateOne) RemovePets(p ...*Pet) *CategoryUpdateOne
RemovePets removes "pets" edges to Pet entities.
func (*CategoryUpdateOne) Save ¶
func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
Save executes the query and returns the updated Category entity.
func (*CategoryUpdateOne) SaveX ¶
func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdateOne) Select ¶
func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CategoryUpdateOne) SetInts ¶
func (cuo *CategoryUpdateOne) SetInts(i []int) *CategoryUpdateOne
SetInts sets the "ints" field.
func (*CategoryUpdateOne) SetName ¶
func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
SetName sets the "name" field.
func (*CategoryUpdateOne) SetNillable ¶
func (cuo *CategoryUpdateOne) SetNillable(s string) *CategoryUpdateOne
SetNillable sets the "nillable" field.
func (*CategoryUpdateOne) SetNillableName ¶
func (cuo *CategoryUpdateOne) SetNillableName(s *string) *CategoryUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoryUpdateOne) SetNillableNillable ¶
func (cuo *CategoryUpdateOne) SetNillableNillable(s *string) *CategoryUpdateOne
SetNillableNillable sets the "nillable" field if the given value is not nil.
func (*CategoryUpdateOne) SetNillableReadonly ¶
func (cuo *CategoryUpdateOne) SetNillableReadonly(s *string) *CategoryUpdateOne
SetNillableReadonly sets the "readonly" field if the given value is not nil.
func (*CategoryUpdateOne) SetNillableSkipInSpec ¶
func (cuo *CategoryUpdateOne) SetNillableSkipInSpec(s *string) *CategoryUpdateOne
SetNillableSkipInSpec sets the "skip_in_spec" field if the given value is not nil.
func (*CategoryUpdateOne) SetReadonly ¶
func (cuo *CategoryUpdateOne) SetReadonly(s string) *CategoryUpdateOne
SetReadonly sets the "readonly" field.
func (*CategoryUpdateOne) SetSkipInSpec ¶
func (cuo *CategoryUpdateOne) SetSkipInSpec(s string) *CategoryUpdateOne
SetSkipInSpec sets the "skip_in_spec" field.
func (*CategoryUpdateOne) SetStrings ¶
func (cuo *CategoryUpdateOne) SetStrings(s []string) *CategoryUpdateOne
SetStrings sets the "strings" field.
func (*CategoryUpdateOne) SetUpdatedAt ¶
func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpdateOne) Where ¶
func (cuo *CategoryUpdateOne) Where(ps ...predicate.Category) *CategoryUpdateOne
Where appends a list predicates to the CategoryUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Category is the client for interacting with the Category builders. Category *CategoryClient // Follows is the client for interacting with the Follows builders. Follows *FollowsClient // Friendship is the client for interacting with the Friendship builders. Friendship *FriendshipClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // Settings is the client for interacting with the Settings builders. Settings *SettingsClient // Skipped is the client for interacting with the Skipped builders. Skipped *SkippedClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Category. Query(). Count(ctx)
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 Follows ¶
type Follows struct { // FollowedAt holds the value of the "followed_at" field. FollowedAt time.Time `json:"followed_at"` // UserID holds the value of the "user_id" field. UserID int `json:"user_id"` // PetID holds the value of the "pet_id" field. PetID int `json:"pet_id"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FollowsQuery when eager-loading is set. Edges FollowsEdges `json:"edges"` // contains filtered or unexported fields }
Follows is the model entity for the Follows schema.
func (*Follows) Unwrap ¶
Unwrap unwraps the Follows 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 (*Follows) Update ¶
func (f *Follows) Update() *FollowsUpdateOne
Update returns a builder for updating this Follows. Note that you need to call Follows.Unwrap() before calling this method if this Follows was returned from a transaction, and the transaction was committed or rolled back.
type FollowsClient ¶
type FollowsClient struct {
// contains filtered or unexported fields
}
FollowsClient is a client for the Follows schema.
func NewFollowsClient ¶
func NewFollowsClient(c config) *FollowsClient
NewFollowsClient returns a client for the Follows from the given config.
func (*FollowsClient) Create ¶
func (c *FollowsClient) Create() *FollowsCreate
Create returns a builder for creating a Follows entity.
func (*FollowsClient) CreateBulk ¶
func (c *FollowsClient) CreateBulk(builders ...*FollowsCreate) *FollowsCreateBulk
CreateBulk returns a builder for creating a bulk of Follows entities.
func (*FollowsClient) Delete ¶
func (c *FollowsClient) Delete() *FollowsDelete
Delete returns a delete builder for Follows.
func (*FollowsClient) Hooks ¶
func (c *FollowsClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FollowsClient) Intercept ¶
func (c *FollowsClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `follows.Intercept(f(g(h())))`.
func (*FollowsClient) Interceptors ¶
func (c *FollowsClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FollowsClient) MapCreateBulk ¶
func (c *FollowsClient) MapCreateBulk(slice any, setFunc func(*FollowsCreate, int)) *FollowsCreateBulk
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 (*FollowsClient) Query ¶
func (c *FollowsClient) Query() *FollowsQuery
Query returns a query builder for Follows.
func (*FollowsClient) QueryPet ¶
func (c *FollowsClient) QueryPet(f *Follows) *PetQuery
QueryPet queries the pet edge of a Follows.
func (*FollowsClient) QueryUser ¶
func (c *FollowsClient) QueryUser(f *Follows) *UserQuery
QueryUser queries the user edge of a Follows.
func (*FollowsClient) Update ¶
func (c *FollowsClient) Update() *FollowsUpdate
Update returns an update builder for Follows.
func (*FollowsClient) UpdateOne ¶
func (c *FollowsClient) UpdateOne(f *Follows) *FollowsUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FollowsClient) Use ¶
func (c *FollowsClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `follows.Hooks(f(g(h())))`.
type FollowsCreate ¶
type FollowsCreate struct {
// contains filtered or unexported fields
}
FollowsCreate is the builder for creating a Follows entity.
func (*FollowsCreate) Exec ¶
func (fc *FollowsCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FollowsCreate) ExecX ¶
func (fc *FollowsCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FollowsCreate) Mutation ¶
func (fc *FollowsCreate) Mutation() *FollowsMutation
Mutation returns the FollowsMutation object of the builder.
func (*FollowsCreate) Save ¶
func (fc *FollowsCreate) Save(ctx context.Context) (*Follows, error)
Save creates the Follows in the database.
func (*FollowsCreate) SaveX ¶
func (fc *FollowsCreate) SaveX(ctx context.Context) *Follows
SaveX calls Save and panics if Save returns an error.
func (*FollowsCreate) SetFollowedAt ¶
func (fc *FollowsCreate) SetFollowedAt(t time.Time) *FollowsCreate
SetFollowedAt sets the "followed_at" field.
func (*FollowsCreate) SetNillableFollowedAt ¶
func (fc *FollowsCreate) SetNillableFollowedAt(t *time.Time) *FollowsCreate
SetNillableFollowedAt sets the "followed_at" field if the given value is not nil.
func (*FollowsCreate) SetPet ¶
func (fc *FollowsCreate) SetPet(p *Pet) *FollowsCreate
SetPet sets the "pet" edge to the Pet entity.
func (*FollowsCreate) SetPetID ¶
func (fc *FollowsCreate) SetPetID(i int) *FollowsCreate
SetPetID sets the "pet_id" field.
func (*FollowsCreate) SetUser ¶
func (fc *FollowsCreate) SetUser(u *User) *FollowsCreate
SetUser sets the "user" edge to the User entity.
func (*FollowsCreate) SetUserID ¶
func (fc *FollowsCreate) SetUserID(i int) *FollowsCreate
SetUserID sets the "user_id" field.
type FollowsCreateBulk ¶
type FollowsCreateBulk struct {
// contains filtered or unexported fields
}
FollowsCreateBulk is the builder for creating many Follows entities in bulk.
func (*FollowsCreateBulk) Exec ¶
func (fcb *FollowsCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FollowsCreateBulk) ExecX ¶
func (fcb *FollowsCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FollowsDelete ¶
type FollowsDelete struct {
// contains filtered or unexported fields
}
FollowsDelete is the builder for deleting a Follows entity.
func (*FollowsDelete) Exec ¶
func (fd *FollowsDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FollowsDelete) ExecX ¶
func (fd *FollowsDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FollowsDelete) Where ¶
func (fd *FollowsDelete) Where(ps ...predicate.Follows) *FollowsDelete
Where appends a list predicates to the FollowsDelete builder.
type FollowsDeleteOne ¶
type FollowsDeleteOne struct {
// contains filtered or unexported fields
}
FollowsDeleteOne is the builder for deleting a single Follows entity.
func (*FollowsDeleteOne) Exec ¶
func (fdo *FollowsDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FollowsDeleteOne) ExecX ¶
func (fdo *FollowsDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FollowsDeleteOne) Where ¶
func (fdo *FollowsDeleteOne) Where(ps ...predicate.Follows) *FollowsDeleteOne
Where appends a list predicates to the FollowsDelete builder.
type FollowsEdges ¶
type FollowsEdges struct { // The user that is following the pet. User *User `json:"user,omitempty"` // The pet that is being followed by the user. Pet *Pet `json:"pet,omitempty"` // contains filtered or unexported fields }
FollowsEdges holds the relations/edges for other nodes in the graph.
func (FollowsEdges) PetOrErr ¶
func (e FollowsEdges) PetOrErr() (*Pet, error)
PetOrErr returns the Pet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (FollowsEdges) UserOrErr ¶
func (e FollowsEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type FollowsGroupBy ¶
type FollowsGroupBy struct {
// contains filtered or unexported fields
}
FollowsGroupBy is the group-by builder for Follows entities.
func (*FollowsGroupBy) Aggregate ¶
func (fgb *FollowsGroupBy) Aggregate(fns ...AggregateFunc) *FollowsGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FollowsGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FollowsGroupBy) Scan ¶
func (fgb *FollowsGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FollowsGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FollowsMutation ¶
type FollowsMutation struct {
// contains filtered or unexported fields
}
FollowsMutation represents an operation that mutates the Follows nodes in the graph.
func (*FollowsMutation) AddField ¶
func (m *FollowsMutation) 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 (*FollowsMutation) AddedEdges ¶
func (m *FollowsMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FollowsMutation) AddedField ¶
func (m *FollowsMutation) 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 (*FollowsMutation) AddedFields ¶
func (m *FollowsMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FollowsMutation) AddedIDs ¶
func (m *FollowsMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FollowsMutation) ClearEdge ¶
func (m *FollowsMutation) 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 (*FollowsMutation) ClearField ¶
func (m *FollowsMutation) 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 (*FollowsMutation) ClearPet ¶
func (m *FollowsMutation) ClearPet()
ClearPet clears the "pet" edge to the Pet entity.
func (*FollowsMutation) ClearUser ¶
func (m *FollowsMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*FollowsMutation) ClearedEdges ¶
func (m *FollowsMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FollowsMutation) ClearedFields ¶
func (m *FollowsMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FollowsMutation) Client ¶
func (m FollowsMutation) 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 (*FollowsMutation) EdgeCleared ¶
func (m *FollowsMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FollowsMutation) Field ¶
func (m *FollowsMutation) 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 (*FollowsMutation) FieldCleared ¶
func (m *FollowsMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FollowsMutation) Fields ¶
func (m *FollowsMutation) 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 (*FollowsMutation) FollowedAt ¶
func (m *FollowsMutation) FollowedAt() (r time.Time, exists bool)
FollowedAt returns the value of the "followed_at" field in the mutation.
func (*FollowsMutation) 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 (*FollowsMutation) PetCleared ¶
func (m *FollowsMutation) PetCleared() bool
PetCleared reports if the "pet" edge to the Pet entity was cleared.
func (*FollowsMutation) PetID ¶
func (m *FollowsMutation) PetID() (r int, exists bool)
PetID returns the value of the "pet_id" field in the mutation.
func (*FollowsMutation) PetIDs ¶
func (m *FollowsMutation) PetIDs() (ids []int)
PetIDs returns the "pet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PetID instead. It exists only for internal usage by the builders.
func (*FollowsMutation) RemovedEdges ¶
func (m *FollowsMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FollowsMutation) RemovedIDs ¶
func (m *FollowsMutation) 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 (*FollowsMutation) ResetEdge ¶
func (m *FollowsMutation) 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 (*FollowsMutation) ResetField ¶
func (m *FollowsMutation) 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 (*FollowsMutation) ResetFollowedAt ¶
func (m *FollowsMutation) ResetFollowedAt()
ResetFollowedAt resets all changes to the "followed_at" field.
func (*FollowsMutation) ResetPet ¶
func (m *FollowsMutation) ResetPet()
ResetPet resets all changes to the "pet" edge.
func (*FollowsMutation) ResetPetID ¶
func (m *FollowsMutation) ResetPetID()
ResetPetID resets all changes to the "pet_id" field.
func (*FollowsMutation) ResetUser ¶
func (m *FollowsMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*FollowsMutation) ResetUserID ¶
func (m *FollowsMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*FollowsMutation) SetField ¶
func (m *FollowsMutation) 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 (*FollowsMutation) SetFollowedAt ¶
func (m *FollowsMutation) SetFollowedAt(t time.Time)
SetFollowedAt sets the "followed_at" field.
func (*FollowsMutation) SetOp ¶
func (m *FollowsMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FollowsMutation) SetPetID ¶
func (m *FollowsMutation) SetPetID(i int)
SetPetID sets the "pet_id" field.
func (*FollowsMutation) SetUserID ¶
func (m *FollowsMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (FollowsMutation) Tx ¶
func (m FollowsMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FollowsMutation) Type ¶
func (m *FollowsMutation) Type() string
Type returns the node type of this mutation (Follows).
func (*FollowsMutation) UserCleared ¶
func (m *FollowsMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*FollowsMutation) UserID ¶
func (m *FollowsMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*FollowsMutation) UserIDs ¶
func (m *FollowsMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*FollowsMutation) Where ¶
func (m *FollowsMutation) Where(ps ...predicate.Follows)
Where appends a list predicates to the FollowsMutation builder.
func (*FollowsMutation) WhereP ¶
func (m *FollowsMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FollowsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FollowsQuery ¶
type FollowsQuery struct {
// contains filtered or unexported fields
}
FollowsQuery is the builder for querying Follows entities.
func (*FollowsQuery) Aggregate ¶
func (fq *FollowsQuery) Aggregate(fns ...AggregateFunc) *FollowsSelect
Aggregate returns a FollowsSelect configured with the given aggregations.
func (*FollowsQuery) All ¶
func (fq *FollowsQuery) All(ctx context.Context) ([]*Follows, error)
All executes the query and returns a list of FollowsSlice.
func (*FollowsQuery) AllX ¶
func (fq *FollowsQuery) AllX(ctx context.Context) []*Follows
AllX is like All, but panics if an error occurs.
func (*FollowsQuery) Clone ¶
func (fq *FollowsQuery) Clone() *FollowsQuery
Clone returns a duplicate of the FollowsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FollowsQuery) Count ¶
func (fq *FollowsQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FollowsQuery) CountX ¶
func (fq *FollowsQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FollowsQuery) Exist ¶
func (fq *FollowsQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FollowsQuery) ExistX ¶
func (fq *FollowsQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FollowsQuery) First ¶
func (fq *FollowsQuery) First(ctx context.Context) (*Follows, error)
First returns the first Follows entity from the query. Returns a *NotFoundError when no Follows was found.
func (*FollowsQuery) FirstX ¶
func (fq *FollowsQuery) FirstX(ctx context.Context) *Follows
FirstX is like First, but panics if an error occurs.
func (*FollowsQuery) GroupBy ¶
func (fq *FollowsQuery) GroupBy(field string, fields ...string) *FollowsGroupBy
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 { FollowedAt time.Time `json:"followed_at"` Count int `json:"count,omitempty"` } client.Follows.Query(). GroupBy(follows.FieldFollowedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FollowsQuery) Limit ¶
func (fq *FollowsQuery) Limit(limit int) *FollowsQuery
Limit the number of records to be returned by this query.
func (*FollowsQuery) Offset ¶
func (fq *FollowsQuery) Offset(offset int) *FollowsQuery
Offset to start from.
func (*FollowsQuery) Only ¶
func (fq *FollowsQuery) Only(ctx context.Context) (*Follows, error)
Only returns a single Follows entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Follows entity is found. Returns a *NotFoundError when no Follows entities are found.
func (*FollowsQuery) OnlyX ¶
func (fq *FollowsQuery) OnlyX(ctx context.Context) *Follows
OnlyX is like Only, but panics if an error occurs.
func (*FollowsQuery) Order ¶
func (fq *FollowsQuery) Order(o ...follows.OrderOption) *FollowsQuery
Order specifies how the records should be ordered.
func (*FollowsQuery) QueryPet ¶
func (fq *FollowsQuery) QueryPet() *PetQuery
QueryPet chains the current query on the "pet" edge.
func (*FollowsQuery) QueryUser ¶
func (fq *FollowsQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*FollowsQuery) Select ¶
func (fq *FollowsQuery) Select(fields ...string) *FollowsSelect
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 { FollowedAt time.Time `json:"followed_at"` } client.Follows.Query(). Select(follows.FieldFollowedAt). Scan(ctx, &v)
func (*FollowsQuery) Unique ¶
func (fq *FollowsQuery) Unique(unique bool) *FollowsQuery
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 (*FollowsQuery) Where ¶
func (fq *FollowsQuery) Where(ps ...predicate.Follows) *FollowsQuery
Where adds a new predicate for the FollowsQuery builder.
func (*FollowsQuery) WithPet ¶
func (fq *FollowsQuery) WithPet(opts ...func(*PetQuery)) *FollowsQuery
WithPet tells the query-builder to eager-load the nodes that are connected to the "pet" edge. The optional arguments are used to configure the query builder of the edge.
func (*FollowsQuery) WithUser ¶
func (fq *FollowsQuery) WithUser(opts ...func(*UserQuery)) *FollowsQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type FollowsSelect ¶
type FollowsSelect struct { *FollowsQuery // contains filtered or unexported fields }
FollowsSelect is the builder for selecting fields of Follows entities.
func (*FollowsSelect) Aggregate ¶
func (fs *FollowsSelect) Aggregate(fns ...AggregateFunc) *FollowsSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FollowsSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FollowsSelect) Scan ¶
func (fs *FollowsSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FollowsSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FollowsUpdate ¶
type FollowsUpdate struct {
// contains filtered or unexported fields
}
FollowsUpdate is the builder for updating Follows entities.
func (*FollowsUpdate) ClearPet ¶
func (fu *FollowsUpdate) ClearPet() *FollowsUpdate
ClearPet clears the "pet" edge to the Pet entity.
func (*FollowsUpdate) ClearUser ¶
func (fu *FollowsUpdate) ClearUser() *FollowsUpdate
ClearUser clears the "user" edge to the User entity.
func (*FollowsUpdate) Exec ¶
func (fu *FollowsUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FollowsUpdate) ExecX ¶
func (fu *FollowsUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FollowsUpdate) Mutation ¶
func (fu *FollowsUpdate) Mutation() *FollowsMutation
Mutation returns the FollowsMutation object of the builder.
func (*FollowsUpdate) Save ¶
func (fu *FollowsUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FollowsUpdate) SaveX ¶
func (fu *FollowsUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FollowsUpdate) SetFollowedAt ¶
func (fu *FollowsUpdate) SetFollowedAt(t time.Time) *FollowsUpdate
SetFollowedAt sets the "followed_at" field.
func (*FollowsUpdate) SetNillableFollowedAt ¶
func (fu *FollowsUpdate) SetNillableFollowedAt(t *time.Time) *FollowsUpdate
SetNillableFollowedAt sets the "followed_at" field if the given value is not nil.
func (*FollowsUpdate) SetNillablePetID ¶
func (fu *FollowsUpdate) SetNillablePetID(i *int) *FollowsUpdate
SetNillablePetID sets the "pet_id" field if the given value is not nil.
func (*FollowsUpdate) SetNillableUserID ¶
func (fu *FollowsUpdate) SetNillableUserID(i *int) *FollowsUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*FollowsUpdate) SetPet ¶
func (fu *FollowsUpdate) SetPet(p *Pet) *FollowsUpdate
SetPet sets the "pet" edge to the Pet entity.
func (*FollowsUpdate) SetPetID ¶
func (fu *FollowsUpdate) SetPetID(i int) *FollowsUpdate
SetPetID sets the "pet_id" field.
func (*FollowsUpdate) SetUser ¶
func (fu *FollowsUpdate) SetUser(u *User) *FollowsUpdate
SetUser sets the "user" edge to the User entity.
func (*FollowsUpdate) SetUserID ¶
func (fu *FollowsUpdate) SetUserID(i int) *FollowsUpdate
SetUserID sets the "user_id" field.
func (*FollowsUpdate) Where ¶
func (fu *FollowsUpdate) Where(ps ...predicate.Follows) *FollowsUpdate
Where appends a list predicates to the FollowsUpdate builder.
type FollowsUpdateOne ¶
type FollowsUpdateOne struct {
// contains filtered or unexported fields
}
FollowsUpdateOne is the builder for updating a single Follows entity.
func (*FollowsUpdateOne) ClearPet ¶
func (fuo *FollowsUpdateOne) ClearPet() *FollowsUpdateOne
ClearPet clears the "pet" edge to the Pet entity.
func (*FollowsUpdateOne) ClearUser ¶
func (fuo *FollowsUpdateOne) ClearUser() *FollowsUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*FollowsUpdateOne) Exec ¶
func (fuo *FollowsUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FollowsUpdateOne) ExecX ¶
func (fuo *FollowsUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FollowsUpdateOne) Mutation ¶
func (fuo *FollowsUpdateOne) Mutation() *FollowsMutation
Mutation returns the FollowsMutation object of the builder.
func (*FollowsUpdateOne) Save ¶
func (fuo *FollowsUpdateOne) Save(ctx context.Context) (*Follows, error)
Save executes the query and returns the updated Follows entity.
func (*FollowsUpdateOne) SaveX ¶
func (fuo *FollowsUpdateOne) SaveX(ctx context.Context) *Follows
SaveX is like Save, but panics if an error occurs.
func (*FollowsUpdateOne) Select ¶
func (fuo *FollowsUpdateOne) Select(field string, fields ...string) *FollowsUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FollowsUpdateOne) SetFollowedAt ¶
func (fuo *FollowsUpdateOne) SetFollowedAt(t time.Time) *FollowsUpdateOne
SetFollowedAt sets the "followed_at" field.
func (*FollowsUpdateOne) SetNillableFollowedAt ¶
func (fuo *FollowsUpdateOne) SetNillableFollowedAt(t *time.Time) *FollowsUpdateOne
SetNillableFollowedAt sets the "followed_at" field if the given value is not nil.
func (*FollowsUpdateOne) SetNillablePetID ¶
func (fuo *FollowsUpdateOne) SetNillablePetID(i *int) *FollowsUpdateOne
SetNillablePetID sets the "pet_id" field if the given value is not nil.
func (*FollowsUpdateOne) SetNillableUserID ¶
func (fuo *FollowsUpdateOne) SetNillableUserID(i *int) *FollowsUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*FollowsUpdateOne) SetPet ¶
func (fuo *FollowsUpdateOne) SetPet(p *Pet) *FollowsUpdateOne
SetPet sets the "pet" edge to the Pet entity.
func (*FollowsUpdateOne) SetPetID ¶
func (fuo *FollowsUpdateOne) SetPetID(i int) *FollowsUpdateOne
SetPetID sets the "pet_id" field.
func (*FollowsUpdateOne) SetUser ¶
func (fuo *FollowsUpdateOne) SetUser(u *User) *FollowsUpdateOne
SetUser sets the "user" edge to the User entity.
func (*FollowsUpdateOne) SetUserID ¶
func (fuo *FollowsUpdateOne) SetUserID(i int) *FollowsUpdateOne
SetUserID sets the "user_id" field.
func (*FollowsUpdateOne) Where ¶
func (fuo *FollowsUpdateOne) Where(ps ...predicate.Follows) *FollowsUpdateOne
Where appends a list predicates to the FollowsUpdate builder.
type Friendship ¶
type Friendship struct { // ID of the ent. ID int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at"` // UserID holds the value of the "user_id" field. UserID int `json:"user_id"` // FriendID holds the value of the "friend_id" field. FriendID int `json:"friend_id"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FriendshipQuery when eager-loading is set. Edges FriendshipEdges `json:"edges"` // contains filtered or unexported fields }
Friendship is the model entity for the Friendship schema.
func (*Friendship) QueryFriend ¶
func (f *Friendship) QueryFriend() *UserQuery
QueryFriend queries the "friend" edge of the Friendship entity.
func (*Friendship) QueryUser ¶
func (f *Friendship) QueryUser() *UserQuery
QueryUser queries the "user" edge of the Friendship entity.
func (*Friendship) String ¶
func (f *Friendship) String() string
String implements the fmt.Stringer.
func (*Friendship) Unwrap ¶
func (f *Friendship) Unwrap() *Friendship
Unwrap unwraps the Friendship 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 (*Friendship) Update ¶
func (f *Friendship) Update() *FriendshipUpdateOne
Update returns a builder for updating this Friendship. Note that you need to call Friendship.Unwrap() before calling this method if this Friendship was returned from a transaction, and the transaction was committed or rolled back.
type FriendshipClient ¶
type FriendshipClient struct {
// contains filtered or unexported fields
}
FriendshipClient is a client for the Friendship schema.
func NewFriendshipClient ¶
func NewFriendshipClient(c config) *FriendshipClient
NewFriendshipClient returns a client for the Friendship from the given config.
func (*FriendshipClient) Create ¶
func (c *FriendshipClient) Create() *FriendshipCreate
Create returns a builder for creating a Friendship entity.
func (*FriendshipClient) CreateBulk ¶
func (c *FriendshipClient) CreateBulk(builders ...*FriendshipCreate) *FriendshipCreateBulk
CreateBulk returns a builder for creating a bulk of Friendship entities.
func (*FriendshipClient) Delete ¶
func (c *FriendshipClient) Delete() *FriendshipDelete
Delete returns a delete builder for Friendship.
func (*FriendshipClient) DeleteOne ¶
func (c *FriendshipClient) DeleteOne(f *Friendship) *FriendshipDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FriendshipClient) DeleteOneID ¶
func (c *FriendshipClient) DeleteOneID(id int) *FriendshipDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FriendshipClient) Get ¶
func (c *FriendshipClient) Get(ctx context.Context, id int) (*Friendship, error)
Get returns a Friendship entity by its id.
func (*FriendshipClient) GetX ¶
func (c *FriendshipClient) GetX(ctx context.Context, id int) *Friendship
GetX is like Get, but panics if an error occurs.
func (*FriendshipClient) Hooks ¶
func (c *FriendshipClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FriendshipClient) Intercept ¶
func (c *FriendshipClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `friendship.Intercept(f(g(h())))`.
func (*FriendshipClient) Interceptors ¶
func (c *FriendshipClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FriendshipClient) MapCreateBulk ¶
func (c *FriendshipClient) MapCreateBulk(slice any, setFunc func(*FriendshipCreate, int)) *FriendshipCreateBulk
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 (*FriendshipClient) Query ¶
func (c *FriendshipClient) Query() *FriendshipQuery
Query returns a query builder for Friendship.
func (*FriendshipClient) QueryFriend ¶
func (c *FriendshipClient) QueryFriend(f *Friendship) *UserQuery
QueryFriend queries the friend edge of a Friendship.
func (*FriendshipClient) QueryUser ¶
func (c *FriendshipClient) QueryUser(f *Friendship) *UserQuery
QueryUser queries the user edge of a Friendship.
func (*FriendshipClient) Update ¶
func (c *FriendshipClient) Update() *FriendshipUpdate
Update returns an update builder for Friendship.
func (*FriendshipClient) UpdateOne ¶
func (c *FriendshipClient) UpdateOne(f *Friendship) *FriendshipUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FriendshipClient) UpdateOneID ¶
func (c *FriendshipClient) UpdateOneID(id int) *FriendshipUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FriendshipClient) Use ¶
func (c *FriendshipClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `friendship.Hooks(f(g(h())))`.
type FriendshipCreate ¶
type FriendshipCreate struct {
// contains filtered or unexported fields
}
FriendshipCreate is the builder for creating a Friendship entity.
func (*FriendshipCreate) Exec ¶
func (fc *FriendshipCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FriendshipCreate) ExecX ¶
func (fc *FriendshipCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipCreate) Mutation ¶
func (fc *FriendshipCreate) Mutation() *FriendshipMutation
Mutation returns the FriendshipMutation object of the builder.
func (*FriendshipCreate) Save ¶
func (fc *FriendshipCreate) Save(ctx context.Context) (*Friendship, error)
Save creates the Friendship in the database.
func (*FriendshipCreate) SaveX ¶
func (fc *FriendshipCreate) SaveX(ctx context.Context) *Friendship
SaveX calls Save and panics if Save returns an error.
func (*FriendshipCreate) SetCreatedAt ¶
func (fc *FriendshipCreate) SetCreatedAt(t time.Time) *FriendshipCreate
SetCreatedAt sets the "created_at" field.
func (*FriendshipCreate) SetFriend ¶
func (fc *FriendshipCreate) SetFriend(u *User) *FriendshipCreate
SetFriend sets the "friend" edge to the User entity.
func (*FriendshipCreate) SetFriendID ¶
func (fc *FriendshipCreate) SetFriendID(i int) *FriendshipCreate
SetFriendID sets the "friend_id" field.
func (*FriendshipCreate) SetNillableCreatedAt ¶
func (fc *FriendshipCreate) SetNillableCreatedAt(t *time.Time) *FriendshipCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FriendshipCreate) SetUser ¶
func (fc *FriendshipCreate) SetUser(u *User) *FriendshipCreate
SetUser sets the "user" edge to the User entity.
func (*FriendshipCreate) SetUserID ¶
func (fc *FriendshipCreate) SetUserID(i int) *FriendshipCreate
SetUserID sets the "user_id" field.
type FriendshipCreateBulk ¶
type FriendshipCreateBulk struct {
// contains filtered or unexported fields
}
FriendshipCreateBulk is the builder for creating many Friendship entities in bulk.
func (*FriendshipCreateBulk) Exec ¶
func (fcb *FriendshipCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FriendshipCreateBulk) ExecX ¶
func (fcb *FriendshipCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipCreateBulk) Save ¶
func (fcb *FriendshipCreateBulk) Save(ctx context.Context) ([]*Friendship, error)
Save creates the Friendship entities in the database.
func (*FriendshipCreateBulk) SaveX ¶
func (fcb *FriendshipCreateBulk) SaveX(ctx context.Context) []*Friendship
SaveX is like Save, but panics if an error occurs.
type FriendshipDelete ¶
type FriendshipDelete struct {
// contains filtered or unexported fields
}
FriendshipDelete is the builder for deleting a Friendship entity.
func (*FriendshipDelete) Exec ¶
func (fd *FriendshipDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FriendshipDelete) ExecX ¶
func (fd *FriendshipDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipDelete) Where ¶
func (fd *FriendshipDelete) Where(ps ...predicate.Friendship) *FriendshipDelete
Where appends a list predicates to the FriendshipDelete builder.
type FriendshipDeleteOne ¶
type FriendshipDeleteOne struct {
// contains filtered or unexported fields
}
FriendshipDeleteOne is the builder for deleting a single Friendship entity.
func (*FriendshipDeleteOne) Exec ¶
func (fdo *FriendshipDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FriendshipDeleteOne) ExecX ¶
func (fdo *FriendshipDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipDeleteOne) Where ¶
func (fdo *FriendshipDeleteOne) Where(ps ...predicate.Friendship) *FriendshipDeleteOne
Where appends a list predicates to the FriendshipDelete builder.
type FriendshipEdges ¶
type FriendshipEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Friend holds the value of the friend edge. Friend *User `json:"friend,omitempty"` // contains filtered or unexported fields }
FriendshipEdges holds the relations/edges for other nodes in the graph.
func (FriendshipEdges) FriendOrErr ¶
func (e FriendshipEdges) FriendOrErr() (*User, error)
FriendOrErr returns the Friend value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (FriendshipEdges) UserOrErr ¶
func (e FriendshipEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type FriendshipGroupBy ¶
type FriendshipGroupBy struct {
// contains filtered or unexported fields
}
FriendshipGroupBy is the group-by builder for Friendship entities.
func (*FriendshipGroupBy) Aggregate ¶
func (fgb *FriendshipGroupBy) Aggregate(fns ...AggregateFunc) *FriendshipGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FriendshipGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FriendshipGroupBy) Scan ¶
func (fgb *FriendshipGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FriendshipGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FriendshipMutation ¶
type FriendshipMutation struct {
// contains filtered or unexported fields
}
FriendshipMutation represents an operation that mutates the Friendship nodes in the graph.
func (*FriendshipMutation) AddField ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) AddedEdges ¶
func (m *FriendshipMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FriendshipMutation) AddedField ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) AddedFields ¶
func (m *FriendshipMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FriendshipMutation) AddedIDs ¶
func (m *FriendshipMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FriendshipMutation) ClearEdge ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) ClearField ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) ClearFriend ¶
func (m *FriendshipMutation) ClearFriend()
ClearFriend clears the "friend" edge to the User entity.
func (*FriendshipMutation) ClearUser ¶
func (m *FriendshipMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*FriendshipMutation) ClearedEdges ¶
func (m *FriendshipMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FriendshipMutation) ClearedFields ¶
func (m *FriendshipMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FriendshipMutation) Client ¶
func (m FriendshipMutation) 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 (*FriendshipMutation) CreatedAt ¶
func (m *FriendshipMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*FriendshipMutation) EdgeCleared ¶
func (m *FriendshipMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FriendshipMutation) Field ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) FieldCleared ¶
func (m *FriendshipMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FriendshipMutation) Fields ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) FriendCleared ¶
func (m *FriendshipMutation) FriendCleared() bool
FriendCleared reports if the "friend" edge to the User entity was cleared.
func (*FriendshipMutation) FriendID ¶
func (m *FriendshipMutation) FriendID() (r int, exists bool)
FriendID returns the value of the "friend_id" field in the mutation.
func (*FriendshipMutation) FriendIDs ¶
func (m *FriendshipMutation) FriendIDs() (ids []int)
FriendIDs returns the "friend" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FriendID instead. It exists only for internal usage by the builders.
func (*FriendshipMutation) ID ¶
func (m *FriendshipMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*FriendshipMutation) IDs ¶
func (m *FriendshipMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FriendshipMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) 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 (*FriendshipMutation) OldFriendID ¶
func (m *FriendshipMutation) OldFriendID(ctx context.Context) (v int, err error)
OldFriendID returns the old "friend_id" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) OldUserID ¶
func (m *FriendshipMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) RemovedEdges ¶
func (m *FriendshipMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FriendshipMutation) RemovedIDs ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) ResetCreatedAt ¶
func (m *FriendshipMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*FriendshipMutation) ResetEdge ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) ResetField ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) ResetFriend ¶
func (m *FriendshipMutation) ResetFriend()
ResetFriend resets all changes to the "friend" edge.
func (*FriendshipMutation) ResetFriendID ¶
func (m *FriendshipMutation) ResetFriendID()
ResetFriendID resets all changes to the "friend_id" field.
func (*FriendshipMutation) ResetUser ¶
func (m *FriendshipMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*FriendshipMutation) ResetUserID ¶
func (m *FriendshipMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*FriendshipMutation) SetCreatedAt ¶
func (m *FriendshipMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*FriendshipMutation) SetField ¶
func (m *FriendshipMutation) 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 (*FriendshipMutation) SetFriendID ¶
func (m *FriendshipMutation) SetFriendID(i int)
SetFriendID sets the "friend_id" field.
func (*FriendshipMutation) SetOp ¶
func (m *FriendshipMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FriendshipMutation) SetUserID ¶
func (m *FriendshipMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (FriendshipMutation) Tx ¶
func (m FriendshipMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FriendshipMutation) Type ¶
func (m *FriendshipMutation) Type() string
Type returns the node type of this mutation (Friendship).
func (*FriendshipMutation) UserCleared ¶
func (m *FriendshipMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*FriendshipMutation) UserID ¶
func (m *FriendshipMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*FriendshipMutation) UserIDs ¶
func (m *FriendshipMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*FriendshipMutation) Where ¶
func (m *FriendshipMutation) Where(ps ...predicate.Friendship)
Where appends a list predicates to the FriendshipMutation builder.
func (*FriendshipMutation) WhereP ¶
func (m *FriendshipMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FriendshipMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FriendshipQuery ¶
type FriendshipQuery struct {
// contains filtered or unexported fields
}
FriendshipQuery is the builder for querying Friendship entities.
func (*FriendshipQuery) Aggregate ¶
func (fq *FriendshipQuery) Aggregate(fns ...AggregateFunc) *FriendshipSelect
Aggregate returns a FriendshipSelect configured with the given aggregations.
func (*FriendshipQuery) All ¶
func (fq *FriendshipQuery) All(ctx context.Context) ([]*Friendship, error)
All executes the query and returns a list of Friendships.
func (*FriendshipQuery) AllX ¶
func (fq *FriendshipQuery) AllX(ctx context.Context) []*Friendship
AllX is like All, but panics if an error occurs.
func (*FriendshipQuery) Clone ¶
func (fq *FriendshipQuery) Clone() *FriendshipQuery
Clone returns a duplicate of the FriendshipQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FriendshipQuery) Count ¶
func (fq *FriendshipQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FriendshipQuery) CountX ¶
func (fq *FriendshipQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FriendshipQuery) Exist ¶
func (fq *FriendshipQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FriendshipQuery) ExistX ¶
func (fq *FriendshipQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FriendshipQuery) First ¶
func (fq *FriendshipQuery) First(ctx context.Context) (*Friendship, error)
First returns the first Friendship entity from the query. Returns a *NotFoundError when no Friendship was found.
func (*FriendshipQuery) FirstID ¶
func (fq *FriendshipQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Friendship ID from the query. Returns a *NotFoundError when no Friendship ID was found.
func (*FriendshipQuery) FirstIDX ¶
func (fq *FriendshipQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*FriendshipQuery) FirstX ¶
func (fq *FriendshipQuery) FirstX(ctx context.Context) *Friendship
FirstX is like First, but panics if an error occurs.
func (*FriendshipQuery) GroupBy ¶
func (fq *FriendshipQuery) GroupBy(field string, fields ...string) *FriendshipGroupBy
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 { CreatedAt time.Time `json:"created_at"` Count int `json:"count,omitempty"` } client.Friendship.Query(). GroupBy(friendship.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FriendshipQuery) IDs ¶
func (fq *FriendshipQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Friendship IDs.
func (*FriendshipQuery) IDsX ¶
func (fq *FriendshipQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*FriendshipQuery) Limit ¶
func (fq *FriendshipQuery) Limit(limit int) *FriendshipQuery
Limit the number of records to be returned by this query.
func (*FriendshipQuery) Offset ¶
func (fq *FriendshipQuery) Offset(offset int) *FriendshipQuery
Offset to start from.
func (*FriendshipQuery) Only ¶
func (fq *FriendshipQuery) Only(ctx context.Context) (*Friendship, error)
Only returns a single Friendship entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Friendship entity is found. Returns a *NotFoundError when no Friendship entities are found.
func (*FriendshipQuery) OnlyID ¶
func (fq *FriendshipQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Friendship ID in the query. Returns a *NotSingularError when more than one Friendship ID is found. Returns a *NotFoundError when no entities are found.
func (*FriendshipQuery) OnlyIDX ¶
func (fq *FriendshipQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FriendshipQuery) OnlyX ¶
func (fq *FriendshipQuery) OnlyX(ctx context.Context) *Friendship
OnlyX is like Only, but panics if an error occurs.
func (*FriendshipQuery) Order ¶
func (fq *FriendshipQuery) Order(o ...friendship.OrderOption) *FriendshipQuery
Order specifies how the records should be ordered.
func (*FriendshipQuery) QueryFriend ¶
func (fq *FriendshipQuery) QueryFriend() *UserQuery
QueryFriend chains the current query on the "friend" edge.
func (*FriendshipQuery) QueryUser ¶
func (fq *FriendshipQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*FriendshipQuery) Select ¶
func (fq *FriendshipQuery) Select(fields ...string) *FriendshipSelect
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 { CreatedAt time.Time `json:"created_at"` } client.Friendship.Query(). Select(friendship.FieldCreatedAt). Scan(ctx, &v)
func (*FriendshipQuery) Unique ¶
func (fq *FriendshipQuery) Unique(unique bool) *FriendshipQuery
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 (*FriendshipQuery) Where ¶
func (fq *FriendshipQuery) Where(ps ...predicate.Friendship) *FriendshipQuery
Where adds a new predicate for the FriendshipQuery builder.
func (*FriendshipQuery) WithFriend ¶
func (fq *FriendshipQuery) WithFriend(opts ...func(*UserQuery)) *FriendshipQuery
WithFriend tells the query-builder to eager-load the nodes that are connected to the "friend" edge. The optional arguments are used to configure the query builder of the edge.
func (*FriendshipQuery) WithUser ¶
func (fq *FriendshipQuery) WithUser(opts ...func(*UserQuery)) *FriendshipQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type FriendshipSelect ¶
type FriendshipSelect struct { *FriendshipQuery // contains filtered or unexported fields }
FriendshipSelect is the builder for selecting fields of Friendship entities.
func (*FriendshipSelect) Aggregate ¶
func (fs *FriendshipSelect) Aggregate(fns ...AggregateFunc) *FriendshipSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FriendshipSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FriendshipSelect) Scan ¶
func (fs *FriendshipSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FriendshipSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FriendshipUpdate ¶
type FriendshipUpdate struct {
// contains filtered or unexported fields
}
FriendshipUpdate is the builder for updating Friendship entities.
func (*FriendshipUpdate) ClearFriend ¶
func (fu *FriendshipUpdate) ClearFriend() *FriendshipUpdate
ClearFriend clears the "friend" edge to the User entity.
func (*FriendshipUpdate) ClearUser ¶
func (fu *FriendshipUpdate) ClearUser() *FriendshipUpdate
ClearUser clears the "user" edge to the User entity.
func (*FriendshipUpdate) Exec ¶
func (fu *FriendshipUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FriendshipUpdate) ExecX ¶
func (fu *FriendshipUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipUpdate) Mutation ¶
func (fu *FriendshipUpdate) Mutation() *FriendshipMutation
Mutation returns the FriendshipMutation object of the builder.
func (*FriendshipUpdate) Save ¶
func (fu *FriendshipUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FriendshipUpdate) SaveX ¶
func (fu *FriendshipUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FriendshipUpdate) SetCreatedAt ¶
func (fu *FriendshipUpdate) SetCreatedAt(t time.Time) *FriendshipUpdate
SetCreatedAt sets the "created_at" field.
func (*FriendshipUpdate) SetFriend ¶
func (fu *FriendshipUpdate) SetFriend(u *User) *FriendshipUpdate
SetFriend sets the "friend" edge to the User entity.
func (*FriendshipUpdate) SetFriendID ¶
func (fu *FriendshipUpdate) SetFriendID(i int) *FriendshipUpdate
SetFriendID sets the "friend_id" field.
func (*FriendshipUpdate) SetNillableCreatedAt ¶
func (fu *FriendshipUpdate) SetNillableCreatedAt(t *time.Time) *FriendshipUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FriendshipUpdate) SetNillableFriendID ¶
func (fu *FriendshipUpdate) SetNillableFriendID(i *int) *FriendshipUpdate
SetNillableFriendID sets the "friend_id" field if the given value is not nil.
func (*FriendshipUpdate) SetNillableUserID ¶
func (fu *FriendshipUpdate) SetNillableUserID(i *int) *FriendshipUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*FriendshipUpdate) SetUser ¶
func (fu *FriendshipUpdate) SetUser(u *User) *FriendshipUpdate
SetUser sets the "user" edge to the User entity.
func (*FriendshipUpdate) SetUserID ¶
func (fu *FriendshipUpdate) SetUserID(i int) *FriendshipUpdate
SetUserID sets the "user_id" field.
func (*FriendshipUpdate) Where ¶
func (fu *FriendshipUpdate) Where(ps ...predicate.Friendship) *FriendshipUpdate
Where appends a list predicates to the FriendshipUpdate builder.
type FriendshipUpdateOne ¶
type FriendshipUpdateOne struct {
// contains filtered or unexported fields
}
FriendshipUpdateOne is the builder for updating a single Friendship entity.
func (*FriendshipUpdateOne) ClearFriend ¶
func (fuo *FriendshipUpdateOne) ClearFriend() *FriendshipUpdateOne
ClearFriend clears the "friend" edge to the User entity.
func (*FriendshipUpdateOne) ClearUser ¶
func (fuo *FriendshipUpdateOne) ClearUser() *FriendshipUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*FriendshipUpdateOne) Exec ¶
func (fuo *FriendshipUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FriendshipUpdateOne) ExecX ¶
func (fuo *FriendshipUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FriendshipUpdateOne) Mutation ¶
func (fuo *FriendshipUpdateOne) Mutation() *FriendshipMutation
Mutation returns the FriendshipMutation object of the builder.
func (*FriendshipUpdateOne) Save ¶
func (fuo *FriendshipUpdateOne) Save(ctx context.Context) (*Friendship, error)
Save executes the query and returns the updated Friendship entity.
func (*FriendshipUpdateOne) SaveX ¶
func (fuo *FriendshipUpdateOne) SaveX(ctx context.Context) *Friendship
SaveX is like Save, but panics if an error occurs.
func (*FriendshipUpdateOne) Select ¶
func (fuo *FriendshipUpdateOne) Select(field string, fields ...string) *FriendshipUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FriendshipUpdateOne) SetCreatedAt ¶
func (fuo *FriendshipUpdateOne) SetCreatedAt(t time.Time) *FriendshipUpdateOne
SetCreatedAt sets the "created_at" field.
func (*FriendshipUpdateOne) SetFriend ¶
func (fuo *FriendshipUpdateOne) SetFriend(u *User) *FriendshipUpdateOne
SetFriend sets the "friend" edge to the User entity.
func (*FriendshipUpdateOne) SetFriendID ¶
func (fuo *FriendshipUpdateOne) SetFriendID(i int) *FriendshipUpdateOne
SetFriendID sets the "friend_id" field.
func (*FriendshipUpdateOne) SetNillableCreatedAt ¶
func (fuo *FriendshipUpdateOne) SetNillableCreatedAt(t *time.Time) *FriendshipUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FriendshipUpdateOne) SetNillableFriendID ¶
func (fuo *FriendshipUpdateOne) SetNillableFriendID(i *int) *FriendshipUpdateOne
SetNillableFriendID sets the "friend_id" field if the given value is not nil.
func (*FriendshipUpdateOne) SetNillableUserID ¶
func (fuo *FriendshipUpdateOne) SetNillableUserID(i *int) *FriendshipUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*FriendshipUpdateOne) SetUser ¶
func (fuo *FriendshipUpdateOne) SetUser(u *User) *FriendshipUpdateOne
SetUser sets the "user" edge to the User entity.
func (*FriendshipUpdateOne) SetUserID ¶
func (fuo *FriendshipUpdateOne) SetUserID(i int) *FriendshipUpdateOne
SetUserID sets the "user_id" field.
func (*FriendshipUpdateOne) Where ¶
func (fuo *FriendshipUpdateOne) Where(ps ...predicate.Friendship) *FriendshipUpdateOne
Where appends a list predicates to the FriendshipUpdate 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 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 Pet ¶
type Pet struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name"` // Nicknames holds the value of the "nicknames" field. Nicknames []string `json:"nicknames"` // Age holds the value of the "age" field. Age int `json:"age"` // Type holds the value of the "type" field. Type pet.Type `json:"type"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PetQuery when eager-loading is set. Edges PetEdges `json:"edges"` // contains filtered or unexported fields }
Pet is the model entity for the Pet schema.
func (*Pet) QueryCategories ¶
func (pe *Pet) QueryCategories() *CategoryQuery
QueryCategories queries the "categories" edge of the Pet entity.
func (*Pet) QueryFollowedBy ¶
QueryFollowedBy queries the "followed_by" edge of the Pet entity.
func (*Pet) QueryFollowing ¶
func (pe *Pet) QueryFollowing() *FollowsQuery
QueryFollowing queries the "following" edge of the Pet entity.
func (*Pet) QueryFriends ¶
QueryFriends queries the "friends" edge of the Pet entity.
func (*Pet) QueryOwner ¶
QueryOwner queries the "owner" edge of the Pet entity.
func (*Pet) Unwrap ¶
Unwrap unwraps the Pet entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Pet) Update ¶
func (pe *Pet) Update() *PetUpdateOne
Update returns a builder for updating this Pet. Note that you need to call Pet.Unwrap() before calling this method if this Pet was returned from a transaction, and the transaction was committed or rolled back.
type PetClient ¶
type PetClient struct {
// contains filtered or unexported fields
}
PetClient is a client for the Pet schema.
func NewPetClient ¶
func NewPetClient(c config) *PetClient
NewPetClient returns a client for the Pet from the given config.
func (*PetClient) CreateBulk ¶
func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
CreateBulk returns a builder for creating a bulk of Pet entities.
func (*PetClient) DeleteOne ¶
func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PetClient) DeleteOneID ¶
func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PetClient) Intercept ¶
func (c *PetClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pet.Intercept(f(g(h())))`.
func (*PetClient) Interceptors ¶
func (c *PetClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PetClient) MapCreateBulk ¶
func (c *PetClient) MapCreateBulk(slice any, setFunc func(*PetCreate, int)) *PetCreateBulk
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 (*PetClient) QueryCategories ¶
func (c *PetClient) QueryCategories(pe *Pet) *CategoryQuery
QueryCategories queries the categories edge of a Pet.
func (*PetClient) QueryFollowedBy ¶
QueryFollowedBy queries the followed_by edge of a Pet.
func (*PetClient) QueryFollowing ¶
func (c *PetClient) QueryFollowing(pe *Pet) *FollowsQuery
QueryFollowing queries the following edge of a Pet.
func (*PetClient) QueryFriends ¶
QueryFriends queries the friends edge of a Pet.
func (*PetClient) QueryOwner ¶
QueryOwner queries the owner edge of a Pet.
func (*PetClient) UpdateOne ¶
func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PetClient) UpdateOneID ¶
func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
UpdateOneID returns an update builder for the given id.
type PetCreate ¶
type PetCreate struct {
// contains filtered or unexported fields
}
PetCreate is the builder for creating a Pet entity.
func (*PetCreate) AddCategories ¶
AddCategories adds the "categories" edges to the Category entity.
func (*PetCreate) AddCategoryIDs ¶
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
func (*PetCreate) AddFollowedBy ¶
AddFollowedBy adds the "followed_by" edges to the User entity.
func (*PetCreate) AddFollowedByIDs ¶
AddFollowedByIDs adds the "followed_by" edge to the User entity by IDs.
func (*PetCreate) AddFriendIDs ¶
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetCreate) AddFriends ¶
AddFriends adds the "friends" edges to the Pet entity.
func (*PetCreate) Mutation ¶
func (pc *PetCreate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetCreate) SetNicknames ¶
SetNicknames sets the "nicknames" field.
func (*PetCreate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.
func (*PetCreate) SetOwnerID ¶
SetOwnerID sets the "owner" edge to the User entity by ID.
type PetCreateBulk ¶
type PetCreateBulk struct {
// contains filtered or unexported fields
}
PetCreateBulk is the builder for creating many Pet entities in bulk.
func (*PetCreateBulk) Exec ¶
func (pcb *PetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PetCreateBulk) ExecX ¶
func (pcb *PetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetDelete ¶
type PetDelete struct {
// contains filtered or unexported fields
}
PetDelete is the builder for deleting a Pet entity.
func (*PetDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type PetDeleteOne ¶
type PetDeleteOne struct {
// contains filtered or unexported fields
}
PetDeleteOne is the builder for deleting a single Pet entity.
func (*PetDeleteOne) Exec ¶
func (pdo *PetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PetDeleteOne) ExecX ¶
func (pdo *PetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PetDeleteOne) Where ¶
func (pdo *PetDeleteOne) Where(ps ...predicate.Pet) *PetDeleteOne
Where appends a list predicates to the PetDelete builder.
type PetEdges ¶
type PetEdges struct { // Categories that the pet belongs to. Categories []*Category `json:"categories,omitempty"` // The user that owns the pet. Owner *User `json:"owner,omitempty"` // Pets that this pet is friends with. Friends []*Pet `json:"friends,omitempty"` // Users that this pet is followed by. FollowedBy []*User `json:"followed_by,omitempty"` // Following holds the value of the following edge. Following []*Follows `json:"following,omitempty"` // contains filtered or unexported fields }
PetEdges holds the relations/edges for other nodes in the graph.
func (PetEdges) CategoriesOrErr ¶
CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading.
func (PetEdges) FollowedByOrErr ¶
FollowedByOrErr returns the FollowedBy value or an error if the edge was not loaded in eager-loading.
func (PetEdges) FollowingOrErr ¶
FollowingOrErr returns the Following value or an error if the edge was not loaded in eager-loading.
func (PetEdges) FriendsOrErr ¶
FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.
func (PetEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PetGroupBy ¶
type PetGroupBy struct {
// contains filtered or unexported fields
}
PetGroupBy is the group-by builder for Pet entities.
func (*PetGroupBy) Aggregate ¶
func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PetGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Scan ¶
func (pgb *PetGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PetGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PetMutation ¶
type PetMutation struct {
// contains filtered or unexported fields
}
PetMutation represents an operation that mutates the Pet nodes in the graph.
func (*PetMutation) AddCategoryIDs ¶
func (m *PetMutation) AddCategoryIDs(ids ...int)
AddCategoryIDs adds the "categories" edge to the Category entity by ids.
func (*PetMutation) AddField ¶
func (m *PetMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PetMutation) AddFollowedByIDs ¶
func (m *PetMutation) AddFollowedByIDs(ids ...int)
AddFollowedByIDs adds the "followed_by" edge to the User entity by ids.
func (*PetMutation) AddFriendIDs ¶
func (m *PetMutation) AddFriendIDs(ids ...int)
AddFriendIDs adds the "friends" edge to the Pet entity by ids.
func (*PetMutation) AddedAge ¶
func (m *PetMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*PetMutation) AddedEdges ¶
func (m *PetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PetMutation) AddedField ¶
func (m *PetMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PetMutation) AddedFields ¶
func (m *PetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PetMutation) AddedIDs ¶
func (m *PetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PetMutation) Age ¶
func (m *PetMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*PetMutation) AppendNicknames ¶
func (m *PetMutation) AppendNicknames(s []string)
AppendNicknames adds s to the "nicknames" field.
func (*PetMutation) AppendedNicknames ¶
func (m *PetMutation) AppendedNicknames() ([]string, bool)
AppendedNicknames returns the list of values that were appended to the "nicknames" field in this mutation.
func (*PetMutation) CategoriesCleared ¶
func (m *PetMutation) CategoriesCleared() bool
CategoriesCleared reports if the "categories" edge to the Category entity was cleared.
func (*PetMutation) CategoriesIDs ¶
func (m *PetMutation) CategoriesIDs() (ids []int)
CategoriesIDs returns the "categories" edge IDs in the mutation.
func (*PetMutation) ClearCategories ¶
func (m *PetMutation) ClearCategories()
ClearCategories clears the "categories" edge to the Category entity.
func (*PetMutation) ClearEdge ¶
func (m *PetMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*PetMutation) ClearField ¶
func (m *PetMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*PetMutation) ClearFollowedBy ¶
func (m *PetMutation) ClearFollowedBy()
ClearFollowedBy clears the "followed_by" edge to the User entity.
func (*PetMutation) ClearFriends ¶
func (m *PetMutation) ClearFriends()
ClearFriends clears the "friends" edge to the Pet entity.
func (*PetMutation) ClearNicknames ¶
func (m *PetMutation) ClearNicknames()
ClearNicknames clears the value of the "nicknames" field.
func (*PetMutation) ClearOwner ¶
func (m *PetMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*PetMutation) ClearedEdges ¶
func (m *PetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PetMutation) ClearedFields ¶
func (m *PetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PetMutation) Client ¶
func (m PetMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*PetMutation) EdgeCleared ¶
func (m *PetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PetMutation) Field ¶
func (m *PetMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PetMutation) FieldCleared ¶
func (m *PetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PetMutation) Fields ¶
func (m *PetMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*PetMutation) FollowedByCleared ¶
func (m *PetMutation) FollowedByCleared() bool
FollowedByCleared reports if the "followed_by" edge to the User entity was cleared.
func (*PetMutation) FollowedByIDs ¶
func (m *PetMutation) FollowedByIDs() (ids []int)
FollowedByIDs returns the "followed_by" edge IDs in the mutation.
func (*PetMutation) FriendsCleared ¶
func (m *PetMutation) FriendsCleared() bool
FriendsCleared reports if the "friends" edge to the Pet entity was cleared.
func (*PetMutation) FriendsIDs ¶
func (m *PetMutation) FriendsIDs() (ids []int)
FriendsIDs returns the "friends" edge IDs in the mutation.
func (*PetMutation) GetType ¶
func (m *PetMutation) GetType() (r pet.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*PetMutation) ID ¶
func (m *PetMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PetMutation) IDs ¶
func (m *PetMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PetMutation) Name ¶
func (m *PetMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PetMutation) Nicknames ¶
func (m *PetMutation) Nicknames() (r []string, exists bool)
Nicknames returns the value of the "nicknames" field in the mutation.
func (*PetMutation) NicknamesCleared ¶
func (m *PetMutation) NicknamesCleared() bool
NicknamesCleared returns if the "nicknames" field was cleared in this mutation.
func (*PetMutation) OldAge ¶
func (m *PetMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the Pet entity. If the Pet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PetMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*PetMutation) OldName ¶
func (m *PetMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Pet entity. If the Pet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PetMutation) OldNicknames ¶
func (m *PetMutation) OldNicknames(ctx context.Context) (v []string, err error)
OldNicknames returns the old "nicknames" field's value of the Pet entity. If the Pet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PetMutation) OldType ¶
OldType returns the old "type" field's value of the Pet entity. If the Pet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PetMutation) OwnerCleared ¶
func (m *PetMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*PetMutation) OwnerID ¶
func (m *PetMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*PetMutation) OwnerIDs ¶
func (m *PetMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*PetMutation) RemoveCategoryIDs ¶
func (m *PetMutation) RemoveCategoryIDs(ids ...int)
RemoveCategoryIDs removes the "categories" edge to the Category entity by IDs.
func (*PetMutation) RemoveFollowedByIDs ¶
func (m *PetMutation) RemoveFollowedByIDs(ids ...int)
RemoveFollowedByIDs removes the "followed_by" edge to the User entity by IDs.
func (*PetMutation) RemoveFriendIDs ¶
func (m *PetMutation) RemoveFriendIDs(ids ...int)
RemoveFriendIDs removes the "friends" edge to the Pet entity by IDs.
func (*PetMutation) RemovedCategoriesIDs ¶
func (m *PetMutation) RemovedCategoriesIDs() (ids []int)
RemovedCategories returns the removed IDs of the "categories" edge to the Category entity.
func (*PetMutation) RemovedEdges ¶
func (m *PetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PetMutation) RemovedFollowedByIDs ¶
func (m *PetMutation) RemovedFollowedByIDs() (ids []int)
RemovedFollowedBy returns the removed IDs of the "followed_by" edge to the User entity.
func (*PetMutation) RemovedFriendsIDs ¶
func (m *PetMutation) RemovedFriendsIDs() (ids []int)
RemovedFriends returns the removed IDs of the "friends" edge to the Pet entity.
func (*PetMutation) RemovedIDs ¶
func (m *PetMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*PetMutation) ResetAge ¶
func (m *PetMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*PetMutation) ResetCategories ¶
func (m *PetMutation) ResetCategories()
ResetCategories resets all changes to the "categories" edge.
func (*PetMutation) ResetEdge ¶
func (m *PetMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*PetMutation) ResetField ¶
func (m *PetMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*PetMutation) ResetFollowedBy ¶
func (m *PetMutation) ResetFollowedBy()
ResetFollowedBy resets all changes to the "followed_by" edge.
func (*PetMutation) ResetFriends ¶
func (m *PetMutation) ResetFriends()
ResetFriends resets all changes to the "friends" edge.
func (*PetMutation) ResetName ¶
func (m *PetMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PetMutation) ResetNicknames ¶
func (m *PetMutation) ResetNicknames()
ResetNicknames resets all changes to the "nicknames" field.
func (*PetMutation) ResetOwner ¶
func (m *PetMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*PetMutation) ResetType ¶
func (m *PetMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*PetMutation) SetField ¶
func (m *PetMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PetMutation) SetID ¶
func (m *PetMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Pet entities.
func (*PetMutation) SetName ¶
func (m *PetMutation) SetName(s string)
SetName sets the "name" field.
func (*PetMutation) SetNicknames ¶
func (m *PetMutation) SetNicknames(s []string)
SetNicknames sets the "nicknames" field.
func (*PetMutation) SetOp ¶
func (m *PetMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PetMutation) SetOwnerID ¶
func (m *PetMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the User entity by id.
func (*PetMutation) SetType ¶
func (m *PetMutation) SetType(pe pet.Type)
SetType sets the "type" field.
func (PetMutation) Tx ¶
func (m PetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PetMutation) Type ¶
func (m *PetMutation) Type() string
Type returns the node type of this mutation (Pet).
func (*PetMutation) Where ¶
func (m *PetMutation) Where(ps ...predicate.Pet)
Where appends a list predicates to the PetMutation builder.
func (*PetMutation) WhereP ¶
func (m *PetMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PetQuery ¶
type PetQuery struct {
// contains filtered or unexported fields
}
PetQuery is the builder for querying Pet entities.
func (*PetQuery) Aggregate ¶
func (pq *PetQuery) Aggregate(fns ...AggregateFunc) *PetSelect
Aggregate returns a PetSelect configured with the given aggregations.
func (*PetQuery) Clone ¶
Clone returns a duplicate of the PetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PetQuery) First ¶
First returns the first Pet entity from the query. Returns a *NotFoundError when no Pet was found.
func (*PetQuery) FirstID ¶
FirstID returns the first Pet ID from the query. Returns a *NotFoundError when no Pet ID was found.
func (*PetQuery) GroupBy ¶
func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name"` Count int `json:"count,omitempty"` } client.Pet.Query(). GroupBy(pet.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PetQuery) Only ¶
Only returns a single Pet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pet entity is found. Returns a *NotFoundError when no Pet entities are found.
func (*PetQuery) OnlyID ¶
OnlyID is like Only, but returns the only Pet ID in the query. Returns a *NotSingularError when more than one Pet ID is found. Returns a *NotFoundError when no entities are found.
func (*PetQuery) Order ¶
func (pq *PetQuery) Order(o ...pet.OrderOption) *PetQuery
Order specifies how the records should be ordered.
func (*PetQuery) QueryCategories ¶
func (pq *PetQuery) QueryCategories() *CategoryQuery
QueryCategories chains the current query on the "categories" edge.
func (*PetQuery) QueryFollowedBy ¶
QueryFollowedBy chains the current query on the "followed_by" edge.
func (*PetQuery) QueryFollowing ¶
func (pq *PetQuery) QueryFollowing() *FollowsQuery
QueryFollowing chains the current query on the "following" edge.
func (*PetQuery) QueryFriends ¶
QueryFriends chains the current query on the "friends" edge.
func (*PetQuery) QueryOwner ¶
QueryOwner chains the current query on the "owner" edge.
func (*PetQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name"` } client.Pet.Query(). Select(pet.FieldName). Scan(ctx, &v)
func (*PetQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*PetQuery) WithCategories ¶
func (pq *PetQuery) WithCategories(opts ...func(*CategoryQuery)) *PetQuery
WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithFollowedBy ¶
WithFollowedBy tells the query-builder to eager-load the nodes that are connected to the "followed_by" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithFollowing ¶
func (pq *PetQuery) WithFollowing(opts ...func(*FollowsQuery)) *PetQuery
WithFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge. The optional arguments are used to configure the query builder of the edge.
func (*PetQuery) WithFriends ¶
WithFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge. The optional arguments are used to configure the query builder of the edge.
type PetSelect ¶
type PetSelect struct { *PetQuery // contains filtered or unexported fields }
PetSelect is the builder for selecting fields of Pet entities.
func (*PetSelect) Aggregate ¶
func (ps *PetSelect) Aggregate(fns ...AggregateFunc) *PetSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PetUpdate ¶
type PetUpdate struct {
// contains filtered or unexported fields
}
PetUpdate is the builder for updating Pet entities.
func (*PetUpdate) AddCategories ¶
AddCategories adds the "categories" edges to the Category entity.
func (*PetUpdate) AddCategoryIDs ¶
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
func (*PetUpdate) AddFollowedBy ¶
AddFollowedBy adds the "followed_by" edges to the User entity.
func (*PetUpdate) AddFollowedByIDs ¶
AddFollowedByIDs adds the "followed_by" edge to the User entity by IDs.
func (*PetUpdate) AddFriendIDs ¶
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetUpdate) AddFriends ¶
AddFriends adds the "friends" edges to the Pet entity.
func (*PetUpdate) AppendNicknames ¶
AppendNicknames appends s to the "nicknames" field.
func (*PetUpdate) ClearCategories ¶
ClearCategories clears all "categories" edges to the Category entity.
func (*PetUpdate) ClearFollowedBy ¶
ClearFollowedBy clears all "followed_by" edges to the User entity.
func (*PetUpdate) ClearFriends ¶
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdate) ClearNicknames ¶
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdate) ClearOwner ¶
ClearOwner clears the "owner" edge to the User entity.
func (*PetUpdate) Mutation ¶
func (pu *PetUpdate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdate) RemoveCategories ¶
RemoveCategories removes "categories" edges to Category entities.
func (*PetUpdate) RemoveCategoryIDs ¶
RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.
func (*PetUpdate) RemoveFollowedBy ¶
RemoveFollowedBy removes "followed_by" edges to User entities.
func (*PetUpdate) RemoveFollowedByIDs ¶
RemoveFollowedByIDs removes the "followed_by" edge to User entities by IDs.
func (*PetUpdate) RemoveFriendIDs ¶
RemoveFriendIDs removes the "friends" edge to Pet entities by IDs.
func (*PetUpdate) RemoveFriends ¶
RemoveFriends removes "friends" edges to Pet entities.
func (*PetUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*PetUpdate) SetNicknames ¶
SetNicknames sets the "nicknames" field.
func (*PetUpdate) SetNillableAge ¶
SetNillableAge sets the "age" field if the given value is not nil.
func (*PetUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*PetUpdate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.
func (*PetUpdate) SetNillableType ¶
SetNillableType sets the "type" field if the given value is not nil.
func (*PetUpdate) SetOwnerID ¶
SetOwnerID sets the "owner" edge to the User entity by ID.
type PetUpdateOne ¶
type PetUpdateOne struct {
// contains filtered or unexported fields
}
PetUpdateOne is the builder for updating a single Pet entity.
func (*PetUpdateOne) AddAge ¶
func (puo *PetUpdateOne) AddAge(i int) *PetUpdateOne
AddAge adds i to the "age" field.
func (*PetUpdateOne) AddCategories ¶
func (puo *PetUpdateOne) AddCategories(c ...*Category) *PetUpdateOne
AddCategories adds the "categories" edges to the Category entity.
func (*PetUpdateOne) AddCategoryIDs ¶
func (puo *PetUpdateOne) AddCategoryIDs(ids ...int) *PetUpdateOne
AddCategoryIDs adds the "categories" edge to the Category entity by IDs.
func (*PetUpdateOne) AddFollowedBy ¶
func (puo *PetUpdateOne) AddFollowedBy(u ...*User) *PetUpdateOne
AddFollowedBy adds the "followed_by" edges to the User entity.
func (*PetUpdateOne) AddFollowedByIDs ¶
func (puo *PetUpdateOne) AddFollowedByIDs(ids ...int) *PetUpdateOne
AddFollowedByIDs adds the "followed_by" edge to the User entity by IDs.
func (*PetUpdateOne) AddFriendIDs ¶
func (puo *PetUpdateOne) AddFriendIDs(ids ...int) *PetUpdateOne
AddFriendIDs adds the "friends" edge to the Pet entity by IDs.
func (*PetUpdateOne) AddFriends ¶
func (puo *PetUpdateOne) AddFriends(p ...*Pet) *PetUpdateOne
AddFriends adds the "friends" edges to the Pet entity.
func (*PetUpdateOne) AppendNicknames ¶
func (puo *PetUpdateOne) AppendNicknames(s []string) *PetUpdateOne
AppendNicknames appends s to the "nicknames" field.
func (*PetUpdateOne) ClearCategories ¶
func (puo *PetUpdateOne) ClearCategories() *PetUpdateOne
ClearCategories clears all "categories" edges to the Category entity.
func (*PetUpdateOne) ClearFollowedBy ¶
func (puo *PetUpdateOne) ClearFollowedBy() *PetUpdateOne
ClearFollowedBy clears all "followed_by" edges to the User entity.
func (*PetUpdateOne) ClearFriends ¶
func (puo *PetUpdateOne) ClearFriends() *PetUpdateOne
ClearFriends clears all "friends" edges to the Pet entity.
func (*PetUpdateOne) ClearNicknames ¶
func (puo *PetUpdateOne) ClearNicknames() *PetUpdateOne
ClearNicknames clears the value of the "nicknames" field.
func (*PetUpdateOne) ClearOwner ¶
func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*PetUpdateOne) Exec ¶
func (puo *PetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PetUpdateOne) ExecX ¶
func (puo *PetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PetUpdateOne) Mutation ¶
func (puo *PetUpdateOne) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdateOne) RemoveCategories ¶
func (puo *PetUpdateOne) RemoveCategories(c ...*Category) *PetUpdateOne
RemoveCategories removes "categories" edges to Category entities.
func (*PetUpdateOne) RemoveCategoryIDs ¶
func (puo *PetUpdateOne) RemoveCategoryIDs(ids ...int) *PetUpdateOne
RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.
func (*PetUpdateOne) RemoveFollowedBy ¶
func (puo *PetUpdateOne) RemoveFollowedBy(u ...*User) *PetUpdateOne
RemoveFollowedBy removes "followed_by" edges to User entities.
func (*PetUpdateOne) RemoveFollowedByIDs ¶
func (puo *PetUpdateOne) RemoveFollowedByIDs(ids ...int) *PetUpdateOne
RemoveFollowedByIDs removes the "followed_by" edge to User entities by IDs.
func (*PetUpdateOne) RemoveFriendIDs ¶
func (puo *PetUpdateOne) RemoveFriendIDs(ids ...int) *PetUpdateOne
RemoveFriendIDs removes the "friends" edge to Pet entities by IDs.
func (*PetUpdateOne) RemoveFriends ¶
func (puo *PetUpdateOne) RemoveFriends(p ...*Pet) *PetUpdateOne
RemoveFriends removes "friends" edges to Pet entities.
func (*PetUpdateOne) Save ¶
func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
Save executes the query and returns the updated Pet entity.
func (*PetUpdateOne) SaveX ¶
func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
SaveX is like Save, but panics if an error occurs.
func (*PetUpdateOne) Select ¶
func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PetUpdateOne) SetAge ¶
func (puo *PetUpdateOne) SetAge(i int) *PetUpdateOne
SetAge sets the "age" field.
func (*PetUpdateOne) SetName ¶
func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne
SetName sets the "name" field.
func (*PetUpdateOne) SetNicknames ¶
func (puo *PetUpdateOne) SetNicknames(s []string) *PetUpdateOne
SetNicknames sets the "nicknames" field.
func (*PetUpdateOne) SetNillableAge ¶
func (puo *PetUpdateOne) SetNillableAge(i *int) *PetUpdateOne
SetNillableAge sets the "age" field if the given value is not nil.
func (*PetUpdateOne) SetNillableName ¶
func (puo *PetUpdateOne) SetNillableName(s *string) *PetUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*PetUpdateOne) SetNillableOwnerID ¶
func (puo *PetUpdateOne) SetNillableOwnerID(id *int) *PetUpdateOne
SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.
func (*PetUpdateOne) SetNillableType ¶
func (puo *PetUpdateOne) SetNillableType(pe *pet.Type) *PetUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*PetUpdateOne) SetOwner ¶
func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*PetUpdateOne) SetOwnerID ¶
func (puo *PetUpdateOne) SetOwnerID(id int) *PetUpdateOne
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*PetUpdateOne) SetType ¶
func (puo *PetUpdateOne) SetType(pe pet.Type) *PetUpdateOne
SetType sets the "type" field.
func (*PetUpdateOne) Where ¶
func (puo *PetUpdateOne) Where(ps ...predicate.Pet) *PetUpdateOne
Where appends a list predicates to the PetUpdate builder.
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 Settings ¶
type Settings struct { // ID of the ent. ID int `json:"id,omitempty"` // Time in which the resource was initially created. CreatedAt time.Time `json:"created_at"` // Time that the resource was last updated. UpdatedAt time.Time `json:"updated_at"` // Global banner text to apply to the frontend. GlobalBanner *string `json:"global_banner"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SettingsQuery when eager-loading is set. Edges SettingsEdges `json:"edges"` // contains filtered or unexported fields }
Settings is the model entity for the Settings schema.
func (*Settings) QueryAdmins ¶
QueryAdmins queries the "admins" edge of the Settings entity.
func (*Settings) Unwrap ¶
Unwrap unwraps the Settings 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 (*Settings) Update ¶
func (s *Settings) Update() *SettingsUpdateOne
Update returns a builder for updating this Settings. Note that you need to call Settings.Unwrap() before calling this method if this Settings was returned from a transaction, and the transaction was committed or rolled back.
type SettingsClient ¶
type SettingsClient struct {
// contains filtered or unexported fields
}
SettingsClient is a client for the Settings schema.
func NewSettingsClient ¶
func NewSettingsClient(c config) *SettingsClient
NewSettingsClient returns a client for the Settings from the given config.
func (*SettingsClient) Create ¶
func (c *SettingsClient) Create() *SettingsCreate
Create returns a builder for creating a Settings entity.
func (*SettingsClient) CreateBulk ¶
func (c *SettingsClient) CreateBulk(builders ...*SettingsCreate) *SettingsCreateBulk
CreateBulk returns a builder for creating a bulk of Settings entities.
func (*SettingsClient) Delete ¶
func (c *SettingsClient) Delete() *SettingsDelete
Delete returns a delete builder for Settings.
func (*SettingsClient) DeleteOne ¶
func (c *SettingsClient) DeleteOne(s *Settings) *SettingsDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SettingsClient) DeleteOneID ¶
func (c *SettingsClient) DeleteOneID(id int) *SettingsDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SettingsClient) GetX ¶
func (c *SettingsClient) GetX(ctx context.Context, id int) *Settings
GetX is like Get, but panics if an error occurs.
func (*SettingsClient) Hooks ¶
func (c *SettingsClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SettingsClient) Intercept ¶
func (c *SettingsClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `settings.Intercept(f(g(h())))`.
func (*SettingsClient) Interceptors ¶
func (c *SettingsClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SettingsClient) MapCreateBulk ¶
func (c *SettingsClient) MapCreateBulk(slice any, setFunc func(*SettingsCreate, int)) *SettingsCreateBulk
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 (*SettingsClient) Query ¶
func (c *SettingsClient) Query() *SettingsQuery
Query returns a query builder for Settings.
func (*SettingsClient) QueryAdmins ¶
func (c *SettingsClient) QueryAdmins(s *Settings) *UserQuery
QueryAdmins queries the admins edge of a Settings.
func (*SettingsClient) Update ¶
func (c *SettingsClient) Update() *SettingsUpdate
Update returns an update builder for Settings.
func (*SettingsClient) UpdateOne ¶
func (c *SettingsClient) UpdateOne(s *Settings) *SettingsUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SettingsClient) UpdateOneID ¶
func (c *SettingsClient) UpdateOneID(id int) *SettingsUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SettingsClient) Use ¶
func (c *SettingsClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `settings.Hooks(f(g(h())))`.
type SettingsCreate ¶
type SettingsCreate struct {
// contains filtered or unexported fields
}
SettingsCreate is the builder for creating a Settings entity.
func (*SettingsCreate) AddAdminIDs ¶
func (sc *SettingsCreate) AddAdminIDs(ids ...int) *SettingsCreate
AddAdminIDs adds the "admins" edge to the User entity by IDs.
func (*SettingsCreate) AddAdmins ¶
func (sc *SettingsCreate) AddAdmins(u ...*User) *SettingsCreate
AddAdmins adds the "admins" edges to the User entity.
func (*SettingsCreate) Exec ¶
func (sc *SettingsCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingsCreate) ExecX ¶
func (sc *SettingsCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingsCreate) Mutation ¶
func (sc *SettingsCreate) Mutation() *SettingsMutation
Mutation returns the SettingsMutation object of the builder.
func (*SettingsCreate) Save ¶
func (sc *SettingsCreate) Save(ctx context.Context) (*Settings, error)
Save creates the Settings in the database.
func (*SettingsCreate) SaveX ¶
func (sc *SettingsCreate) SaveX(ctx context.Context) *Settings
SaveX calls Save and panics if Save returns an error.
func (*SettingsCreate) SetCreatedAt ¶
func (sc *SettingsCreate) SetCreatedAt(t time.Time) *SettingsCreate
SetCreatedAt sets the "created_at" field.
func (*SettingsCreate) SetGlobalBanner ¶
func (sc *SettingsCreate) SetGlobalBanner(s string) *SettingsCreate
SetGlobalBanner sets the "global_banner" field.
func (*SettingsCreate) SetNillableCreatedAt ¶
func (sc *SettingsCreate) SetNillableCreatedAt(t *time.Time) *SettingsCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*SettingsCreate) SetNillableGlobalBanner ¶
func (sc *SettingsCreate) SetNillableGlobalBanner(s *string) *SettingsCreate
SetNillableGlobalBanner sets the "global_banner" field if the given value is not nil.
func (*SettingsCreate) SetNillableUpdatedAt ¶
func (sc *SettingsCreate) SetNillableUpdatedAt(t *time.Time) *SettingsCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*SettingsCreate) SetUpdatedAt ¶
func (sc *SettingsCreate) SetUpdatedAt(t time.Time) *SettingsCreate
SetUpdatedAt sets the "updated_at" field.
type SettingsCreateBulk ¶
type SettingsCreateBulk struct {
// contains filtered or unexported fields
}
SettingsCreateBulk is the builder for creating many Settings entities in bulk.
func (*SettingsCreateBulk) Exec ¶
func (scb *SettingsCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingsCreateBulk) ExecX ¶
func (scb *SettingsCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SettingsDelete ¶
type SettingsDelete struct {
// contains filtered or unexported fields
}
SettingsDelete is the builder for deleting a Settings entity.
func (*SettingsDelete) Exec ¶
func (sd *SettingsDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SettingsDelete) ExecX ¶
func (sd *SettingsDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SettingsDelete) Where ¶
func (sd *SettingsDelete) Where(ps ...predicate.Settings) *SettingsDelete
Where appends a list predicates to the SettingsDelete builder.
type SettingsDeleteOne ¶
type SettingsDeleteOne struct {
// contains filtered or unexported fields
}
SettingsDeleteOne is the builder for deleting a single Settings entity.
func (*SettingsDeleteOne) Exec ¶
func (sdo *SettingsDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SettingsDeleteOne) ExecX ¶
func (sdo *SettingsDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingsDeleteOne) Where ¶
func (sdo *SettingsDeleteOne) Where(ps ...predicate.Settings) *SettingsDeleteOne
Where appends a list predicates to the SettingsDelete builder.
type SettingsEdges ¶
type SettingsEdges struct { // Administrators for the platform. Admins []*User `json:"admins,omitempty"` // contains filtered or unexported fields }
SettingsEdges holds the relations/edges for other nodes in the graph.
func (SettingsEdges) AdminsOrErr ¶
func (e SettingsEdges) AdminsOrErr() ([]*User, error)
AdminsOrErr returns the Admins value or an error if the edge was not loaded in eager-loading.
type SettingsGroupBy ¶
type SettingsGroupBy struct {
// contains filtered or unexported fields
}
SettingsGroupBy is the group-by builder for Settings entities.
func (*SettingsGroupBy) Aggregate ¶
func (sgb *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SettingsGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SettingsGroupBy) Scan ¶
func (sgb *SettingsGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SettingsGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SettingsMutation ¶
type SettingsMutation struct {
// contains filtered or unexported fields
}
SettingsMutation represents an operation that mutates the Settings nodes in the graph.
func (*SettingsMutation) AddAdminIDs ¶
func (m *SettingsMutation) AddAdminIDs(ids ...int)
AddAdminIDs adds the "admins" edge to the User entity by ids.
func (*SettingsMutation) AddField ¶
func (m *SettingsMutation) 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 (*SettingsMutation) AddedEdges ¶
func (m *SettingsMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SettingsMutation) AddedField ¶
func (m *SettingsMutation) 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 (*SettingsMutation) AddedFields ¶
func (m *SettingsMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SettingsMutation) AddedIDs ¶
func (m *SettingsMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SettingsMutation) AdminsCleared ¶
func (m *SettingsMutation) AdminsCleared() bool
AdminsCleared reports if the "admins" edge to the User entity was cleared.
func (*SettingsMutation) AdminsIDs ¶
func (m *SettingsMutation) AdminsIDs() (ids []int)
AdminsIDs returns the "admins" edge IDs in the mutation.
func (*SettingsMutation) ClearAdmins ¶
func (m *SettingsMutation) ClearAdmins()
ClearAdmins clears the "admins" edge to the User entity.
func (*SettingsMutation) ClearEdge ¶
func (m *SettingsMutation) 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 (*SettingsMutation) ClearField ¶
func (m *SettingsMutation) 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 (*SettingsMutation) ClearGlobalBanner ¶
func (m *SettingsMutation) ClearGlobalBanner()
ClearGlobalBanner clears the value of the "global_banner" field.
func (*SettingsMutation) ClearedEdges ¶
func (m *SettingsMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SettingsMutation) ClearedFields ¶
func (m *SettingsMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SettingsMutation) Client ¶
func (m SettingsMutation) 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 (*SettingsMutation) CreatedAt ¶
func (m *SettingsMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*SettingsMutation) EdgeCleared ¶
func (m *SettingsMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SettingsMutation) Field ¶
func (m *SettingsMutation) 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 (*SettingsMutation) FieldCleared ¶
func (m *SettingsMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SettingsMutation) Fields ¶
func (m *SettingsMutation) 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 (*SettingsMutation) GlobalBanner ¶
func (m *SettingsMutation) GlobalBanner() (r string, exists bool)
GlobalBanner returns the value of the "global_banner" field in the mutation.
func (*SettingsMutation) GlobalBannerCleared ¶
func (m *SettingsMutation) GlobalBannerCleared() bool
GlobalBannerCleared returns if the "global_banner" field was cleared in this mutation.
func (*SettingsMutation) ID ¶
func (m *SettingsMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*SettingsMutation) IDs ¶
func (m *SettingsMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*SettingsMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) 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 (*SettingsMutation) OldGlobalBanner ¶
func (m *SettingsMutation) OldGlobalBanner(ctx context.Context) (v *string, err error)
OldGlobalBanner returns the old "global_banner" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) RemoveAdminIDs ¶
func (m *SettingsMutation) RemoveAdminIDs(ids ...int)
RemoveAdminIDs removes the "admins" edge to the User entity by IDs.
func (*SettingsMutation) RemovedAdminsIDs ¶
func (m *SettingsMutation) RemovedAdminsIDs() (ids []int)
RemovedAdmins returns the removed IDs of the "admins" edge to the User entity.
func (*SettingsMutation) RemovedEdges ¶
func (m *SettingsMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SettingsMutation) RemovedIDs ¶
func (m *SettingsMutation) 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 (*SettingsMutation) ResetAdmins ¶
func (m *SettingsMutation) ResetAdmins()
ResetAdmins resets all changes to the "admins" edge.
func (*SettingsMutation) ResetCreatedAt ¶
func (m *SettingsMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*SettingsMutation) ResetEdge ¶
func (m *SettingsMutation) 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 (*SettingsMutation) ResetField ¶
func (m *SettingsMutation) 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 (*SettingsMutation) ResetGlobalBanner ¶
func (m *SettingsMutation) ResetGlobalBanner()
ResetGlobalBanner resets all changes to the "global_banner" field.
func (*SettingsMutation) ResetUpdatedAt ¶
func (m *SettingsMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*SettingsMutation) SetCreatedAt ¶
func (m *SettingsMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*SettingsMutation) SetField ¶
func (m *SettingsMutation) 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 (*SettingsMutation) SetGlobalBanner ¶
func (m *SettingsMutation) SetGlobalBanner(s string)
SetGlobalBanner sets the "global_banner" field.
func (*SettingsMutation) SetOp ¶
func (m *SettingsMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SettingsMutation) SetUpdatedAt ¶
func (m *SettingsMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (SettingsMutation) Tx ¶
func (m SettingsMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SettingsMutation) Type ¶
func (m *SettingsMutation) Type() string
Type returns the node type of this mutation (Settings).
func (*SettingsMutation) UpdatedAt ¶
func (m *SettingsMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*SettingsMutation) Where ¶
func (m *SettingsMutation) Where(ps ...predicate.Settings)
Where appends a list predicates to the SettingsMutation builder.
func (*SettingsMutation) WhereP ¶
func (m *SettingsMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SettingsQuery ¶
type SettingsQuery struct {
// contains filtered or unexported fields
}
SettingsQuery is the builder for querying Settings entities.
func (*SettingsQuery) Aggregate ¶
func (sq *SettingsQuery) Aggregate(fns ...AggregateFunc) *SettingsSelect
Aggregate returns a SettingsSelect configured with the given aggregations.
func (*SettingsQuery) All ¶
func (sq *SettingsQuery) All(ctx context.Context) ([]*Settings, error)
All executes the query and returns a list of SettingsSlice.
func (*SettingsQuery) AllX ¶
func (sq *SettingsQuery) AllX(ctx context.Context) []*Settings
AllX is like All, but panics if an error occurs.
func (*SettingsQuery) Clone ¶
func (sq *SettingsQuery) Clone() *SettingsQuery
Clone returns a duplicate of the SettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SettingsQuery) Count ¶
func (sq *SettingsQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SettingsQuery) CountX ¶
func (sq *SettingsQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SettingsQuery) Exist ¶
func (sq *SettingsQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SettingsQuery) ExistX ¶
func (sq *SettingsQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SettingsQuery) First ¶
func (sq *SettingsQuery) First(ctx context.Context) (*Settings, error)
First returns the first Settings entity from the query. Returns a *NotFoundError when no Settings was found.
func (*SettingsQuery) FirstID ¶
func (sq *SettingsQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Settings ID from the query. Returns a *NotFoundError when no Settings ID was found.
func (*SettingsQuery) FirstIDX ¶
func (sq *SettingsQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SettingsQuery) FirstX ¶
func (sq *SettingsQuery) FirstX(ctx context.Context) *Settings
FirstX is like First, but panics if an error occurs.
func (*SettingsQuery) GroupBy ¶
func (sq *SettingsQuery) GroupBy(field string, fields ...string) *SettingsGroupBy
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 { CreatedAt time.Time `json:"created_at"` Count int `json:"count,omitempty"` } client.Settings.Query(). GroupBy(settings.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SettingsQuery) IDs ¶
func (sq *SettingsQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Settings IDs.
func (*SettingsQuery) IDsX ¶
func (sq *SettingsQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SettingsQuery) Limit ¶
func (sq *SettingsQuery) Limit(limit int) *SettingsQuery
Limit the number of records to be returned by this query.
func (*SettingsQuery) Offset ¶
func (sq *SettingsQuery) Offset(offset int) *SettingsQuery
Offset to start from.
func (*SettingsQuery) Only ¶
func (sq *SettingsQuery) Only(ctx context.Context) (*Settings, error)
Only returns a single Settings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Settings entity is found. Returns a *NotFoundError when no Settings entities are found.
func (*SettingsQuery) OnlyID ¶
func (sq *SettingsQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Settings ID in the query. Returns a *NotSingularError when more than one Settings ID is found. Returns a *NotFoundError when no entities are found.
func (*SettingsQuery) OnlyIDX ¶
func (sq *SettingsQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SettingsQuery) OnlyX ¶
func (sq *SettingsQuery) OnlyX(ctx context.Context) *Settings
OnlyX is like Only, but panics if an error occurs.
func (*SettingsQuery) Order ¶
func (sq *SettingsQuery) Order(o ...settings.OrderOption) *SettingsQuery
Order specifies how the records should be ordered.
func (*SettingsQuery) QueryAdmins ¶
func (sq *SettingsQuery) QueryAdmins() *UserQuery
QueryAdmins chains the current query on the "admins" edge.
func (*SettingsQuery) Select ¶
func (sq *SettingsQuery) Select(fields ...string) *SettingsSelect
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 { CreatedAt time.Time `json:"created_at"` } client.Settings.Query(). Select(settings.FieldCreatedAt). Scan(ctx, &v)
func (*SettingsQuery) Unique ¶
func (sq *SettingsQuery) Unique(unique bool) *SettingsQuery
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 (*SettingsQuery) Where ¶
func (sq *SettingsQuery) Where(ps ...predicate.Settings) *SettingsQuery
Where adds a new predicate for the SettingsQuery builder.
func (*SettingsQuery) WithAdmins ¶
func (sq *SettingsQuery) WithAdmins(opts ...func(*UserQuery)) *SettingsQuery
WithAdmins tells the query-builder to eager-load the nodes that are connected to the "admins" edge. The optional arguments are used to configure the query builder of the edge.
type SettingsSelect ¶
type SettingsSelect struct { *SettingsQuery // contains filtered or unexported fields }
SettingsSelect is the builder for selecting fields of Settings entities.
func (*SettingsSelect) Aggregate ¶
func (ss *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SettingsSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SettingsSelect) Scan ¶
func (ss *SettingsSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SettingsSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SettingsUpdate ¶
type SettingsUpdate struct {
// contains filtered or unexported fields
}
SettingsUpdate is the builder for updating Settings entities.
func (*SettingsUpdate) AddAdminIDs ¶
func (su *SettingsUpdate) AddAdminIDs(ids ...int) *SettingsUpdate
AddAdminIDs adds the "admins" edge to the User entity by IDs.
func (*SettingsUpdate) AddAdmins ¶
func (su *SettingsUpdate) AddAdmins(u ...*User) *SettingsUpdate
AddAdmins adds the "admins" edges to the User entity.
func (*SettingsUpdate) ClearAdmins ¶
func (su *SettingsUpdate) ClearAdmins() *SettingsUpdate
ClearAdmins clears all "admins" edges to the User entity.
func (*SettingsUpdate) ClearGlobalBanner ¶
func (su *SettingsUpdate) ClearGlobalBanner() *SettingsUpdate
ClearGlobalBanner clears the value of the "global_banner" field.
func (*SettingsUpdate) Exec ¶
func (su *SettingsUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingsUpdate) ExecX ¶
func (su *SettingsUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingsUpdate) Mutation ¶
func (su *SettingsUpdate) Mutation() *SettingsMutation
Mutation returns the SettingsMutation object of the builder.
func (*SettingsUpdate) RemoveAdminIDs ¶
func (su *SettingsUpdate) RemoveAdminIDs(ids ...int) *SettingsUpdate
RemoveAdminIDs removes the "admins" edge to User entities by IDs.
func (*SettingsUpdate) RemoveAdmins ¶
func (su *SettingsUpdate) RemoveAdmins(u ...*User) *SettingsUpdate
RemoveAdmins removes "admins" edges to User entities.
func (*SettingsUpdate) Save ¶
func (su *SettingsUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SettingsUpdate) SaveX ¶
func (su *SettingsUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SettingsUpdate) SetGlobalBanner ¶
func (su *SettingsUpdate) SetGlobalBanner(s string) *SettingsUpdate
SetGlobalBanner sets the "global_banner" field.
func (*SettingsUpdate) SetNillableGlobalBanner ¶
func (su *SettingsUpdate) SetNillableGlobalBanner(s *string) *SettingsUpdate
SetNillableGlobalBanner sets the "global_banner" field if the given value is not nil.
func (*SettingsUpdate) SetUpdatedAt ¶
func (su *SettingsUpdate) SetUpdatedAt(t time.Time) *SettingsUpdate
SetUpdatedAt sets the "updated_at" field.
func (*SettingsUpdate) Where ¶
func (su *SettingsUpdate) Where(ps ...predicate.Settings) *SettingsUpdate
Where appends a list predicates to the SettingsUpdate builder.
type SettingsUpdateOne ¶
type SettingsUpdateOne struct {
// contains filtered or unexported fields
}
SettingsUpdateOne is the builder for updating a single Settings entity.
func (*SettingsUpdateOne) AddAdminIDs ¶
func (suo *SettingsUpdateOne) AddAdminIDs(ids ...int) *SettingsUpdateOne
AddAdminIDs adds the "admins" edge to the User entity by IDs.
func (*SettingsUpdateOne) AddAdmins ¶
func (suo *SettingsUpdateOne) AddAdmins(u ...*User) *SettingsUpdateOne
AddAdmins adds the "admins" edges to the User entity.
func (*SettingsUpdateOne) ClearAdmins ¶
func (suo *SettingsUpdateOne) ClearAdmins() *SettingsUpdateOne
ClearAdmins clears all "admins" edges to the User entity.
func (*SettingsUpdateOne) ClearGlobalBanner ¶
func (suo *SettingsUpdateOne) ClearGlobalBanner() *SettingsUpdateOne
ClearGlobalBanner clears the value of the "global_banner" field.
func (*SettingsUpdateOne) Exec ¶
func (suo *SettingsUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SettingsUpdateOne) ExecX ¶
func (suo *SettingsUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingsUpdateOne) Mutation ¶
func (suo *SettingsUpdateOne) Mutation() *SettingsMutation
Mutation returns the SettingsMutation object of the builder.
func (*SettingsUpdateOne) RemoveAdminIDs ¶
func (suo *SettingsUpdateOne) RemoveAdminIDs(ids ...int) *SettingsUpdateOne
RemoveAdminIDs removes the "admins" edge to User entities by IDs.
func (*SettingsUpdateOne) RemoveAdmins ¶
func (suo *SettingsUpdateOne) RemoveAdmins(u ...*User) *SettingsUpdateOne
RemoveAdmins removes "admins" edges to User entities.
func (*SettingsUpdateOne) Save ¶
func (suo *SettingsUpdateOne) Save(ctx context.Context) (*Settings, error)
Save executes the query and returns the updated Settings entity.
func (*SettingsUpdateOne) SaveX ¶
func (suo *SettingsUpdateOne) SaveX(ctx context.Context) *Settings
SaveX is like Save, but panics if an error occurs.
func (*SettingsUpdateOne) Select ¶
func (suo *SettingsUpdateOne) Select(field string, fields ...string) *SettingsUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SettingsUpdateOne) SetGlobalBanner ¶
func (suo *SettingsUpdateOne) SetGlobalBanner(s string) *SettingsUpdateOne
SetGlobalBanner sets the "global_banner" field.
func (*SettingsUpdateOne) SetNillableGlobalBanner ¶
func (suo *SettingsUpdateOne) SetNillableGlobalBanner(s *string) *SettingsUpdateOne
SetNillableGlobalBanner sets the "global_banner" field if the given value is not nil.
func (*SettingsUpdateOne) SetUpdatedAt ¶
func (suo *SettingsUpdateOne) SetUpdatedAt(t time.Time) *SettingsUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*SettingsUpdateOne) Where ¶
func (suo *SettingsUpdateOne) Where(ps ...predicate.Settings) *SettingsUpdateOne
Where appends a list predicates to the SettingsUpdate builder.
type Skipped ¶
type Skipped struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name"` // contains filtered or unexported fields }
Skipped is the model entity for the Skipped schema.
func (*Skipped) Unwrap ¶
Unwrap unwraps the Skipped 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 (*Skipped) Update ¶
func (s *Skipped) Update() *SkippedUpdateOne
Update returns a builder for updating this Skipped. Note that you need to call Skipped.Unwrap() before calling this method if this Skipped was returned from a transaction, and the transaction was committed or rolled back.
type SkippedClient ¶
type SkippedClient struct {
// contains filtered or unexported fields
}
SkippedClient is a client for the Skipped schema.
func NewSkippedClient ¶
func NewSkippedClient(c config) *SkippedClient
NewSkippedClient returns a client for the Skipped from the given config.
func (*SkippedClient) Create ¶
func (c *SkippedClient) Create() *SkippedCreate
Create returns a builder for creating a Skipped entity.
func (*SkippedClient) CreateBulk ¶
func (c *SkippedClient) CreateBulk(builders ...*SkippedCreate) *SkippedCreateBulk
CreateBulk returns a builder for creating a bulk of Skipped entities.
func (*SkippedClient) Delete ¶
func (c *SkippedClient) Delete() *SkippedDelete
Delete returns a delete builder for Skipped.
func (*SkippedClient) DeleteOne ¶
func (c *SkippedClient) DeleteOne(s *Skipped) *SkippedDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SkippedClient) DeleteOneID ¶
func (c *SkippedClient) DeleteOneID(id int) *SkippedDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SkippedClient) GetX ¶
func (c *SkippedClient) GetX(ctx context.Context, id int) *Skipped
GetX is like Get, but panics if an error occurs.
func (*SkippedClient) Hooks ¶
func (c *SkippedClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SkippedClient) Intercept ¶
func (c *SkippedClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `skipped.Intercept(f(g(h())))`.
func (*SkippedClient) Interceptors ¶
func (c *SkippedClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SkippedClient) MapCreateBulk ¶
func (c *SkippedClient) MapCreateBulk(slice any, setFunc func(*SkippedCreate, int)) *SkippedCreateBulk
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 (*SkippedClient) Query ¶
func (c *SkippedClient) Query() *SkippedQuery
Query returns a query builder for Skipped.
func (*SkippedClient) Update ¶
func (c *SkippedClient) Update() *SkippedUpdate
Update returns an update builder for Skipped.
func (*SkippedClient) UpdateOne ¶
func (c *SkippedClient) UpdateOne(s *Skipped) *SkippedUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SkippedClient) UpdateOneID ¶
func (c *SkippedClient) UpdateOneID(id int) *SkippedUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SkippedClient) Use ¶
func (c *SkippedClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `skipped.Hooks(f(g(h())))`.
type SkippedCreate ¶
type SkippedCreate struct {
// contains filtered or unexported fields
}
SkippedCreate is the builder for creating a Skipped entity.
func (*SkippedCreate) Exec ¶
func (sc *SkippedCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SkippedCreate) ExecX ¶
func (sc *SkippedCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SkippedCreate) Mutation ¶
func (sc *SkippedCreate) Mutation() *SkippedMutation
Mutation returns the SkippedMutation object of the builder.
func (*SkippedCreate) Save ¶
func (sc *SkippedCreate) Save(ctx context.Context) (*Skipped, error)
Save creates the Skipped in the database.
func (*SkippedCreate) SaveX ¶
func (sc *SkippedCreate) SaveX(ctx context.Context) *Skipped
SaveX calls Save and panics if Save returns an error.
func (*SkippedCreate) SetName ¶
func (sc *SkippedCreate) SetName(s string) *SkippedCreate
SetName sets the "name" field.
type SkippedCreateBulk ¶
type SkippedCreateBulk struct {
// contains filtered or unexported fields
}
SkippedCreateBulk is the builder for creating many Skipped entities in bulk.
func (*SkippedCreateBulk) Exec ¶
func (scb *SkippedCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SkippedCreateBulk) ExecX ¶
func (scb *SkippedCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SkippedDelete ¶
type SkippedDelete struct {
// contains filtered or unexported fields
}
SkippedDelete is the builder for deleting a Skipped entity.
func (*SkippedDelete) Exec ¶
func (sd *SkippedDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SkippedDelete) ExecX ¶
func (sd *SkippedDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SkippedDelete) Where ¶
func (sd *SkippedDelete) Where(ps ...predicate.Skipped) *SkippedDelete
Where appends a list predicates to the SkippedDelete builder.
type SkippedDeleteOne ¶
type SkippedDeleteOne struct {
// contains filtered or unexported fields
}
SkippedDeleteOne is the builder for deleting a single Skipped entity.
func (*SkippedDeleteOne) Exec ¶
func (sdo *SkippedDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SkippedDeleteOne) ExecX ¶
func (sdo *SkippedDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SkippedDeleteOne) Where ¶
func (sdo *SkippedDeleteOne) Where(ps ...predicate.Skipped) *SkippedDeleteOne
Where appends a list predicates to the SkippedDelete builder.
type SkippedGroupBy ¶
type SkippedGroupBy struct {
// contains filtered or unexported fields
}
SkippedGroupBy is the group-by builder for Skipped entities.
func (*SkippedGroupBy) Aggregate ¶
func (sgb *SkippedGroupBy) Aggregate(fns ...AggregateFunc) *SkippedGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SkippedGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SkippedGroupBy) Scan ¶
func (sgb *SkippedGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SkippedGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SkippedMutation ¶
type SkippedMutation struct {
// contains filtered or unexported fields
}
SkippedMutation represents an operation that mutates the Skipped nodes in the graph.
func (*SkippedMutation) AddField ¶
func (m *SkippedMutation) 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 (*SkippedMutation) AddedEdges ¶
func (m *SkippedMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SkippedMutation) AddedField ¶
func (m *SkippedMutation) 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 (*SkippedMutation) AddedFields ¶
func (m *SkippedMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SkippedMutation) AddedIDs ¶
func (m *SkippedMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SkippedMutation) ClearEdge ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ClearField ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ClearedEdges ¶
func (m *SkippedMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SkippedMutation) ClearedFields ¶
func (m *SkippedMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SkippedMutation) Client ¶
func (m SkippedMutation) 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 (*SkippedMutation) EdgeCleared ¶
func (m *SkippedMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SkippedMutation) Field ¶
func (m *SkippedMutation) 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 (*SkippedMutation) FieldCleared ¶
func (m *SkippedMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SkippedMutation) Fields ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ID ¶
func (m *SkippedMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*SkippedMutation) IDs ¶
func (m *SkippedMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*SkippedMutation) Name ¶
func (m *SkippedMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*SkippedMutation) 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 (*SkippedMutation) OldName ¶
func (m *SkippedMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Skipped entity. If the Skipped 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 (*SkippedMutation) RemovedEdges ¶
func (m *SkippedMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SkippedMutation) RemovedIDs ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ResetEdge ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ResetField ¶
func (m *SkippedMutation) 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 (*SkippedMutation) ResetName ¶
func (m *SkippedMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*SkippedMutation) SetField ¶
func (m *SkippedMutation) 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 (*SkippedMutation) SetName ¶
func (m *SkippedMutation) SetName(s string)
SetName sets the "name" field.
func (*SkippedMutation) SetOp ¶
func (m *SkippedMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (SkippedMutation) Tx ¶
func (m SkippedMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SkippedMutation) Type ¶
func (m *SkippedMutation) Type() string
Type returns the node type of this mutation (Skipped).
func (*SkippedMutation) Where ¶
func (m *SkippedMutation) Where(ps ...predicate.Skipped)
Where appends a list predicates to the SkippedMutation builder.
func (*SkippedMutation) WhereP ¶
func (m *SkippedMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SkippedMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SkippedQuery ¶
type SkippedQuery struct {
// contains filtered or unexported fields
}
SkippedQuery is the builder for querying Skipped entities.
func (*SkippedQuery) Aggregate ¶
func (sq *SkippedQuery) Aggregate(fns ...AggregateFunc) *SkippedSelect
Aggregate returns a SkippedSelect configured with the given aggregations.
func (*SkippedQuery) All ¶
func (sq *SkippedQuery) All(ctx context.Context) ([]*Skipped, error)
All executes the query and returns a list of Skippeds.
func (*SkippedQuery) AllX ¶
func (sq *SkippedQuery) AllX(ctx context.Context) []*Skipped
AllX is like All, but panics if an error occurs.
func (*SkippedQuery) Clone ¶
func (sq *SkippedQuery) Clone() *SkippedQuery
Clone returns a duplicate of the SkippedQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SkippedQuery) Count ¶
func (sq *SkippedQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SkippedQuery) CountX ¶
func (sq *SkippedQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SkippedQuery) Exist ¶
func (sq *SkippedQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SkippedQuery) ExistX ¶
func (sq *SkippedQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SkippedQuery) First ¶
func (sq *SkippedQuery) First(ctx context.Context) (*Skipped, error)
First returns the first Skipped entity from the query. Returns a *NotFoundError when no Skipped was found.
func (*SkippedQuery) FirstID ¶
func (sq *SkippedQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Skipped ID from the query. Returns a *NotFoundError when no Skipped ID was found.
func (*SkippedQuery) FirstIDX ¶
func (sq *SkippedQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SkippedQuery) FirstX ¶
func (sq *SkippedQuery) FirstX(ctx context.Context) *Skipped
FirstX is like First, but panics if an error occurs.
func (*SkippedQuery) GroupBy ¶
func (sq *SkippedQuery) GroupBy(field string, fields ...string) *SkippedGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name"` Count int `json:"count,omitempty"` } client.Skipped.Query(). GroupBy(skipped.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SkippedQuery) IDs ¶
func (sq *SkippedQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Skipped IDs.
func (*SkippedQuery) IDsX ¶
func (sq *SkippedQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SkippedQuery) Limit ¶
func (sq *SkippedQuery) Limit(limit int) *SkippedQuery
Limit the number of records to be returned by this query.
func (*SkippedQuery) Offset ¶
func (sq *SkippedQuery) Offset(offset int) *SkippedQuery
Offset to start from.
func (*SkippedQuery) Only ¶
func (sq *SkippedQuery) Only(ctx context.Context) (*Skipped, error)
Only returns a single Skipped entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Skipped entity is found. Returns a *NotFoundError when no Skipped entities are found.
func (*SkippedQuery) OnlyID ¶
func (sq *SkippedQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Skipped ID in the query. Returns a *NotSingularError when more than one Skipped ID is found. Returns a *NotFoundError when no entities are found.
func (*SkippedQuery) OnlyIDX ¶
func (sq *SkippedQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SkippedQuery) OnlyX ¶
func (sq *SkippedQuery) OnlyX(ctx context.Context) *Skipped
OnlyX is like Only, but panics if an error occurs.
func (*SkippedQuery) Order ¶
func (sq *SkippedQuery) Order(o ...skipped.OrderOption) *SkippedQuery
Order specifies how the records should be ordered.
func (*SkippedQuery) Select ¶
func (sq *SkippedQuery) Select(fields ...string) *SkippedSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name"` } client.Skipped.Query(). Select(skipped.FieldName). Scan(ctx, &v)
func (*SkippedQuery) Unique ¶
func (sq *SkippedQuery) Unique(unique bool) *SkippedQuery
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 (*SkippedQuery) Where ¶
func (sq *SkippedQuery) Where(ps ...predicate.Skipped) *SkippedQuery
Where adds a new predicate for the SkippedQuery builder.
type SkippedSelect ¶
type SkippedSelect struct { *SkippedQuery // contains filtered or unexported fields }
SkippedSelect is the builder for selecting fields of Skipped entities.
func (*SkippedSelect) Aggregate ¶
func (ss *SkippedSelect) Aggregate(fns ...AggregateFunc) *SkippedSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SkippedSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SkippedSelect) Scan ¶
func (ss *SkippedSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SkippedSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SkippedUpdate ¶
type SkippedUpdate struct {
// contains filtered or unexported fields
}
SkippedUpdate is the builder for updating Skipped entities.
func (*SkippedUpdate) Exec ¶
func (su *SkippedUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SkippedUpdate) ExecX ¶
func (su *SkippedUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SkippedUpdate) Mutation ¶
func (su *SkippedUpdate) Mutation() *SkippedMutation
Mutation returns the SkippedMutation object of the builder.
func (*SkippedUpdate) Save ¶
func (su *SkippedUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SkippedUpdate) SaveX ¶
func (su *SkippedUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SkippedUpdate) SetName ¶
func (su *SkippedUpdate) SetName(s string) *SkippedUpdate
SetName sets the "name" field.
func (*SkippedUpdate) SetNillableName ¶
func (su *SkippedUpdate) SetNillableName(s *string) *SkippedUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*SkippedUpdate) Where ¶
func (su *SkippedUpdate) Where(ps ...predicate.Skipped) *SkippedUpdate
Where appends a list predicates to the SkippedUpdate builder.
type SkippedUpdateOne ¶
type SkippedUpdateOne struct {
// contains filtered or unexported fields
}
SkippedUpdateOne is the builder for updating a single Skipped entity.
func (*SkippedUpdateOne) Exec ¶
func (suo *SkippedUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SkippedUpdateOne) ExecX ¶
func (suo *SkippedUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SkippedUpdateOne) Mutation ¶
func (suo *SkippedUpdateOne) Mutation() *SkippedMutation
Mutation returns the SkippedMutation object of the builder.
func (*SkippedUpdateOne) Save ¶
func (suo *SkippedUpdateOne) Save(ctx context.Context) (*Skipped, error)
Save executes the query and returns the updated Skipped entity.
func (*SkippedUpdateOne) SaveX ¶
func (suo *SkippedUpdateOne) SaveX(ctx context.Context) *Skipped
SaveX is like Save, but panics if an error occurs.
func (*SkippedUpdateOne) Select ¶
func (suo *SkippedUpdateOne) Select(field string, fields ...string) *SkippedUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SkippedUpdateOne) SetName ¶
func (suo *SkippedUpdateOne) SetName(s string) *SkippedUpdateOne
SetName sets the "name" field.
func (*SkippedUpdateOne) SetNillableName ¶
func (suo *SkippedUpdateOne) SetNillableName(s *string) *SkippedUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*SkippedUpdateOne) Where ¶
func (suo *SkippedUpdateOne) Where(ps ...predicate.Skipped) *SkippedUpdateOne
Where appends a list predicates to the SkippedUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Category is the client for interacting with the Category builders. Category *CategoryClient // Follows is the client for interacting with the Follows builders. Follows *FollowsClient // Friendship is the client for interacting with the Friendship builders. Friendship *FriendshipClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // Settings is the client for interacting with the Settings builders. Settings *SettingsClient // Skipped is the client for interacting with the Skipped builders. Skipped *SkippedClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Time in which the resource was initially created. CreatedAt time.Time `json:"created_at"` // Time that the resource was last updated. UpdatedAt time.Time `json:"updated_at"` // Name of the user. Name string `json:"name"` // Type of object being defined (user or system which is for internal usecases). Type user.Type `json:"type"` // Full name if USER, otherwise null. Description *string `json:"description"` // If the user is still in the source system. Enabled bool `json:"enabled"` // Email associated with the user. Note that not all users have an associated email address. Email *string `json:"email"` // Avatar data for the user. This should generally only apply to the USER user type. Avatar *[]byte `json:"-"` // Hashed password for the user, this shouldn't be readable in the spec anywhere. PasswordHashed string `json:"-"` // The github user raw JSON data. GithubData *github.User `json:"github_data"` // ProfileURL holds the value of the "profile_url" field. ProfileURL *schema.ExampleValuer `json:"profile_url"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryFollowedPets ¶
QueryFollowedPets queries the "followed_pets" edge of the User entity.
func (*User) QueryFollowing ¶
func (u *User) QueryFollowing() *FollowsQuery
QueryFollowing queries the "following" edge of the User entity.
func (*User) QueryFriends ¶
QueryFriends queries the "friends" edge of the User entity.
func (*User) QueryFriendships ¶
func (u *User) QueryFriendships() *FriendshipQuery
QueryFriendships queries the "friendships" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryFollowedPets ¶
func (c *UserClient) QueryFollowedPets(u *User) *PetQuery
QueryFollowedPets queries the followed_pets edge of a User.
func (*UserClient) QueryFollowing ¶
func (c *UserClient) QueryFollowing(u *User) *FollowsQuery
QueryFollowing queries the following edge of a User.
func (*UserClient) QueryFriends ¶
func (c *UserClient) QueryFriends(u *User) *UserQuery
QueryFriends queries the friends edge of a User.
func (*UserClient) QueryFriendships ¶
func (c *UserClient) QueryFriendships(u *User) *FriendshipQuery
QueryFriendships queries the friendships edge of a User.
func (*UserClient) QueryPets ¶
func (c *UserClient) QueryPets(u *User) *PetQuery
QueryPets queries the pets edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddFollowedPetIDs ¶
func (uc *UserCreate) AddFollowedPetIDs(ids ...int) *UserCreate
AddFollowedPetIDs adds the "followed_pets" edge to the Pet entity by IDs.
func (*UserCreate) AddFollowedPets ¶
func (uc *UserCreate) AddFollowedPets(p ...*Pet) *UserCreate
AddFollowedPets adds the "followed_pets" edges to the Pet entity.
func (*UserCreate) AddFriendIDs ¶
func (uc *UserCreate) AddFriendIDs(ids ...int) *UserCreate
AddFriendIDs adds the "friends" edge to the User entity by IDs.
func (*UserCreate) AddFriends ¶
func (uc *UserCreate) AddFriends(u ...*User) *UserCreate
AddFriends adds the "friends" edges to the User entity.
func (*UserCreate) AddFriendshipIDs ¶
func (uc *UserCreate) AddFriendshipIDs(ids ...int) *UserCreate
AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.
func (*UserCreate) AddFriendships ¶
func (uc *UserCreate) AddFriendships(f ...*Friendship) *UserCreate
AddFriendships adds the "friendships" edges to the Friendship entity.
func (*UserCreate) AddPetIDs ¶
func (uc *UserCreate) AddPetIDs(ids ...int) *UserCreate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserCreate) AddPets ¶
func (uc *UserCreate) AddPets(p ...*Pet) *UserCreate
AddPets adds the "pets" edges to the Pet entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAvatar ¶
func (uc *UserCreate) SetAvatar(b []byte) *UserCreate
SetAvatar sets the "avatar" field.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetDescription ¶
func (uc *UserCreate) SetDescription(s string) *UserCreate
SetDescription sets the "description" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetEnabled ¶
func (uc *UserCreate) SetEnabled(b bool) *UserCreate
SetEnabled sets the "enabled" field.
func (*UserCreate) SetGithubData ¶
func (uc *UserCreate) SetGithubData(gi *github.User) *UserCreate
SetGithubData sets the "github_data" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(i int) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableDescription ¶
func (uc *UserCreate) SetNillableDescription(s *string) *UserCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*UserCreate) SetNillableEmail ¶
func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserCreate) SetNillableEnabled ¶
func (uc *UserCreate) SetNillableEnabled(b *bool) *UserCreate
SetNillableEnabled sets the "enabled" field if the given value is not nil.
func (*UserCreate) SetNillableType ¶
func (uc *UserCreate) SetNillableType(u *user.Type) *UserCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetPasswordHashed ¶
func (uc *UserCreate) SetPasswordHashed(s string) *UserCreate
SetPasswordHashed sets the "password_hashed" field.
func (*UserCreate) SetProfileURL ¶
func (uc *UserCreate) SetProfileURL(sv *schema.ExampleValuer) *UserCreate
SetProfileURL sets the "profile_url" field.
func (*UserCreate) SetType ¶
func (uc *UserCreate) SetType(u user.Type) *UserCreate
SetType sets the "type" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Pets owned by the user. Pets []*Pet `json:"pets,omitempty"` // Pets that the user is following. FollowedPets []*Pet `json:"followed_pets,omitempty"` // Friends of the user. Friends []*User `json:"friends,omitempty"` // Following holds the value of the following edge. Following []*Follows `json:"following,omitempty"` // Friendships holds the value of the friendships edge. Friendships []*Friendship `json:"friendships,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) FollowedPetsOrErr ¶
FollowedPetsOrErr returns the FollowedPets value or an error if the edge was not loaded in eager-loading.
func (UserEdges) FollowingOrErr ¶
FollowingOrErr returns the Following value or an error if the edge was not loaded in eager-loading.
func (UserEdges) FriendsOrErr ¶
FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.
func (UserEdges) FriendshipsOrErr ¶
func (e UserEdges) FriendshipsOrErr() ([]*Friendship, error)
FriendshipsOrErr returns the Friendships value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddFollowedPetIDs ¶
func (m *UserMutation) AddFollowedPetIDs(ids ...int)
AddFollowedPetIDs adds the "followed_pets" edge to the Pet entity by ids.
func (*UserMutation) AddFriendIDs ¶
func (m *UserMutation) AddFriendIDs(ids ...int)
AddFriendIDs adds the "friends" edge to the User entity by ids.
func (*UserMutation) AddFriendshipIDs ¶
func (m *UserMutation) AddFriendshipIDs(ids ...int)
AddFriendshipIDs adds the "friendships" edge to the Friendship entity by ids.
func (*UserMutation) AddPetIDs ¶
func (m *UserMutation) AddPetIDs(ids ...int)
AddPetIDs adds the "pets" edge to the Pet entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) Avatar ¶
func (m *UserMutation) Avatar() (r []byte, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*UserMutation) AvatarCleared ¶
func (m *UserMutation) AvatarCleared() bool
AvatarCleared returns if the "avatar" field was cleared in this mutation.
func (*UserMutation) ClearAvatar ¶
func (m *UserMutation) ClearAvatar()
ClearAvatar clears the value of the "avatar" field.
func (*UserMutation) ClearDescription ¶
func (m *UserMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearEmail ¶
func (m *UserMutation) ClearEmail()
ClearEmail clears the value of the "email" field.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearFollowedPets ¶
func (m *UserMutation) ClearFollowedPets()
ClearFollowedPets clears the "followed_pets" edge to the Pet entity.
func (*UserMutation) ClearFriends ¶
func (m *UserMutation) ClearFriends()
ClearFriends clears the "friends" edge to the User entity.
func (*UserMutation) ClearFriendships ¶
func (m *UserMutation) ClearFriendships()
ClearFriendships clears the "friendships" edge to the Friendship entity.
func (*UserMutation) ClearGithubData ¶
func (m *UserMutation) ClearGithubData()
ClearGithubData clears the value of the "github_data" field.
func (*UserMutation) ClearPets ¶
func (m *UserMutation) ClearPets()
ClearPets clears the "pets" edge to the Pet entity.
func (*UserMutation) ClearProfileURL ¶
func (m *UserMutation) ClearProfileURL()
ClearProfileURL clears the value of the "profile_url" field.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) Description ¶
func (m *UserMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*UserMutation) DescriptionCleared ¶
func (m *UserMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) EmailCleared ¶
func (m *UserMutation) EmailCleared() bool
EmailCleared returns if the "email" field was cleared in this mutation.
func (*UserMutation) Enabled ¶
func (m *UserMutation) Enabled() (r bool, exists bool)
Enabled returns the value of the "enabled" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) FollowedPetsCleared ¶
func (m *UserMutation) FollowedPetsCleared() bool
FollowedPetsCleared reports if the "followed_pets" edge to the Pet entity was cleared.
func (*UserMutation) FollowedPetsIDs ¶
func (m *UserMutation) FollowedPetsIDs() (ids []int)
FollowedPetsIDs returns the "followed_pets" edge IDs in the mutation.
func (*UserMutation) FriendsCleared ¶
func (m *UserMutation) FriendsCleared() bool
FriendsCleared reports if the "friends" edge to the User entity was cleared.
func (*UserMutation) FriendsIDs ¶
func (m *UserMutation) FriendsIDs() (ids []int)
FriendsIDs returns the "friends" edge IDs in the mutation.
func (*UserMutation) FriendshipsCleared ¶
func (m *UserMutation) FriendshipsCleared() bool
FriendshipsCleared reports if the "friendships" edge to the Friendship entity was cleared.
func (*UserMutation) FriendshipsIDs ¶
func (m *UserMutation) FriendshipsIDs() (ids []int)
FriendshipsIDs returns the "friendships" edge IDs in the mutation.
func (*UserMutation) GetType ¶
func (m *UserMutation) GetType() (r user.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*UserMutation) GithubData ¶
func (m *UserMutation) GithubData() (r *github.User, exists bool)
GithubData returns the value of the "github_data" field in the mutation.
func (*UserMutation) GithubDataCleared ¶
func (m *UserMutation) GithubDataCleared() bool
GithubDataCleared returns if the "github_data" field was cleared in this mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) OldAvatar ¶
func (m *UserMutation) OldAvatar(ctx context.Context) (v *[]byte, err error)
OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldDescription ¶
func (m *UserMutation) OldDescription(ctx context.Context) (v *string, err error)
OldDescription returns the old "description" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEnabled ¶
func (m *UserMutation) OldEnabled(ctx context.Context) (v bool, err error)
OldEnabled returns the old "enabled" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldGithubData ¶
OldGithubData returns the old "github_data" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPasswordHashed ¶
func (m *UserMutation) OldPasswordHashed(ctx context.Context) (v string, err error)
OldPasswordHashed returns the old "password_hashed" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldProfileURL ¶
func (m *UserMutation) OldProfileURL(ctx context.Context) (v *schema.ExampleValuer, err error)
OldProfileURL returns the old "profile_url" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldType ¶
OldType returns the old "type" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) PasswordHashed ¶
func (m *UserMutation) PasswordHashed() (r string, exists bool)
PasswordHashed returns the value of the "password_hashed" field in the mutation.
func (*UserMutation) PetsCleared ¶
func (m *UserMutation) PetsCleared() bool
PetsCleared reports if the "pets" edge to the Pet entity was cleared.
func (*UserMutation) PetsIDs ¶
func (m *UserMutation) PetsIDs() (ids []int)
PetsIDs returns the "pets" edge IDs in the mutation.
func (*UserMutation) ProfileURL ¶
func (m *UserMutation) ProfileURL() (r *schema.ExampleValuer, exists bool)
ProfileURL returns the value of the "profile_url" field in the mutation.
func (*UserMutation) ProfileURLCleared ¶
func (m *UserMutation) ProfileURLCleared() bool
ProfileURLCleared returns if the "profile_url" field was cleared in this mutation.
func (*UserMutation) RemoveFollowedPetIDs ¶
func (m *UserMutation) RemoveFollowedPetIDs(ids ...int)
RemoveFollowedPetIDs removes the "followed_pets" edge to the Pet entity by IDs.
func (*UserMutation) RemoveFriendIDs ¶
func (m *UserMutation) RemoveFriendIDs(ids ...int)
RemoveFriendIDs removes the "friends" edge to the User entity by IDs.
func (*UserMutation) RemoveFriendshipIDs ¶
func (m *UserMutation) RemoveFriendshipIDs(ids ...int)
RemoveFriendshipIDs removes the "friendships" edge to the Friendship entity by IDs.
func (*UserMutation) RemovePetIDs ¶
func (m *UserMutation) RemovePetIDs(ids ...int)
RemovePetIDs removes the "pets" edge to the Pet entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedFollowedPetsIDs ¶
func (m *UserMutation) RemovedFollowedPetsIDs() (ids []int)
RemovedFollowedPets returns the removed IDs of the "followed_pets" edge to the Pet entity.
func (*UserMutation) RemovedFriendsIDs ¶
func (m *UserMutation) RemovedFriendsIDs() (ids []int)
RemovedFriends returns the removed IDs of the "friends" edge to the User entity.
func (*UserMutation) RemovedFriendshipsIDs ¶
func (m *UserMutation) RemovedFriendshipsIDs() (ids []int)
RemovedFriendships returns the removed IDs of the "friendships" edge to the Friendship entity.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedPetsIDs ¶
func (m *UserMutation) RemovedPetsIDs() (ids []int)
RemovedPets returns the removed IDs of the "pets" edge to the Pet entity.
func (*UserMutation) ResetAvatar ¶
func (m *UserMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetDescription ¶
func (m *UserMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetEnabled ¶
func (m *UserMutation) ResetEnabled()
ResetEnabled resets all changes to the "enabled" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetFollowedPets ¶
func (m *UserMutation) ResetFollowedPets()
ResetFollowedPets resets all changes to the "followed_pets" edge.
func (*UserMutation) ResetFriends ¶
func (m *UserMutation) ResetFriends()
ResetFriends resets all changes to the "friends" edge.
func (*UserMutation) ResetFriendships ¶
func (m *UserMutation) ResetFriendships()
ResetFriendships resets all changes to the "friendships" edge.
func (*UserMutation) ResetGithubData ¶
func (m *UserMutation) ResetGithubData()
ResetGithubData resets all changes to the "github_data" field.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetPasswordHashed ¶
func (m *UserMutation) ResetPasswordHashed()
ResetPasswordHashed resets all changes to the "password_hashed" field.
func (*UserMutation) ResetPets ¶
func (m *UserMutation) ResetPets()
ResetPets resets all changes to the "pets" edge.
func (*UserMutation) ResetProfileURL ¶
func (m *UserMutation) ResetProfileURL()
ResetProfileURL resets all changes to the "profile_url" field.
func (*UserMutation) ResetType ¶
func (m *UserMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) SetAvatar ¶
func (m *UserMutation) SetAvatar(b []byte)
SetAvatar sets the "avatar" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetDescription ¶
func (m *UserMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetEnabled ¶
func (m *UserMutation) SetEnabled(b bool)
SetEnabled sets the "enabled" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetGithubData ¶
func (m *UserMutation) SetGithubData(gi *github.User)
SetGithubData sets the "github_data" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPasswordHashed ¶
func (m *UserMutation) SetPasswordHashed(s string)
SetPasswordHashed sets the "password_hashed" field.
func (*UserMutation) SetProfileURL ¶
func (m *UserMutation) SetProfileURL(sv *schema.ExampleValuer)
SetProfileURL sets the "profile_url" field.
func (*UserMutation) SetType ¶
func (m *UserMutation) SetType(u user.Type)
SetType sets the "type" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryFollowedPets ¶
QueryFollowedPets chains the current query on the "followed_pets" edge.
func (*UserQuery) QueryFollowing ¶
func (uq *UserQuery) QueryFollowing() *FollowsQuery
QueryFollowing chains the current query on the "following" edge.
func (*UserQuery) QueryFriends ¶
QueryFriends chains the current query on the "friends" edge.
func (*UserQuery) QueryFriendships ¶
func (uq *UserQuery) QueryFriendships() *FriendshipQuery
QueryFriendships chains the current query on the "friendships" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithFollowedPets ¶
WithFollowedPets tells the query-builder to eager-load the nodes that are connected to the "followed_pets" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithFollowing ¶
func (uq *UserQuery) WithFollowing(opts ...func(*FollowsQuery)) *UserQuery
WithFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithFriends ¶
WithFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithFriendships ¶
func (uq *UserQuery) WithFriendships(opts ...func(*FriendshipQuery)) *UserQuery
WithFriendships tells the query-builder to eager-load the nodes that are connected to the "friendships" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddFollowedPetIDs ¶
func (uu *UserUpdate) AddFollowedPetIDs(ids ...int) *UserUpdate
AddFollowedPetIDs adds the "followed_pets" edge to the Pet entity by IDs.
func (*UserUpdate) AddFollowedPets ¶
func (uu *UserUpdate) AddFollowedPets(p ...*Pet) *UserUpdate
AddFollowedPets adds the "followed_pets" edges to the Pet entity.
func (*UserUpdate) AddFriendIDs ¶
func (uu *UserUpdate) AddFriendIDs(ids ...int) *UserUpdate
AddFriendIDs adds the "friends" edge to the User entity by IDs.
func (*UserUpdate) AddFriends ¶
func (uu *UserUpdate) AddFriends(u ...*User) *UserUpdate
AddFriends adds the "friends" edges to the User entity.
func (*UserUpdate) AddFriendshipIDs ¶
func (uu *UserUpdate) AddFriendshipIDs(ids ...int) *UserUpdate
AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.
func (*UserUpdate) AddFriendships ¶
func (uu *UserUpdate) AddFriendships(f ...*Friendship) *UserUpdate
AddFriendships adds the "friendships" edges to the Friendship entity.
func (*UserUpdate) AddPetIDs ¶
func (uu *UserUpdate) AddPetIDs(ids ...int) *UserUpdate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserUpdate) AddPets ¶
func (uu *UserUpdate) AddPets(p ...*Pet) *UserUpdate
AddPets adds the "pets" edges to the Pet entity.
func (*UserUpdate) ClearAvatar ¶
func (uu *UserUpdate) ClearAvatar() *UserUpdate
ClearAvatar clears the value of the "avatar" field.
func (*UserUpdate) ClearDescription ¶
func (uu *UserUpdate) ClearDescription() *UserUpdate
ClearDescription clears the value of the "description" field.
func (*UserUpdate) ClearEmail ¶
func (uu *UserUpdate) ClearEmail() *UserUpdate
ClearEmail clears the value of the "email" field.
func (*UserUpdate) ClearFollowedPets ¶
func (uu *UserUpdate) ClearFollowedPets() *UserUpdate
ClearFollowedPets clears all "followed_pets" edges to the Pet entity.
func (*UserUpdate) ClearFriends ¶
func (uu *UserUpdate) ClearFriends() *UserUpdate
ClearFriends clears all "friends" edges to the User entity.
func (*UserUpdate) ClearFriendships ¶
func (uu *UserUpdate) ClearFriendships() *UserUpdate
ClearFriendships clears all "friendships" edges to the Friendship entity.
func (*UserUpdate) ClearGithubData ¶
func (uu *UserUpdate) ClearGithubData() *UserUpdate
ClearGithubData clears the value of the "github_data" field.
func (*UserUpdate) ClearPets ¶
func (uu *UserUpdate) ClearPets() *UserUpdate
ClearPets clears all "pets" edges to the Pet entity.
func (*UserUpdate) ClearProfileURL ¶
func (uu *UserUpdate) ClearProfileURL() *UserUpdate
ClearProfileURL clears the value of the "profile_url" field.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveFollowedPetIDs ¶
func (uu *UserUpdate) RemoveFollowedPetIDs(ids ...int) *UserUpdate
RemoveFollowedPetIDs removes the "followed_pets" edge to Pet entities by IDs.
func (*UserUpdate) RemoveFollowedPets ¶
func (uu *UserUpdate) RemoveFollowedPets(p ...*Pet) *UserUpdate
RemoveFollowedPets removes "followed_pets" edges to Pet entities.
func (*UserUpdate) RemoveFriendIDs ¶
func (uu *UserUpdate) RemoveFriendIDs(ids ...int) *UserUpdate
RemoveFriendIDs removes the "friends" edge to User entities by IDs.
func (*UserUpdate) RemoveFriends ¶
func (uu *UserUpdate) RemoveFriends(u ...*User) *UserUpdate
RemoveFriends removes "friends" edges to User entities.
func (*UserUpdate) RemoveFriendshipIDs ¶
func (uu *UserUpdate) RemoveFriendshipIDs(ids ...int) *UserUpdate
RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.
func (*UserUpdate) RemoveFriendships ¶
func (uu *UserUpdate) RemoveFriendships(f ...*Friendship) *UserUpdate
RemoveFriendships removes "friendships" edges to Friendship entities.
func (*UserUpdate) RemovePetIDs ¶
func (uu *UserUpdate) RemovePetIDs(ids ...int) *UserUpdate
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*UserUpdate) RemovePets ¶
func (uu *UserUpdate) RemovePets(p ...*Pet) *UserUpdate
RemovePets removes "pets" edges to Pet entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAvatar ¶
func (uu *UserUpdate) SetAvatar(b []byte) *UserUpdate
SetAvatar sets the "avatar" field.
func (*UserUpdate) SetDescription ¶
func (uu *UserUpdate) SetDescription(s string) *UserUpdate
SetDescription sets the "description" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetEnabled ¶
func (uu *UserUpdate) SetEnabled(b bool) *UserUpdate
SetEnabled sets the "enabled" field.
func (*UserUpdate) SetGithubData ¶
func (uu *UserUpdate) SetGithubData(gi *github.User) *UserUpdate
SetGithubData sets the "github_data" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableDescription ¶
func (uu *UserUpdate) SetNillableDescription(s *string) *UserUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableEnabled ¶
func (uu *UserUpdate) SetNillableEnabled(b *bool) *UserUpdate
SetNillableEnabled sets the "enabled" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillablePasswordHashed ¶
func (uu *UserUpdate) SetNillablePasswordHashed(s *string) *UserUpdate
SetNillablePasswordHashed sets the "password_hashed" field if the given value is not nil.
func (*UserUpdate) SetNillableType ¶
func (uu *UserUpdate) SetNillableType(u *user.Type) *UserUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*UserUpdate) SetPasswordHashed ¶
func (uu *UserUpdate) SetPasswordHashed(s string) *UserUpdate
SetPasswordHashed sets the "password_hashed" field.
func (*UserUpdate) SetProfileURL ¶
func (uu *UserUpdate) SetProfileURL(sv *schema.ExampleValuer) *UserUpdate
SetProfileURL sets the "profile_url" field.
func (*UserUpdate) SetType ¶
func (uu *UserUpdate) SetType(u user.Type) *UserUpdate
SetType sets the "type" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddFollowedPetIDs ¶
func (uuo *UserUpdateOne) AddFollowedPetIDs(ids ...int) *UserUpdateOne
AddFollowedPetIDs adds the "followed_pets" edge to the Pet entity by IDs.
func (*UserUpdateOne) AddFollowedPets ¶
func (uuo *UserUpdateOne) AddFollowedPets(p ...*Pet) *UserUpdateOne
AddFollowedPets adds the "followed_pets" edges to the Pet entity.
func (*UserUpdateOne) AddFriendIDs ¶
func (uuo *UserUpdateOne) AddFriendIDs(ids ...int) *UserUpdateOne
AddFriendIDs adds the "friends" edge to the User entity by IDs.
func (*UserUpdateOne) AddFriends ¶
func (uuo *UserUpdateOne) AddFriends(u ...*User) *UserUpdateOne
AddFriends adds the "friends" edges to the User entity.
func (*UserUpdateOne) AddFriendshipIDs ¶
func (uuo *UserUpdateOne) AddFriendshipIDs(ids ...int) *UserUpdateOne
AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.
func (*UserUpdateOne) AddFriendships ¶
func (uuo *UserUpdateOne) AddFriendships(f ...*Friendship) *UserUpdateOne
AddFriendships adds the "friendships" edges to the Friendship entity.
func (*UserUpdateOne) AddPetIDs ¶
func (uuo *UserUpdateOne) AddPetIDs(ids ...int) *UserUpdateOne
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserUpdateOne) AddPets ¶
func (uuo *UserUpdateOne) AddPets(p ...*Pet) *UserUpdateOne
AddPets adds the "pets" edges to the Pet entity.
func (*UserUpdateOne) ClearAvatar ¶
func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne
ClearAvatar clears the value of the "avatar" field.
func (*UserUpdateOne) ClearDescription ¶
func (uuo *UserUpdateOne) ClearDescription() *UserUpdateOne
ClearDescription clears the value of the "description" field.
func (*UserUpdateOne) ClearEmail ¶
func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
ClearEmail clears the value of the "email" field.
func (*UserUpdateOne) ClearFollowedPets ¶
func (uuo *UserUpdateOne) ClearFollowedPets() *UserUpdateOne
ClearFollowedPets clears all "followed_pets" edges to the Pet entity.
func (*UserUpdateOne) ClearFriends ¶
func (uuo *UserUpdateOne) ClearFriends() *UserUpdateOne
ClearFriends clears all "friends" edges to the User entity.
func (*UserUpdateOne) ClearFriendships ¶
func (uuo *UserUpdateOne) ClearFriendships() *UserUpdateOne
ClearFriendships clears all "friendships" edges to the Friendship entity.
func (*UserUpdateOne) ClearGithubData ¶
func (uuo *UserUpdateOne) ClearGithubData() *UserUpdateOne
ClearGithubData clears the value of the "github_data" field.
func (*UserUpdateOne) ClearPets ¶
func (uuo *UserUpdateOne) ClearPets() *UserUpdateOne
ClearPets clears all "pets" edges to the Pet entity.
func (*UserUpdateOne) ClearProfileURL ¶
func (uuo *UserUpdateOne) ClearProfileURL() *UserUpdateOne
ClearProfileURL clears the value of the "profile_url" field.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveFollowedPetIDs ¶
func (uuo *UserUpdateOne) RemoveFollowedPetIDs(ids ...int) *UserUpdateOne
RemoveFollowedPetIDs removes the "followed_pets" edge to Pet entities by IDs.
func (*UserUpdateOne) RemoveFollowedPets ¶
func (uuo *UserUpdateOne) RemoveFollowedPets(p ...*Pet) *UserUpdateOne
RemoveFollowedPets removes "followed_pets" edges to Pet entities.
func (*UserUpdateOne) RemoveFriendIDs ¶
func (uuo *UserUpdateOne) RemoveFriendIDs(ids ...int) *UserUpdateOne
RemoveFriendIDs removes the "friends" edge to User entities by IDs.
func (*UserUpdateOne) RemoveFriends ¶
func (uuo *UserUpdateOne) RemoveFriends(u ...*User) *UserUpdateOne
RemoveFriends removes "friends" edges to User entities.
func (*UserUpdateOne) RemoveFriendshipIDs ¶
func (uuo *UserUpdateOne) RemoveFriendshipIDs(ids ...int) *UserUpdateOne
RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.
func (*UserUpdateOne) RemoveFriendships ¶
func (uuo *UserUpdateOne) RemoveFriendships(f ...*Friendship) *UserUpdateOne
RemoveFriendships removes "friendships" edges to Friendship entities.
func (*UserUpdateOne) RemovePetIDs ¶
func (uuo *UserUpdateOne) RemovePetIDs(ids ...int) *UserUpdateOne
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*UserUpdateOne) RemovePets ¶
func (uuo *UserUpdateOne) RemovePets(p ...*Pet) *UserUpdateOne
RemovePets removes "pets" edges to Pet entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAvatar ¶
func (uuo *UserUpdateOne) SetAvatar(b []byte) *UserUpdateOne
SetAvatar sets the "avatar" field.
func (*UserUpdateOne) SetDescription ¶
func (uuo *UserUpdateOne) SetDescription(s string) *UserUpdateOne
SetDescription sets the "description" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetEnabled ¶
func (uuo *UserUpdateOne) SetEnabled(b bool) *UserUpdateOne
SetEnabled sets the "enabled" field.
func (*UserUpdateOne) SetGithubData ¶
func (uuo *UserUpdateOne) SetGithubData(gi *github.User) *UserUpdateOne
SetGithubData sets the "github_data" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableDescription ¶
func (uuo *UserUpdateOne) SetNillableDescription(s *string) *UserUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEnabled ¶
func (uuo *UserUpdateOne) SetNillableEnabled(b *bool) *UserUpdateOne
SetNillableEnabled sets the "enabled" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePasswordHashed ¶
func (uuo *UserUpdateOne) SetNillablePasswordHashed(s *string) *UserUpdateOne
SetNillablePasswordHashed sets the "password_hashed" field if the given value is not nil.
func (*UserUpdateOne) SetNillableType ¶
func (uuo *UserUpdateOne) SetNillableType(u *user.Type) *UserUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*UserUpdateOne) SetPasswordHashed ¶
func (uuo *UserUpdateOne) SetPasswordHashed(s string) *UserUpdateOne
SetPasswordHashed sets the "password_hashed" field.
func (*UserUpdateOne) SetProfileURL ¶
func (uuo *UserUpdateOne) SetProfileURL(sv *schema.ExampleValuer) *UserUpdateOne
SetProfileURL sets the "profile_url" field.
func (*UserUpdateOne) SetType ¶
func (uuo *UserUpdateOne) SetType(u user.Type) *UserUpdateOne
SetType sets the "type" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- category.go
- category_create.go
- category_delete.go
- category_query.go
- category_update.go
- client.go
- ent.go
- follows.go
- follows_create.go
- follows_delete.go
- follows_query.go
- follows_update.go
- friendship.go
- friendship_create.go
- friendship_delete.go
- friendship_query.go
- friendship_update.go
- mutation.go
- pet.go
- pet_create.go
- pet_delete.go
- pet_query.go
- pet_update.go
- runtime.go
- settings.go
- settings_create.go
- settings_delete.go
- settings_query.go
- settings_update.go
- skipped.go
- skipped_create.go
- skipped_delete.go
- skipped_query.go
- skipped_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go