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 Admin
- type AdminClient
- func (c *AdminClient) Create() *AdminCreate
- func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk
- func (c *AdminClient) Delete() *AdminDelete
- func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne
- func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne
- func (c *AdminClient) Get(ctx context.Context, id int) (*Admin, error)
- func (c *AdminClient) GetX(ctx context.Context, id int) *Admin
- func (c *AdminClient) Hooks() []Hook
- func (c *AdminClient) Query() *AdminQuery
- func (c *AdminClient) QueryUser(a *Admin) *UserQuery
- func (c *AdminClient) Update() *AdminUpdate
- func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne
- func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne
- func (c *AdminClient) Use(hooks ...Hook)
- type AdminCreate
- func (ac *AdminCreate) Exec(ctx context.Context) error
- func (ac *AdminCreate) ExecX(ctx context.Context)
- func (ac *AdminCreate) Mutation() *AdminMutation
- func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)
- func (ac *AdminCreate) SaveX(ctx context.Context) *Admin
- func (ac *AdminCreate) SetCreateTime(t time.Time) *AdminCreate
- func (ac *AdminCreate) SetNillableCreateTime(t *time.Time) *AdminCreate
- func (ac *AdminCreate) SetNillableUpdateTime(t *time.Time) *AdminCreate
- func (ac *AdminCreate) SetPhoneNumber(s string) *AdminCreate
- func (ac *AdminCreate) SetUpdateTime(t time.Time) *AdminCreate
- func (ac *AdminCreate) SetUser(u *User) *AdminCreate
- func (ac *AdminCreate) SetUserID(id int) *AdminCreate
- type AdminCreateBulk
- type AdminDelete
- type AdminDeleteOne
- type AdminEdges
- type AdminGroupBy
- func (agb *AdminGroupBy) Aggregate(fns ...AggregateFunc) *AdminGroupBy
- func (s *AdminGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AdminGroupBy) BoolX(ctx context.Context) bool
- func (s *AdminGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AdminGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AdminGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AdminGroupBy) Float64X(ctx context.Context) float64
- func (s *AdminGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AdminGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AdminGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AdminGroupBy) IntX(ctx context.Context) int
- func (s *AdminGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AdminGroupBy) IntsX(ctx context.Context) []int
- func (agb *AdminGroupBy) Scan(ctx context.Context, v any) error
- func (s *AdminGroupBy) ScanX(ctx context.Context, v any)
- func (s *AdminGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AdminGroupBy) StringX(ctx context.Context) string
- func (s *AdminGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AdminGroupBy) StringsX(ctx context.Context) []string
- type AdminMutation
- func (m *AdminMutation) AddField(name string, value ent.Value) error
- func (m *AdminMutation) AddedEdges() []string
- func (m *AdminMutation) AddedField(name string) (ent.Value, bool)
- func (m *AdminMutation) AddedFields() []string
- func (m *AdminMutation) AddedIDs(name string) []ent.Value
- func (m *AdminMutation) ClearEdge(name string) error
- func (m *AdminMutation) ClearField(name string) error
- func (m *AdminMutation) ClearUser()
- func (m *AdminMutation) ClearedEdges() []string
- func (m *AdminMutation) ClearedFields() []string
- func (m AdminMutation) Client() *Client
- func (m *AdminMutation) CreateTime() (r time.Time, exists bool)
- func (m *AdminMutation) EdgeCleared(name string) bool
- func (m *AdminMutation) Field(name string) (ent.Value, bool)
- func (m *AdminMutation) FieldCleared(name string) bool
- func (m *AdminMutation) Fields() []string
- func (m *AdminMutation) ID() (id int, exists bool)
- func (m *AdminMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AdminMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *AdminMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AdminMutation) OldPhoneNumber(ctx context.Context) (v string, err error)
- func (m *AdminMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *AdminMutation) Op() Op
- func (m *AdminMutation) PhoneNumber() (r string, exists bool)
- func (m *AdminMutation) RemovedEdges() []string
- func (m *AdminMutation) RemovedIDs(name string) []ent.Value
- func (m *AdminMutation) ResetCreateTime()
- func (m *AdminMutation) ResetEdge(name string) error
- func (m *AdminMutation) ResetField(name string) error
- func (m *AdminMutation) ResetPhoneNumber()
- func (m *AdminMutation) ResetUpdateTime()
- func (m *AdminMutation) ResetUser()
- func (m *AdminMutation) SetCreateTime(t time.Time)
- func (m *AdminMutation) SetField(name string, value ent.Value) error
- func (m *AdminMutation) SetPhoneNumber(s string)
- func (m *AdminMutation) SetUpdateTime(t time.Time)
- func (m *AdminMutation) SetUserID(id int)
- func (m AdminMutation) Tx() (*Tx, error)
- func (m *AdminMutation) Type() string
- func (m *AdminMutation) UpdateTime() (r time.Time, exists bool)
- func (m *AdminMutation) UserCleared() bool
- func (m *AdminMutation) UserID() (id int, exists bool)
- func (m *AdminMutation) UserIDs() (ids []int)
- func (m *AdminMutation) Where(ps ...predicate.Admin)
- type AdminQuery
- func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect
- func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)
- func (aq *AdminQuery) AllX(ctx context.Context) []*Admin
- func (aq *AdminQuery) Clone() *AdminQuery
- func (aq *AdminQuery) Count(ctx context.Context) (int, error)
- func (aq *AdminQuery) CountX(ctx context.Context) int
- func (aq *AdminQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AdminQuery) ExistX(ctx context.Context) bool
- func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)
- func (aq *AdminQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AdminQuery) FirstIDX(ctx context.Context) int
- func (aq *AdminQuery) FirstX(ctx context.Context) *Admin
- func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy
- func (aq *AdminQuery) IDs(ctx context.Context) ([]int, error)
- func (aq *AdminQuery) IDsX(ctx context.Context) []int
- func (aq *AdminQuery) Limit(limit int) *AdminQuery
- func (aq *AdminQuery) Offset(offset int) *AdminQuery
- func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)
- func (aq *AdminQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AdminQuery) OnlyIDX(ctx context.Context) int
- func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin
- func (aq *AdminQuery) Order(o ...OrderFunc) *AdminQuery
- func (aq *AdminQuery) QueryUser() *UserQuery
- func (aq *AdminQuery) Select(fields ...string) *AdminSelect
- func (aq *AdminQuery) Unique(unique bool) *AdminQuery
- func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery
- func (aq *AdminQuery) WithUser(opts ...func(*UserQuery)) *AdminQuery
- type AdminSelect
- func (as *AdminSelect) Aggregate(fns ...AggregateFunc) *AdminSelect
- func (s *AdminSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AdminSelect) BoolX(ctx context.Context) bool
- func (s *AdminSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AdminSelect) BoolsX(ctx context.Context) []bool
- func (s *AdminSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AdminSelect) Float64X(ctx context.Context) float64
- func (s *AdminSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AdminSelect) Float64sX(ctx context.Context) []float64
- func (s *AdminSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AdminSelect) IntX(ctx context.Context) int
- func (s *AdminSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AdminSelect) IntsX(ctx context.Context) []int
- func (as *AdminSelect) Scan(ctx context.Context, v any) error
- func (s *AdminSelect) ScanX(ctx context.Context, v any)
- func (s *AdminSelect) String(ctx context.Context) (_ string, err error)
- func (s *AdminSelect) StringX(ctx context.Context) string
- func (s *AdminSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AdminSelect) StringsX(ctx context.Context) []string
- type AdminUpdate
- func (au *AdminUpdate) ClearUser() *AdminUpdate
- func (au *AdminUpdate) Exec(ctx context.Context) error
- func (au *AdminUpdate) ExecX(ctx context.Context)
- func (au *AdminUpdate) Mutation() *AdminMutation
- func (au *AdminUpdate) Save(ctx context.Context) (int, error)
- func (au *AdminUpdate) SaveX(ctx context.Context) int
- func (au *AdminUpdate) SetPhoneNumber(s string) *AdminUpdate
- func (au *AdminUpdate) SetUpdateTime(t time.Time) *AdminUpdate
- func (au *AdminUpdate) SetUser(u *User) *AdminUpdate
- func (au *AdminUpdate) SetUserID(id int) *AdminUpdate
- func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate
- type AdminUpdateOne
- func (auo *AdminUpdateOne) ClearUser() *AdminUpdateOne
- func (auo *AdminUpdateOne) Exec(ctx context.Context) error
- func (auo *AdminUpdateOne) ExecX(ctx context.Context)
- func (auo *AdminUpdateOne) Mutation() *AdminMutation
- func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)
- func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin
- func (auo *AdminUpdateOne) Select(field string, fields ...string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetPhoneNumber(s string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetUpdateTime(t time.Time) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetUser(u *User) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetUserID(id int) *AdminUpdateOne
- type Admins
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type Meeting
- type MeetingClient
- func (c *MeetingClient) Create() *MeetingCreate
- func (c *MeetingClient) CreateBulk(builders ...*MeetingCreate) *MeetingCreateBulk
- func (c *MeetingClient) Delete() *MeetingDelete
- func (c *MeetingClient) DeleteOne(m *Meeting) *MeetingDeleteOne
- func (c *MeetingClient) DeleteOneID(id int) *MeetingDeleteOne
- func (c *MeetingClient) Get(ctx context.Context, id int) (*Meeting, error)
- func (c *MeetingClient) GetX(ctx context.Context, id int) *Meeting
- func (c *MeetingClient) Hooks() []Hook
- func (c *MeetingClient) Query() *MeetingQuery
- func (c *MeetingClient) QueryOrganizer(m *Meeting) *UserQuery
- func (c *MeetingClient) QueryParticipants(m *Meeting) *UserQuery
- func (c *MeetingClient) Update() *MeetingUpdate
- func (c *MeetingClient) UpdateOne(m *Meeting) *MeetingUpdateOne
- func (c *MeetingClient) UpdateOneID(id int) *MeetingUpdateOne
- func (c *MeetingClient) Use(hooks ...Hook)
- type MeetingCreate
- func (mc *MeetingCreate) AddParticipantIDs(ids ...int) *MeetingCreate
- func (mc *MeetingCreate) AddParticipants(u ...*User) *MeetingCreate
- func (mc *MeetingCreate) Exec(ctx context.Context) error
- func (mc *MeetingCreate) ExecX(ctx context.Context)
- func (mc *MeetingCreate) Mutation() *MeetingMutation
- func (mc *MeetingCreate) Save(ctx context.Context) (*Meeting, error)
- func (mc *MeetingCreate) SaveX(ctx context.Context) *Meeting
- func (mc *MeetingCreate) SetCreateTime(t time.Time) *MeetingCreate
- func (mc *MeetingCreate) SetDescription(s string) *MeetingCreate
- func (mc *MeetingCreate) SetEndsAt(t time.Time) *MeetingCreate
- func (mc *MeetingCreate) SetNillableCreateTime(t *time.Time) *MeetingCreate
- func (mc *MeetingCreate) SetNillableDescription(s *string) *MeetingCreate
- func (mc *MeetingCreate) SetNillableOrganizerID(id *int) *MeetingCreate
- func (mc *MeetingCreate) SetNillableUpdateTime(t *time.Time) *MeetingCreate
- func (mc *MeetingCreate) SetOrganizer(u *User) *MeetingCreate
- func (mc *MeetingCreate) SetOrganizerID(id int) *MeetingCreate
- func (mc *MeetingCreate) SetStartsAt(t time.Time) *MeetingCreate
- func (mc *MeetingCreate) SetTitle(s string) *MeetingCreate
- func (mc *MeetingCreate) SetUpdateTime(t time.Time) *MeetingCreate
- type MeetingCreateBulk
- type MeetingDelete
- type MeetingDeleteOne
- type MeetingEdges
- type MeetingGroupBy
- func (mgb *MeetingGroupBy) Aggregate(fns ...AggregateFunc) *MeetingGroupBy
- func (s *MeetingGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MeetingGroupBy) BoolX(ctx context.Context) bool
- func (s *MeetingGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MeetingGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MeetingGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MeetingGroupBy) Float64X(ctx context.Context) float64
- func (s *MeetingGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MeetingGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MeetingGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MeetingGroupBy) IntX(ctx context.Context) int
- func (s *MeetingGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MeetingGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MeetingGroupBy) Scan(ctx context.Context, v any) error
- func (s *MeetingGroupBy) ScanX(ctx context.Context, v any)
- func (s *MeetingGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MeetingGroupBy) StringX(ctx context.Context) string
- func (s *MeetingGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MeetingGroupBy) StringsX(ctx context.Context) []string
- type MeetingMutation
- func (m *MeetingMutation) AddField(name string, value ent.Value) error
- func (m *MeetingMutation) AddParticipantIDs(ids ...int)
- func (m *MeetingMutation) AddedEdges() []string
- func (m *MeetingMutation) AddedField(name string) (ent.Value, bool)
- func (m *MeetingMutation) AddedFields() []string
- func (m *MeetingMutation) AddedIDs(name string) []ent.Value
- func (m *MeetingMutation) ClearDescription()
- func (m *MeetingMutation) ClearEdge(name string) error
- func (m *MeetingMutation) ClearField(name string) error
- func (m *MeetingMutation) ClearOrganizer()
- func (m *MeetingMutation) ClearParticipants()
- func (m *MeetingMutation) ClearedEdges() []string
- func (m *MeetingMutation) ClearedFields() []string
- func (m MeetingMutation) Client() *Client
- func (m *MeetingMutation) CreateTime() (r time.Time, exists bool)
- func (m *MeetingMutation) Description() (r string, exists bool)
- func (m *MeetingMutation) DescriptionCleared() bool
- func (m *MeetingMutation) EdgeCleared(name string) bool
- func (m *MeetingMutation) EndsAt() (r time.Time, exists bool)
- func (m *MeetingMutation) Field(name string) (ent.Value, bool)
- func (m *MeetingMutation) FieldCleared(name string) bool
- func (m *MeetingMutation) Fields() []string
- func (m *MeetingMutation) ID() (id int, exists bool)
- func (m *MeetingMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MeetingMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *MeetingMutation) OldDescription(ctx context.Context) (v *string, err error)
- func (m *MeetingMutation) OldEndsAt(ctx context.Context) (v time.Time, err error)
- func (m *MeetingMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MeetingMutation) OldStartsAt(ctx context.Context) (v time.Time, err error)
- func (m *MeetingMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *MeetingMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *MeetingMutation) Op() Op
- func (m *MeetingMutation) OrganizerCleared() bool
- func (m *MeetingMutation) OrganizerID() (id int, exists bool)
- func (m *MeetingMutation) OrganizerIDs() (ids []int)
- func (m *MeetingMutation) ParticipantsCleared() bool
- func (m *MeetingMutation) ParticipantsIDs() (ids []int)
- func (m *MeetingMutation) RemoveParticipantIDs(ids ...int)
- func (m *MeetingMutation) RemovedEdges() []string
- func (m *MeetingMutation) RemovedIDs(name string) []ent.Value
- func (m *MeetingMutation) RemovedParticipantsIDs() (ids []int)
- func (m *MeetingMutation) ResetCreateTime()
- func (m *MeetingMutation) ResetDescription()
- func (m *MeetingMutation) ResetEdge(name string) error
- func (m *MeetingMutation) ResetEndsAt()
- func (m *MeetingMutation) ResetField(name string) error
- func (m *MeetingMutation) ResetOrganizer()
- func (m *MeetingMutation) ResetParticipants()
- func (m *MeetingMutation) ResetStartsAt()
- func (m *MeetingMutation) ResetTitle()
- func (m *MeetingMutation) ResetUpdateTime()
- func (m *MeetingMutation) SetCreateTime(t time.Time)
- func (m *MeetingMutation) SetDescription(s string)
- func (m *MeetingMutation) SetEndsAt(t time.Time)
- func (m *MeetingMutation) SetField(name string, value ent.Value) error
- func (m *MeetingMutation) SetOrganizerID(id int)
- func (m *MeetingMutation) SetStartsAt(t time.Time)
- func (m *MeetingMutation) SetTitle(s string)
- func (m *MeetingMutation) SetUpdateTime(t time.Time)
- func (m *MeetingMutation) StartsAt() (r time.Time, exists bool)
- func (m *MeetingMutation) Title() (r string, exists bool)
- func (m MeetingMutation) Tx() (*Tx, error)
- func (m *MeetingMutation) Type() string
- func (m *MeetingMutation) UpdateTime() (r time.Time, exists bool)
- func (m *MeetingMutation) Where(ps ...predicate.Meeting)
- type MeetingQuery
- func (mq *MeetingQuery) Aggregate(fns ...AggregateFunc) *MeetingSelect
- func (mq *MeetingQuery) All(ctx context.Context) ([]*Meeting, error)
- func (mq *MeetingQuery) AllX(ctx context.Context) []*Meeting
- func (mq *MeetingQuery) Clone() *MeetingQuery
- func (mq *MeetingQuery) Count(ctx context.Context) (int, error)
- func (mq *MeetingQuery) CountX(ctx context.Context) int
- func (mq *MeetingQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MeetingQuery) ExistX(ctx context.Context) bool
- func (mq *MeetingQuery) First(ctx context.Context) (*Meeting, error)
- func (mq *MeetingQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MeetingQuery) FirstIDX(ctx context.Context) int
- func (mq *MeetingQuery) FirstX(ctx context.Context) *Meeting
- func (mq *MeetingQuery) GroupBy(field string, fields ...string) *MeetingGroupBy
- func (mq *MeetingQuery) IDs(ctx context.Context) ([]int, error)
- func (mq *MeetingQuery) IDsX(ctx context.Context) []int
- func (mq *MeetingQuery) Limit(limit int) *MeetingQuery
- func (mq *MeetingQuery) Offset(offset int) *MeetingQuery
- func (mq *MeetingQuery) Only(ctx context.Context) (*Meeting, error)
- func (mq *MeetingQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MeetingQuery) OnlyIDX(ctx context.Context) int
- func (mq *MeetingQuery) OnlyX(ctx context.Context) *Meeting
- func (mq *MeetingQuery) Order(o ...OrderFunc) *MeetingQuery
- func (mq *MeetingQuery) QueryOrganizer() *UserQuery
- func (mq *MeetingQuery) QueryParticipants() *UserQuery
- func (mq *MeetingQuery) Select(fields ...string) *MeetingSelect
- func (mq *MeetingQuery) Unique(unique bool) *MeetingQuery
- func (mq *MeetingQuery) Where(ps ...predicate.Meeting) *MeetingQuery
- func (mq *MeetingQuery) WithOrganizer(opts ...func(*UserQuery)) *MeetingQuery
- func (mq *MeetingQuery) WithParticipants(opts ...func(*UserQuery)) *MeetingQuery
- type MeetingSelect
- func (ms *MeetingSelect) Aggregate(fns ...AggregateFunc) *MeetingSelect
- func (s *MeetingSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MeetingSelect) BoolX(ctx context.Context) bool
- func (s *MeetingSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MeetingSelect) BoolsX(ctx context.Context) []bool
- func (s *MeetingSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MeetingSelect) Float64X(ctx context.Context) float64
- func (s *MeetingSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MeetingSelect) Float64sX(ctx context.Context) []float64
- func (s *MeetingSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MeetingSelect) IntX(ctx context.Context) int
- func (s *MeetingSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MeetingSelect) IntsX(ctx context.Context) []int
- func (ms *MeetingSelect) Scan(ctx context.Context, v any) error
- func (s *MeetingSelect) ScanX(ctx context.Context, v any)
- func (s *MeetingSelect) String(ctx context.Context) (_ string, err error)
- func (s *MeetingSelect) StringX(ctx context.Context) string
- func (s *MeetingSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MeetingSelect) StringsX(ctx context.Context) []string
- type MeetingUpdate
- func (mu *MeetingUpdate) AddParticipantIDs(ids ...int) *MeetingUpdate
- func (mu *MeetingUpdate) AddParticipants(u ...*User) *MeetingUpdate
- func (mu *MeetingUpdate) ClearDescription() *MeetingUpdate
- func (mu *MeetingUpdate) ClearOrganizer() *MeetingUpdate
- func (mu *MeetingUpdate) ClearParticipants() *MeetingUpdate
- func (mu *MeetingUpdate) Exec(ctx context.Context) error
- func (mu *MeetingUpdate) ExecX(ctx context.Context)
- func (mu *MeetingUpdate) Mutation() *MeetingMutation
- func (mu *MeetingUpdate) RemoveParticipantIDs(ids ...int) *MeetingUpdate
- func (mu *MeetingUpdate) RemoveParticipants(u ...*User) *MeetingUpdate
- func (mu *MeetingUpdate) Save(ctx context.Context) (int, error)
- func (mu *MeetingUpdate) SaveX(ctx context.Context) int
- func (mu *MeetingUpdate) SetDescription(s string) *MeetingUpdate
- func (mu *MeetingUpdate) SetEndsAt(t time.Time) *MeetingUpdate
- func (mu *MeetingUpdate) SetNillableDescription(s *string) *MeetingUpdate
- func (mu *MeetingUpdate) SetNillableOrganizerID(id *int) *MeetingUpdate
- func (mu *MeetingUpdate) SetOrganizer(u *User) *MeetingUpdate
- func (mu *MeetingUpdate) SetOrganizerID(id int) *MeetingUpdate
- func (mu *MeetingUpdate) SetStartsAt(t time.Time) *MeetingUpdate
- func (mu *MeetingUpdate) SetTitle(s string) *MeetingUpdate
- func (mu *MeetingUpdate) SetUpdateTime(t time.Time) *MeetingUpdate
- func (mu *MeetingUpdate) Where(ps ...predicate.Meeting) *MeetingUpdate
- type MeetingUpdateOne
- func (muo *MeetingUpdateOne) AddParticipantIDs(ids ...int) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) AddParticipants(u ...*User) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) ClearDescription() *MeetingUpdateOne
- func (muo *MeetingUpdateOne) ClearOrganizer() *MeetingUpdateOne
- func (muo *MeetingUpdateOne) ClearParticipants() *MeetingUpdateOne
- func (muo *MeetingUpdateOne) Exec(ctx context.Context) error
- func (muo *MeetingUpdateOne) ExecX(ctx context.Context)
- func (muo *MeetingUpdateOne) Mutation() *MeetingMutation
- func (muo *MeetingUpdateOne) RemoveParticipantIDs(ids ...int) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) RemoveParticipants(u ...*User) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) Save(ctx context.Context) (*Meeting, error)
- func (muo *MeetingUpdateOne) SaveX(ctx context.Context) *Meeting
- func (muo *MeetingUpdateOne) Select(field string, fields ...string) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetDescription(s string) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetEndsAt(t time.Time) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetNillableDescription(s *string) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetNillableOrganizerID(id *int) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetOrganizer(u *User) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetOrganizerID(id int) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetStartsAt(t time.Time) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetTitle(s string) *MeetingUpdateOne
- func (muo *MeetingUpdateOne) SetUpdateTime(t time.Time) *MeetingUpdateOne
- type Meetings
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- 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 int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryAdmin(u *User) *AdminQuery
- func (c *UserClient) QueryMeetings(u *User) *MeetingQuery
- func (c *UserClient) QueryOrganizes(u *User) *MeetingQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddMeetingIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddMeetings(m ...*Meeting) *UserCreate
- func (uc *UserCreate) AddOrganizeIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddOrganizes(m ...*Meeting) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAdmin(a *Admin) *UserCreate
- func (uc *UserCreate) SetAdminID(id int) *UserCreate
- func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetNickname(s string) *UserCreate
- func (uc *UserCreate) SetNillableAdminID(id *int) *UserCreate
- func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
- func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddMeetingIDs(ids ...int)
- func (m *UserMutation) AddOrganizeIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) AdminCleared() bool
- func (m *UserMutation) AdminID() (id int, exists bool)
- func (m *UserMutation) AdminIDs() (ids []int)
- func (m *UserMutation) ClearAdmin()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEmail()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearMeetings()
- func (m *UserMutation) ClearOrganizes()
- 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) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailCleared() 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) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) MeetingsCleared() bool
- func (m *UserMutation) MeetingsIDs() (ids []int)
- func (m *UserMutation) Nickname() (r string, exists bool)
- func (m *UserMutation) OldCreateTime(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) OldNickname(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OrganizesCleared() bool
- func (m *UserMutation) OrganizesIDs() (ids []int)
- func (m *UserMutation) RemoveMeetingIDs(ids ...int)
- func (m *UserMutation) RemoveOrganizeIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedMeetingsIDs() (ids []int)
- func (m *UserMutation) RemovedOrganizesIDs() (ids []int)
- func (m *UserMutation) ResetAdmin()
- func (m *UserMutation) ResetCreateTime()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetMeetings()
- func (m *UserMutation) ResetNickname()
- func (m *UserMutation) ResetOrganizes()
- func (m *UserMutation) ResetUpdateTime()
- func (m *UserMutation) SetAdminID(id int)
- func (m *UserMutation) SetCreateTime(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetNickname(s string)
- func (m *UserMutation) SetUpdateTime(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryAdmin() *AdminQuery
- func (uq *UserQuery) QueryMeetings() *MeetingQuery
- func (uq *UserQuery) QueryOrganizes() *MeetingQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAdmin(opts ...func(*AdminQuery)) *UserQuery
- func (uq *UserQuery) WithMeetings(opts ...func(*MeetingQuery)) *UserQuery
- func (uq *UserQuery) WithOrganizes(opts ...func(*MeetingQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddMeetingIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddMeetings(m ...*Meeting) *UserUpdate
- func (uu *UserUpdate) AddOrganizeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddOrganizes(m ...*Meeting) *UserUpdate
- func (uu *UserUpdate) ClearAdmin() *UserUpdate
- func (uu *UserUpdate) ClearEmail() *UserUpdate
- func (uu *UserUpdate) ClearMeetings() *UserUpdate
- func (uu *UserUpdate) ClearOrganizes() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveMeetingIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveMeetings(m ...*Meeting) *UserUpdate
- func (uu *UserUpdate) RemoveOrganizeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveOrganizes(m ...*Meeting) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAdmin(a *Admin) *UserUpdate
- func (uu *UserUpdate) SetAdminID(id int) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetNickname(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableAdminID(id *int) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddMeetingIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddMeetings(m ...*Meeting) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOrganizeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOrganizes(m ...*Meeting) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAdmin() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearMeetings() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearOrganizes() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveMeetingIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveMeetings(m ...*Meeting) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOrganizeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOrganizes(m ...*Meeting) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAdmin(a *Admin) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAdminID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAdminID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *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. TypeAdmin = "Admin" TypeMeeting = "Meeting" 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 validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type Admin ¶
type Admin struct { // ID of the ent. ID int `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"` // PhoneNumber holds the value of the "phone_number" field. PhoneNumber string `json:"phone_number,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AdminQuery when eager-loading is set. Edges AdminEdges `json:"edges"` // contains filtered or unexported fields }
Admin is the model entity for the Admin schema.
func (*Admin) Unwrap ¶
Unwrap unwraps the Admin 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 (*Admin) Update ¶
func (a *Admin) Update() *AdminUpdateOne
Update returns a builder for updating this Admin. Note that you need to call Admin.Unwrap() before calling this method if this Admin was returned from a transaction, and the transaction was committed or rolled back.
type AdminClient ¶
type AdminClient struct {
// contains filtered or unexported fields
}
AdminClient is a client for the Admin schema.
func NewAdminClient ¶
func NewAdminClient(c config) *AdminClient
NewAdminClient returns a client for the Admin from the given config.
func (*AdminClient) Create ¶
func (c *AdminClient) Create() *AdminCreate
Create returns a builder for creating a Admin entity.
func (*AdminClient) CreateBulk ¶
func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk
CreateBulk returns a builder for creating a bulk of Admin entities.
func (*AdminClient) Delete ¶
func (c *AdminClient) Delete() *AdminDelete
Delete returns a delete builder for Admin.
func (*AdminClient) DeleteOne ¶
func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AdminClient) DeleteOneID ¶
func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AdminClient) GetX ¶
func (c *AdminClient) GetX(ctx context.Context, id int) *Admin
GetX is like Get, but panics if an error occurs.
func (*AdminClient) Query ¶
func (c *AdminClient) Query() *AdminQuery
Query returns a query builder for Admin.
func (*AdminClient) QueryUser ¶
func (c *AdminClient) QueryUser(a *Admin) *UserQuery
QueryUser queries the user edge of a Admin.
func (*AdminClient) Update ¶
func (c *AdminClient) Update() *AdminUpdate
Update returns an update builder for Admin.
func (*AdminClient) UpdateOne ¶
func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AdminClient) UpdateOneID ¶
func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AdminClient) Use ¶
func (c *AdminClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `admin.Hooks(f(g(h())))`.
type AdminCreate ¶
type AdminCreate struct {
// contains filtered or unexported fields
}
AdminCreate is the builder for creating a Admin entity.
func (*AdminCreate) Exec ¶
func (ac *AdminCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminCreate) ExecX ¶
func (ac *AdminCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminCreate) Mutation ¶
func (ac *AdminCreate) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminCreate) Save ¶
func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)
Save creates the Admin in the database.
func (*AdminCreate) SaveX ¶
func (ac *AdminCreate) SaveX(ctx context.Context) *Admin
SaveX calls Save and panics if Save returns an error.
func (*AdminCreate) SetCreateTime ¶
func (ac *AdminCreate) SetCreateTime(t time.Time) *AdminCreate
SetCreateTime sets the "create_time" field.
func (*AdminCreate) SetNillableCreateTime ¶
func (ac *AdminCreate) SetNillableCreateTime(t *time.Time) *AdminCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*AdminCreate) SetNillableUpdateTime ¶
func (ac *AdminCreate) SetNillableUpdateTime(t *time.Time) *AdminCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*AdminCreate) SetPhoneNumber ¶
func (ac *AdminCreate) SetPhoneNumber(s string) *AdminCreate
SetPhoneNumber sets the "phone_number" field.
func (*AdminCreate) SetUpdateTime ¶
func (ac *AdminCreate) SetUpdateTime(t time.Time) *AdminCreate
SetUpdateTime sets the "update_time" field.
func (*AdminCreate) SetUser ¶
func (ac *AdminCreate) SetUser(u *User) *AdminCreate
SetUser sets the "user" edge to the User entity.
func (*AdminCreate) SetUserID ¶
func (ac *AdminCreate) SetUserID(id int) *AdminCreate
SetUserID sets the "user" edge to the User entity by ID.
type AdminCreateBulk ¶
type AdminCreateBulk struct {
// contains filtered or unexported fields
}
AdminCreateBulk is the builder for creating many Admin entities in bulk.
func (*AdminCreateBulk) Exec ¶
func (acb *AdminCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminCreateBulk) ExecX ¶
func (acb *AdminCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AdminDelete ¶
type AdminDelete struct {
// contains filtered or unexported fields
}
AdminDelete is the builder for deleting a Admin entity.
func (*AdminDelete) Exec ¶
func (ad *AdminDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AdminDelete) ExecX ¶
func (ad *AdminDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AdminDelete) Where ¶
func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete
Where appends a list predicates to the AdminDelete builder.
type AdminDeleteOne ¶
type AdminDeleteOne struct {
// contains filtered or unexported fields
}
AdminDeleteOne is the builder for deleting a single Admin entity.
func (*AdminDeleteOne) Exec ¶
func (ado *AdminDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AdminDeleteOne) ExecX ¶
func (ado *AdminDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AdminEdges ¶
type AdminEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
AdminEdges holds the relations/edges for other nodes in the graph.
func (AdminEdges) UserOrErr ¶
func (e AdminEdges) 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 AdminGroupBy ¶
type AdminGroupBy struct {
// contains filtered or unexported fields
}
AdminGroupBy is the group-by builder for Admin entities.
func (*AdminGroupBy) Aggregate ¶
func (agb *AdminGroupBy) Aggregate(fns ...AggregateFunc) *AdminGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AdminGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Scan ¶
func (agb *AdminGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*AdminGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AdminMutation ¶
type AdminMutation struct {
// contains filtered or unexported fields
}
AdminMutation represents an operation that mutates the Admin nodes in the graph.
func (*AdminMutation) AddField ¶
func (m *AdminMutation) 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 (*AdminMutation) AddedEdges ¶
func (m *AdminMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AdminMutation) AddedField ¶
func (m *AdminMutation) 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 (*AdminMutation) AddedFields ¶
func (m *AdminMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AdminMutation) AddedIDs ¶
func (m *AdminMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AdminMutation) ClearEdge ¶
func (m *AdminMutation) 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 (*AdminMutation) ClearField ¶
func (m *AdminMutation) 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 (*AdminMutation) ClearUser ¶
func (m *AdminMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*AdminMutation) ClearedEdges ¶
func (m *AdminMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AdminMutation) ClearedFields ¶
func (m *AdminMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AdminMutation) Client ¶
func (m AdminMutation) 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 (*AdminMutation) CreateTime ¶
func (m *AdminMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*AdminMutation) EdgeCleared ¶
func (m *AdminMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AdminMutation) Field ¶
func (m *AdminMutation) 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 (*AdminMutation) FieldCleared ¶
func (m *AdminMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AdminMutation) Fields ¶
func (m *AdminMutation) 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 (*AdminMutation) ID ¶
func (m *AdminMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*AdminMutation) IDs ¶
func (m *AdminMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*AdminMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Admin entity. If the Admin 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 (*AdminMutation) 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 (*AdminMutation) OldPhoneNumber ¶
func (m *AdminMutation) OldPhoneNumber(ctx context.Context) (v string, err error)
OldPhoneNumber returns the old "phone_number" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Admin entity. If the Admin 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 (*AdminMutation) PhoneNumber ¶
func (m *AdminMutation) PhoneNumber() (r string, exists bool)
PhoneNumber returns the value of the "phone_number" field in the mutation.
func (*AdminMutation) RemovedEdges ¶
func (m *AdminMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AdminMutation) RemovedIDs ¶
func (m *AdminMutation) 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 (*AdminMutation) ResetCreateTime ¶
func (m *AdminMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*AdminMutation) ResetEdge ¶
func (m *AdminMutation) 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 (*AdminMutation) ResetField ¶
func (m *AdminMutation) 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 (*AdminMutation) ResetPhoneNumber ¶
func (m *AdminMutation) ResetPhoneNumber()
ResetPhoneNumber resets all changes to the "phone_number" field.
func (*AdminMutation) ResetUpdateTime ¶
func (m *AdminMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*AdminMutation) ResetUser ¶
func (m *AdminMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*AdminMutation) SetCreateTime ¶
func (m *AdminMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*AdminMutation) SetField ¶
func (m *AdminMutation) 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 (*AdminMutation) SetPhoneNumber ¶
func (m *AdminMutation) SetPhoneNumber(s string)
SetPhoneNumber sets the "phone_number" field.
func (*AdminMutation) SetUpdateTime ¶
func (m *AdminMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*AdminMutation) SetUserID ¶
func (m *AdminMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (AdminMutation) Tx ¶
func (m AdminMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AdminMutation) Type ¶
func (m *AdminMutation) Type() string
Type returns the node type of this mutation (Admin).
func (*AdminMutation) UpdateTime ¶
func (m *AdminMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*AdminMutation) UserCleared ¶
func (m *AdminMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*AdminMutation) UserID ¶
func (m *AdminMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*AdminMutation) UserIDs ¶
func (m *AdminMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*AdminMutation) Where ¶
func (m *AdminMutation) Where(ps ...predicate.Admin)
Where appends a list predicates to the AdminMutation builder.
type AdminQuery ¶
type AdminQuery struct {
// contains filtered or unexported fields
}
AdminQuery is the builder for querying Admin entities.
func (*AdminQuery) Aggregate ¶
func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect
Aggregate returns a AdminSelect configured with the given aggregations.
func (*AdminQuery) All ¶
func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)
All executes the query and returns a list of Admins.
func (*AdminQuery) AllX ¶
func (aq *AdminQuery) AllX(ctx context.Context) []*Admin
AllX is like All, but panics if an error occurs.
func (*AdminQuery) Clone ¶
func (aq *AdminQuery) Clone() *AdminQuery
Clone returns a duplicate of the AdminQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AdminQuery) Count ¶
func (aq *AdminQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AdminQuery) CountX ¶
func (aq *AdminQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AdminQuery) Exist ¶
func (aq *AdminQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AdminQuery) ExistX ¶
func (aq *AdminQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AdminQuery) First ¶
func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)
First returns the first Admin entity from the query. Returns a *NotFoundError when no Admin was found.
func (*AdminQuery) FirstID ¶
func (aq *AdminQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Admin ID from the query. Returns a *NotFoundError when no Admin ID was found.
func (*AdminQuery) FirstIDX ¶
func (aq *AdminQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AdminQuery) FirstX ¶
func (aq *AdminQuery) FirstX(ctx context.Context) *Admin
FirstX is like First, but panics if an error occurs.
func (*AdminQuery) GroupBy ¶
func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy
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.Admin.Query(). GroupBy(admin.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AdminQuery) IDs ¶
func (aq *AdminQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Admin IDs.
func (*AdminQuery) IDsX ¶
func (aq *AdminQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AdminQuery) Limit ¶
func (aq *AdminQuery) Limit(limit int) *AdminQuery
Limit adds a limit step to the query.
func (*AdminQuery) Offset ¶
func (aq *AdminQuery) Offset(offset int) *AdminQuery
Offset adds an offset step to the query.
func (*AdminQuery) Only ¶
func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)
Only returns a single Admin entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Admin entity is found. Returns a *NotFoundError when no Admin entities are found.
func (*AdminQuery) OnlyID ¶
func (aq *AdminQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Admin ID in the query. Returns a *NotSingularError when more than one Admin ID is found. Returns a *NotFoundError when no entities are found.
func (*AdminQuery) OnlyIDX ¶
func (aq *AdminQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AdminQuery) OnlyX ¶
func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin
OnlyX is like Only, but panics if an error occurs.
func (*AdminQuery) Order ¶
func (aq *AdminQuery) Order(o ...OrderFunc) *AdminQuery
Order adds an order step to the query.
func (*AdminQuery) QueryUser ¶
func (aq *AdminQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*AdminQuery) Select ¶
func (aq *AdminQuery) Select(fields ...string) *AdminSelect
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.Admin.Query(). Select(admin.FieldCreateTime). Scan(ctx, &v)
func (*AdminQuery) Unique ¶
func (aq *AdminQuery) Unique(unique bool) *AdminQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*AdminQuery) Where ¶
func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery
Where adds a new predicate for the AdminQuery builder.
func (*AdminQuery) WithUser ¶
func (aq *AdminQuery) WithUser(opts ...func(*UserQuery)) *AdminQuery
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 AdminSelect ¶
type AdminSelect struct { *AdminQuery // contains filtered or unexported fields }
AdminSelect is the builder for selecting fields of Admin entities.
func (*AdminSelect) Aggregate ¶
func (as *AdminSelect) Aggregate(fns ...AggregateFunc) *AdminSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AdminSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Scan ¶
func (as *AdminSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AdminSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AdminUpdate ¶
type AdminUpdate struct {
// contains filtered or unexported fields
}
AdminUpdate is the builder for updating Admin entities.
func (*AdminUpdate) ClearUser ¶
func (au *AdminUpdate) ClearUser() *AdminUpdate
ClearUser clears the "user" edge to the User entity.
func (*AdminUpdate) Exec ¶
func (au *AdminUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminUpdate) ExecX ¶
func (au *AdminUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminUpdate) Mutation ¶
func (au *AdminUpdate) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminUpdate) Save ¶
func (au *AdminUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AdminUpdate) SaveX ¶
func (au *AdminUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AdminUpdate) SetPhoneNumber ¶
func (au *AdminUpdate) SetPhoneNumber(s string) *AdminUpdate
SetPhoneNumber sets the "phone_number" field.
func (*AdminUpdate) SetUpdateTime ¶
func (au *AdminUpdate) SetUpdateTime(t time.Time) *AdminUpdate
SetUpdateTime sets the "update_time" field.
func (*AdminUpdate) SetUser ¶
func (au *AdminUpdate) SetUser(u *User) *AdminUpdate
SetUser sets the "user" edge to the User entity.
func (*AdminUpdate) SetUserID ¶
func (au *AdminUpdate) SetUserID(id int) *AdminUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*AdminUpdate) Where ¶
func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate
Where appends a list predicates to the AdminUpdate builder.
type AdminUpdateOne ¶
type AdminUpdateOne struct {
// contains filtered or unexported fields
}
AdminUpdateOne is the builder for updating a single Admin entity.
func (*AdminUpdateOne) ClearUser ¶
func (auo *AdminUpdateOne) ClearUser() *AdminUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*AdminUpdateOne) Exec ¶
func (auo *AdminUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AdminUpdateOne) ExecX ¶
func (auo *AdminUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminUpdateOne) Mutation ¶
func (auo *AdminUpdateOne) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminUpdateOne) Save ¶
func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)
Save executes the query and returns the updated Admin entity.
func (*AdminUpdateOne) SaveX ¶
func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin
SaveX is like Save, but panics if an error occurs.
func (*AdminUpdateOne) Select ¶
func (auo *AdminUpdateOne) Select(field string, fields ...string) *AdminUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AdminUpdateOne) SetPhoneNumber ¶
func (auo *AdminUpdateOne) SetPhoneNumber(s string) *AdminUpdateOne
SetPhoneNumber sets the "phone_number" field.
func (*AdminUpdateOne) SetUpdateTime ¶
func (auo *AdminUpdateOne) SetUpdateTime(t time.Time) *AdminUpdateOne
SetUpdateTime sets the "update_time" field.
func (*AdminUpdateOne) SetUser ¶
func (auo *AdminUpdateOne) SetUser(u *User) *AdminUpdateOne
SetUser sets the "user" edge to the User entity.
func (*AdminUpdateOne) SetUserID ¶
func (auo *AdminUpdateOne) SetUserID(id int) *AdminUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
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 // Admin is the client for interacting with the Admin builders. Admin *AdminClient // Meeting is the client for interacting with the Meeting builders. Meeting *MeetingClient // 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(). Admin. 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(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Meeting ¶
type Meeting struct { // ID of the ent. ID int `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"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // StartsAt holds the value of the "starts_at" field. StartsAt time.Time `json:"starts_at,omitempty"` // EndsAt holds the value of the "ends_at" field. EndsAt time.Time `json:"ends_at,omitempty"` // Description holds the value of the "description" field. Description *string `json:"description,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MeetingQuery when eager-loading is set. Edges MeetingEdges `json:"edges"` // contains filtered or unexported fields }
Meeting is the model entity for the Meeting schema.
func (*Meeting) QueryOrganizer ¶
QueryOrganizer queries the "organizer" edge of the Meeting entity.
func (*Meeting) QueryParticipants ¶
QueryParticipants queries the "participants" edge of the Meeting entity.
func (*Meeting) Unwrap ¶
Unwrap unwraps the Meeting 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 (*Meeting) Update ¶
func (m *Meeting) Update() *MeetingUpdateOne
Update returns a builder for updating this Meeting. Note that you need to call Meeting.Unwrap() before calling this method if this Meeting was returned from a transaction, and the transaction was committed or rolled back.
type MeetingClient ¶
type MeetingClient struct {
// contains filtered or unexported fields
}
MeetingClient is a client for the Meeting schema.
func NewMeetingClient ¶
func NewMeetingClient(c config) *MeetingClient
NewMeetingClient returns a client for the Meeting from the given config.
func (*MeetingClient) Create ¶
func (c *MeetingClient) Create() *MeetingCreate
Create returns a builder for creating a Meeting entity.
func (*MeetingClient) CreateBulk ¶
func (c *MeetingClient) CreateBulk(builders ...*MeetingCreate) *MeetingCreateBulk
CreateBulk returns a builder for creating a bulk of Meeting entities.
func (*MeetingClient) Delete ¶
func (c *MeetingClient) Delete() *MeetingDelete
Delete returns a delete builder for Meeting.
func (*MeetingClient) DeleteOne ¶
func (c *MeetingClient) DeleteOne(m *Meeting) *MeetingDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MeetingClient) DeleteOneID ¶
func (c *MeetingClient) DeleteOneID(id int) *MeetingDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MeetingClient) GetX ¶
func (c *MeetingClient) GetX(ctx context.Context, id int) *Meeting
GetX is like Get, but panics if an error occurs.
func (*MeetingClient) Hooks ¶
func (c *MeetingClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MeetingClient) Query ¶
func (c *MeetingClient) Query() *MeetingQuery
Query returns a query builder for Meeting.
func (*MeetingClient) QueryOrganizer ¶
func (c *MeetingClient) QueryOrganizer(m *Meeting) *UserQuery
QueryOrganizer queries the organizer edge of a Meeting.
func (*MeetingClient) QueryParticipants ¶
func (c *MeetingClient) QueryParticipants(m *Meeting) *UserQuery
QueryParticipants queries the participants edge of a Meeting.
func (*MeetingClient) Update ¶
func (c *MeetingClient) Update() *MeetingUpdate
Update returns an update builder for Meeting.
func (*MeetingClient) UpdateOne ¶
func (c *MeetingClient) UpdateOne(m *Meeting) *MeetingUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MeetingClient) UpdateOneID ¶
func (c *MeetingClient) UpdateOneID(id int) *MeetingUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MeetingClient) Use ¶
func (c *MeetingClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `meeting.Hooks(f(g(h())))`.
type MeetingCreate ¶
type MeetingCreate struct {
// contains filtered or unexported fields
}
MeetingCreate is the builder for creating a Meeting entity.
func (*MeetingCreate) AddParticipantIDs ¶
func (mc *MeetingCreate) AddParticipantIDs(ids ...int) *MeetingCreate
AddParticipantIDs adds the "participants" edge to the User entity by IDs.
func (*MeetingCreate) AddParticipants ¶
func (mc *MeetingCreate) AddParticipants(u ...*User) *MeetingCreate
AddParticipants adds the "participants" edges to the User entity.
func (*MeetingCreate) Exec ¶
func (mc *MeetingCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MeetingCreate) ExecX ¶
func (mc *MeetingCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MeetingCreate) Mutation ¶
func (mc *MeetingCreate) Mutation() *MeetingMutation
Mutation returns the MeetingMutation object of the builder.
func (*MeetingCreate) Save ¶
func (mc *MeetingCreate) Save(ctx context.Context) (*Meeting, error)
Save creates the Meeting in the database.
func (*MeetingCreate) SaveX ¶
func (mc *MeetingCreate) SaveX(ctx context.Context) *Meeting
SaveX calls Save and panics if Save returns an error.
func (*MeetingCreate) SetCreateTime ¶
func (mc *MeetingCreate) SetCreateTime(t time.Time) *MeetingCreate
SetCreateTime sets the "create_time" field.
func (*MeetingCreate) SetDescription ¶
func (mc *MeetingCreate) SetDescription(s string) *MeetingCreate
SetDescription sets the "description" field.
func (*MeetingCreate) SetEndsAt ¶
func (mc *MeetingCreate) SetEndsAt(t time.Time) *MeetingCreate
SetEndsAt sets the "ends_at" field.
func (*MeetingCreate) SetNillableCreateTime ¶
func (mc *MeetingCreate) SetNillableCreateTime(t *time.Time) *MeetingCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*MeetingCreate) SetNillableDescription ¶
func (mc *MeetingCreate) SetNillableDescription(s *string) *MeetingCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*MeetingCreate) SetNillableOrganizerID ¶
func (mc *MeetingCreate) SetNillableOrganizerID(id *int) *MeetingCreate
SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.
func (*MeetingCreate) SetNillableUpdateTime ¶
func (mc *MeetingCreate) SetNillableUpdateTime(t *time.Time) *MeetingCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*MeetingCreate) SetOrganizer ¶
func (mc *MeetingCreate) SetOrganizer(u *User) *MeetingCreate
SetOrganizer sets the "organizer" edge to the User entity.
func (*MeetingCreate) SetOrganizerID ¶
func (mc *MeetingCreate) SetOrganizerID(id int) *MeetingCreate
SetOrganizerID sets the "organizer" edge to the User entity by ID.
func (*MeetingCreate) SetStartsAt ¶
func (mc *MeetingCreate) SetStartsAt(t time.Time) *MeetingCreate
SetStartsAt sets the "starts_at" field.
func (*MeetingCreate) SetTitle ¶
func (mc *MeetingCreate) SetTitle(s string) *MeetingCreate
SetTitle sets the "title" field.
func (*MeetingCreate) SetUpdateTime ¶
func (mc *MeetingCreate) SetUpdateTime(t time.Time) *MeetingCreate
SetUpdateTime sets the "update_time" field.
type MeetingCreateBulk ¶
type MeetingCreateBulk struct {
// contains filtered or unexported fields
}
MeetingCreateBulk is the builder for creating many Meeting entities in bulk.
func (*MeetingCreateBulk) Exec ¶
func (mcb *MeetingCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MeetingCreateBulk) ExecX ¶
func (mcb *MeetingCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MeetingDelete ¶
type MeetingDelete struct {
// contains filtered or unexported fields
}
MeetingDelete is the builder for deleting a Meeting entity.
func (*MeetingDelete) Exec ¶
func (md *MeetingDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MeetingDelete) ExecX ¶
func (md *MeetingDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MeetingDelete) Where ¶
func (md *MeetingDelete) Where(ps ...predicate.Meeting) *MeetingDelete
Where appends a list predicates to the MeetingDelete builder.
type MeetingDeleteOne ¶
type MeetingDeleteOne struct {
// contains filtered or unexported fields
}
MeetingDeleteOne is the builder for deleting a single Meeting entity.
func (*MeetingDeleteOne) Exec ¶
func (mdo *MeetingDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MeetingDeleteOne) ExecX ¶
func (mdo *MeetingDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MeetingEdges ¶
type MeetingEdges struct { // Organizer holds the value of the organizer edge. Organizer *User `json:"organizer,omitempty"` // Participants holds the value of the participants edge. Participants []*User `json:"participants,omitempty"` // contains filtered or unexported fields }
MeetingEdges holds the relations/edges for other nodes in the graph.
func (MeetingEdges) OrganizerOrErr ¶
func (e MeetingEdges) OrganizerOrErr() (*User, error)
OrganizerOrErr returns the Organizer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (MeetingEdges) ParticipantsOrErr ¶
func (e MeetingEdges) ParticipantsOrErr() ([]*User, error)
ParticipantsOrErr returns the Participants value or an error if the edge was not loaded in eager-loading.
type MeetingGroupBy ¶
type MeetingGroupBy struct {
// contains filtered or unexported fields
}
MeetingGroupBy is the group-by builder for Meeting entities.
func (*MeetingGroupBy) Aggregate ¶
func (mgb *MeetingGroupBy) Aggregate(fns ...AggregateFunc) *MeetingGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MeetingGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MeetingGroupBy) Scan ¶
func (mgb *MeetingGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*MeetingGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MeetingMutation ¶
type MeetingMutation struct {
// contains filtered or unexported fields
}
MeetingMutation represents an operation that mutates the Meeting nodes in the graph.
func (*MeetingMutation) AddField ¶
func (m *MeetingMutation) 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 (*MeetingMutation) AddParticipantIDs ¶
func (m *MeetingMutation) AddParticipantIDs(ids ...int)
AddParticipantIDs adds the "participants" edge to the User entity by ids.
func (*MeetingMutation) AddedEdges ¶
func (m *MeetingMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MeetingMutation) AddedField ¶
func (m *MeetingMutation) 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 (*MeetingMutation) AddedFields ¶
func (m *MeetingMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MeetingMutation) AddedIDs ¶
func (m *MeetingMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MeetingMutation) ClearDescription ¶
func (m *MeetingMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*MeetingMutation) ClearEdge ¶
func (m *MeetingMutation) 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 (*MeetingMutation) ClearField ¶
func (m *MeetingMutation) 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 (*MeetingMutation) ClearOrganizer ¶
func (m *MeetingMutation) ClearOrganizer()
ClearOrganizer clears the "organizer" edge to the User entity.
func (*MeetingMutation) ClearParticipants ¶
func (m *MeetingMutation) ClearParticipants()
ClearParticipants clears the "participants" edge to the User entity.
func (*MeetingMutation) ClearedEdges ¶
func (m *MeetingMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MeetingMutation) ClearedFields ¶
func (m *MeetingMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MeetingMutation) Client ¶
func (m MeetingMutation) 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 (*MeetingMutation) CreateTime ¶
func (m *MeetingMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*MeetingMutation) Description ¶
func (m *MeetingMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*MeetingMutation) DescriptionCleared ¶
func (m *MeetingMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*MeetingMutation) EdgeCleared ¶
func (m *MeetingMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MeetingMutation) EndsAt ¶
func (m *MeetingMutation) EndsAt() (r time.Time, exists bool)
EndsAt returns the value of the "ends_at" field in the mutation.
func (*MeetingMutation) Field ¶
func (m *MeetingMutation) 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 (*MeetingMutation) FieldCleared ¶
func (m *MeetingMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MeetingMutation) Fields ¶
func (m *MeetingMutation) 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 (*MeetingMutation) ID ¶
func (m *MeetingMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*MeetingMutation) IDs ¶
func (m *MeetingMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*MeetingMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldDescription ¶
func (m *MeetingMutation) OldDescription(ctx context.Context) (v *string, err error)
OldDescription returns the old "description" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldEndsAt ¶
OldEndsAt returns the old "ends_at" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) 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 (*MeetingMutation) OldStartsAt ¶
OldStartsAt returns the old "starts_at" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldTitle ¶
func (m *MeetingMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OrganizerCleared ¶
func (m *MeetingMutation) OrganizerCleared() bool
OrganizerCleared reports if the "organizer" edge to the User entity was cleared.
func (*MeetingMutation) OrganizerID ¶
func (m *MeetingMutation) OrganizerID() (id int, exists bool)
OrganizerID returns the "organizer" edge ID in the mutation.
func (*MeetingMutation) OrganizerIDs ¶
func (m *MeetingMutation) OrganizerIDs() (ids []int)
OrganizerIDs returns the "organizer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrganizerID instead. It exists only for internal usage by the builders.
func (*MeetingMutation) ParticipantsCleared ¶
func (m *MeetingMutation) ParticipantsCleared() bool
ParticipantsCleared reports if the "participants" edge to the User entity was cleared.
func (*MeetingMutation) ParticipantsIDs ¶
func (m *MeetingMutation) ParticipantsIDs() (ids []int)
ParticipantsIDs returns the "participants" edge IDs in the mutation.
func (*MeetingMutation) RemoveParticipantIDs ¶
func (m *MeetingMutation) RemoveParticipantIDs(ids ...int)
RemoveParticipantIDs removes the "participants" edge to the User entity by IDs.
func (*MeetingMutation) RemovedEdges ¶
func (m *MeetingMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MeetingMutation) RemovedIDs ¶
func (m *MeetingMutation) 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 (*MeetingMutation) RemovedParticipantsIDs ¶
func (m *MeetingMutation) RemovedParticipantsIDs() (ids []int)
RemovedParticipants returns the removed IDs of the "participants" edge to the User entity.
func (*MeetingMutation) ResetCreateTime ¶
func (m *MeetingMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*MeetingMutation) ResetDescription ¶
func (m *MeetingMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*MeetingMutation) ResetEdge ¶
func (m *MeetingMutation) 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 (*MeetingMutation) ResetEndsAt ¶
func (m *MeetingMutation) ResetEndsAt()
ResetEndsAt resets all changes to the "ends_at" field.
func (*MeetingMutation) ResetField ¶
func (m *MeetingMutation) 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 (*MeetingMutation) ResetOrganizer ¶
func (m *MeetingMutation) ResetOrganizer()
ResetOrganizer resets all changes to the "organizer" edge.
func (*MeetingMutation) ResetParticipants ¶
func (m *MeetingMutation) ResetParticipants()
ResetParticipants resets all changes to the "participants" edge.
func (*MeetingMutation) ResetStartsAt ¶
func (m *MeetingMutation) ResetStartsAt()
ResetStartsAt resets all changes to the "starts_at" field.
func (*MeetingMutation) ResetTitle ¶
func (m *MeetingMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*MeetingMutation) ResetUpdateTime ¶
func (m *MeetingMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*MeetingMutation) SetCreateTime ¶
func (m *MeetingMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*MeetingMutation) SetDescription ¶
func (m *MeetingMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*MeetingMutation) SetEndsAt ¶
func (m *MeetingMutation) SetEndsAt(t time.Time)
SetEndsAt sets the "ends_at" field.
func (*MeetingMutation) SetField ¶
func (m *MeetingMutation) 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 (*MeetingMutation) SetOrganizerID ¶
func (m *MeetingMutation) SetOrganizerID(id int)
SetOrganizerID sets the "organizer" edge to the User entity by id.
func (*MeetingMutation) SetStartsAt ¶
func (m *MeetingMutation) SetStartsAt(t time.Time)
SetStartsAt sets the "starts_at" field.
func (*MeetingMutation) SetTitle ¶
func (m *MeetingMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*MeetingMutation) SetUpdateTime ¶
func (m *MeetingMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*MeetingMutation) StartsAt ¶
func (m *MeetingMutation) StartsAt() (r time.Time, exists bool)
StartsAt returns the value of the "starts_at" field in the mutation.
func (*MeetingMutation) Title ¶
func (m *MeetingMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (MeetingMutation) Tx ¶
func (m MeetingMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MeetingMutation) Type ¶
func (m *MeetingMutation) Type() string
Type returns the node type of this mutation (Meeting).
func (*MeetingMutation) UpdateTime ¶
func (m *MeetingMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*MeetingMutation) Where ¶
func (m *MeetingMutation) Where(ps ...predicate.Meeting)
Where appends a list predicates to the MeetingMutation builder.
type MeetingQuery ¶
type MeetingQuery struct {
// contains filtered or unexported fields
}
MeetingQuery is the builder for querying Meeting entities.
func (*MeetingQuery) Aggregate ¶
func (mq *MeetingQuery) Aggregate(fns ...AggregateFunc) *MeetingSelect
Aggregate returns a MeetingSelect configured with the given aggregations.
func (*MeetingQuery) All ¶
func (mq *MeetingQuery) All(ctx context.Context) ([]*Meeting, error)
All executes the query and returns a list of Meetings.
func (*MeetingQuery) AllX ¶
func (mq *MeetingQuery) AllX(ctx context.Context) []*Meeting
AllX is like All, but panics if an error occurs.
func (*MeetingQuery) Clone ¶
func (mq *MeetingQuery) Clone() *MeetingQuery
Clone returns a duplicate of the MeetingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MeetingQuery) Count ¶
func (mq *MeetingQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MeetingQuery) CountX ¶
func (mq *MeetingQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MeetingQuery) Exist ¶
func (mq *MeetingQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MeetingQuery) ExistX ¶
func (mq *MeetingQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MeetingQuery) First ¶
func (mq *MeetingQuery) First(ctx context.Context) (*Meeting, error)
First returns the first Meeting entity from the query. Returns a *NotFoundError when no Meeting was found.
func (*MeetingQuery) FirstID ¶
func (mq *MeetingQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Meeting ID from the query. Returns a *NotFoundError when no Meeting ID was found.
func (*MeetingQuery) FirstIDX ¶
func (mq *MeetingQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MeetingQuery) FirstX ¶
func (mq *MeetingQuery) FirstX(ctx context.Context) *Meeting
FirstX is like First, but panics if an error occurs.
func (*MeetingQuery) GroupBy ¶
func (mq *MeetingQuery) GroupBy(field string, fields ...string) *MeetingGroupBy
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.Meeting.Query(). GroupBy(meeting.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MeetingQuery) IDs ¶
func (mq *MeetingQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Meeting IDs.
func (*MeetingQuery) IDsX ¶
func (mq *MeetingQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MeetingQuery) Limit ¶
func (mq *MeetingQuery) Limit(limit int) *MeetingQuery
Limit adds a limit step to the query.
func (*MeetingQuery) Offset ¶
func (mq *MeetingQuery) Offset(offset int) *MeetingQuery
Offset adds an offset step to the query.
func (*MeetingQuery) Only ¶
func (mq *MeetingQuery) Only(ctx context.Context) (*Meeting, error)
Only returns a single Meeting entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Meeting entity is found. Returns a *NotFoundError when no Meeting entities are found.
func (*MeetingQuery) OnlyID ¶
func (mq *MeetingQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Meeting ID in the query. Returns a *NotSingularError when more than one Meeting ID is found. Returns a *NotFoundError when no entities are found.
func (*MeetingQuery) OnlyIDX ¶
func (mq *MeetingQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MeetingQuery) OnlyX ¶
func (mq *MeetingQuery) OnlyX(ctx context.Context) *Meeting
OnlyX is like Only, but panics if an error occurs.
func (*MeetingQuery) Order ¶
func (mq *MeetingQuery) Order(o ...OrderFunc) *MeetingQuery
Order adds an order step to the query.
func (*MeetingQuery) QueryOrganizer ¶
func (mq *MeetingQuery) QueryOrganizer() *UserQuery
QueryOrganizer chains the current query on the "organizer" edge.
func (*MeetingQuery) QueryParticipants ¶
func (mq *MeetingQuery) QueryParticipants() *UserQuery
QueryParticipants chains the current query on the "participants" edge.
func (*MeetingQuery) Select ¶
func (mq *MeetingQuery) Select(fields ...string) *MeetingSelect
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.Meeting.Query(). Select(meeting.FieldCreateTime). Scan(ctx, &v)
func (*MeetingQuery) Unique ¶
func (mq *MeetingQuery) Unique(unique bool) *MeetingQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*MeetingQuery) Where ¶
func (mq *MeetingQuery) Where(ps ...predicate.Meeting) *MeetingQuery
Where adds a new predicate for the MeetingQuery builder.
func (*MeetingQuery) WithOrganizer ¶
func (mq *MeetingQuery) WithOrganizer(opts ...func(*UserQuery)) *MeetingQuery
WithOrganizer tells the query-builder to eager-load the nodes that are connected to the "organizer" edge. The optional arguments are used to configure the query builder of the edge.
func (*MeetingQuery) WithParticipants ¶
func (mq *MeetingQuery) WithParticipants(opts ...func(*UserQuery)) *MeetingQuery
WithParticipants tells the query-builder to eager-load the nodes that are connected to the "participants" edge. The optional arguments are used to configure the query builder of the edge.
type MeetingSelect ¶
type MeetingSelect struct { *MeetingQuery // contains filtered or unexported fields }
MeetingSelect is the builder for selecting fields of Meeting entities.
func (*MeetingSelect) Aggregate ¶
func (ms *MeetingSelect) Aggregate(fns ...AggregateFunc) *MeetingSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MeetingSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MeetingSelect) Scan ¶
func (ms *MeetingSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MeetingSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MeetingUpdate ¶
type MeetingUpdate struct {
// contains filtered or unexported fields
}
MeetingUpdate is the builder for updating Meeting entities.
func (*MeetingUpdate) AddParticipantIDs ¶
func (mu *MeetingUpdate) AddParticipantIDs(ids ...int) *MeetingUpdate
AddParticipantIDs adds the "participants" edge to the User entity by IDs.
func (*MeetingUpdate) AddParticipants ¶
func (mu *MeetingUpdate) AddParticipants(u ...*User) *MeetingUpdate
AddParticipants adds the "participants" edges to the User entity.
func (*MeetingUpdate) ClearDescription ¶
func (mu *MeetingUpdate) ClearDescription() *MeetingUpdate
ClearDescription clears the value of the "description" field.
func (*MeetingUpdate) ClearOrganizer ¶
func (mu *MeetingUpdate) ClearOrganizer() *MeetingUpdate
ClearOrganizer clears the "organizer" edge to the User entity.
func (*MeetingUpdate) ClearParticipants ¶
func (mu *MeetingUpdate) ClearParticipants() *MeetingUpdate
ClearParticipants clears all "participants" edges to the User entity.
func (*MeetingUpdate) Exec ¶
func (mu *MeetingUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MeetingUpdate) ExecX ¶
func (mu *MeetingUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MeetingUpdate) Mutation ¶
func (mu *MeetingUpdate) Mutation() *MeetingMutation
Mutation returns the MeetingMutation object of the builder.
func (*MeetingUpdate) RemoveParticipantIDs ¶
func (mu *MeetingUpdate) RemoveParticipantIDs(ids ...int) *MeetingUpdate
RemoveParticipantIDs removes the "participants" edge to User entities by IDs.
func (*MeetingUpdate) RemoveParticipants ¶
func (mu *MeetingUpdate) RemoveParticipants(u ...*User) *MeetingUpdate
RemoveParticipants removes "participants" edges to User entities.
func (*MeetingUpdate) Save ¶
func (mu *MeetingUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MeetingUpdate) SaveX ¶
func (mu *MeetingUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MeetingUpdate) SetDescription ¶
func (mu *MeetingUpdate) SetDescription(s string) *MeetingUpdate
SetDescription sets the "description" field.
func (*MeetingUpdate) SetEndsAt ¶
func (mu *MeetingUpdate) SetEndsAt(t time.Time) *MeetingUpdate
SetEndsAt sets the "ends_at" field.
func (*MeetingUpdate) SetNillableDescription ¶
func (mu *MeetingUpdate) SetNillableDescription(s *string) *MeetingUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*MeetingUpdate) SetNillableOrganizerID ¶
func (mu *MeetingUpdate) SetNillableOrganizerID(id *int) *MeetingUpdate
SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.
func (*MeetingUpdate) SetOrganizer ¶
func (mu *MeetingUpdate) SetOrganizer(u *User) *MeetingUpdate
SetOrganizer sets the "organizer" edge to the User entity.
func (*MeetingUpdate) SetOrganizerID ¶
func (mu *MeetingUpdate) SetOrganizerID(id int) *MeetingUpdate
SetOrganizerID sets the "organizer" edge to the User entity by ID.
func (*MeetingUpdate) SetStartsAt ¶
func (mu *MeetingUpdate) SetStartsAt(t time.Time) *MeetingUpdate
SetStartsAt sets the "starts_at" field.
func (*MeetingUpdate) SetTitle ¶
func (mu *MeetingUpdate) SetTitle(s string) *MeetingUpdate
SetTitle sets the "title" field.
func (*MeetingUpdate) SetUpdateTime ¶
func (mu *MeetingUpdate) SetUpdateTime(t time.Time) *MeetingUpdate
SetUpdateTime sets the "update_time" field.
func (*MeetingUpdate) Where ¶
func (mu *MeetingUpdate) Where(ps ...predicate.Meeting) *MeetingUpdate
Where appends a list predicates to the MeetingUpdate builder.
type MeetingUpdateOne ¶
type MeetingUpdateOne struct {
// contains filtered or unexported fields
}
MeetingUpdateOne is the builder for updating a single Meeting entity.
func (*MeetingUpdateOne) AddParticipantIDs ¶
func (muo *MeetingUpdateOne) AddParticipantIDs(ids ...int) *MeetingUpdateOne
AddParticipantIDs adds the "participants" edge to the User entity by IDs.
func (*MeetingUpdateOne) AddParticipants ¶
func (muo *MeetingUpdateOne) AddParticipants(u ...*User) *MeetingUpdateOne
AddParticipants adds the "participants" edges to the User entity.
func (*MeetingUpdateOne) ClearDescription ¶
func (muo *MeetingUpdateOne) ClearDescription() *MeetingUpdateOne
ClearDescription clears the value of the "description" field.
func (*MeetingUpdateOne) ClearOrganizer ¶
func (muo *MeetingUpdateOne) ClearOrganizer() *MeetingUpdateOne
ClearOrganizer clears the "organizer" edge to the User entity.
func (*MeetingUpdateOne) ClearParticipants ¶
func (muo *MeetingUpdateOne) ClearParticipants() *MeetingUpdateOne
ClearParticipants clears all "participants" edges to the User entity.
func (*MeetingUpdateOne) Exec ¶
func (muo *MeetingUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MeetingUpdateOne) ExecX ¶
func (muo *MeetingUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MeetingUpdateOne) Mutation ¶
func (muo *MeetingUpdateOne) Mutation() *MeetingMutation
Mutation returns the MeetingMutation object of the builder.
func (*MeetingUpdateOne) RemoveParticipantIDs ¶
func (muo *MeetingUpdateOne) RemoveParticipantIDs(ids ...int) *MeetingUpdateOne
RemoveParticipantIDs removes the "participants" edge to User entities by IDs.
func (*MeetingUpdateOne) RemoveParticipants ¶
func (muo *MeetingUpdateOne) RemoveParticipants(u ...*User) *MeetingUpdateOne
RemoveParticipants removes "participants" edges to User entities.
func (*MeetingUpdateOne) Save ¶
func (muo *MeetingUpdateOne) Save(ctx context.Context) (*Meeting, error)
Save executes the query and returns the updated Meeting entity.
func (*MeetingUpdateOne) SaveX ¶
func (muo *MeetingUpdateOne) SaveX(ctx context.Context) *Meeting
SaveX is like Save, but panics if an error occurs.
func (*MeetingUpdateOne) Select ¶
func (muo *MeetingUpdateOne) Select(field string, fields ...string) *MeetingUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MeetingUpdateOne) SetDescription ¶
func (muo *MeetingUpdateOne) SetDescription(s string) *MeetingUpdateOne
SetDescription sets the "description" field.
func (*MeetingUpdateOne) SetEndsAt ¶
func (muo *MeetingUpdateOne) SetEndsAt(t time.Time) *MeetingUpdateOne
SetEndsAt sets the "ends_at" field.
func (*MeetingUpdateOne) SetNillableDescription ¶
func (muo *MeetingUpdateOne) SetNillableDescription(s *string) *MeetingUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*MeetingUpdateOne) SetNillableOrganizerID ¶
func (muo *MeetingUpdateOne) SetNillableOrganizerID(id *int) *MeetingUpdateOne
SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.
func (*MeetingUpdateOne) SetOrganizer ¶
func (muo *MeetingUpdateOne) SetOrganizer(u *User) *MeetingUpdateOne
SetOrganizer sets the "organizer" edge to the User entity.
func (*MeetingUpdateOne) SetOrganizerID ¶
func (muo *MeetingUpdateOne) SetOrganizerID(id int) *MeetingUpdateOne
SetOrganizerID sets the "organizer" edge to the User entity by ID.
func (*MeetingUpdateOne) SetStartsAt ¶
func (muo *MeetingUpdateOne) SetStartsAt(t time.Time) *MeetingUpdateOne
SetStartsAt sets the "starts_at" field.
func (*MeetingUpdateOne) SetTitle ¶
func (muo *MeetingUpdateOne) SetTitle(s string) *MeetingUpdateOne
SetTitle sets the "title" field.
func (*MeetingUpdateOne) SetUpdateTime ¶
func (muo *MeetingUpdateOne) SetUpdateTime(t time.Time) *MeetingUpdateOne
SetUpdateTime sets the "update_time" field.
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 RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tx ¶
type Tx struct { // Admin is the client for interacting with the Admin builders. Admin *AdminClient // Meeting is the client for interacting with the Meeting builders. Meeting *MeetingClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // 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"` // Nickname holds the value of the "nickname" field. Nickname string `json:"nickname,omitempty"` // Email holds the value of the "email" field. Email *string `json:"email,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) QueryAdmin ¶
func (u *User) QueryAdmin() *AdminQuery
QueryAdmin queries the "admin" edge of the User entity.
func (*User) QueryMeetings ¶
func (u *User) QueryMeetings() *MeetingQuery
QueryMeetings queries the "meetings" edge of the User entity.
func (*User) QueryOrganizes ¶
func (u *User) QueryOrganizes() *MeetingQuery
QueryOrganizes queries the "organizes" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryAdmin ¶
func (c *UserClient) QueryAdmin(u *User) *AdminQuery
QueryAdmin queries the admin edge of a User.
func (*UserClient) QueryMeetings ¶
func (c *UserClient) QueryMeetings(u *User) *MeetingQuery
QueryMeetings queries the meetings edge of a User.
func (*UserClient) QueryOrganizes ¶
func (c *UserClient) QueryOrganizes(u *User) *MeetingQuery
QueryOrganizes queries the organizes edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddMeetingIDs ¶
func (uc *UserCreate) AddMeetingIDs(ids ...int) *UserCreate
AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.
func (*UserCreate) AddMeetings ¶
func (uc *UserCreate) AddMeetings(m ...*Meeting) *UserCreate
AddMeetings adds the "meetings" edges to the Meeting entity.
func (*UserCreate) AddOrganizeIDs ¶
func (uc *UserCreate) AddOrganizeIDs(ids ...int) *UserCreate
AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.
func (*UserCreate) AddOrganizes ¶
func (uc *UserCreate) AddOrganizes(m ...*Meeting) *UserCreate
AddOrganizes adds the "organizes" edges to the Meeting entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAdmin ¶
func (uc *UserCreate) SetAdmin(a *Admin) *UserCreate
SetAdmin sets the "admin" edge to the Admin entity.
func (*UserCreate) SetAdminID ¶
func (uc *UserCreate) SetAdminID(id int) *UserCreate
SetAdminID sets the "admin" edge to the Admin entity by ID.
func (*UserCreate) SetCreateTime ¶
func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate
SetCreateTime sets the "create_time" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetNickname ¶
func (uc *UserCreate) SetNickname(s string) *UserCreate
SetNickname sets the "nickname" field.
func (*UserCreate) SetNillableAdminID ¶
func (uc *UserCreate) SetNillableAdminID(id *int) *UserCreate
SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.
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) SetNillableEmail ¶
func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
SetNillableEmail sets the "email" 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) SetUpdateTime ¶
func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
SetUpdateTime sets the "update_time" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶
type UserEdges struct { // Admin holds the value of the admin edge. Admin *Admin `json:"admin,omitempty"` // Organizes holds the value of the organizes edge. Organizes []*Meeting `json:"organizes,omitempty"` // Meetings holds the value of the meetings edge. Meetings []*Meeting `json:"meetings,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AdminOrErr ¶
AdminOrErr returns the Admin value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) MeetingsOrErr ¶
MeetingsOrErr returns the Meetings value or an error if the edge was not loaded in eager-loading.
func (UserEdges) OrganizesOrErr ¶
OrganizesOrErr returns the Organizes value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddMeetingIDs ¶
func (m *UserMutation) AddMeetingIDs(ids ...int)
AddMeetingIDs adds the "meetings" edge to the Meeting entity by ids.
func (*UserMutation) AddOrganizeIDs ¶
func (m *UserMutation) AddOrganizeIDs(ids ...int)
AddOrganizeIDs adds the "organizes" edge to the Meeting entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) AdminCleared ¶
func (m *UserMutation) AdminCleared() bool
AdminCleared reports if the "admin" edge to the Admin entity was cleared.
func (*UserMutation) AdminID ¶
func (m *UserMutation) AdminID() (id int, exists bool)
AdminID returns the "admin" edge ID in the mutation.
func (*UserMutation) AdminIDs ¶
func (m *UserMutation) AdminIDs() (ids []int)
AdminIDs returns the "admin" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AdminID instead. It exists only for internal usage by the builders.
func (*UserMutation) ClearAdmin ¶
func (m *UserMutation) ClearAdmin()
ClearAdmin clears the "admin" edge to the Admin entity.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearEmail ¶
func (m *UserMutation) ClearEmail()
ClearEmail clears the value of the "email" field.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearMeetings ¶
func (m *UserMutation) ClearMeetings()
ClearMeetings clears the "meetings" edge to the Meeting entity.
func (*UserMutation) ClearOrganizes ¶
func (m *UserMutation) ClearOrganizes()
ClearOrganizes clears the "organizes" edge to the Meeting 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) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) EmailCleared ¶
func (m *UserMutation) EmailCleared() bool
EmailCleared returns if the "email" field was cleared in this mutation.
func (*UserMutation) 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) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) MeetingsCleared ¶
func (m *UserMutation) MeetingsCleared() bool
MeetingsCleared reports if the "meetings" edge to the Meeting entity was cleared.
func (*UserMutation) MeetingsIDs ¶
func (m *UserMutation) MeetingsIDs() (ids []int)
MeetingsIDs returns the "meetings" edge IDs in the mutation.
func (*UserMutation) Nickname ¶
func (m *UserMutation) Nickname() (r string, exists bool)
Nickname returns the value of the "nickname" 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) 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) OldNickname ¶
func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)
OldNickname returns the old "nickname" 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) OrganizesCleared ¶
func (m *UserMutation) OrganizesCleared() bool
OrganizesCleared reports if the "organizes" edge to the Meeting entity was cleared.
func (*UserMutation) OrganizesIDs ¶
func (m *UserMutation) OrganizesIDs() (ids []int)
OrganizesIDs returns the "organizes" edge IDs in the mutation.
func (*UserMutation) RemoveMeetingIDs ¶
func (m *UserMutation) RemoveMeetingIDs(ids ...int)
RemoveMeetingIDs removes the "meetings" edge to the Meeting entity by IDs.
func (*UserMutation) RemoveOrganizeIDs ¶
func (m *UserMutation) RemoveOrganizeIDs(ids ...int)
RemoveOrganizeIDs removes the "organizes" edge to the Meeting entity by IDs.
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) RemovedMeetingsIDs ¶
func (m *UserMutation) RemovedMeetingsIDs() (ids []int)
RemovedMeetings returns the removed IDs of the "meetings" edge to the Meeting entity.
func (*UserMutation) RemovedOrganizesIDs ¶
func (m *UserMutation) RemovedOrganizesIDs() (ids []int)
RemovedOrganizes returns the removed IDs of the "organizes" edge to the Meeting entity.
func (*UserMutation) ResetAdmin ¶
func (m *UserMutation) ResetAdmin()
ResetAdmin resets all changes to the "admin" edge.
func (*UserMutation) ResetCreateTime ¶
func (m *UserMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_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) ResetMeetings ¶
func (m *UserMutation) ResetMeetings()
ResetMeetings resets all changes to the "meetings" edge.
func (*UserMutation) ResetNickname ¶
func (m *UserMutation) ResetNickname()
ResetNickname resets all changes to the "nickname" field.
func (*UserMutation) ResetOrganizes ¶
func (m *UserMutation) ResetOrganizes()
ResetOrganizes resets all changes to the "organizes" edge.
func (*UserMutation) ResetUpdateTime ¶
func (m *UserMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*UserMutation) SetAdminID ¶
func (m *UserMutation) SetAdminID(id int)
SetAdminID sets the "admin" edge to the Admin entity by id.
func (*UserMutation) SetCreateTime ¶
func (m *UserMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_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) SetNickname ¶
func (m *UserMutation) SetNickname(s string)
SetNickname sets the "nickname" field.
func (*UserMutation) SetUpdateTime ¶
func (m *UserMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdateTime ¶
func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { 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 more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryAdmin ¶
func (uq *UserQuery) QueryAdmin() *AdminQuery
QueryAdmin chains the current query on the "admin" edge.
func (*UserQuery) QueryMeetings ¶
func (uq *UserQuery) QueryMeetings() *MeetingQuery
QueryMeetings chains the current query on the "meetings" edge.
func (*UserQuery) QueryOrganizes ¶
func (uq *UserQuery) QueryOrganizes() *MeetingQuery
QueryOrganizes chains the current query on the "organizes" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.User.Query(). Select(user.FieldCreateTime). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithAdmin ¶
func (uq *UserQuery) WithAdmin(opts ...func(*AdminQuery)) *UserQuery
WithAdmin tells the query-builder to eager-load the nodes that are connected to the "admin" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithMeetings ¶
func (uq *UserQuery) WithMeetings(opts ...func(*MeetingQuery)) *UserQuery
WithMeetings tells the query-builder to eager-load the nodes that are connected to the "meetings" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithOrganizes ¶
func (uq *UserQuery) WithOrganizes(opts ...func(*MeetingQuery)) *UserQuery
WithOrganizes tells the query-builder to eager-load the nodes that are connected to the "organizes" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddMeetingIDs ¶
func (uu *UserUpdate) AddMeetingIDs(ids ...int) *UserUpdate
AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.
func (*UserUpdate) AddMeetings ¶
func (uu *UserUpdate) AddMeetings(m ...*Meeting) *UserUpdate
AddMeetings adds the "meetings" edges to the Meeting entity.
func (*UserUpdate) AddOrganizeIDs ¶
func (uu *UserUpdate) AddOrganizeIDs(ids ...int) *UserUpdate
AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.
func (*UserUpdate) AddOrganizes ¶
func (uu *UserUpdate) AddOrganizes(m ...*Meeting) *UserUpdate
AddOrganizes adds the "organizes" edges to the Meeting entity.
func (*UserUpdate) ClearAdmin ¶
func (uu *UserUpdate) ClearAdmin() *UserUpdate
ClearAdmin clears the "admin" edge to the Admin entity.
func (*UserUpdate) ClearEmail ¶
func (uu *UserUpdate) ClearEmail() *UserUpdate
ClearEmail clears the value of the "email" field.
func (*UserUpdate) ClearMeetings ¶
func (uu *UserUpdate) ClearMeetings() *UserUpdate
ClearMeetings clears all "meetings" edges to the Meeting entity.
func (*UserUpdate) ClearOrganizes ¶
func (uu *UserUpdate) ClearOrganizes() *UserUpdate
ClearOrganizes clears all "organizes" edges to the Meeting 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) RemoveMeetingIDs ¶
func (uu *UserUpdate) RemoveMeetingIDs(ids ...int) *UserUpdate
RemoveMeetingIDs removes the "meetings" edge to Meeting entities by IDs.
func (*UserUpdate) RemoveMeetings ¶
func (uu *UserUpdate) RemoveMeetings(m ...*Meeting) *UserUpdate
RemoveMeetings removes "meetings" edges to Meeting entities.
func (*UserUpdate) RemoveOrganizeIDs ¶
func (uu *UserUpdate) RemoveOrganizeIDs(ids ...int) *UserUpdate
RemoveOrganizeIDs removes the "organizes" edge to Meeting entities by IDs.
func (*UserUpdate) RemoveOrganizes ¶
func (uu *UserUpdate) RemoveOrganizes(m ...*Meeting) *UserUpdate
RemoveOrganizes removes "organizes" edges to Meeting entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAdmin ¶
func (uu *UserUpdate) SetAdmin(a *Admin) *UserUpdate
SetAdmin sets the "admin" edge to the Admin entity.
func (*UserUpdate) SetAdminID ¶
func (uu *UserUpdate) SetAdminID(id int) *UserUpdate
SetAdminID sets the "admin" edge to the Admin entity by ID.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNickname ¶
func (uu *UserUpdate) SetNickname(s string) *UserUpdate
SetNickname sets the "nickname" field.
func (*UserUpdate) SetNillableAdminID ¶
func (uu *UserUpdate) SetNillableAdminID(id *int) *UserUpdate
SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetUpdateTime ¶
func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate
SetUpdateTime sets the "update_time" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddMeetingIDs ¶
func (uuo *UserUpdateOne) AddMeetingIDs(ids ...int) *UserUpdateOne
AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.
func (*UserUpdateOne) AddMeetings ¶
func (uuo *UserUpdateOne) AddMeetings(m ...*Meeting) *UserUpdateOne
AddMeetings adds the "meetings" edges to the Meeting entity.
func (*UserUpdateOne) AddOrganizeIDs ¶
func (uuo *UserUpdateOne) AddOrganizeIDs(ids ...int) *UserUpdateOne
AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.
func (*UserUpdateOne) AddOrganizes ¶
func (uuo *UserUpdateOne) AddOrganizes(m ...*Meeting) *UserUpdateOne
AddOrganizes adds the "organizes" edges to the Meeting entity.
func (*UserUpdateOne) ClearAdmin ¶
func (uuo *UserUpdateOne) ClearAdmin() *UserUpdateOne
ClearAdmin clears the "admin" edge to the Admin entity.
func (*UserUpdateOne) ClearEmail ¶
func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
ClearEmail clears the value of the "email" field.
func (*UserUpdateOne) ClearMeetings ¶
func (uuo *UserUpdateOne) ClearMeetings() *UserUpdateOne
ClearMeetings clears all "meetings" edges to the Meeting entity.
func (*UserUpdateOne) ClearOrganizes ¶
func (uuo *UserUpdateOne) ClearOrganizes() *UserUpdateOne
ClearOrganizes clears all "organizes" edges to the Meeting 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) RemoveMeetingIDs ¶
func (uuo *UserUpdateOne) RemoveMeetingIDs(ids ...int) *UserUpdateOne
RemoveMeetingIDs removes the "meetings" edge to Meeting entities by IDs.
func (*UserUpdateOne) RemoveMeetings ¶
func (uuo *UserUpdateOne) RemoveMeetings(m ...*Meeting) *UserUpdateOne
RemoveMeetings removes "meetings" edges to Meeting entities.
func (*UserUpdateOne) RemoveOrganizeIDs ¶
func (uuo *UserUpdateOne) RemoveOrganizeIDs(ids ...int) *UserUpdateOne
RemoveOrganizeIDs removes the "organizes" edge to Meeting entities by IDs.
func (*UserUpdateOne) RemoveOrganizes ¶
func (uuo *UserUpdateOne) RemoveOrganizes(m ...*Meeting) *UserUpdateOne
RemoveOrganizes removes "organizes" edges to Meeting entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAdmin ¶
func (uuo *UserUpdateOne) SetAdmin(a *Admin) *UserUpdateOne
SetAdmin sets the "admin" edge to the Admin entity.
func (*UserUpdateOne) SetAdminID ¶
func (uuo *UserUpdateOne) SetAdminID(id int) *UserUpdateOne
SetAdminID sets the "admin" edge to the Admin entity by ID.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNickname ¶
func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne
SetNickname sets the "nickname" field.
func (*UserUpdateOne) SetNillableAdminID ¶
func (uuo *UserUpdateOne) SetNillableAdminID(id *int) *UserUpdateOne
SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetUpdateTime ¶
func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne
SetUpdateTime sets the "update_time" field.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.