Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Profile
- type ProfileClient
- func (c *ProfileClient) Create() *ProfileCreate
- func (c *ProfileClient) CreateBulk(builders ...*ProfileCreate) *ProfileCreateBulk
- func (c *ProfileClient) Delete() *ProfileDelete
- func (c *ProfileClient) DeleteOne(pr *Profile) *ProfileDeleteOne
- func (c *ProfileClient) DeleteOneID(id uuid.UUID) *ProfileDeleteOne
- func (c *ProfileClient) Get(ctx context.Context, id uuid.UUID) (*Profile, error)
- func (c *ProfileClient) GetX(ctx context.Context, id uuid.UUID) *Profile
- func (c *ProfileClient) Hooks() []Hook
- func (c *ProfileClient) Query() *ProfileQuery
- func (c *ProfileClient) QueryUser(pr *Profile) *UserQuery
- func (c *ProfileClient) Update() *ProfileUpdate
- func (c *ProfileClient) UpdateOne(pr *Profile) *ProfileUpdateOne
- func (c *ProfileClient) UpdateOneID(id uuid.UUID) *ProfileUpdateOne
- func (c *ProfileClient) Use(hooks ...Hook)
- type ProfileCreate
- func (pc *ProfileCreate) Mutation() *ProfileMutation
- func (pc *ProfileCreate) Save(ctx context.Context) (*Profile, error)
- func (pc *ProfileCreate) SaveX(ctx context.Context) *Profile
- func (pc *ProfileCreate) SetAge(i int) *ProfileCreate
- func (pc *ProfileCreate) SetAvatar(u *url.URL) *ProfileCreate
- func (pc *ProfileCreate) SetBirthday(t time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetCreateTime(t time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetDeleteTime(t time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetGender(pr profile.Gender) *ProfileCreate
- func (pc *ProfileCreate) SetID(u uuid.UUID) *ProfileCreate
- func (pc *ProfileCreate) SetNillableBirthday(t *time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetNillableCreateTime(t *time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetNillableDeleteTime(t *time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetNillableGender(pr *profile.Gender) *ProfileCreate
- func (pc *ProfileCreate) SetNillablePreferredTheme(s *string) *ProfileCreate
- func (pc *ProfileCreate) SetNillableUpdateTime(t *time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetPreferredTheme(s string) *ProfileCreate
- func (pc *ProfileCreate) SetTz(s string) *ProfileCreate
- func (pc *ProfileCreate) SetUpdateTime(t time.Time) *ProfileCreate
- func (pc *ProfileCreate) SetUser(u *User) *ProfileCreate
- func (pc *ProfileCreate) SetUserID(id uuid.UUID) *ProfileCreate
- type ProfileCreateBulk
- type ProfileDelete
- type ProfileDeleteOne
- type ProfileEdges
- type ProfileGroupBy
- func (pgb *ProfileGroupBy) Aggregate(fns ...AggregateFunc) *ProfileGroupBy
- func (pgb *ProfileGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (pgb *ProfileGroupBy) BoolX(ctx context.Context) bool
- func (pgb *ProfileGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (pgb *ProfileGroupBy) BoolsX(ctx context.Context) []bool
- func (pgb *ProfileGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (pgb *ProfileGroupBy) Float64X(ctx context.Context) float64
- func (pgb *ProfileGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (pgb *ProfileGroupBy) Float64sX(ctx context.Context) []float64
- func (pgb *ProfileGroupBy) Int(ctx context.Context) (_ int, err error)
- func (pgb *ProfileGroupBy) IntX(ctx context.Context) int
- func (pgb *ProfileGroupBy) Ints(ctx context.Context) ([]int, error)
- func (pgb *ProfileGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProfileGroupBy) Scan(ctx context.Context, v interface{}) error
- func (pgb *ProfileGroupBy) ScanX(ctx context.Context, v interface{})
- func (pgb *ProfileGroupBy) String(ctx context.Context) (_ string, err error)
- func (pgb *ProfileGroupBy) StringX(ctx context.Context) string
- func (pgb *ProfileGroupBy) Strings(ctx context.Context) ([]string, error)
- func (pgb *ProfileGroupBy) StringsX(ctx context.Context) []string
- type ProfileMutation
- func (m *ProfileMutation) AddAge(i int)
- func (m *ProfileMutation) AddField(name string, value ent.Value) error
- func (m *ProfileMutation) AddedAge() (r int, exists bool)
- func (m *ProfileMutation) AddedEdges() []string
- func (m *ProfileMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProfileMutation) AddedFields() []string
- func (m *ProfileMutation) AddedIDs(name string) []ent.Value
- func (m *ProfileMutation) Age() (r int, exists bool)
- func (m *ProfileMutation) Avatar() (r *url.URL, exists bool)
- func (m *ProfileMutation) AvatarCleared() bool
- func (m *ProfileMutation) Birthday() (r time.Time, exists bool)
- func (m *ProfileMutation) BirthdayCleared() bool
- func (m *ProfileMutation) ClearAvatar()
- func (m *ProfileMutation) ClearBirthday()
- func (m *ProfileMutation) ClearDeleteTime()
- func (m *ProfileMutation) ClearEdge(name string) error
- func (m *ProfileMutation) ClearField(name string) error
- func (m *ProfileMutation) ClearGender()
- func (m *ProfileMutation) ClearPreferredTheme()
- func (m *ProfileMutation) ClearUser()
- func (m *ProfileMutation) ClearedEdges() []string
- func (m *ProfileMutation) ClearedFields() []string
- func (m ProfileMutation) Client() *Client
- func (m *ProfileMutation) CreateTime() (r time.Time, exists bool)
- func (m *ProfileMutation) DeleteTime() (r time.Time, exists bool)
- func (m *ProfileMutation) DeleteTimeCleared() bool
- func (m *ProfileMutation) EdgeCleared(name string) bool
- func (m *ProfileMutation) Field(name string) (ent.Value, bool)
- func (m *ProfileMutation) FieldCleared(name string) bool
- func (m *ProfileMutation) Fields() []string
- func (m *ProfileMutation) Gender() (r profile.Gender, exists bool)
- func (m *ProfileMutation) GenderCleared() bool
- func (m *ProfileMutation) ID() (id uuid.UUID, exists bool)
- func (m *ProfileMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *ProfileMutation) OldAvatar(ctx context.Context) (v *url.URL, err error)
- func (m *ProfileMutation) OldBirthday(ctx context.Context) (v time.Time, err error)
- func (m *ProfileMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *ProfileMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error)
- func (m *ProfileMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProfileMutation) OldGender(ctx context.Context) (v profile.Gender, err error)
- func (m *ProfileMutation) OldPreferredTheme(ctx context.Context) (v string, err error)
- func (m *ProfileMutation) OldTz(ctx context.Context) (v string, err error)
- func (m *ProfileMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *ProfileMutation) Op() Op
- func (m *ProfileMutation) PreferredTheme() (r string, exists bool)
- func (m *ProfileMutation) PreferredThemeCleared() bool
- func (m *ProfileMutation) RemovedEdges() []string
- func (m *ProfileMutation) RemovedIDs(name string) []ent.Value
- func (m *ProfileMutation) ResetAge()
- func (m *ProfileMutation) ResetAvatar()
- func (m *ProfileMutation) ResetBirthday()
- func (m *ProfileMutation) ResetCreateTime()
- func (m *ProfileMutation) ResetDeleteTime()
- func (m *ProfileMutation) ResetEdge(name string) error
- func (m *ProfileMutation) ResetField(name string) error
- func (m *ProfileMutation) ResetGender()
- func (m *ProfileMutation) ResetPreferredTheme()
- func (m *ProfileMutation) ResetTz()
- func (m *ProfileMutation) ResetUpdateTime()
- func (m *ProfileMutation) ResetUser()
- func (m *ProfileMutation) SetAge(i int)
- func (m *ProfileMutation) SetAvatar(u *url.URL)
- func (m *ProfileMutation) SetBirthday(t time.Time)
- func (m *ProfileMutation) SetCreateTime(t time.Time)
- func (m *ProfileMutation) SetDeleteTime(t time.Time)
- func (m *ProfileMutation) SetField(name string, value ent.Value) error
- func (m *ProfileMutation) SetGender(pr profile.Gender)
- func (m *ProfileMutation) SetID(id uuid.UUID)
- func (m *ProfileMutation) SetPreferredTheme(s string)
- func (m *ProfileMutation) SetTz(s string)
- func (m *ProfileMutation) SetUpdateTime(t time.Time)
- func (m *ProfileMutation) SetUserID(id uuid.UUID)
- func (m ProfileMutation) Tx() (*Tx, error)
- func (m *ProfileMutation) Type() string
- func (m *ProfileMutation) Tz() (r string, exists bool)
- func (m *ProfileMutation) UpdateTime() (r time.Time, exists bool)
- func (m *ProfileMutation) UserCleared() bool
- func (m *ProfileMutation) UserID() (id uuid.UUID, exists bool)
- func (m *ProfileMutation) UserIDs() (ids []uuid.UUID)
- type ProfileQuery
- func (pq *ProfileQuery) All(ctx context.Context) ([]*Profile, error)
- func (pq *ProfileQuery) AllX(ctx context.Context) []*Profile
- func (pq *ProfileQuery) Clone() *ProfileQuery
- func (pq *ProfileQuery) Count(ctx context.Context) (int, error)
- func (pq *ProfileQuery) CountX(ctx context.Context) int
- func (pq *ProfileQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProfileQuery) ExistX(ctx context.Context) bool
- func (pq *ProfileQuery) First(ctx context.Context) (*Profile, error)
- func (pq *ProfileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *ProfileQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (pq *ProfileQuery) FirstX(ctx context.Context) *Profile
- func (pq *ProfileQuery) GroupBy(field string, fields ...string) *ProfileGroupBy
- func (pq *ProfileQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (pq *ProfileQuery) IDsX(ctx context.Context) []uuid.UUID
- func (pq *ProfileQuery) Limit(limit int) *ProfileQuery
- func (pq *ProfileQuery) Offset(offset int) *ProfileQuery
- func (pq *ProfileQuery) Only(ctx context.Context) (*Profile, error)
- func (pq *ProfileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *ProfileQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (pq *ProfileQuery) OnlyX(ctx context.Context) *Profile
- func (pq *ProfileQuery) Order(o ...OrderFunc) *ProfileQuery
- func (pq *ProfileQuery) QueryUser() *UserQuery
- func (pq *ProfileQuery) Select(field string, fields ...string) *ProfileSelect
- func (pq *ProfileQuery) Where(ps ...predicate.Profile) *ProfileQuery
- func (pq *ProfileQuery) WithUser(opts ...func(*UserQuery)) *ProfileQuery
- type ProfileSelect
- func (ps *ProfileSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ps *ProfileSelect) BoolX(ctx context.Context) bool
- func (ps *ProfileSelect) Bools(ctx context.Context) ([]bool, error)
- func (ps *ProfileSelect) BoolsX(ctx context.Context) []bool
- func (ps *ProfileSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ps *ProfileSelect) Float64X(ctx context.Context) float64
- func (ps *ProfileSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ps *ProfileSelect) Float64sX(ctx context.Context) []float64
- func (ps *ProfileSelect) Int(ctx context.Context) (_ int, err error)
- func (ps *ProfileSelect) IntX(ctx context.Context) int
- func (ps *ProfileSelect) Ints(ctx context.Context) ([]int, error)
- func (ps *ProfileSelect) IntsX(ctx context.Context) []int
- func (ps *ProfileSelect) Scan(ctx context.Context, v interface{}) error
- func (ps *ProfileSelect) ScanX(ctx context.Context, v interface{})
- func (ps *ProfileSelect) String(ctx context.Context) (_ string, err error)
- func (ps *ProfileSelect) StringX(ctx context.Context) string
- func (ps *ProfileSelect) Strings(ctx context.Context) ([]string, error)
- func (ps *ProfileSelect) StringsX(ctx context.Context) []string
- type ProfileUpdate
- func (pu *ProfileUpdate) AddAge(i int) *ProfileUpdate
- func (pu *ProfileUpdate) ClearAvatar() *ProfileUpdate
- func (pu *ProfileUpdate) ClearBirthday() *ProfileUpdate
- func (pu *ProfileUpdate) ClearDeleteTime() *ProfileUpdate
- func (pu *ProfileUpdate) ClearGender() *ProfileUpdate
- func (pu *ProfileUpdate) ClearPreferredTheme() *ProfileUpdate
- func (pu *ProfileUpdate) ClearUser() *ProfileUpdate
- func (pu *ProfileUpdate) Exec(ctx context.Context) error
- func (pu *ProfileUpdate) ExecX(ctx context.Context)
- func (pu *ProfileUpdate) Mutation() *ProfileMutation
- func (pu *ProfileUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProfileUpdate) SaveX(ctx context.Context) int
- func (pu *ProfileUpdate) SetAge(i int) *ProfileUpdate
- func (pu *ProfileUpdate) SetAvatar(u *url.URL) *ProfileUpdate
- func (pu *ProfileUpdate) SetBirthday(t time.Time) *ProfileUpdate
- func (pu *ProfileUpdate) SetDeleteTime(t time.Time) *ProfileUpdate
- func (pu *ProfileUpdate) SetGender(pr profile.Gender) *ProfileUpdate
- func (pu *ProfileUpdate) SetNillableBirthday(t *time.Time) *ProfileUpdate
- func (pu *ProfileUpdate) SetNillableDeleteTime(t *time.Time) *ProfileUpdate
- func (pu *ProfileUpdate) SetNillableGender(pr *profile.Gender) *ProfileUpdate
- func (pu *ProfileUpdate) SetNillablePreferredTheme(s *string) *ProfileUpdate
- func (pu *ProfileUpdate) SetPreferredTheme(s string) *ProfileUpdate
- func (pu *ProfileUpdate) SetTz(s string) *ProfileUpdate
- func (pu *ProfileUpdate) SetUser(u *User) *ProfileUpdate
- func (pu *ProfileUpdate) SetUserID(id uuid.UUID) *ProfileUpdate
- func (pu *ProfileUpdate) Where(ps ...predicate.Profile) *ProfileUpdate
- type ProfileUpdateOne
- func (puo *ProfileUpdateOne) AddAge(i int) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearAvatar() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearBirthday() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearDeleteTime() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearGender() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearPreferredTheme() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) ClearUser() *ProfileUpdateOne
- func (puo *ProfileUpdateOne) Exec(ctx context.Context) error
- func (puo *ProfileUpdateOne) ExecX(ctx context.Context)
- func (puo *ProfileUpdateOne) Mutation() *ProfileMutation
- func (puo *ProfileUpdateOne) Save(ctx context.Context) (*Profile, error)
- func (puo *ProfileUpdateOne) SaveX(ctx context.Context) *Profile
- func (puo *ProfileUpdateOne) SetAge(i int) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetAvatar(u *url.URL) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetBirthday(t time.Time) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetDeleteTime(t time.Time) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetGender(pr profile.Gender) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetNillableBirthday(t *time.Time) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetNillableDeleteTime(t *time.Time) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetNillableGender(pr *profile.Gender) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetNillablePreferredTheme(s *string) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetPreferredTheme(s string) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetTz(s string) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetUser(u *User) *ProfileUpdateOne
- func (puo *ProfileUpdateOne) SetUserID(id uuid.UUID) *ProfileUpdateOne
- type Profiles
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type User
- 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 uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryProfile(u *User) *ProfileQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- 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) SetCreateTime(t time.Time) *UserCreate
- func (uc *UserCreate) SetDeleteTime(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetFirstName(s string) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetLastName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableDeleteTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableProfileID(id *uuid.UUID) *UserCreate
- func (uc *UserCreate) SetNillableTenant(s *string) *UserCreate
- func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetProfile(p *Profile) *UserCreate
- func (uc *UserCreate) SetProfileID(id uuid.UUID) *UserCreate
- func (uc *UserCreate) SetTenant(s string) *UserCreate
- func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
- func (uc *UserCreate) SetUsername(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
- func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
- func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *UserGroupBy) IntX(ctx context.Context) int
- func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *UserGroupBy) StringX(ctx context.Context) string
- func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- 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) ClearDeleteTime()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearProfile()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreateTime() (r time.Time, exists bool)
- func (m *UserMutation) DeleteTime() (r time.Time, exists bool)
- func (m *UserMutation) DeleteTimeCleared() bool
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, 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) FirstName() (r string, exists bool)
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) LastName() (r string, exists bool)
- func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldTenant(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) ProfileCleared() bool
- func (m *UserMutation) ProfileID() (id uuid.UUID, exists bool)
- func (m *UserMutation) ProfileIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetCreateTime()
- func (m *UserMutation) ResetDeleteTime()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFirstName()
- func (m *UserMutation) ResetLastName()
- func (m *UserMutation) ResetProfile()
- func (m *UserMutation) ResetTenant()
- func (m *UserMutation) ResetUpdateTime()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) SetCreateTime(t time.Time)
- func (m *UserMutation) SetDeleteTime(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFirstName(s string)
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetLastName(s string)
- func (m *UserMutation) SetProfileID(id uuid.UUID)
- func (m *UserMutation) SetTenant(s string)
- func (m *UserMutation) SetUpdateTime(t time.Time)
- func (m *UserMutation) SetUsername(s string)
- func (m *UserMutation) Tenant() (r string, exists bool)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
- func (m *UserMutation) Username() (r string, exists bool)
- type UserQuery
- 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 uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- 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 uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryProfile() *ProfileQuery
- func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithProfile(opts ...func(*ProfileQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *UserSelect) BoolX(ctx context.Context) bool
- func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *UserSelect) BoolsX(ctx context.Context) []bool
- func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *UserSelect) Float64X(ctx context.Context) float64
- func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *UserSelect) Float64sX(ctx context.Context) []float64
- func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (us *UserSelect) IntX(ctx context.Context) int
- func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (us *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (us *UserSelect) ScanX(ctx context.Context, v interface{})
- func (us *UserSelect) String(ctx context.Context) (_ string, err error)
- func (us *UserSelect) StringX(ctx context.Context) string
- func (us *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (us *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) ClearDeleteTime() *UserUpdate
- func (uu *UserUpdate) ClearProfile() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetDeleteTime(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
- func (uu *UserUpdate) SetLastName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableDeleteTime(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableProfileID(id *uuid.UUID) *UserUpdate
- func (uu *UserUpdate) SetProfile(p *Profile) *UserUpdate
- func (uu *UserUpdate) SetProfileID(id uuid.UUID) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearProfile() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) SetDeleteTime(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDeleteTime(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableProfileID(id *uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) SetProfile(p *Profile) *UserUpdateOne
- func (uuo *UserUpdateOne) SetProfileID(id uuid.UUID) *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. TypeProfile = "Profile" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validaton 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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Profile is the client for interacting with the Profile builders. Profile *ProfileClient // 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(). Profile. Query(). Count(ctx)
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type Profile ¶
type Profile struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // DeleteTime holds the value of the "delete_time" field. DeleteTime *time.Time `json:"delete_time,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,omitempty"` // Tz holds the value of the "tz" field. Tz string `json:"tz,omitempty"` // Avatar holds the value of the "avatar" field. Avatar *url.URL `json:"avatar,omitempty"` // Birthday holds the value of the "birthday" field. Birthday time.Time `json:"birthday,omitempty"` // Gender holds the value of the "gender" field. Gender profile.Gender `json:"gender,omitempty"` // PreferredTheme holds the value of the "preferred_theme" field. PreferredTheme string `json:"preferred_theme,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProfileQuery when eager-loading is set. Edges ProfileEdges `json:"edges"` // contains filtered or unexported fields }
Profile is the model entity for the Profile schema.
func (*Profile) Unwrap ¶
Unwrap unwraps the Profile 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 (*Profile) Update ¶
func (pr *Profile) Update() *ProfileUpdateOne
Update returns a builder for updating this Profile. Note that you need to call Profile.Unwrap() before calling this method if this Profile was returned from a transaction, and the transaction was committed or rolled back.
type ProfileClient ¶
type ProfileClient struct {
// contains filtered or unexported fields
}
ProfileClient is a client for the Profile schema.
func NewProfileClient ¶
func NewProfileClient(c config) *ProfileClient
NewProfileClient returns a client for the Profile from the given config.
func (*ProfileClient) Create ¶
func (c *ProfileClient) Create() *ProfileCreate
Create returns a create builder for Profile.
func (*ProfileClient) CreateBulk ¶
func (c *ProfileClient) CreateBulk(builders ...*ProfileCreate) *ProfileCreateBulk
CreateBulk returns a builder for creating a bulk of Profile entities.
func (*ProfileClient) Delete ¶
func (c *ProfileClient) Delete() *ProfileDelete
Delete returns a delete builder for Profile.
func (*ProfileClient) DeleteOne ¶
func (c *ProfileClient) DeleteOne(pr *Profile) *ProfileDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ProfileClient) DeleteOneID ¶
func (c *ProfileClient) DeleteOneID(id uuid.UUID) *ProfileDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ProfileClient) Hooks ¶
func (c *ProfileClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProfileClient) Query ¶
func (c *ProfileClient) Query() *ProfileQuery
Query returns a query builder for Profile.
func (*ProfileClient) QueryUser ¶
func (c *ProfileClient) QueryUser(pr *Profile) *UserQuery
QueryUser queries the user edge of a Profile.
func (*ProfileClient) Update ¶
func (c *ProfileClient) Update() *ProfileUpdate
Update returns an update builder for Profile.
func (*ProfileClient) UpdateOne ¶
func (c *ProfileClient) UpdateOne(pr *Profile) *ProfileUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProfileClient) UpdateOneID ¶
func (c *ProfileClient) UpdateOneID(id uuid.UUID) *ProfileUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProfileClient) Use ¶
func (c *ProfileClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `profile.Hooks(f(g(h())))`.
type ProfileCreate ¶
type ProfileCreate struct {
// contains filtered or unexported fields
}
ProfileCreate is the builder for creating a Profile entity.
func (*ProfileCreate) Mutation ¶
func (pc *ProfileCreate) Mutation() *ProfileMutation
Mutation returns the ProfileMutation object of the builder.
func (*ProfileCreate) Save ¶
func (pc *ProfileCreate) Save(ctx context.Context) (*Profile, error)
Save creates the Profile in the database.
func (*ProfileCreate) SaveX ¶
func (pc *ProfileCreate) SaveX(ctx context.Context) *Profile
SaveX calls Save and panics if Save returns an error.
func (*ProfileCreate) SetAge ¶
func (pc *ProfileCreate) SetAge(i int) *ProfileCreate
SetAge sets the "age" field.
func (*ProfileCreate) SetAvatar ¶
func (pc *ProfileCreate) SetAvatar(u *url.URL) *ProfileCreate
SetAvatar sets the "avatar" field.
func (*ProfileCreate) SetBirthday ¶
func (pc *ProfileCreate) SetBirthday(t time.Time) *ProfileCreate
SetBirthday sets the "birthday" field.
func (*ProfileCreate) SetCreateTime ¶
func (pc *ProfileCreate) SetCreateTime(t time.Time) *ProfileCreate
SetCreateTime sets the "create_time" field.
func (*ProfileCreate) SetDeleteTime ¶
func (pc *ProfileCreate) SetDeleteTime(t time.Time) *ProfileCreate
SetDeleteTime sets the "delete_time" field.
func (*ProfileCreate) SetGender ¶
func (pc *ProfileCreate) SetGender(pr profile.Gender) *ProfileCreate
SetGender sets the "gender" field.
func (*ProfileCreate) SetID ¶
func (pc *ProfileCreate) SetID(u uuid.UUID) *ProfileCreate
SetID sets the "id" field.
func (*ProfileCreate) SetNillableBirthday ¶
func (pc *ProfileCreate) SetNillableBirthday(t *time.Time) *ProfileCreate
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*ProfileCreate) SetNillableCreateTime ¶
func (pc *ProfileCreate) SetNillableCreateTime(t *time.Time) *ProfileCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*ProfileCreate) SetNillableDeleteTime ¶
func (pc *ProfileCreate) SetNillableDeleteTime(t *time.Time) *ProfileCreate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*ProfileCreate) SetNillableGender ¶
func (pc *ProfileCreate) SetNillableGender(pr *profile.Gender) *ProfileCreate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*ProfileCreate) SetNillablePreferredTheme ¶
func (pc *ProfileCreate) SetNillablePreferredTheme(s *string) *ProfileCreate
SetNillablePreferredTheme sets the "preferred_theme" field if the given value is not nil.
func (*ProfileCreate) SetNillableUpdateTime ¶
func (pc *ProfileCreate) SetNillableUpdateTime(t *time.Time) *ProfileCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*ProfileCreate) SetPreferredTheme ¶
func (pc *ProfileCreate) SetPreferredTheme(s string) *ProfileCreate
SetPreferredTheme sets the "preferred_theme" field.
func (*ProfileCreate) SetTz ¶
func (pc *ProfileCreate) SetTz(s string) *ProfileCreate
SetTz sets the "tz" field.
func (*ProfileCreate) SetUpdateTime ¶
func (pc *ProfileCreate) SetUpdateTime(t time.Time) *ProfileCreate
SetUpdateTime sets the "update_time" field.
func (*ProfileCreate) SetUser ¶
func (pc *ProfileCreate) SetUser(u *User) *ProfileCreate
SetUser sets the "user" edge to the User entity.
func (*ProfileCreate) SetUserID ¶
func (pc *ProfileCreate) SetUserID(id uuid.UUID) *ProfileCreate
SetUserID sets the "user" edge to the User entity by ID.
type ProfileCreateBulk ¶
type ProfileCreateBulk struct {
// contains filtered or unexported fields
}
ProfileCreateBulk is the builder for creating many Profile entities in bulk.
type ProfileDelete ¶
type ProfileDelete struct {
// contains filtered or unexported fields
}
ProfileDelete is the builder for deleting a Profile entity.
func (*ProfileDelete) Exec ¶
func (pd *ProfileDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProfileDelete) ExecX ¶
func (pd *ProfileDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProfileDelete) Where ¶
func (pd *ProfileDelete) Where(ps ...predicate.Profile) *ProfileDelete
Where adds a new predicate to the ProfileDelete builder.
type ProfileDeleteOne ¶
type ProfileDeleteOne struct {
// contains filtered or unexported fields
}
ProfileDeleteOne is the builder for deleting a single Profile entity.
func (*ProfileDeleteOne) Exec ¶
func (pdo *ProfileDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProfileDeleteOne) ExecX ¶
func (pdo *ProfileDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProfileEdges ¶
type ProfileEdges struct { // User holds the value of the user edge. User *User // contains filtered or unexported fields }
ProfileEdges holds the relations/edges for other nodes in the graph.
func (ProfileEdges) UserOrErr ¶
func (e ProfileEdges) 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 ProfileGroupBy ¶
type ProfileGroupBy struct {
// contains filtered or unexported fields
}
ProfileGroupBy is the group-by builder for Profile entities.
func (*ProfileGroupBy) Aggregate ¶
func (pgb *ProfileGroupBy) Aggregate(fns ...AggregateFunc) *ProfileGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProfileGroupBy) Bool ¶
func (pgb *ProfileGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) BoolX ¶
func (pgb *ProfileGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ProfileGroupBy) Bools ¶
func (pgb *ProfileGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) BoolsX ¶
func (pgb *ProfileGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ProfileGroupBy) Float64 ¶
func (pgb *ProfileGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) Float64X ¶
func (pgb *ProfileGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ProfileGroupBy) Float64s ¶
func (pgb *ProfileGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) Float64sX ¶
func (pgb *ProfileGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ProfileGroupBy) Int ¶
func (pgb *ProfileGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) IntX ¶
func (pgb *ProfileGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ProfileGroupBy) Ints ¶
func (pgb *ProfileGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) IntsX ¶
func (pgb *ProfileGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ProfileGroupBy) Scan ¶
func (pgb *ProfileGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*ProfileGroupBy) ScanX ¶
func (pgb *ProfileGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ProfileGroupBy) String ¶
func (pgb *ProfileGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*ProfileGroupBy) StringX ¶
func (pgb *ProfileGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ProfileMutation ¶
type ProfileMutation struct {
// contains filtered or unexported fields
}
ProfileMutation represents an operation that mutates the Profile nodes in the graph.
func (*ProfileMutation) AddAge ¶
func (m *ProfileMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*ProfileMutation) AddField ¶
func (m *ProfileMutation) 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 (*ProfileMutation) AddedAge ¶
func (m *ProfileMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*ProfileMutation) AddedEdges ¶
func (m *ProfileMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProfileMutation) AddedField ¶
func (m *ProfileMutation) 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 (*ProfileMutation) AddedFields ¶
func (m *ProfileMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProfileMutation) AddedIDs ¶
func (m *ProfileMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProfileMutation) Age ¶
func (m *ProfileMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*ProfileMutation) Avatar ¶
func (m *ProfileMutation) Avatar() (r *url.URL, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*ProfileMutation) AvatarCleared ¶
func (m *ProfileMutation) AvatarCleared() bool
AvatarCleared returns if the "avatar" field was cleared in this mutation.
func (*ProfileMutation) Birthday ¶
func (m *ProfileMutation) Birthday() (r time.Time, exists bool)
Birthday returns the value of the "birthday" field in the mutation.
func (*ProfileMutation) BirthdayCleared ¶
func (m *ProfileMutation) BirthdayCleared() bool
BirthdayCleared returns if the "birthday" field was cleared in this mutation.
func (*ProfileMutation) ClearAvatar ¶
func (m *ProfileMutation) ClearAvatar()
ClearAvatar clears the value of the "avatar" field.
func (*ProfileMutation) ClearBirthday ¶
func (m *ProfileMutation) ClearBirthday()
ClearBirthday clears the value of the "birthday" field.
func (*ProfileMutation) ClearDeleteTime ¶
func (m *ProfileMutation) ClearDeleteTime()
ClearDeleteTime clears the value of the "delete_time" field.
func (*ProfileMutation) ClearEdge ¶
func (m *ProfileMutation) 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 (*ProfileMutation) ClearField ¶
func (m *ProfileMutation) 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 (*ProfileMutation) ClearGender ¶
func (m *ProfileMutation) ClearGender()
ClearGender clears the value of the "gender" field.
func (*ProfileMutation) ClearPreferredTheme ¶
func (m *ProfileMutation) ClearPreferredTheme()
ClearPreferredTheme clears the value of the "preferred_theme" field.
func (*ProfileMutation) ClearUser ¶
func (m *ProfileMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ProfileMutation) ClearedEdges ¶
func (m *ProfileMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProfileMutation) ClearedFields ¶
func (m *ProfileMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProfileMutation) Client ¶
func (m ProfileMutation) 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 (*ProfileMutation) CreateTime ¶
func (m *ProfileMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*ProfileMutation) DeleteTime ¶
func (m *ProfileMutation) DeleteTime() (r time.Time, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*ProfileMutation) DeleteTimeCleared ¶
func (m *ProfileMutation) DeleteTimeCleared() bool
DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation.
func (*ProfileMutation) EdgeCleared ¶
func (m *ProfileMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProfileMutation) Field ¶
func (m *ProfileMutation) 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 (*ProfileMutation) FieldCleared ¶
func (m *ProfileMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProfileMutation) Fields ¶
func (m *ProfileMutation) 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 (*ProfileMutation) Gender ¶
func (m *ProfileMutation) Gender() (r profile.Gender, exists bool)
Gender returns the value of the "gender" field in the mutation.
func (*ProfileMutation) GenderCleared ¶
func (m *ProfileMutation) GenderCleared() bool
GenderCleared returns if the "gender" field was cleared in this mutation.
func (*ProfileMutation) ID ¶
func (m *ProfileMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.
func (*ProfileMutation) OldAge ¶
func (m *ProfileMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldAvatar ¶
OldAvatar returns the old "avatar" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldBirthday ¶
OldBirthday returns the old "birthday" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldDeleteTime ¶
OldDeleteTime returns the old "delete_time" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) 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 (*ProfileMutation) OldGender ¶
OldGender returns the old "gender" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldPreferredTheme ¶
func (m *ProfileMutation) OldPreferredTheme(ctx context.Context) (v string, err error)
OldPreferredTheme returns the old "preferred_theme" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldTz ¶
func (m *ProfileMutation) OldTz(ctx context.Context) (v string, err error)
OldTz returns the old "tz" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Profile entity. If the Profile 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 (*ProfileMutation) PreferredTheme ¶
func (m *ProfileMutation) PreferredTheme() (r string, exists bool)
PreferredTheme returns the value of the "preferred_theme" field in the mutation.
func (*ProfileMutation) PreferredThemeCleared ¶
func (m *ProfileMutation) PreferredThemeCleared() bool
PreferredThemeCleared returns if the "preferred_theme" field was cleared in this mutation.
func (*ProfileMutation) RemovedEdges ¶
func (m *ProfileMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProfileMutation) RemovedIDs ¶
func (m *ProfileMutation) 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 (*ProfileMutation) ResetAge ¶
func (m *ProfileMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*ProfileMutation) ResetAvatar ¶
func (m *ProfileMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*ProfileMutation) ResetBirthday ¶
func (m *ProfileMutation) ResetBirthday()
ResetBirthday resets all changes to the "birthday" field.
func (*ProfileMutation) ResetCreateTime ¶
func (m *ProfileMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*ProfileMutation) ResetDeleteTime ¶
func (m *ProfileMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" field.
func (*ProfileMutation) ResetEdge ¶
func (m *ProfileMutation) 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 (*ProfileMutation) ResetField ¶
func (m *ProfileMutation) 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 (*ProfileMutation) ResetGender ¶
func (m *ProfileMutation) ResetGender()
ResetGender resets all changes to the "gender" field.
func (*ProfileMutation) ResetPreferredTheme ¶
func (m *ProfileMutation) ResetPreferredTheme()
ResetPreferredTheme resets all changes to the "preferred_theme" field.
func (*ProfileMutation) ResetTz ¶
func (m *ProfileMutation) ResetTz()
ResetTz resets all changes to the "tz" field.
func (*ProfileMutation) ResetUpdateTime ¶
func (m *ProfileMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*ProfileMutation) ResetUser ¶
func (m *ProfileMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ProfileMutation) SetAge ¶
func (m *ProfileMutation) SetAge(i int)
SetAge sets the "age" field.
func (*ProfileMutation) SetAvatar ¶
func (m *ProfileMutation) SetAvatar(u *url.URL)
SetAvatar sets the "avatar" field.
func (*ProfileMutation) SetBirthday ¶
func (m *ProfileMutation) SetBirthday(t time.Time)
SetBirthday sets the "birthday" field.
func (*ProfileMutation) SetCreateTime ¶
func (m *ProfileMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*ProfileMutation) SetDeleteTime ¶
func (m *ProfileMutation) SetDeleteTime(t time.Time)
SetDeleteTime sets the "delete_time" field.
func (*ProfileMutation) SetField ¶
func (m *ProfileMutation) 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 (*ProfileMutation) SetGender ¶
func (m *ProfileMutation) SetGender(pr profile.Gender)
SetGender sets the "gender" field.
func (*ProfileMutation) SetID ¶
func (m *ProfileMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Profile entities.
func (*ProfileMutation) SetPreferredTheme ¶
func (m *ProfileMutation) SetPreferredTheme(s string)
SetPreferredTheme sets the "preferred_theme" field.
func (*ProfileMutation) SetTz ¶
func (m *ProfileMutation) SetTz(s string)
SetTz sets the "tz" field.
func (*ProfileMutation) SetUpdateTime ¶
func (m *ProfileMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*ProfileMutation) SetUserID ¶
func (m *ProfileMutation) SetUserID(id uuid.UUID)
SetUserID sets the "user" edge to the User entity by id.
func (ProfileMutation) Tx ¶
func (m ProfileMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProfileMutation) Type ¶
func (m *ProfileMutation) Type() string
Type returns the node type of this mutation (Profile).
func (*ProfileMutation) Tz ¶
func (m *ProfileMutation) Tz() (r string, exists bool)
Tz returns the value of the "tz" field in the mutation.
func (*ProfileMutation) UpdateTime ¶
func (m *ProfileMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*ProfileMutation) UserCleared ¶
func (m *ProfileMutation) UserCleared() bool
UserCleared returns if the "user" edge to the User entity was cleared.
func (*ProfileMutation) UserID ¶
func (m *ProfileMutation) UserID() (id uuid.UUID, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*ProfileMutation) UserIDs ¶
func (m *ProfileMutation) UserIDs() (ids []uuid.UUID)
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.
type ProfileQuery ¶
type ProfileQuery struct {
// contains filtered or unexported fields
}
ProfileQuery is the builder for querying Profile entities.
func (*ProfileQuery) All ¶
func (pq *ProfileQuery) All(ctx context.Context) ([]*Profile, error)
All executes the query and returns a list of Profiles.
func (*ProfileQuery) AllX ¶
func (pq *ProfileQuery) AllX(ctx context.Context) []*Profile
AllX is like All, but panics if an error occurs.
func (*ProfileQuery) Clone ¶
func (pq *ProfileQuery) Clone() *ProfileQuery
Clone returns a duplicate of the ProfileQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProfileQuery) Count ¶
func (pq *ProfileQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProfileQuery) CountX ¶
func (pq *ProfileQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProfileQuery) Exist ¶
func (pq *ProfileQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProfileQuery) ExistX ¶
func (pq *ProfileQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProfileQuery) First ¶
func (pq *ProfileQuery) First(ctx context.Context) (*Profile, error)
First returns the first Profile entity from the query. Returns a *NotFoundError when no Profile was found.
func (*ProfileQuery) FirstID ¶
FirstID returns the first Profile ID from the query. Returns a *NotFoundError when no Profile ID was found.
func (*ProfileQuery) FirstIDX ¶
func (pq *ProfileQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProfileQuery) FirstX ¶
func (pq *ProfileQuery) FirstX(ctx context.Context) *Profile
FirstX is like First, but panics if an error occurs.
func (*ProfileQuery) GroupBy ¶
func (pq *ProfileQuery) GroupBy(field string, fields ...string) *ProfileGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Profile.Query(). GroupBy(profile.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProfileQuery) IDsX ¶
func (pq *ProfileQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ProfileQuery) Limit ¶
func (pq *ProfileQuery) Limit(limit int) *ProfileQuery
Limit adds a limit step to the query.
func (*ProfileQuery) Offset ¶
func (pq *ProfileQuery) Offset(offset int) *ProfileQuery
Offset adds an offset step to the query.
func (*ProfileQuery) Only ¶
func (pq *ProfileQuery) Only(ctx context.Context) (*Profile, error)
Only returns a single Profile entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Profile entity is not found. Returns a *NotFoundError when no Profile entities are found.
func (*ProfileQuery) OnlyID ¶
OnlyID is like Only, but returns the only Profile ID in the query. Returns a *NotSingularError when exactly one Profile ID is not found. Returns a *NotFoundError when no entities are found.
func (*ProfileQuery) OnlyIDX ¶
func (pq *ProfileQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProfileQuery) OnlyX ¶
func (pq *ProfileQuery) OnlyX(ctx context.Context) *Profile
OnlyX is like Only, but panics if an error occurs.
func (*ProfileQuery) Order ¶
func (pq *ProfileQuery) Order(o ...OrderFunc) *ProfileQuery
Order adds an order step to the query.
func (*ProfileQuery) QueryUser ¶
func (pq *ProfileQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ProfileQuery) Select ¶
func (pq *ProfileQuery) Select(field string, fields ...string) *ProfileSelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Profile.Query(). Select(profile.FieldCreateTime). Scan(ctx, &v)
func (*ProfileQuery) Where ¶
func (pq *ProfileQuery) Where(ps ...predicate.Profile) *ProfileQuery
Where adds a new predicate for the ProfileQuery builder.
func (*ProfileQuery) WithUser ¶
func (pq *ProfileQuery) WithUser(opts ...func(*UserQuery)) *ProfileQuery
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 ProfileSelect ¶
type ProfileSelect struct { *ProfileQuery // contains filtered or unexported fields }
ProfileSelect is the builder for selecting fields of Profile entities.
func (*ProfileSelect) Bool ¶
func (ps *ProfileSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) BoolX ¶
func (ps *ProfileSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ProfileSelect) Bools ¶
func (ps *ProfileSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) BoolsX ¶
func (ps *ProfileSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ProfileSelect) Float64 ¶
func (ps *ProfileSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) Float64X ¶
func (ps *ProfileSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ProfileSelect) Float64s ¶
func (ps *ProfileSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) Float64sX ¶
func (ps *ProfileSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ProfileSelect) Int ¶
func (ps *ProfileSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) IntX ¶
func (ps *ProfileSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ProfileSelect) Ints ¶
func (ps *ProfileSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) IntsX ¶
func (ps *ProfileSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ProfileSelect) Scan ¶
func (ps *ProfileSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*ProfileSelect) ScanX ¶
func (ps *ProfileSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ProfileSelect) String ¶
func (ps *ProfileSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*ProfileSelect) StringX ¶
func (ps *ProfileSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ProfileUpdate ¶
type ProfileUpdate struct {
// contains filtered or unexported fields
}
ProfileUpdate is the builder for updating Profile entities.
func (*ProfileUpdate) AddAge ¶
func (pu *ProfileUpdate) AddAge(i int) *ProfileUpdate
AddAge adds i to the "age" field.
func (*ProfileUpdate) ClearAvatar ¶
func (pu *ProfileUpdate) ClearAvatar() *ProfileUpdate
ClearAvatar clears the value of the "avatar" field.
func (*ProfileUpdate) ClearBirthday ¶
func (pu *ProfileUpdate) ClearBirthday() *ProfileUpdate
ClearBirthday clears the value of the "birthday" field.
func (*ProfileUpdate) ClearDeleteTime ¶
func (pu *ProfileUpdate) ClearDeleteTime() *ProfileUpdate
ClearDeleteTime clears the value of the "delete_time" field.
func (*ProfileUpdate) ClearGender ¶
func (pu *ProfileUpdate) ClearGender() *ProfileUpdate
ClearGender clears the value of the "gender" field.
func (*ProfileUpdate) ClearPreferredTheme ¶
func (pu *ProfileUpdate) ClearPreferredTheme() *ProfileUpdate
ClearPreferredTheme clears the value of the "preferred_theme" field.
func (*ProfileUpdate) ClearUser ¶
func (pu *ProfileUpdate) ClearUser() *ProfileUpdate
ClearUser clears the "user" edge to the User entity.
func (*ProfileUpdate) Exec ¶
func (pu *ProfileUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProfileUpdate) ExecX ¶
func (pu *ProfileUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProfileUpdate) Mutation ¶
func (pu *ProfileUpdate) Mutation() *ProfileMutation
Mutation returns the ProfileMutation object of the builder.
func (*ProfileUpdate) Save ¶
func (pu *ProfileUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProfileUpdate) SaveX ¶
func (pu *ProfileUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProfileUpdate) SetAge ¶
func (pu *ProfileUpdate) SetAge(i int) *ProfileUpdate
SetAge sets the "age" field.
func (*ProfileUpdate) SetAvatar ¶
func (pu *ProfileUpdate) SetAvatar(u *url.URL) *ProfileUpdate
SetAvatar sets the "avatar" field.
func (*ProfileUpdate) SetBirthday ¶
func (pu *ProfileUpdate) SetBirthday(t time.Time) *ProfileUpdate
SetBirthday sets the "birthday" field.
func (*ProfileUpdate) SetDeleteTime ¶
func (pu *ProfileUpdate) SetDeleteTime(t time.Time) *ProfileUpdate
SetDeleteTime sets the "delete_time" field.
func (*ProfileUpdate) SetGender ¶
func (pu *ProfileUpdate) SetGender(pr profile.Gender) *ProfileUpdate
SetGender sets the "gender" field.
func (*ProfileUpdate) SetNillableBirthday ¶
func (pu *ProfileUpdate) SetNillableBirthday(t *time.Time) *ProfileUpdate
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*ProfileUpdate) SetNillableDeleteTime ¶
func (pu *ProfileUpdate) SetNillableDeleteTime(t *time.Time) *ProfileUpdate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*ProfileUpdate) SetNillableGender ¶
func (pu *ProfileUpdate) SetNillableGender(pr *profile.Gender) *ProfileUpdate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*ProfileUpdate) SetNillablePreferredTheme ¶
func (pu *ProfileUpdate) SetNillablePreferredTheme(s *string) *ProfileUpdate
SetNillablePreferredTheme sets the "preferred_theme" field if the given value is not nil.
func (*ProfileUpdate) SetPreferredTheme ¶
func (pu *ProfileUpdate) SetPreferredTheme(s string) *ProfileUpdate
SetPreferredTheme sets the "preferred_theme" field.
func (*ProfileUpdate) SetTz ¶
func (pu *ProfileUpdate) SetTz(s string) *ProfileUpdate
SetTz sets the "tz" field.
func (*ProfileUpdate) SetUser ¶
func (pu *ProfileUpdate) SetUser(u *User) *ProfileUpdate
SetUser sets the "user" edge to the User entity.
func (*ProfileUpdate) SetUserID ¶
func (pu *ProfileUpdate) SetUserID(id uuid.UUID) *ProfileUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*ProfileUpdate) Where ¶
func (pu *ProfileUpdate) Where(ps ...predicate.Profile) *ProfileUpdate
Where adds a new predicate for the ProfileUpdate builder.
type ProfileUpdateOne ¶
type ProfileUpdateOne struct {
// contains filtered or unexported fields
}
ProfileUpdateOne is the builder for updating a single Profile entity.
func (*ProfileUpdateOne) AddAge ¶
func (puo *ProfileUpdateOne) AddAge(i int) *ProfileUpdateOne
AddAge adds i to the "age" field.
func (*ProfileUpdateOne) ClearAvatar ¶
func (puo *ProfileUpdateOne) ClearAvatar() *ProfileUpdateOne
ClearAvatar clears the value of the "avatar" field.
func (*ProfileUpdateOne) ClearBirthday ¶
func (puo *ProfileUpdateOne) ClearBirthday() *ProfileUpdateOne
ClearBirthday clears the value of the "birthday" field.
func (*ProfileUpdateOne) ClearDeleteTime ¶
func (puo *ProfileUpdateOne) ClearDeleteTime() *ProfileUpdateOne
ClearDeleteTime clears the value of the "delete_time" field.
func (*ProfileUpdateOne) ClearGender ¶
func (puo *ProfileUpdateOne) ClearGender() *ProfileUpdateOne
ClearGender clears the value of the "gender" field.
func (*ProfileUpdateOne) ClearPreferredTheme ¶
func (puo *ProfileUpdateOne) ClearPreferredTheme() *ProfileUpdateOne
ClearPreferredTheme clears the value of the "preferred_theme" field.
func (*ProfileUpdateOne) ClearUser ¶
func (puo *ProfileUpdateOne) ClearUser() *ProfileUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ProfileUpdateOne) Exec ¶
func (puo *ProfileUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProfileUpdateOne) ExecX ¶
func (puo *ProfileUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProfileUpdateOne) Mutation ¶
func (puo *ProfileUpdateOne) Mutation() *ProfileMutation
Mutation returns the ProfileMutation object of the builder.
func (*ProfileUpdateOne) Save ¶
func (puo *ProfileUpdateOne) Save(ctx context.Context) (*Profile, error)
Save executes the query and returns the updated Profile entity.
func (*ProfileUpdateOne) SaveX ¶
func (puo *ProfileUpdateOne) SaveX(ctx context.Context) *Profile
SaveX is like Save, but panics if an error occurs.
func (*ProfileUpdateOne) SetAge ¶
func (puo *ProfileUpdateOne) SetAge(i int) *ProfileUpdateOne
SetAge sets the "age" field.
func (*ProfileUpdateOne) SetAvatar ¶
func (puo *ProfileUpdateOne) SetAvatar(u *url.URL) *ProfileUpdateOne
SetAvatar sets the "avatar" field.
func (*ProfileUpdateOne) SetBirthday ¶
func (puo *ProfileUpdateOne) SetBirthday(t time.Time) *ProfileUpdateOne
SetBirthday sets the "birthday" field.
func (*ProfileUpdateOne) SetDeleteTime ¶
func (puo *ProfileUpdateOne) SetDeleteTime(t time.Time) *ProfileUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*ProfileUpdateOne) SetGender ¶
func (puo *ProfileUpdateOne) SetGender(pr profile.Gender) *ProfileUpdateOne
SetGender sets the "gender" field.
func (*ProfileUpdateOne) SetNillableBirthday ¶
func (puo *ProfileUpdateOne) SetNillableBirthday(t *time.Time) *ProfileUpdateOne
SetNillableBirthday sets the "birthday" field if the given value is not nil.
func (*ProfileUpdateOne) SetNillableDeleteTime ¶
func (puo *ProfileUpdateOne) SetNillableDeleteTime(t *time.Time) *ProfileUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*ProfileUpdateOne) SetNillableGender ¶
func (puo *ProfileUpdateOne) SetNillableGender(pr *profile.Gender) *ProfileUpdateOne
SetNillableGender sets the "gender" field if the given value is not nil.
func (*ProfileUpdateOne) SetNillablePreferredTheme ¶
func (puo *ProfileUpdateOne) SetNillablePreferredTheme(s *string) *ProfileUpdateOne
SetNillablePreferredTheme sets the "preferred_theme" field if the given value is not nil.
func (*ProfileUpdateOne) SetPreferredTheme ¶
func (puo *ProfileUpdateOne) SetPreferredTheme(s string) *ProfileUpdateOne
SetPreferredTheme sets the "preferred_theme" field.
func (*ProfileUpdateOne) SetTz ¶
func (puo *ProfileUpdateOne) SetTz(s string) *ProfileUpdateOne
SetTz sets the "tz" field.
func (*ProfileUpdateOne) SetUser ¶
func (puo *ProfileUpdateOne) SetUser(u *User) *ProfileUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ProfileUpdateOne) SetUserID ¶
func (puo *ProfileUpdateOne) SetUserID(id uuid.UUID) *ProfileUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollbacker method.
type Tx ¶
type Tx struct { // Profile is the client for interacting with the Profile builders. Profile *ProfileClient // 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 uuid.UUID `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // DeleteTime holds the value of the "delete_time" field. DeleteTime *time.Time `json:"delete_time,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // FirstName holds the value of the "first_name" field. FirstName string `json:"first_name,omitempty"` // LastName holds the value of the "last_name" field. LastName string `json:"last_name,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Tenant holds the value of the "tenant" field. Tenant string `json:"tenant,omitempty"` // 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) QueryProfile ¶
func (u *User) QueryProfile() *ProfileQuery
QueryProfile queries the "profile" 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 create builder for User.
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 delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryProfile ¶
func (c *UserClient) QueryProfile(u *User) *ProfileQuery
QueryProfile queries the profile 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 uuid.UUID) *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) 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) SetCreateTime ¶
func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate
SetCreateTime sets the "create_time" field.
func (*UserCreate) SetDeleteTime ¶
func (uc *UserCreate) SetDeleteTime(t time.Time) *UserCreate
SetDeleteTime sets the "delete_time" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetFirstName ¶
func (uc *UserCreate) SetFirstName(s string) *UserCreate
SetFirstName sets the "first_name" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetLastName ¶
func (uc *UserCreate) SetLastName(s string) *UserCreate
SetLastName sets the "last_name" field.
func (*UserCreate) SetNillableCreateTime ¶
func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*UserCreate) SetNillableDeleteTime ¶
func (uc *UserCreate) SetNillableDeleteTime(t *time.Time) *UserCreate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserCreate) SetNillableProfileID ¶
func (uc *UserCreate) SetNillableProfileID(id *uuid.UUID) *UserCreate
SetNillableProfileID sets the "profile" edge to the Profile entity by ID if the given value is not nil.
func (*UserCreate) SetNillableTenant ¶
func (uc *UserCreate) SetNillableTenant(s *string) *UserCreate
SetNillableTenant sets the "tenant" field if the given value is not nil.
func (*UserCreate) SetNillableUpdateTime ¶
func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*UserCreate) SetProfile ¶
func (uc *UserCreate) SetProfile(p *Profile) *UserCreate
SetProfile sets the "profile" edge to the Profile entity.
func (*UserCreate) SetProfileID ¶
func (uc *UserCreate) SetProfileID(id uuid.UUID) *UserCreate
SetProfileID sets the "profile" edge to the Profile entity by ID.
func (*UserCreate) SetTenant ¶
func (uc *UserCreate) SetTenant(s string) *UserCreate
SetTenant sets the "tenant" field.
func (*UserCreate) SetUpdateTime ¶
func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
SetUpdateTime sets the "update_time" field.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
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 adds a new predicate 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.
type UserEdges ¶
type UserEdges struct { // Profile holds the value of the profile edge. Profile *Profile // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) ProfileOrErr ¶
ProfileOrErr returns the Profile value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
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 ¶
func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolX ¶
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶
func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolsX ¶
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶
func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64X ¶
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶
func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64sX ¶
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶
func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntX ¶
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶
func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntsX ¶
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) ScanX ¶
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶
func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) StringX ¶
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
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) 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) ClearDeleteTime ¶
func (m *UserMutation) ClearDeleteTime()
ClearDeleteTime clears the value of the "delete_time" 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) 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) ClearProfile ¶
func (m *UserMutation) ClearProfile()
ClearProfile clears the "profile" edge to the Profile entity.
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) CreateTime ¶
func (m *UserMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*UserMutation) DeleteTime ¶
func (m *UserMutation) DeleteTime() (r time.Time, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*UserMutation) DeleteTimeCleared ¶
func (m *UserMutation) DeleteTimeCleared() bool
DeleteTimeCleared returns if the "delete_time" 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) 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) FirstName ¶
func (m *UserMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "first_name" field in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.
func (*UserMutation) LastName ¶
func (m *UserMutation) LastName() (r string, exists bool)
LastName returns the value of the "last_name" field in the mutation.
func (*UserMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" 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) OldDeleteTime ¶
OldDeleteTime returns the old "delete_time" 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) 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) OldFirstName ¶
func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
OldFirstName returns the old "first_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) OldLastName ¶
func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
OldLastName returns the old "last_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) OldTenant ¶
func (m *UserMutation) OldTenant(ctx context.Context) (v string, err error)
OldTenant returns the old "tenant" 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) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" 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) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" 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) ProfileCleared ¶
func (m *UserMutation) ProfileCleared() bool
ProfileCleared returns if the "profile" edge to the Profile entity was cleared.
func (*UserMutation) ProfileID ¶
func (m *UserMutation) ProfileID() (id uuid.UUID, exists bool)
ProfileID returns the "profile" edge ID in the mutation.
func (*UserMutation) ProfileIDs ¶
func (m *UserMutation) ProfileIDs() (ids []uuid.UUID)
ProfileIDs returns the "profile" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProfileID instead. It exists only for internal usage by the builders.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
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) ResetCreateTime ¶
func (m *UserMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*UserMutation) ResetDeleteTime ¶
func (m *UserMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" 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) 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) ResetFirstName ¶
func (m *UserMutation) ResetFirstName()
ResetFirstName resets all changes to the "first_name" field.
func (*UserMutation) ResetLastName ¶
func (m *UserMutation) ResetLastName()
ResetLastName resets all changes to the "last_name" field.
func (*UserMutation) ResetProfile ¶
func (m *UserMutation) ResetProfile()
ResetProfile resets all changes to the "profile" edge.
func (*UserMutation) ResetTenant ¶
func (m *UserMutation) ResetTenant()
ResetTenant resets all changes to the "tenant" field.
func (*UserMutation) ResetUpdateTime ¶
func (m *UserMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) SetCreateTime ¶
func (m *UserMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*UserMutation) SetDeleteTime ¶
func (m *UserMutation) SetDeleteTime(t time.Time)
SetDeleteTime sets the "delete_time" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" 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) SetFirstName ¶
func (m *UserMutation) SetFirstName(s string)
SetFirstName sets the "first_name" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetLastName ¶
func (m *UserMutation) SetLastName(s string)
SetLastName sets the "last_name" field.
func (*UserMutation) SetProfileID ¶
func (m *UserMutation) SetProfileID(id uuid.UUID)
SetProfileID sets the "profile" edge to the Profile entity by id.
func (*UserMutation) SetTenant ¶
func (m *UserMutation) SetTenant(s string)
SetTenant sets the "tenant" field.
func (*UserMutation) SetUpdateTime ¶
func (m *UserMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (*UserMutation) Tenant ¶
func (m *UserMutation) Tenant() (r string, exists bool)
Tenant returns the value of the "tenant" field in the mutation.
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) UpdateTime ¶
func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*UserMutation) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreateTime). 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 exactly one User entity is not 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 exactly one User ID is not found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryProfile ¶
func (uq *UserQuery) QueryProfile() *ProfileQuery
QueryProfile chains the current query on the "profile" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(field string, 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 { CreateTime time.Time `json:"create_time,omitempty"` } client.User.Query(). Select(user.FieldCreateTime). Scan(ctx, &v)
func (*UserQuery) WithProfile ¶
func (uq *UserQuery) WithProfile(opts ...func(*ProfileQuery)) *UserQuery
WithProfile tells the query-builder to eager-load the nodes that are connected to the "profile" 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) Bool ¶
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) ScanX ¶
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) ClearDeleteTime ¶
func (uu *UserUpdate) ClearDeleteTime() *UserUpdate
ClearDeleteTime clears the value of the "delete_time" field.
func (*UserUpdate) ClearProfile ¶
func (uu *UserUpdate) ClearProfile() *UserUpdate
ClearProfile clears the "profile" edge to the Profile entity.
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) 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) SetDeleteTime ¶
func (uu *UserUpdate) SetDeleteTime(t time.Time) *UserUpdate
SetDeleteTime sets the "delete_time" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetFirstName ¶
func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
SetFirstName sets the "first_name" field.
func (*UserUpdate) SetLastName ¶
func (uu *UserUpdate) SetLastName(s string) *UserUpdate
SetLastName sets the "last_name" field.
func (*UserUpdate) SetNillableDeleteTime ¶
func (uu *UserUpdate) SetNillableDeleteTime(t *time.Time) *UserUpdate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserUpdate) SetNillableProfileID ¶
func (uu *UserUpdate) SetNillableProfileID(id *uuid.UUID) *UserUpdate
SetNillableProfileID sets the "profile" edge to the Profile entity by ID if the given value is not nil.
func (*UserUpdate) SetProfile ¶
func (uu *UserUpdate) SetProfile(p *Profile) *UserUpdate
SetProfile sets the "profile" edge to the Profile entity.
func (*UserUpdate) SetProfileID ¶
func (uu *UserUpdate) SetProfileID(id uuid.UUID) *UserUpdate
SetProfileID sets the "profile" edge to the Profile entity by ID.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where adds a new predicate for 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) ClearDeleteTime ¶
func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne
ClearDeleteTime clears the value of the "delete_time" field.
func (*UserUpdateOne) ClearProfile ¶
func (uuo *UserUpdateOne) ClearProfile() *UserUpdateOne
ClearProfile clears the "profile" edge to the Profile entity.
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) 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) SetDeleteTime ¶
func (uuo *UserUpdateOne) SetDeleteTime(t time.Time) *UserUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetFirstName ¶
func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
SetFirstName sets the "first_name" field.
func (*UserUpdateOne) SetLastName ¶
func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
SetLastName sets the "last_name" field.
func (*UserUpdateOne) SetNillableDeleteTime ¶
func (uuo *UserUpdateOne) SetNillableDeleteTime(t *time.Time) *UserUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserUpdateOne) SetNillableProfileID ¶
func (uuo *UserUpdateOne) SetNillableProfileID(id *uuid.UUID) *UserUpdateOne
SetNillableProfileID sets the "profile" edge to the Profile entity by ID if the given value is not nil.
func (*UserUpdateOne) SetProfile ¶
func (uuo *UserUpdateOne) SetProfile(p *Profile) *UserUpdateOne
SetProfile sets the "profile" edge to the Profile entity.
func (*UserUpdateOne) SetProfileID ¶
func (uuo *UserUpdateOne) SetProfileID(id uuid.UUID) *UserUpdateOne
SetProfileID sets the "profile" edge to the Profile entity by ID.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.