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 APICreate
- func (ac *APICreate) Exec(ctx context.Context) error
- func (ac *APICreate) ExecX(ctx context.Context)
- func (ac *APICreate) Mutation() *APIMutation
- func (ac *APICreate) Save(ctx context.Context) (*Api, error)
- func (ac *APICreate) SaveX(ctx context.Context) *Api
- func (ac *APICreate) SetCreatedAt(t time.Time) *APICreate
- func (ac *APICreate) SetCreatedBy(i int64) *APICreate
- func (ac *APICreate) SetDesc(s string) *APICreate
- func (ac *APICreate) SetGroup(s string) *APICreate
- func (ac *APICreate) SetID(i int64) *APICreate
- func (ac *APICreate) SetMethod(s string) *APICreate
- func (ac *APICreate) SetName(s string) *APICreate
- func (ac *APICreate) SetNillableCreatedAt(t *time.Time) *APICreate
- func (ac *APICreate) SetNillableCreatedBy(i *int64) *APICreate
- func (ac *APICreate) SetNillableDesc(s *string) *APICreate
- func (ac *APICreate) SetNillableGroup(s *string) *APICreate
- func (ac *APICreate) SetNillableMethod(s *string) *APICreate
- func (ac *APICreate) SetNillableName(s *string) *APICreate
- func (ac *APICreate) SetNillablePath(s *string) *APICreate
- func (ac *APICreate) SetNillablePermission(s *string) *APICreate
- func (ac *APICreate) SetNillableStatus(u *uint8) *APICreate
- func (ac *APICreate) SetNillableUpdatedAt(t *time.Time) *APICreate
- func (ac *APICreate) SetNillableUpdatedBy(i *int64) *APICreate
- func (ac *APICreate) SetPath(s string) *APICreate
- func (ac *APICreate) SetPermission(s string) *APICreate
- func (ac *APICreate) SetStatus(u uint8) *APICreate
- func (ac *APICreate) SetUpdatedAt(t time.Time) *APICreate
- func (ac *APICreate) SetUpdatedBy(i int64) *APICreate
- type APICreateBulk
- type APIDelete
- type APIDeleteOne
- type APIGroupBy
- func (agb *APIGroupBy) Aggregate(fns ...AggregateFunc) *APIGroupBy
- func (agb *APIGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (agb *APIGroupBy) BoolX(ctx context.Context) bool
- func (agb *APIGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (agb *APIGroupBy) BoolsX(ctx context.Context) []bool
- func (agb *APIGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (agb *APIGroupBy) Float64X(ctx context.Context) float64
- func (agb *APIGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (agb *APIGroupBy) Float64sX(ctx context.Context) []float64
- func (agb *APIGroupBy) Int(ctx context.Context) (_ int, err error)
- func (agb *APIGroupBy) IntX(ctx context.Context) int
- func (agb *APIGroupBy) Ints(ctx context.Context) ([]int, error)
- func (agb *APIGroupBy) IntsX(ctx context.Context) []int
- func (agb *APIGroupBy) Scan(ctx context.Context, v interface{}) error
- func (agb *APIGroupBy) ScanX(ctx context.Context, v interface{})
- func (agb *APIGroupBy) String(ctx context.Context) (_ string, err error)
- func (agb *APIGroupBy) StringX(ctx context.Context) string
- func (agb *APIGroupBy) Strings(ctx context.Context) ([]string, error)
- func (agb *APIGroupBy) StringsX(ctx context.Context) []string
- type APIMutation
- func (m *APIMutation) AddCreatedBy(i int64)
- func (m *APIMutation) AddField(name string, value ent.Value) error
- func (m *APIMutation) AddStatus(u int8)
- func (m *APIMutation) AddUpdatedBy(i int64)
- func (m *APIMutation) AddedCreatedBy() (r int64, exists bool)
- func (m *APIMutation) AddedEdges() []string
- func (m *APIMutation) AddedField(name string) (ent.Value, bool)
- func (m *APIMutation) AddedFields() []string
- func (m *APIMutation) AddedIDs(name string) []ent.Value
- func (m *APIMutation) AddedStatus() (r int8, exists bool)
- func (m *APIMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *APIMutation) ClearEdge(name string) error
- func (m *APIMutation) ClearField(name string) error
- func (m *APIMutation) ClearedEdges() []string
- func (m *APIMutation) ClearedFields() []string
- func (m APIMutation) Client() *Client
- func (m *APIMutation) CreatedAt() (r time.Time, exists bool)
- func (m *APIMutation) CreatedBy() (r int64, exists bool)
- func (m *APIMutation) Desc() (r string, exists bool)
- func (m *APIMutation) EdgeCleared(name string) bool
- func (m *APIMutation) Field(name string) (ent.Value, bool)
- func (m *APIMutation) FieldCleared(name string) bool
- func (m *APIMutation) Fields() []string
- func (m *APIMutation) Group() (r string, exists bool)
- func (m *APIMutation) ID() (id int64, exists bool)
- func (m *APIMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *APIMutation) Method() (r string, exists bool)
- func (m *APIMutation) Name() (r string, exists bool)
- func (m *APIMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *APIMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *APIMutation) OldDesc(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *APIMutation) OldGroup(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldMethod(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldName(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldPermission(ctx context.Context) (v string, err error)
- func (m *APIMutation) OldStatus(ctx context.Context) (v uint8, err error)
- func (m *APIMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *APIMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *APIMutation) Op() Op
- func (m *APIMutation) Path() (r string, exists bool)
- func (m *APIMutation) Permission() (r string, exists bool)
- func (m *APIMutation) RemovedEdges() []string
- func (m *APIMutation) RemovedIDs(name string) []ent.Value
- func (m *APIMutation) ResetCreatedAt()
- func (m *APIMutation) ResetCreatedBy()
- func (m *APIMutation) ResetDesc()
- func (m *APIMutation) ResetEdge(name string) error
- func (m *APIMutation) ResetField(name string) error
- func (m *APIMutation) ResetGroup()
- func (m *APIMutation) ResetMethod()
- func (m *APIMutation) ResetName()
- func (m *APIMutation) ResetPath()
- func (m *APIMutation) ResetPermission()
- func (m *APIMutation) ResetStatus()
- func (m *APIMutation) ResetUpdatedAt()
- func (m *APIMutation) ResetUpdatedBy()
- func (m *APIMutation) SetCreatedAt(t time.Time)
- func (m *APIMutation) SetCreatedBy(i int64)
- func (m *APIMutation) SetDesc(s string)
- func (m *APIMutation) SetField(name string, value ent.Value) error
- func (m *APIMutation) SetGroup(s string)
- func (m *APIMutation) SetID(id int64)
- func (m *APIMutation) SetMethod(s string)
- func (m *APIMutation) SetName(s string)
- func (m *APIMutation) SetPath(s string)
- func (m *APIMutation) SetPermission(s string)
- func (m *APIMutation) SetStatus(u uint8)
- func (m *APIMutation) SetUpdatedAt(t time.Time)
- func (m *APIMutation) SetUpdatedBy(i int64)
- func (m *APIMutation) Status() (r uint8, exists bool)
- func (m APIMutation) Tx() (*Tx, error)
- func (m *APIMutation) Type() string
- func (m *APIMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *APIMutation) UpdatedBy() (r int64, exists bool)
- func (m *APIMutation) Where(ps ...predicate.Api)
- type APIQuery
- func (aq *APIQuery) All(ctx context.Context) ([]*Api, error)
- func (aq *APIQuery) AllX(ctx context.Context) []*Api
- func (aq *APIQuery) Clone() *APIQuery
- func (aq *APIQuery) Count(ctx context.Context) (int, error)
- func (aq *APIQuery) CountX(ctx context.Context) int
- func (aq *APIQuery) Exist(ctx context.Context) (bool, error)
- func (aq *APIQuery) ExistX(ctx context.Context) bool
- func (aq *APIQuery) First(ctx context.Context) (*Api, error)
- func (aq *APIQuery) FirstID(ctx context.Context) (id int64, err error)
- func (aq *APIQuery) FirstIDX(ctx context.Context) int64
- func (aq *APIQuery) FirstX(ctx context.Context) *Api
- func (aq *APIQuery) GroupBy(field string, fields ...string) *APIGroupBy
- func (aq *APIQuery) IDs(ctx context.Context) ([]int64, error)
- func (aq *APIQuery) IDsX(ctx context.Context) []int64
- func (aq *APIQuery) Limit(limit int) *APIQuery
- func (aq *APIQuery) Offset(offset int) *APIQuery
- func (aq *APIQuery) Only(ctx context.Context) (*Api, error)
- func (aq *APIQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (aq *APIQuery) OnlyIDX(ctx context.Context) int64
- func (aq *APIQuery) OnlyX(ctx context.Context) *Api
- func (aq *APIQuery) Order(o ...OrderFunc) *APIQuery
- func (aq *APIQuery) Select(fields ...string) *APISelect
- func (aq *APIQuery) Unique(unique bool) *APIQuery
- func (aq *APIQuery) Where(ps ...predicate.Api) *APIQuery
- type APISelect
- func (as *APISelect) Bool(ctx context.Context) (_ bool, err error)
- func (as *APISelect) BoolX(ctx context.Context) bool
- func (as *APISelect) Bools(ctx context.Context) ([]bool, error)
- func (as *APISelect) BoolsX(ctx context.Context) []bool
- func (as *APISelect) Float64(ctx context.Context) (_ float64, err error)
- func (as *APISelect) Float64X(ctx context.Context) float64
- func (as *APISelect) Float64s(ctx context.Context) ([]float64, error)
- func (as *APISelect) Float64sX(ctx context.Context) []float64
- func (as *APISelect) Int(ctx context.Context) (_ int, err error)
- func (as *APISelect) IntX(ctx context.Context) int
- func (as *APISelect) Ints(ctx context.Context) ([]int, error)
- func (as *APISelect) IntsX(ctx context.Context) []int
- func (as *APISelect) Scan(ctx context.Context, v interface{}) error
- func (as *APISelect) ScanX(ctx context.Context, v interface{})
- func (as *APISelect) String(ctx context.Context) (_ string, err error)
- func (as *APISelect) StringX(ctx context.Context) string
- func (as *APISelect) Strings(ctx context.Context) ([]string, error)
- func (as *APISelect) StringsX(ctx context.Context) []string
- type APIUpdate
- func (au *APIUpdate) AddCreatedBy(i int64) *APIUpdate
- func (au *APIUpdate) AddStatus(u int8) *APIUpdate
- func (au *APIUpdate) AddUpdatedBy(i int64) *APIUpdate
- func (au *APIUpdate) Exec(ctx context.Context) error
- func (au *APIUpdate) ExecX(ctx context.Context)
- func (au *APIUpdate) Mutation() *APIMutation
- func (au *APIUpdate) Save(ctx context.Context) (int, error)
- func (au *APIUpdate) SaveX(ctx context.Context) int
- func (au *APIUpdate) SetCreatedAt(t time.Time) *APIUpdate
- func (au *APIUpdate) SetCreatedBy(i int64) *APIUpdate
- func (au *APIUpdate) SetDesc(s string) *APIUpdate
- func (au *APIUpdate) SetGroup(s string) *APIUpdate
- func (au *APIUpdate) SetMethod(s string) *APIUpdate
- func (au *APIUpdate) SetName(s string) *APIUpdate
- func (au *APIUpdate) SetNillableCreatedAt(t *time.Time) *APIUpdate
- func (au *APIUpdate) SetNillableCreatedBy(i *int64) *APIUpdate
- func (au *APIUpdate) SetNillableDesc(s *string) *APIUpdate
- func (au *APIUpdate) SetNillableGroup(s *string) *APIUpdate
- func (au *APIUpdate) SetNillableMethod(s *string) *APIUpdate
- func (au *APIUpdate) SetNillableName(s *string) *APIUpdate
- func (au *APIUpdate) SetNillablePath(s *string) *APIUpdate
- func (au *APIUpdate) SetNillablePermission(s *string) *APIUpdate
- func (au *APIUpdate) SetNillableStatus(u *uint8) *APIUpdate
- func (au *APIUpdate) SetNillableUpdatedBy(i *int64) *APIUpdate
- func (au *APIUpdate) SetPath(s string) *APIUpdate
- func (au *APIUpdate) SetPermission(s string) *APIUpdate
- func (au *APIUpdate) SetStatus(u uint8) *APIUpdate
- func (au *APIUpdate) SetUpdatedAt(t time.Time) *APIUpdate
- func (au *APIUpdate) SetUpdatedBy(i int64) *APIUpdate
- func (au *APIUpdate) Where(ps ...predicate.Api) *APIUpdate
- type APIUpdateOne
- func (auo *APIUpdateOne) AddCreatedBy(i int64) *APIUpdateOne
- func (auo *APIUpdateOne) AddStatus(u int8) *APIUpdateOne
- func (auo *APIUpdateOne) AddUpdatedBy(i int64) *APIUpdateOne
- func (auo *APIUpdateOne) Exec(ctx context.Context) error
- func (auo *APIUpdateOne) ExecX(ctx context.Context)
- func (auo *APIUpdateOne) Mutation() *APIMutation
- func (auo *APIUpdateOne) Save(ctx context.Context) (*Api, error)
- func (auo *APIUpdateOne) SaveX(ctx context.Context) *Api
- func (auo *APIUpdateOne) Select(field string, fields ...string) *APIUpdateOne
- func (auo *APIUpdateOne) SetCreatedAt(t time.Time) *APIUpdateOne
- func (auo *APIUpdateOne) SetCreatedBy(i int64) *APIUpdateOne
- func (auo *APIUpdateOne) SetDesc(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetGroup(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetMethod(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetName(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableCreatedAt(t *time.Time) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableCreatedBy(i *int64) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableDesc(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableGroup(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableMethod(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableName(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillablePath(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillablePermission(s *string) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableStatus(u *uint8) *APIUpdateOne
- func (auo *APIUpdateOne) SetNillableUpdatedBy(i *int64) *APIUpdateOne
- func (auo *APIUpdateOne) SetPath(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetPermission(s string) *APIUpdateOne
- func (auo *APIUpdateOne) SetStatus(u uint8) *APIUpdateOne
- func (auo *APIUpdateOne) SetUpdatedAt(t time.Time) *APIUpdateOne
- func (auo *APIUpdateOne) SetUpdatedBy(i int64) *APIUpdateOne
- type AggregateFunc
- type Api
- type ApiClient
- func (c *ApiClient) Create() *APICreate
- func (c *ApiClient) CreateBulk(builders ...*APICreate) *APICreateBulk
- func (c *ApiClient) Delete() *APIDelete
- func (c *ApiClient) DeleteOne(a *Api) *APIDeleteOne
- func (c *ApiClient) DeleteOneID(id int64) *APIDeleteOne
- func (c *ApiClient) Get(ctx context.Context, id int64) (*Api, error)
- func (c *ApiClient) GetX(ctx context.Context, id int64) *Api
- func (c *ApiClient) Hooks() []Hook
- func (c *ApiClient) Query() *APIQuery
- func (c *ApiClient) Update() *APIUpdate
- func (c *ApiClient) UpdateOne(a *Api) *APIUpdateOne
- func (c *ApiClient) UpdateOneID(id int64) *APIUpdateOne
- func (c *ApiClient) Use(hooks ...Hook)
- type Apis
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type DictData
- type DictDataClient
- func (c *DictDataClient) Create() *DictDataCreate
- func (c *DictDataClient) CreateBulk(builders ...*DictDataCreate) *DictDataCreateBulk
- func (c *DictDataClient) Delete() *DictDataDelete
- func (c *DictDataClient) DeleteOne(dd *DictData) *DictDataDeleteOne
- func (c *DictDataClient) DeleteOneID(id int64) *DictDataDeleteOne
- func (c *DictDataClient) Get(ctx context.Context, id int64) (*DictData, error)
- func (c *DictDataClient) GetX(ctx context.Context, id int64) *DictData
- func (c *DictDataClient) Hooks() []Hook
- func (c *DictDataClient) Query() *DictDataQuery
- func (c *DictDataClient) Update() *DictDataUpdate
- func (c *DictDataClient) UpdateOne(dd *DictData) *DictDataUpdateOne
- func (c *DictDataClient) UpdateOneID(id int64) *DictDataUpdateOne
- func (c *DictDataClient) Use(hooks ...Hook)
- type DictDataCreate
- func (ddc *DictDataCreate) Exec(ctx context.Context) error
- func (ddc *DictDataCreate) ExecX(ctx context.Context)
- func (ddc *DictDataCreate) Mutation() *DictDataMutation
- func (ddc *DictDataCreate) Save(ctx context.Context) (*DictData, error)
- func (ddc *DictDataCreate) SaveX(ctx context.Context) *DictData
- func (ddc *DictDataCreate) SetCreatedAt(t time.Time) *DictDataCreate
- func (ddc *DictDataCreate) SetCreatedBy(i int64) *DictDataCreate
- func (ddc *DictDataCreate) SetDictTypeID(i int64) *DictDataCreate
- func (ddc *DictDataCreate) SetID(i int64) *DictDataCreate
- func (ddc *DictDataCreate) SetIsDefault(i int8) *DictDataCreate
- func (ddc *DictDataCreate) SetLabel(s string) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableCreatedAt(t *time.Time) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableCreatedBy(i *int64) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableDictTypeID(i *int64) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableIsDefault(i *int8) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableLabel(s *string) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableRemark(s *string) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableSort(i *int8) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableStatus(i *int8) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableUpdatedAt(t *time.Time) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableUpdatedBy(i *int64) *DictDataCreate
- func (ddc *DictDataCreate) SetNillableValue(s *string) *DictDataCreate
- func (ddc *DictDataCreate) SetRemark(s string) *DictDataCreate
- func (ddc *DictDataCreate) SetSort(i int8) *DictDataCreate
- func (ddc *DictDataCreate) SetStatus(i int8) *DictDataCreate
- func (ddc *DictDataCreate) SetUpdatedAt(t time.Time) *DictDataCreate
- func (ddc *DictDataCreate) SetUpdatedBy(i int64) *DictDataCreate
- func (ddc *DictDataCreate) SetValue(s string) *DictDataCreate
- type DictDataCreateBulk
- type DictDataDelete
- type DictDataDeleteOne
- type DictDataGroupBy
- func (ddgb *DictDataGroupBy) Aggregate(fns ...AggregateFunc) *DictDataGroupBy
- func (ddgb *DictDataGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ddgb *DictDataGroupBy) BoolX(ctx context.Context) bool
- func (ddgb *DictDataGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ddgb *DictDataGroupBy) BoolsX(ctx context.Context) []bool
- func (ddgb *DictDataGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ddgb *DictDataGroupBy) Float64X(ctx context.Context) float64
- func (ddgb *DictDataGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ddgb *DictDataGroupBy) Float64sX(ctx context.Context) []float64
- func (ddgb *DictDataGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ddgb *DictDataGroupBy) IntX(ctx context.Context) int
- func (ddgb *DictDataGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ddgb *DictDataGroupBy) IntsX(ctx context.Context) []int
- func (ddgb *DictDataGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ddgb *DictDataGroupBy) ScanX(ctx context.Context, v interface{})
- func (ddgb *DictDataGroupBy) String(ctx context.Context) (_ string, err error)
- func (ddgb *DictDataGroupBy) StringX(ctx context.Context) string
- func (ddgb *DictDataGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ddgb *DictDataGroupBy) StringsX(ctx context.Context) []string
- type DictDataMutation
- func (m *DictDataMutation) AddCreatedBy(i int64)
- func (m *DictDataMutation) AddDictTypeID(i int64)
- func (m *DictDataMutation) AddField(name string, value ent.Value) error
- func (m *DictDataMutation) AddIsDefault(i int8)
- func (m *DictDataMutation) AddSort(i int8)
- func (m *DictDataMutation) AddStatus(i int8)
- func (m *DictDataMutation) AddUpdatedBy(i int64)
- func (m *DictDataMutation) AddedCreatedBy() (r int64, exists bool)
- func (m *DictDataMutation) AddedDictTypeID() (r int64, exists bool)
- func (m *DictDataMutation) AddedEdges() []string
- func (m *DictDataMutation) AddedField(name string) (ent.Value, bool)
- func (m *DictDataMutation) AddedFields() []string
- func (m *DictDataMutation) AddedIDs(name string) []ent.Value
- func (m *DictDataMutation) AddedIsDefault() (r int8, exists bool)
- func (m *DictDataMutation) AddedSort() (r int8, exists bool)
- func (m *DictDataMutation) AddedStatus() (r int8, exists bool)
- func (m *DictDataMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *DictDataMutation) ClearEdge(name string) error
- func (m *DictDataMutation) ClearField(name string) error
- func (m *DictDataMutation) ClearedEdges() []string
- func (m *DictDataMutation) ClearedFields() []string
- func (m DictDataMutation) Client() *Client
- func (m *DictDataMutation) CreatedAt() (r time.Time, exists bool)
- func (m *DictDataMutation) CreatedBy() (r int64, exists bool)
- func (m *DictDataMutation) DictTypeID() (r int64, exists bool)
- func (m *DictDataMutation) EdgeCleared(name string) bool
- func (m *DictDataMutation) Field(name string) (ent.Value, bool)
- func (m *DictDataMutation) FieldCleared(name string) bool
- func (m *DictDataMutation) Fields() []string
- func (m *DictDataMutation) ID() (id int64, exists bool)
- func (m *DictDataMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *DictDataMutation) IsDefault() (r int8, exists bool)
- func (m *DictDataMutation) Label() (r string, exists bool)
- func (m *DictDataMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DictDataMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *DictDataMutation) OldDictTypeID(ctx context.Context) (v int64, err error)
- func (m *DictDataMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DictDataMutation) OldIsDefault(ctx context.Context) (v int8, err error)
- func (m *DictDataMutation) OldLabel(ctx context.Context) (v string, err error)
- func (m *DictDataMutation) OldRemark(ctx context.Context) (v string, err error)
- func (m *DictDataMutation) OldSort(ctx context.Context) (v int8, err error)
- func (m *DictDataMutation) OldStatus(ctx context.Context) (v int8, err error)
- func (m *DictDataMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DictDataMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *DictDataMutation) OldValue(ctx context.Context) (v string, err error)
- func (m *DictDataMutation) Op() Op
- func (m *DictDataMutation) Remark() (r string, exists bool)
- func (m *DictDataMutation) RemovedEdges() []string
- func (m *DictDataMutation) RemovedIDs(name string) []ent.Value
- func (m *DictDataMutation) ResetCreatedAt()
- func (m *DictDataMutation) ResetCreatedBy()
- func (m *DictDataMutation) ResetDictTypeID()
- func (m *DictDataMutation) ResetEdge(name string) error
- func (m *DictDataMutation) ResetField(name string) error
- func (m *DictDataMutation) ResetIsDefault()
- func (m *DictDataMutation) ResetLabel()
- func (m *DictDataMutation) ResetRemark()
- func (m *DictDataMutation) ResetSort()
- func (m *DictDataMutation) ResetStatus()
- func (m *DictDataMutation) ResetUpdatedAt()
- func (m *DictDataMutation) ResetUpdatedBy()
- func (m *DictDataMutation) ResetValue()
- func (m *DictDataMutation) SetCreatedAt(t time.Time)
- func (m *DictDataMutation) SetCreatedBy(i int64)
- func (m *DictDataMutation) SetDictTypeID(i int64)
- func (m *DictDataMutation) SetField(name string, value ent.Value) error
- func (m *DictDataMutation) SetID(id int64)
- func (m *DictDataMutation) SetIsDefault(i int8)
- func (m *DictDataMutation) SetLabel(s string)
- func (m *DictDataMutation) SetRemark(s string)
- func (m *DictDataMutation) SetSort(i int8)
- func (m *DictDataMutation) SetStatus(i int8)
- func (m *DictDataMutation) SetUpdatedAt(t time.Time)
- func (m *DictDataMutation) SetUpdatedBy(i int64)
- func (m *DictDataMutation) SetValue(s string)
- func (m *DictDataMutation) Sort() (r int8, exists bool)
- func (m *DictDataMutation) Status() (r int8, exists bool)
- func (m DictDataMutation) Tx() (*Tx, error)
- func (m *DictDataMutation) Type() string
- func (m *DictDataMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *DictDataMutation) UpdatedBy() (r int64, exists bool)
- func (m *DictDataMutation) Value() (r string, exists bool)
- func (m *DictDataMutation) Where(ps ...predicate.DictData)
- type DictDataQuery
- func (ddq *DictDataQuery) All(ctx context.Context) ([]*DictData, error)
- func (ddq *DictDataQuery) AllX(ctx context.Context) []*DictData
- func (ddq *DictDataQuery) Clone() *DictDataQuery
- func (ddq *DictDataQuery) Count(ctx context.Context) (int, error)
- func (ddq *DictDataQuery) CountX(ctx context.Context) int
- func (ddq *DictDataQuery) Exist(ctx context.Context) (bool, error)
- func (ddq *DictDataQuery) ExistX(ctx context.Context) bool
- func (ddq *DictDataQuery) First(ctx context.Context) (*DictData, error)
- func (ddq *DictDataQuery) FirstID(ctx context.Context) (id int64, err error)
- func (ddq *DictDataQuery) FirstIDX(ctx context.Context) int64
- func (ddq *DictDataQuery) FirstX(ctx context.Context) *DictData
- func (ddq *DictDataQuery) GroupBy(field string, fields ...string) *DictDataGroupBy
- func (ddq *DictDataQuery) IDs(ctx context.Context) ([]int64, error)
- func (ddq *DictDataQuery) IDsX(ctx context.Context) []int64
- func (ddq *DictDataQuery) Limit(limit int) *DictDataQuery
- func (ddq *DictDataQuery) Offset(offset int) *DictDataQuery
- func (ddq *DictDataQuery) Only(ctx context.Context) (*DictData, error)
- func (ddq *DictDataQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (ddq *DictDataQuery) OnlyIDX(ctx context.Context) int64
- func (ddq *DictDataQuery) OnlyX(ctx context.Context) *DictData
- func (ddq *DictDataQuery) Order(o ...OrderFunc) *DictDataQuery
- func (ddq *DictDataQuery) Select(fields ...string) *DictDataSelect
- func (ddq *DictDataQuery) Unique(unique bool) *DictDataQuery
- func (ddq *DictDataQuery) Where(ps ...predicate.DictData) *DictDataQuery
- type DictDataSelect
- func (dds *DictDataSelect) Bool(ctx context.Context) (_ bool, err error)
- func (dds *DictDataSelect) BoolX(ctx context.Context) bool
- func (dds *DictDataSelect) Bools(ctx context.Context) ([]bool, error)
- func (dds *DictDataSelect) BoolsX(ctx context.Context) []bool
- func (dds *DictDataSelect) Float64(ctx context.Context) (_ float64, err error)
- func (dds *DictDataSelect) Float64X(ctx context.Context) float64
- func (dds *DictDataSelect) Float64s(ctx context.Context) ([]float64, error)
- func (dds *DictDataSelect) Float64sX(ctx context.Context) []float64
- func (dds *DictDataSelect) Int(ctx context.Context) (_ int, err error)
- func (dds *DictDataSelect) IntX(ctx context.Context) int
- func (dds *DictDataSelect) Ints(ctx context.Context) ([]int, error)
- func (dds *DictDataSelect) IntsX(ctx context.Context) []int
- func (dds *DictDataSelect) Scan(ctx context.Context, v interface{}) error
- func (dds *DictDataSelect) ScanX(ctx context.Context, v interface{})
- func (dds *DictDataSelect) String(ctx context.Context) (_ string, err error)
- func (dds *DictDataSelect) StringX(ctx context.Context) string
- func (dds *DictDataSelect) Strings(ctx context.Context) ([]string, error)
- func (dds *DictDataSelect) StringsX(ctx context.Context) []string
- type DictDataSlice
- type DictDataUpdate
- func (ddu *DictDataUpdate) AddCreatedBy(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) AddDictTypeID(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) AddIsDefault(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) AddSort(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) AddStatus(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) AddUpdatedBy(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) Exec(ctx context.Context) error
- func (ddu *DictDataUpdate) ExecX(ctx context.Context)
- func (ddu *DictDataUpdate) Mutation() *DictDataMutation
- func (ddu *DictDataUpdate) Save(ctx context.Context) (int, error)
- func (ddu *DictDataUpdate) SaveX(ctx context.Context) int
- func (ddu *DictDataUpdate) SetCreatedAt(t time.Time) *DictDataUpdate
- func (ddu *DictDataUpdate) SetCreatedBy(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetDictTypeID(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetIsDefault(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetLabel(s string) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableCreatedAt(t *time.Time) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableCreatedBy(i *int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableDictTypeID(i *int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableIsDefault(i *int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableLabel(s *string) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableRemark(s *string) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableSort(i *int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableStatus(i *int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableUpdatedBy(i *int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetNillableValue(s *string) *DictDataUpdate
- func (ddu *DictDataUpdate) SetRemark(s string) *DictDataUpdate
- func (ddu *DictDataUpdate) SetSort(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetStatus(i int8) *DictDataUpdate
- func (ddu *DictDataUpdate) SetUpdatedAt(t time.Time) *DictDataUpdate
- func (ddu *DictDataUpdate) SetUpdatedBy(i int64) *DictDataUpdate
- func (ddu *DictDataUpdate) SetValue(s string) *DictDataUpdate
- func (ddu *DictDataUpdate) Where(ps ...predicate.DictData) *DictDataUpdate
- type DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddCreatedBy(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddDictTypeID(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddIsDefault(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddSort(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddStatus(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) AddUpdatedBy(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) Exec(ctx context.Context) error
- func (dduo *DictDataUpdateOne) ExecX(ctx context.Context)
- func (dduo *DictDataUpdateOne) Mutation() *DictDataMutation
- func (dduo *DictDataUpdateOne) Save(ctx context.Context) (*DictData, error)
- func (dduo *DictDataUpdateOne) SaveX(ctx context.Context) *DictData
- func (dduo *DictDataUpdateOne) Select(field string, fields ...string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetCreatedAt(t time.Time) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetCreatedBy(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetDictTypeID(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetIsDefault(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetLabel(s string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableCreatedAt(t *time.Time) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableCreatedBy(i *int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableDictTypeID(i *int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableIsDefault(i *int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableLabel(s *string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableRemark(s *string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableSort(i *int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableStatus(i *int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableUpdatedBy(i *int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetNillableValue(s *string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetRemark(s string) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetSort(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetStatus(i int8) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetUpdatedAt(t time.Time) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetUpdatedBy(i int64) *DictDataUpdateOne
- func (dduo *DictDataUpdateOne) SetValue(s string) *DictDataUpdateOne
- type DictType
- type DictTypeClient
- func (c *DictTypeClient) Create() *DictTypeCreate
- func (c *DictTypeClient) CreateBulk(builders ...*DictTypeCreate) *DictTypeCreateBulk
- func (c *DictTypeClient) Delete() *DictTypeDelete
- func (c *DictTypeClient) DeleteOne(dt *DictType) *DictTypeDeleteOne
- func (c *DictTypeClient) DeleteOneID(id int64) *DictTypeDeleteOne
- func (c *DictTypeClient) Get(ctx context.Context, id int64) (*DictType, error)
- func (c *DictTypeClient) GetX(ctx context.Context, id int64) *DictType
- func (c *DictTypeClient) Hooks() []Hook
- func (c *DictTypeClient) Query() *DictTypeQuery
- func (c *DictTypeClient) Update() *DictTypeUpdate
- func (c *DictTypeClient) UpdateOne(dt *DictType) *DictTypeUpdateOne
- func (c *DictTypeClient) UpdateOneID(id int64) *DictTypeUpdateOne
- func (c *DictTypeClient) Use(hooks ...Hook)
- type DictTypeCreate
- func (dtc *DictTypeCreate) Exec(ctx context.Context) error
- func (dtc *DictTypeCreate) ExecX(ctx context.Context)
- func (dtc *DictTypeCreate) Mutation() *DictTypeMutation
- func (dtc *DictTypeCreate) Save(ctx context.Context) (*DictType, error)
- func (dtc *DictTypeCreate) SaveX(ctx context.Context) *DictType
- func (dtc *DictTypeCreate) SetCreatedAt(t time.Time) *DictTypeCreate
- func (dtc *DictTypeCreate) SetCreatedBy(i int64) *DictTypeCreate
- func (dtc *DictTypeCreate) SetID(i int64) *DictTypeCreate
- func (dtc *DictTypeCreate) SetName(s string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableCreatedAt(t *time.Time) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableCreatedBy(i *int64) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableName(s *string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableRemark(s *string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableStatus(i *int8) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableType(s *string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableUpdatedAt(t *time.Time) *DictTypeCreate
- func (dtc *DictTypeCreate) SetNillableUpdatedBy(i *int64) *DictTypeCreate
- func (dtc *DictTypeCreate) SetRemark(s string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetStatus(i int8) *DictTypeCreate
- func (dtc *DictTypeCreate) SetType(s string) *DictTypeCreate
- func (dtc *DictTypeCreate) SetUpdatedAt(t time.Time) *DictTypeCreate
- func (dtc *DictTypeCreate) SetUpdatedBy(i int64) *DictTypeCreate
- type DictTypeCreateBulk
- type DictTypeDelete
- type DictTypeDeleteOne
- type DictTypeGroupBy
- func (dtgb *DictTypeGroupBy) Aggregate(fns ...AggregateFunc) *DictTypeGroupBy
- func (dtgb *DictTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (dtgb *DictTypeGroupBy) BoolX(ctx context.Context) bool
- func (dtgb *DictTypeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (dtgb *DictTypeGroupBy) BoolsX(ctx context.Context) []bool
- func (dtgb *DictTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (dtgb *DictTypeGroupBy) Float64X(ctx context.Context) float64
- func (dtgb *DictTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (dtgb *DictTypeGroupBy) Float64sX(ctx context.Context) []float64
- func (dtgb *DictTypeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (dtgb *DictTypeGroupBy) IntX(ctx context.Context) int
- func (dtgb *DictTypeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (dtgb *DictTypeGroupBy) IntsX(ctx context.Context) []int
- func (dtgb *DictTypeGroupBy) Scan(ctx context.Context, v interface{}) error
- func (dtgb *DictTypeGroupBy) ScanX(ctx context.Context, v interface{})
- func (dtgb *DictTypeGroupBy) String(ctx context.Context) (_ string, err error)
- func (dtgb *DictTypeGroupBy) StringX(ctx context.Context) string
- func (dtgb *DictTypeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (dtgb *DictTypeGroupBy) StringsX(ctx context.Context) []string
- type DictTypeMutation
- func (m *DictTypeMutation) AddCreatedBy(i int64)
- func (m *DictTypeMutation) AddField(name string, value ent.Value) error
- func (m *DictTypeMutation) AddStatus(i int8)
- func (m *DictTypeMutation) AddUpdatedBy(i int64)
- func (m *DictTypeMutation) AddedCreatedBy() (r int64, exists bool)
- func (m *DictTypeMutation) AddedEdges() []string
- func (m *DictTypeMutation) AddedField(name string) (ent.Value, bool)
- func (m *DictTypeMutation) AddedFields() []string
- func (m *DictTypeMutation) AddedIDs(name string) []ent.Value
- func (m *DictTypeMutation) AddedStatus() (r int8, exists bool)
- func (m *DictTypeMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *DictTypeMutation) ClearEdge(name string) error
- func (m *DictTypeMutation) ClearField(name string) error
- func (m *DictTypeMutation) ClearedEdges() []string
- func (m *DictTypeMutation) ClearedFields() []string
- func (m DictTypeMutation) Client() *Client
- func (m *DictTypeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *DictTypeMutation) CreatedBy() (r int64, exists bool)
- func (m *DictTypeMutation) EdgeCleared(name string) bool
- func (m *DictTypeMutation) Field(name string) (ent.Value, bool)
- func (m *DictTypeMutation) FieldCleared(name string) bool
- func (m *DictTypeMutation) Fields() []string
- func (m *DictTypeMutation) GetType() (r string, exists bool)
- func (m *DictTypeMutation) ID() (id int64, exists bool)
- func (m *DictTypeMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *DictTypeMutation) Name() (r string, exists bool)
- func (m *DictTypeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DictTypeMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *DictTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DictTypeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *DictTypeMutation) OldRemark(ctx context.Context) (v string, err error)
- func (m *DictTypeMutation) OldStatus(ctx context.Context) (v int8, err error)
- func (m *DictTypeMutation) OldType(ctx context.Context) (v string, err error)
- func (m *DictTypeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DictTypeMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *DictTypeMutation) Op() Op
- func (m *DictTypeMutation) Remark() (r string, exists bool)
- func (m *DictTypeMutation) RemovedEdges() []string
- func (m *DictTypeMutation) RemovedIDs(name string) []ent.Value
- func (m *DictTypeMutation) ResetCreatedAt()
- func (m *DictTypeMutation) ResetCreatedBy()
- func (m *DictTypeMutation) ResetEdge(name string) error
- func (m *DictTypeMutation) ResetField(name string) error
- func (m *DictTypeMutation) ResetName()
- func (m *DictTypeMutation) ResetRemark()
- func (m *DictTypeMutation) ResetStatus()
- func (m *DictTypeMutation) ResetType()
- func (m *DictTypeMutation) ResetUpdatedAt()
- func (m *DictTypeMutation) ResetUpdatedBy()
- func (m *DictTypeMutation) SetCreatedAt(t time.Time)
- func (m *DictTypeMutation) SetCreatedBy(i int64)
- func (m *DictTypeMutation) SetField(name string, value ent.Value) error
- func (m *DictTypeMutation) SetID(id int64)
- func (m *DictTypeMutation) SetName(s string)
- func (m *DictTypeMutation) SetRemark(s string)
- func (m *DictTypeMutation) SetStatus(i int8)
- func (m *DictTypeMutation) SetType(s string)
- func (m *DictTypeMutation) SetUpdatedAt(t time.Time)
- func (m *DictTypeMutation) SetUpdatedBy(i int64)
- func (m *DictTypeMutation) Status() (r int8, exists bool)
- func (m DictTypeMutation) Tx() (*Tx, error)
- func (m *DictTypeMutation) Type() string
- func (m *DictTypeMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *DictTypeMutation) UpdatedBy() (r int64, exists bool)
- func (m *DictTypeMutation) Where(ps ...predicate.DictType)
- type DictTypeQuery
- func (dtq *DictTypeQuery) All(ctx context.Context) ([]*DictType, error)
- func (dtq *DictTypeQuery) AllX(ctx context.Context) []*DictType
- func (dtq *DictTypeQuery) Clone() *DictTypeQuery
- func (dtq *DictTypeQuery) Count(ctx context.Context) (int, error)
- func (dtq *DictTypeQuery) CountX(ctx context.Context) int
- func (dtq *DictTypeQuery) Exist(ctx context.Context) (bool, error)
- func (dtq *DictTypeQuery) ExistX(ctx context.Context) bool
- func (dtq *DictTypeQuery) First(ctx context.Context) (*DictType, error)
- func (dtq *DictTypeQuery) FirstID(ctx context.Context) (id int64, err error)
- func (dtq *DictTypeQuery) FirstIDX(ctx context.Context) int64
- func (dtq *DictTypeQuery) FirstX(ctx context.Context) *DictType
- func (dtq *DictTypeQuery) GroupBy(field string, fields ...string) *DictTypeGroupBy
- func (dtq *DictTypeQuery) IDs(ctx context.Context) ([]int64, error)
- func (dtq *DictTypeQuery) IDsX(ctx context.Context) []int64
- func (dtq *DictTypeQuery) Limit(limit int) *DictTypeQuery
- func (dtq *DictTypeQuery) Offset(offset int) *DictTypeQuery
- func (dtq *DictTypeQuery) Only(ctx context.Context) (*DictType, error)
- func (dtq *DictTypeQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (dtq *DictTypeQuery) OnlyIDX(ctx context.Context) int64
- func (dtq *DictTypeQuery) OnlyX(ctx context.Context) *DictType
- func (dtq *DictTypeQuery) Order(o ...OrderFunc) *DictTypeQuery
- func (dtq *DictTypeQuery) Select(fields ...string) *DictTypeSelect
- func (dtq *DictTypeQuery) Unique(unique bool) *DictTypeQuery
- func (dtq *DictTypeQuery) Where(ps ...predicate.DictType) *DictTypeQuery
- type DictTypeSelect
- func (dts *DictTypeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (dts *DictTypeSelect) BoolX(ctx context.Context) bool
- func (dts *DictTypeSelect) Bools(ctx context.Context) ([]bool, error)
- func (dts *DictTypeSelect) BoolsX(ctx context.Context) []bool
- func (dts *DictTypeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (dts *DictTypeSelect) Float64X(ctx context.Context) float64
- func (dts *DictTypeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (dts *DictTypeSelect) Float64sX(ctx context.Context) []float64
- func (dts *DictTypeSelect) Int(ctx context.Context) (_ int, err error)
- func (dts *DictTypeSelect) IntX(ctx context.Context) int
- func (dts *DictTypeSelect) Ints(ctx context.Context) ([]int, error)
- func (dts *DictTypeSelect) IntsX(ctx context.Context) []int
- func (dts *DictTypeSelect) Scan(ctx context.Context, v interface{}) error
- func (dts *DictTypeSelect) ScanX(ctx context.Context, v interface{})
- func (dts *DictTypeSelect) String(ctx context.Context) (_ string, err error)
- func (dts *DictTypeSelect) StringX(ctx context.Context) string
- func (dts *DictTypeSelect) Strings(ctx context.Context) ([]string, error)
- func (dts *DictTypeSelect) StringsX(ctx context.Context) []string
- type DictTypeUpdate
- func (dtu *DictTypeUpdate) AddCreatedBy(i int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) AddStatus(i int8) *DictTypeUpdate
- func (dtu *DictTypeUpdate) AddUpdatedBy(i int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) Exec(ctx context.Context) error
- func (dtu *DictTypeUpdate) ExecX(ctx context.Context)
- func (dtu *DictTypeUpdate) Mutation() *DictTypeMutation
- func (dtu *DictTypeUpdate) Save(ctx context.Context) (int, error)
- func (dtu *DictTypeUpdate) SaveX(ctx context.Context) int
- func (dtu *DictTypeUpdate) SetCreatedAt(t time.Time) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetCreatedBy(i int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetName(s string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableCreatedAt(t *time.Time) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableCreatedBy(i *int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableName(s *string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableRemark(s *string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableStatus(i *int8) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableType(s *string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetNillableUpdatedBy(i *int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetRemark(s string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetStatus(i int8) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetType(s string) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetUpdatedAt(t time.Time) *DictTypeUpdate
- func (dtu *DictTypeUpdate) SetUpdatedBy(i int64) *DictTypeUpdate
- func (dtu *DictTypeUpdate) Where(ps ...predicate.DictType) *DictTypeUpdate
- type DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) AddCreatedBy(i int64) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) AddStatus(i int8) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) AddUpdatedBy(i int64) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) Exec(ctx context.Context) error
- func (dtuo *DictTypeUpdateOne) ExecX(ctx context.Context)
- func (dtuo *DictTypeUpdateOne) Mutation() *DictTypeMutation
- func (dtuo *DictTypeUpdateOne) Save(ctx context.Context) (*DictType, error)
- func (dtuo *DictTypeUpdateOne) SaveX(ctx context.Context) *DictType
- func (dtuo *DictTypeUpdateOne) Select(field string, fields ...string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetCreatedAt(t time.Time) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetCreatedBy(i int64) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetName(s string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableCreatedAt(t *time.Time) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableCreatedBy(i *int64) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableName(s *string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableRemark(s *string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableStatus(i *int8) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableType(s *string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetNillableUpdatedBy(i *int64) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetRemark(s string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetStatus(i int8) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetType(s string) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetUpdatedAt(t time.Time) *DictTypeUpdateOne
- func (dtuo *DictTypeUpdateOne) SetUpdatedBy(i int64) *DictTypeUpdateOne
- type DictTypes
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Permission
- type PermissionClient
- func (c *PermissionClient) Create() *PermissionCreate
- func (c *PermissionClient) CreateBulk(builders ...*PermissionCreate) *PermissionCreateBulk
- func (c *PermissionClient) Delete() *PermissionDelete
- func (c *PermissionClient) DeleteOne(pe *Permission) *PermissionDeleteOne
- func (c *PermissionClient) DeleteOneID(id int64) *PermissionDeleteOne
- func (c *PermissionClient) Get(ctx context.Context, id int64) (*Permission, error)
- func (c *PermissionClient) GetX(ctx context.Context, id int64) *Permission
- func (c *PermissionClient) Hooks() []Hook
- func (c *PermissionClient) Query() *PermissionQuery
- func (c *PermissionClient) Update() *PermissionUpdate
- func (c *PermissionClient) UpdateOne(pe *Permission) *PermissionUpdateOne
- func (c *PermissionClient) UpdateOneID(id int64) *PermissionUpdateOne
- func (c *PermissionClient) Use(hooks ...Hook)
- type PermissionCreate
- func (pc *PermissionCreate) Exec(ctx context.Context) error
- func (pc *PermissionCreate) ExecX(ctx context.Context)
- func (pc *PermissionCreate) Mutation() *PermissionMutation
- func (pc *PermissionCreate) Save(ctx context.Context) (*Permission, error)
- func (pc *PermissionCreate) SaveX(ctx context.Context) *Permission
- func (pc *PermissionCreate) SetID(i int64) *PermissionCreate
- func (pc *PermissionCreate) SetMenuID(i int64) *PermissionCreate
- func (pc *PermissionCreate) SetName(s string) *PermissionCreate
- func (pc *PermissionCreate) SetNillableMenuID(i *int64) *PermissionCreate
- func (pc *PermissionCreate) SetNillableName(s *string) *PermissionCreate
- func (pc *PermissionCreate) SetNillablePermission(s *string) *PermissionCreate
- func (pc *PermissionCreate) SetPermission(s string) *PermissionCreate
- type PermissionCreateBulk
- type PermissionDelete
- type PermissionDeleteOne
- type PermissionGroupBy
- func (pgb *PermissionGroupBy) Aggregate(fns ...AggregateFunc) *PermissionGroupBy
- func (pgb *PermissionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (pgb *PermissionGroupBy) BoolX(ctx context.Context) bool
- func (pgb *PermissionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (pgb *PermissionGroupBy) BoolsX(ctx context.Context) []bool
- func (pgb *PermissionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (pgb *PermissionGroupBy) Float64X(ctx context.Context) float64
- func (pgb *PermissionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (pgb *PermissionGroupBy) Float64sX(ctx context.Context) []float64
- func (pgb *PermissionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (pgb *PermissionGroupBy) IntX(ctx context.Context) int
- func (pgb *PermissionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (pgb *PermissionGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PermissionGroupBy) Scan(ctx context.Context, v interface{}) error
- func (pgb *PermissionGroupBy) ScanX(ctx context.Context, v interface{})
- func (pgb *PermissionGroupBy) String(ctx context.Context) (_ string, err error)
- func (pgb *PermissionGroupBy) StringX(ctx context.Context) string
- func (pgb *PermissionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (pgb *PermissionGroupBy) StringsX(ctx context.Context) []string
- type PermissionMutation
- func (m *PermissionMutation) AddField(name string, value ent.Value) error
- func (m *PermissionMutation) AddMenuID(i int64)
- func (m *PermissionMutation) AddedEdges() []string
- func (m *PermissionMutation) AddedField(name string) (ent.Value, bool)
- func (m *PermissionMutation) AddedFields() []string
- func (m *PermissionMutation) AddedIDs(name string) []ent.Value
- func (m *PermissionMutation) AddedMenuID() (r int64, exists bool)
- func (m *PermissionMutation) ClearEdge(name string) error
- func (m *PermissionMutation) ClearField(name string) error
- func (m *PermissionMutation) ClearedEdges() []string
- func (m *PermissionMutation) ClearedFields() []string
- func (m PermissionMutation) Client() *Client
- func (m *PermissionMutation) EdgeCleared(name string) bool
- func (m *PermissionMutation) Field(name string) (ent.Value, bool)
- func (m *PermissionMutation) FieldCleared(name string) bool
- func (m *PermissionMutation) Fields() []string
- func (m *PermissionMutation) ID() (id int64, exists bool)
- func (m *PermissionMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *PermissionMutation) MenuID() (r int64, exists bool)
- func (m *PermissionMutation) Name() (r string, exists bool)
- func (m *PermissionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PermissionMutation) OldMenuID(ctx context.Context) (v int64, err error)
- func (m *PermissionMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PermissionMutation) OldPermission(ctx context.Context) (v string, err error)
- func (m *PermissionMutation) Op() Op
- func (m *PermissionMutation) Permission() (r string, exists bool)
- func (m *PermissionMutation) RemovedEdges() []string
- func (m *PermissionMutation) RemovedIDs(name string) []ent.Value
- func (m *PermissionMutation) ResetEdge(name string) error
- func (m *PermissionMutation) ResetField(name string) error
- func (m *PermissionMutation) ResetMenuID()
- func (m *PermissionMutation) ResetName()
- func (m *PermissionMutation) ResetPermission()
- func (m *PermissionMutation) SetField(name string, value ent.Value) error
- func (m *PermissionMutation) SetID(id int64)
- func (m *PermissionMutation) SetMenuID(i int64)
- func (m *PermissionMutation) SetName(s string)
- func (m *PermissionMutation) SetPermission(s string)
- func (m PermissionMutation) Tx() (*Tx, error)
- func (m *PermissionMutation) Type() string
- func (m *PermissionMutation) Where(ps ...predicate.Permission)
- type PermissionQuery
- func (pq *PermissionQuery) All(ctx context.Context) ([]*Permission, error)
- func (pq *PermissionQuery) AllX(ctx context.Context) []*Permission
- func (pq *PermissionQuery) Clone() *PermissionQuery
- func (pq *PermissionQuery) Count(ctx context.Context) (int, error)
- func (pq *PermissionQuery) CountX(ctx context.Context) int
- func (pq *PermissionQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PermissionQuery) ExistX(ctx context.Context) bool
- func (pq *PermissionQuery) First(ctx context.Context) (*Permission, error)
- func (pq *PermissionQuery) FirstID(ctx context.Context) (id int64, err error)
- func (pq *PermissionQuery) FirstIDX(ctx context.Context) int64
- func (pq *PermissionQuery) FirstX(ctx context.Context) *Permission
- func (pq *PermissionQuery) GroupBy(field string, fields ...string) *PermissionGroupBy
- func (pq *PermissionQuery) IDs(ctx context.Context) ([]int64, error)
- func (pq *PermissionQuery) IDsX(ctx context.Context) []int64
- func (pq *PermissionQuery) Limit(limit int) *PermissionQuery
- func (pq *PermissionQuery) Offset(offset int) *PermissionQuery
- func (pq *PermissionQuery) Only(ctx context.Context) (*Permission, error)
- func (pq *PermissionQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (pq *PermissionQuery) OnlyIDX(ctx context.Context) int64
- func (pq *PermissionQuery) OnlyX(ctx context.Context) *Permission
- func (pq *PermissionQuery) Order(o ...OrderFunc) *PermissionQuery
- func (pq *PermissionQuery) Select(fields ...string) *PermissionSelect
- func (pq *PermissionQuery) Unique(unique bool) *PermissionQuery
- func (pq *PermissionQuery) Where(ps ...predicate.Permission) *PermissionQuery
- type PermissionSelect
- func (ps *PermissionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ps *PermissionSelect) BoolX(ctx context.Context) bool
- func (ps *PermissionSelect) Bools(ctx context.Context) ([]bool, error)
- func (ps *PermissionSelect) BoolsX(ctx context.Context) []bool
- func (ps *PermissionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ps *PermissionSelect) Float64X(ctx context.Context) float64
- func (ps *PermissionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ps *PermissionSelect) Float64sX(ctx context.Context) []float64
- func (ps *PermissionSelect) Int(ctx context.Context) (_ int, err error)
- func (ps *PermissionSelect) IntX(ctx context.Context) int
- func (ps *PermissionSelect) Ints(ctx context.Context) ([]int, error)
- func (ps *PermissionSelect) IntsX(ctx context.Context) []int
- func (ps *PermissionSelect) Scan(ctx context.Context, v interface{}) error
- func (ps *PermissionSelect) ScanX(ctx context.Context, v interface{})
- func (ps *PermissionSelect) String(ctx context.Context) (_ string, err error)
- func (ps *PermissionSelect) StringX(ctx context.Context) string
- func (ps *PermissionSelect) Strings(ctx context.Context) ([]string, error)
- func (ps *PermissionSelect) StringsX(ctx context.Context) []string
- type PermissionUpdate
- func (pu *PermissionUpdate) AddMenuID(i int64) *PermissionUpdate
- func (pu *PermissionUpdate) Exec(ctx context.Context) error
- func (pu *PermissionUpdate) ExecX(ctx context.Context)
- func (pu *PermissionUpdate) Mutation() *PermissionMutation
- func (pu *PermissionUpdate) Save(ctx context.Context) (int, error)
- func (pu *PermissionUpdate) SaveX(ctx context.Context) int
- func (pu *PermissionUpdate) SetMenuID(i int64) *PermissionUpdate
- func (pu *PermissionUpdate) SetName(s string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableMenuID(i *int64) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableName(s *string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillablePermission(s *string) *PermissionUpdate
- func (pu *PermissionUpdate) SetPermission(s string) *PermissionUpdate
- func (pu *PermissionUpdate) Where(ps ...predicate.Permission) *PermissionUpdate
- type PermissionUpdateOne
- func (puo *PermissionUpdateOne) AddMenuID(i int64) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) Exec(ctx context.Context) error
- func (puo *PermissionUpdateOne) ExecX(ctx context.Context)
- func (puo *PermissionUpdateOne) Mutation() *PermissionMutation
- func (puo *PermissionUpdateOne) Save(ctx context.Context) (*Permission, error)
- func (puo *PermissionUpdateOne) SaveX(ctx context.Context) *Permission
- func (puo *PermissionUpdateOne) Select(field string, fields ...string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetMenuID(i int64) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetName(s string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableMenuID(i *int64) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableName(s *string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillablePermission(s *string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetPermission(s string) *PermissionUpdateOne
- type Permissions
- type Policy
- type Query
- type Role
- type RoleClient
- func (c *RoleClient) Create() *RoleCreate
- func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
- func (c *RoleClient) Delete() *RoleDelete
- func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
- func (c *RoleClient) DeleteOneID(id int64) *RoleDeleteOne
- func (c *RoleClient) Get(ctx context.Context, id int64) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id int64) *Role
- func (c *RoleClient) Hooks() []Hook
- func (c *RoleClient) Query() *RoleQuery
- func (c *RoleClient) Update() *RoleUpdate
- func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
- func (c *RoleClient) UpdateOneID(id int64) *RoleUpdateOne
- func (c *RoleClient) Use(hooks ...Hook)
- type RoleCreate
- func (rc *RoleCreate) Exec(ctx context.Context) error
- func (rc *RoleCreate) ExecX(ctx context.Context)
- func (rc *RoleCreate) Mutation() *RoleMutation
- func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
- func (rc *RoleCreate) SaveX(ctx context.Context) *Role
- func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate
- func (rc *RoleCreate) SetCreatedBy(i int64) *RoleCreate
- func (rc *RoleCreate) SetID(i int64) *RoleCreate
- func (rc *RoleCreate) SetName(s string) *RoleCreate
- func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetNillableCreatedBy(i *int64) *RoleCreate
- func (rc *RoleCreate) SetNillableName(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableSort(i *int8) *RoleCreate
- func (rc *RoleCreate) SetNillableStatus(i *int8) *RoleCreate
- func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetNillableUpdatedBy(i *int64) *RoleCreate
- func (rc *RoleCreate) SetRemark(s string) *RoleCreate
- func (rc *RoleCreate) SetSort(i int8) *RoleCreate
- func (rc *RoleCreate) SetStatus(i int8) *RoleCreate
- func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate
- func (rc *RoleCreate) SetUpdatedBy(i int64) *RoleCreate
- type RoleCreateBulk
- type RoleDelete
- type RoleDeleteOne
- type RoleGroupBy
- func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
- func (rgb *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (rgb *RoleGroupBy) BoolX(ctx context.Context) bool
- func (rgb *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (rgb *RoleGroupBy) BoolsX(ctx context.Context) []bool
- func (rgb *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (rgb *RoleGroupBy) Float64X(ctx context.Context) float64
- func (rgb *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (rgb *RoleGroupBy) Float64sX(ctx context.Context) []float64
- func (rgb *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (rgb *RoleGroupBy) IntX(ctx context.Context) int
- func (rgb *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (rgb *RoleGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RoleGroupBy) Scan(ctx context.Context, v interface{}) error
- func (rgb *RoleGroupBy) ScanX(ctx context.Context, v interface{})
- func (rgb *RoleGroupBy) String(ctx context.Context) (_ string, err error)
- func (rgb *RoleGroupBy) StringX(ctx context.Context) string
- func (rgb *RoleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (rgb *RoleGroupBy) StringsX(ctx context.Context) []string
- type RoleMutation
- func (m *RoleMutation) AddCreatedBy(i int64)
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddSort(i int8)
- func (m *RoleMutation) AddStatus(i int8)
- func (m *RoleMutation) AddUpdatedBy(i int64)
- func (m *RoleMutation) AddedCreatedBy() (r int64, exists bool)
- func (m *RoleMutation) AddedEdges() []string
- func (m *RoleMutation) AddedField(name string) (ent.Value, bool)
- func (m *RoleMutation) AddedFields() []string
- func (m *RoleMutation) AddedIDs(name string) []ent.Value
- func (m *RoleMutation) AddedSort() (r int8, exists bool)
- func (m *RoleMutation) AddedStatus() (r int8, exists bool)
- func (m *RoleMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *RoleMutation) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RoleMutation) CreatedBy() (r int64, exists bool)
- func (m *RoleMutation) EdgeCleared(name string) bool
- func (m *RoleMutation) Field(name string) (ent.Value, bool)
- func (m *RoleMutation) FieldCleared(name string) bool
- func (m *RoleMutation) Fields() []string
- func (m *RoleMutation) ID() (id int64, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *RoleMutation) Name() (r string, exists bool)
- func (m *RoleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldRemark(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldSort(ctx context.Context) (v int8, err error)
- func (m *RoleMutation) OldStatus(ctx context.Context) (v int8, err error)
- func (m *RoleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) Remark() (r string, exists bool)
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) ResetCreatedAt()
- func (m *RoleMutation) ResetCreatedBy()
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetName()
- func (m *RoleMutation) ResetRemark()
- func (m *RoleMutation) ResetSort()
- func (m *RoleMutation) ResetStatus()
- func (m *RoleMutation) ResetUpdatedAt()
- func (m *RoleMutation) ResetUpdatedBy()
- func (m *RoleMutation) SetCreatedAt(t time.Time)
- func (m *RoleMutation) SetCreatedBy(i int64)
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetID(id int64)
- func (m *RoleMutation) SetName(s string)
- func (m *RoleMutation) SetRemark(s string)
- func (m *RoleMutation) SetSort(i int8)
- func (m *RoleMutation) SetStatus(i int8)
- func (m *RoleMutation) SetUpdatedAt(t time.Time)
- func (m *RoleMutation) SetUpdatedBy(i int64)
- func (m *RoleMutation) Sort() (r int8, exists bool)
- func (m *RoleMutation) Status() (r int8, exists bool)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *RoleMutation) UpdatedBy() (r int64, exists bool)
- func (m *RoleMutation) Where(ps ...predicate.Role)
- type RoleQuery
- func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)
- func (rq *RoleQuery) AllX(ctx context.Context) []*Role
- func (rq *RoleQuery) Clone() *RoleQuery
- func (rq *RoleQuery) Count(ctx context.Context) (int, error)
- func (rq *RoleQuery) CountX(ctx context.Context) int
- func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RoleQuery) ExistX(ctx context.Context) bool
- func (rq *RoleQuery) First(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) FirstID(ctx context.Context) (id int64, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) int64
- func (rq *RoleQuery) FirstX(ctx context.Context) *Role
- func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
- func (rq *RoleQuery) IDs(ctx context.Context) ([]int64, error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []int64
- func (rq *RoleQuery) Limit(limit int) *RoleQuery
- func (rq *RoleQuery) Offset(offset int) *RoleQuery
- func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) int64
- func (rq *RoleQuery) OnlyX(ctx context.Context) *Role
- func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery
- func (rq *RoleQuery) Select(fields ...string) *RoleSelect
- func (rq *RoleQuery) Unique(unique bool) *RoleQuery
- func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery
- type RoleSelect
- func (rs *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (rs *RoleSelect) BoolX(ctx context.Context) bool
- func (rs *RoleSelect) Bools(ctx context.Context) ([]bool, error)
- func (rs *RoleSelect) BoolsX(ctx context.Context) []bool
- func (rs *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (rs *RoleSelect) Float64X(ctx context.Context) float64
- func (rs *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (rs *RoleSelect) Float64sX(ctx context.Context) []float64
- func (rs *RoleSelect) Int(ctx context.Context) (_ int, err error)
- func (rs *RoleSelect) IntX(ctx context.Context) int
- func (rs *RoleSelect) Ints(ctx context.Context) ([]int, error)
- func (rs *RoleSelect) IntsX(ctx context.Context) []int
- func (rs *RoleSelect) Scan(ctx context.Context, v interface{}) error
- func (rs *RoleSelect) ScanX(ctx context.Context, v interface{})
- func (rs *RoleSelect) String(ctx context.Context) (_ string, err error)
- func (rs *RoleSelect) StringX(ctx context.Context) string
- func (rs *RoleSelect) Strings(ctx context.Context) ([]string, error)
- func (rs *RoleSelect) StringsX(ctx context.Context) []string
- type RoleUpdate
- func (ru *RoleUpdate) AddCreatedBy(i int64) *RoleUpdate
- func (ru *RoleUpdate) AddSort(i int8) *RoleUpdate
- func (ru *RoleUpdate) AddStatus(i int8) *RoleUpdate
- func (ru *RoleUpdate) AddUpdatedBy(i int64) *RoleUpdate
- func (ru *RoleUpdate) Exec(ctx context.Context) error
- func (ru *RoleUpdate) ExecX(ctx context.Context)
- func (ru *RoleUpdate) Mutation() *RoleMutation
- func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
- func (ru *RoleUpdate) SaveX(ctx context.Context) int
- func (ru *RoleUpdate) SetCreatedAt(t time.Time) *RoleUpdate
- func (ru *RoleUpdate) SetCreatedBy(i int64) *RoleUpdate
- func (ru *RoleUpdate) SetName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableCreatedAt(t *time.Time) *RoleUpdate
- func (ru *RoleUpdate) SetNillableCreatedBy(i *int64) *RoleUpdate
- func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableSort(i *int8) *RoleUpdate
- func (ru *RoleUpdate) SetNillableStatus(i *int8) *RoleUpdate
- func (ru *RoleUpdate) SetNillableUpdatedBy(i *int64) *RoleUpdate
- func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate
- func (ru *RoleUpdate) SetSort(i int8) *RoleUpdate
- func (ru *RoleUpdate) SetStatus(i int8) *RoleUpdate
- func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate
- func (ru *RoleUpdate) SetUpdatedBy(i int64) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) AddCreatedBy(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddSort(i int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddStatus(i int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddUpdatedBy(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
- func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
- func (ruo *RoleUpdateOne) Mutation() *RoleMutation
- func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)
- func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role
- func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetCreatedAt(t time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetCreatedBy(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableCreatedBy(i *int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableSort(i *int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableStatus(i *int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableUpdatedBy(i *int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetSort(i int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetStatus(i int8) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUpdatedBy(i int64) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Staff
- type StaffClient
- func (c *StaffClient) Create() *StaffCreate
- func (c *StaffClient) CreateBulk(builders ...*StaffCreate) *StaffCreateBulk
- func (c *StaffClient) Delete() *StaffDelete
- func (c *StaffClient) DeleteOne(s *Staff) *StaffDeleteOne
- func (c *StaffClient) DeleteOneID(id int64) *StaffDeleteOne
- func (c *StaffClient) Get(ctx context.Context, id int64) (*Staff, error)
- func (c *StaffClient) GetX(ctx context.Context, id int64) *Staff
- func (c *StaffClient) Hooks() []Hook
- func (c *StaffClient) Query() *StaffQuery
- func (c *StaffClient) Update() *StaffUpdate
- func (c *StaffClient) UpdateOne(s *Staff) *StaffUpdateOne
- func (c *StaffClient) UpdateOneID(id int64) *StaffUpdateOne
- func (c *StaffClient) Use(hooks ...Hook)
- type StaffCreate
- func (sc *StaffCreate) Exec(ctx context.Context) error
- func (sc *StaffCreate) ExecX(ctx context.Context)
- func (sc *StaffCreate) Mutation() *StaffMutation
- func (sc *StaffCreate) Save(ctx context.Context) (*Staff, error)
- func (sc *StaffCreate) SaveX(ctx context.Context) *Staff
- func (sc *StaffCreate) SetAvatar(s string) *StaffCreate
- func (sc *StaffCreate) SetCreatedAt(t time.Time) *StaffCreate
- func (sc *StaffCreate) SetCreatedBy(i int64) *StaffCreate
- func (sc *StaffCreate) SetEmail(s string) *StaffCreate
- func (sc *StaffCreate) SetID(i int64) *StaffCreate
- func (sc *StaffCreate) SetName(s string) *StaffCreate
- func (sc *StaffCreate) SetNickname(s string) *StaffCreate
- func (sc *StaffCreate) SetNillableAvatar(s *string) *StaffCreate
- func (sc *StaffCreate) SetNillableCreatedAt(t *time.Time) *StaffCreate
- func (sc *StaffCreate) SetNillableCreatedBy(i *int64) *StaffCreate
- func (sc *StaffCreate) SetNillableEmail(s *string) *StaffCreate
- func (sc *StaffCreate) SetNillableName(s *string) *StaffCreate
- func (sc *StaffCreate) SetNillableNickname(s *string) *StaffCreate
- func (sc *StaffCreate) SetNillablePhone(s *string) *StaffCreate
- func (sc *StaffCreate) SetNillableUID(i *int64) *StaffCreate
- func (sc *StaffCreate) SetNillableUpdatedAt(t *time.Time) *StaffCreate
- func (sc *StaffCreate) SetNillableUpdatedBy(i *int64) *StaffCreate
- func (sc *StaffCreate) SetPhone(s string) *StaffCreate
- func (sc *StaffCreate) SetUID(i int64) *StaffCreate
- func (sc *StaffCreate) SetUpdatedAt(t time.Time) *StaffCreate
- func (sc *StaffCreate) SetUpdatedBy(i int64) *StaffCreate
- type StaffCreateBulk
- type StaffDelete
- type StaffDeleteOne
- type StaffGroupBy
- func (sgb *StaffGroupBy) Aggregate(fns ...AggregateFunc) *StaffGroupBy
- func (sgb *StaffGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (sgb *StaffGroupBy) BoolX(ctx context.Context) bool
- func (sgb *StaffGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (sgb *StaffGroupBy) BoolsX(ctx context.Context) []bool
- func (sgb *StaffGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (sgb *StaffGroupBy) Float64X(ctx context.Context) float64
- func (sgb *StaffGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (sgb *StaffGroupBy) Float64sX(ctx context.Context) []float64
- func (sgb *StaffGroupBy) Int(ctx context.Context) (_ int, err error)
- func (sgb *StaffGroupBy) IntX(ctx context.Context) int
- func (sgb *StaffGroupBy) Ints(ctx context.Context) ([]int, error)
- func (sgb *StaffGroupBy) IntsX(ctx context.Context) []int
- func (sgb *StaffGroupBy) Scan(ctx context.Context, v interface{}) error
- func (sgb *StaffGroupBy) ScanX(ctx context.Context, v interface{})
- func (sgb *StaffGroupBy) String(ctx context.Context) (_ string, err error)
- func (sgb *StaffGroupBy) StringX(ctx context.Context) string
- func (sgb *StaffGroupBy) Strings(ctx context.Context) ([]string, error)
- func (sgb *StaffGroupBy) StringsX(ctx context.Context) []string
- type StaffMutation
- func (m *StaffMutation) AddCreatedBy(i int64)
- func (m *StaffMutation) AddField(name string, value ent.Value) error
- func (m *StaffMutation) AddUID(i int64)
- func (m *StaffMutation) AddUpdatedBy(i int64)
- func (m *StaffMutation) AddedCreatedBy() (r int64, exists bool)
- func (m *StaffMutation) AddedEdges() []string
- func (m *StaffMutation) AddedField(name string) (ent.Value, bool)
- func (m *StaffMutation) AddedFields() []string
- func (m *StaffMutation) AddedIDs(name string) []ent.Value
- func (m *StaffMutation) AddedUID() (r int64, exists bool)
- func (m *StaffMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *StaffMutation) Avatar() (r string, exists bool)
- func (m *StaffMutation) ClearEdge(name string) error
- func (m *StaffMutation) ClearField(name string) error
- func (m *StaffMutation) ClearedEdges() []string
- func (m *StaffMutation) ClearedFields() []string
- func (m StaffMutation) Client() *Client
- func (m *StaffMutation) CreatedAt() (r time.Time, exists bool)
- func (m *StaffMutation) CreatedBy() (r int64, exists bool)
- func (m *StaffMutation) EdgeCleared(name string) bool
- func (m *StaffMutation) Email() (r string, exists bool)
- func (m *StaffMutation) Field(name string) (ent.Value, bool)
- func (m *StaffMutation) FieldCleared(name string) bool
- func (m *StaffMutation) Fields() []string
- func (m *StaffMutation) ID() (id int64, exists bool)
- func (m *StaffMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *StaffMutation) Name() (r string, exists bool)
- func (m *StaffMutation) Nickname() (r string, exists bool)
- func (m *StaffMutation) OldAvatar(ctx context.Context) (v string, err error)
- func (m *StaffMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *StaffMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *StaffMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *StaffMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *StaffMutation) OldName(ctx context.Context) (v string, err error)
- func (m *StaffMutation) OldNickname(ctx context.Context) (v string, err error)
- func (m *StaffMutation) OldPhone(ctx context.Context) (v string, err error)
- func (m *StaffMutation) OldUID(ctx context.Context) (v int64, err error)
- func (m *StaffMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *StaffMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *StaffMutation) Op() Op
- func (m *StaffMutation) Phone() (r string, exists bool)
- func (m *StaffMutation) RemovedEdges() []string
- func (m *StaffMutation) RemovedIDs(name string) []ent.Value
- func (m *StaffMutation) ResetAvatar()
- func (m *StaffMutation) ResetCreatedAt()
- func (m *StaffMutation) ResetCreatedBy()
- func (m *StaffMutation) ResetEdge(name string) error
- func (m *StaffMutation) ResetEmail()
- func (m *StaffMutation) ResetField(name string) error
- func (m *StaffMutation) ResetName()
- func (m *StaffMutation) ResetNickname()
- func (m *StaffMutation) ResetPhone()
- func (m *StaffMutation) ResetUID()
- func (m *StaffMutation) ResetUpdatedAt()
- func (m *StaffMutation) ResetUpdatedBy()
- func (m *StaffMutation) SetAvatar(s string)
- func (m *StaffMutation) SetCreatedAt(t time.Time)
- func (m *StaffMutation) SetCreatedBy(i int64)
- func (m *StaffMutation) SetEmail(s string)
- func (m *StaffMutation) SetField(name string, value ent.Value) error
- func (m *StaffMutation) SetID(id int64)
- func (m *StaffMutation) SetName(s string)
- func (m *StaffMutation) SetNickname(s string)
- func (m *StaffMutation) SetPhone(s string)
- func (m *StaffMutation) SetUID(i int64)
- func (m *StaffMutation) SetUpdatedAt(t time.Time)
- func (m *StaffMutation) SetUpdatedBy(i int64)
- func (m StaffMutation) Tx() (*Tx, error)
- func (m *StaffMutation) Type() string
- func (m *StaffMutation) UID() (r int64, exists bool)
- func (m *StaffMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *StaffMutation) UpdatedBy() (r int64, exists bool)
- func (m *StaffMutation) Where(ps ...predicate.Staff)
- type StaffQuery
- func (sq *StaffQuery) All(ctx context.Context) ([]*Staff, error)
- func (sq *StaffQuery) AllX(ctx context.Context) []*Staff
- func (sq *StaffQuery) Clone() *StaffQuery
- func (sq *StaffQuery) Count(ctx context.Context) (int, error)
- func (sq *StaffQuery) CountX(ctx context.Context) int
- func (sq *StaffQuery) Exist(ctx context.Context) (bool, error)
- func (sq *StaffQuery) ExistX(ctx context.Context) bool
- func (sq *StaffQuery) First(ctx context.Context) (*Staff, error)
- func (sq *StaffQuery) FirstID(ctx context.Context) (id int64, err error)
- func (sq *StaffQuery) FirstIDX(ctx context.Context) int64
- func (sq *StaffQuery) FirstX(ctx context.Context) *Staff
- func (sq *StaffQuery) GroupBy(field string, fields ...string) *StaffGroupBy
- func (sq *StaffQuery) IDs(ctx context.Context) ([]int64, error)
- func (sq *StaffQuery) IDsX(ctx context.Context) []int64
- func (sq *StaffQuery) Limit(limit int) *StaffQuery
- func (sq *StaffQuery) Offset(offset int) *StaffQuery
- func (sq *StaffQuery) Only(ctx context.Context) (*Staff, error)
- func (sq *StaffQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (sq *StaffQuery) OnlyIDX(ctx context.Context) int64
- func (sq *StaffQuery) OnlyX(ctx context.Context) *Staff
- func (sq *StaffQuery) Order(o ...OrderFunc) *StaffQuery
- func (sq *StaffQuery) Select(fields ...string) *StaffSelect
- func (sq *StaffQuery) Unique(unique bool) *StaffQuery
- func (sq *StaffQuery) Where(ps ...predicate.Staff) *StaffQuery
- type StaffSelect
- func (ss *StaffSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ss *StaffSelect) BoolX(ctx context.Context) bool
- func (ss *StaffSelect) Bools(ctx context.Context) ([]bool, error)
- func (ss *StaffSelect) BoolsX(ctx context.Context) []bool
- func (ss *StaffSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ss *StaffSelect) Float64X(ctx context.Context) float64
- func (ss *StaffSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ss *StaffSelect) Float64sX(ctx context.Context) []float64
- func (ss *StaffSelect) Int(ctx context.Context) (_ int, err error)
- func (ss *StaffSelect) IntX(ctx context.Context) int
- func (ss *StaffSelect) Ints(ctx context.Context) ([]int, error)
- func (ss *StaffSelect) IntsX(ctx context.Context) []int
- func (ss *StaffSelect) Scan(ctx context.Context, v interface{}) error
- func (ss *StaffSelect) ScanX(ctx context.Context, v interface{})
- func (ss *StaffSelect) String(ctx context.Context) (_ string, err error)
- func (ss *StaffSelect) StringX(ctx context.Context) string
- func (ss *StaffSelect) Strings(ctx context.Context) ([]string, error)
- func (ss *StaffSelect) StringsX(ctx context.Context) []string
- type StaffUpdate
- func (su *StaffUpdate) AddCreatedBy(i int64) *StaffUpdate
- func (su *StaffUpdate) AddUID(i int64) *StaffUpdate
- func (su *StaffUpdate) AddUpdatedBy(i int64) *StaffUpdate
- func (su *StaffUpdate) Exec(ctx context.Context) error
- func (su *StaffUpdate) ExecX(ctx context.Context)
- func (su *StaffUpdate) Mutation() *StaffMutation
- func (su *StaffUpdate) Save(ctx context.Context) (int, error)
- func (su *StaffUpdate) SaveX(ctx context.Context) int
- func (su *StaffUpdate) SetAvatar(s string) *StaffUpdate
- func (su *StaffUpdate) SetCreatedAt(t time.Time) *StaffUpdate
- func (su *StaffUpdate) SetCreatedBy(i int64) *StaffUpdate
- func (su *StaffUpdate) SetEmail(s string) *StaffUpdate
- func (su *StaffUpdate) SetName(s string) *StaffUpdate
- func (su *StaffUpdate) SetNickname(s string) *StaffUpdate
- func (su *StaffUpdate) SetNillableAvatar(s *string) *StaffUpdate
- func (su *StaffUpdate) SetNillableCreatedAt(t *time.Time) *StaffUpdate
- func (su *StaffUpdate) SetNillableCreatedBy(i *int64) *StaffUpdate
- func (su *StaffUpdate) SetNillableEmail(s *string) *StaffUpdate
- func (su *StaffUpdate) SetNillableName(s *string) *StaffUpdate
- func (su *StaffUpdate) SetNillableNickname(s *string) *StaffUpdate
- func (su *StaffUpdate) SetNillablePhone(s *string) *StaffUpdate
- func (su *StaffUpdate) SetNillableUID(i *int64) *StaffUpdate
- func (su *StaffUpdate) SetNillableUpdatedBy(i *int64) *StaffUpdate
- func (su *StaffUpdate) SetPhone(s string) *StaffUpdate
- func (su *StaffUpdate) SetUID(i int64) *StaffUpdate
- func (su *StaffUpdate) SetUpdatedAt(t time.Time) *StaffUpdate
- func (su *StaffUpdate) SetUpdatedBy(i int64) *StaffUpdate
- func (su *StaffUpdate) Where(ps ...predicate.Staff) *StaffUpdate
- type StaffUpdateOne
- func (suo *StaffUpdateOne) AddCreatedBy(i int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) AddUID(i int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) AddUpdatedBy(i int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) Exec(ctx context.Context) error
- func (suo *StaffUpdateOne) ExecX(ctx context.Context)
- func (suo *StaffUpdateOne) Mutation() *StaffMutation
- func (suo *StaffUpdateOne) Save(ctx context.Context) (*Staff, error)
- func (suo *StaffUpdateOne) SaveX(ctx context.Context) *Staff
- func (suo *StaffUpdateOne) Select(field string, fields ...string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetAvatar(s string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetCreatedAt(t time.Time) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetCreatedBy(i int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetEmail(s string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetName(s string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNickname(s string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableAvatar(s *string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableCreatedAt(t *time.Time) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableCreatedBy(i *int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableEmail(s *string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableName(s *string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableNickname(s *string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillablePhone(s *string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableUID(i *int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetNillableUpdatedBy(i *int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetPhone(s string) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetUID(i int64) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetUpdatedAt(t time.Time) *StaffUpdateOne
- func (suo *StaffUpdateOne) SetUpdatedBy(i int64) *StaffUpdateOne
- type Staffs
- 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 int64) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int64) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int64) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryRoles(u *User) *RoleQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddRoleIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAvatar(s string) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetCreatedBy(i int64) *UserCreate
- func (uc *UserCreate) SetGender(u user.Gender) *UserCreate
- func (uc *UserCreate) SetID(i int64) *UserCreate
- func (uc *UserCreate) SetNickname(s string) *UserCreate
- func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableCreatedBy(i *int64) *UserCreate
- func (uc *UserCreate) SetNillableGender(u *user.Gender) *UserCreate
- func (uc *UserCreate) SetNillableNickname(s *string) *UserCreate
- func (uc *UserCreate) SetNillableRemark(s *string) *UserCreate
- func (uc *UserCreate) SetNillableUID(i *int64) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedBy(i *int64) *UserCreate
- func (uc *UserCreate) SetRemark(s string) *UserCreate
- func (uc *UserCreate) SetUID(i int64) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetUpdatedBy(i int64) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
- func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
- func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *UserGroupBy) IntX(ctx context.Context) int
- func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *UserGroupBy) StringX(ctx context.Context) string
- func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddCreatedBy(i int64)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddRoleIDs(ids ...int64)
- func (m *UserMutation) AddUID(i int64)
- func (m *UserMutation) AddUpdatedBy(i int64)
- func (m *UserMutation) AddedCreatedBy() (r int64, exists bool)
- 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) AddedUID() (r int64, exists bool)
- func (m *UserMutation) AddedUpdatedBy() (r int64, exists bool)
- func (m *UserMutation) Avatar() (r string, exists bool)
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearRoles()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) CreatedBy() (r int64, exists bool)
- func (m *UserMutation) EdgeCleared(name string) 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) Gender() (r user.Gender, exists bool)
- func (m *UserMutation) ID() (id int64, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *UserMutation) Nickname() (r string, exists bool)
- func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldGender(ctx context.Context) (v user.Gender, err error)
- func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRemark(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUID(ctx context.Context) (v int64, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Remark() (r string, exists bool)
- func (m *UserMutation) RemoveRoleIDs(ids ...int64)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedRolesIDs() (ids []int64)
- func (m *UserMutation) ResetAvatar()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetCreatedBy()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetGender()
- func (m *UserMutation) ResetNickname()
- func (m *UserMutation) ResetRemark()
- func (m *UserMutation) ResetRoles()
- func (m *UserMutation) ResetUID()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetUpdatedBy()
- func (m *UserMutation) RolesCleared() bool
- func (m *UserMutation) RolesIDs() (ids []int64)
- func (m *UserMutation) SetAvatar(s string)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetCreatedBy(i int64)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetGender(u user.Gender)
- func (m *UserMutation) SetID(id int64)
- func (m *UserMutation) SetNickname(s string)
- func (m *UserMutation) SetRemark(s string)
- func (m *UserMutation) SetUID(i int64)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) SetUpdatedBy(i int64)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UID() (r int64, exists bool)
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) UpdatedBy() (r int64, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int64, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int64
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int64, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int64
- 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 int64, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int64
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryRoles() *RoleQuery
- 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) WithRoles(opts ...func(*RoleQuery)) *UserQuery
- type UserRole
- type UserRoleClient
- func (c *UserRoleClient) Create() *UserRoleCreate
- func (c *UserRoleClient) CreateBulk(builders ...*UserRoleCreate) *UserRoleCreateBulk
- func (c *UserRoleClient) Delete() *UserRoleDelete
- func (c *UserRoleClient) DeleteOne(ur *UserRole) *UserRoleDeleteOne
- func (c *UserRoleClient) DeleteOneID(id int) *UserRoleDeleteOne
- func (c *UserRoleClient) Get(ctx context.Context, id int) (*UserRole, error)
- func (c *UserRoleClient) GetX(ctx context.Context, id int) *UserRole
- func (c *UserRoleClient) Hooks() []Hook
- func (c *UserRoleClient) Query() *UserRoleQuery
- func (c *UserRoleClient) Update() *UserRoleUpdate
- func (c *UserRoleClient) UpdateOne(ur *UserRole) *UserRoleUpdateOne
- func (c *UserRoleClient) UpdateOneID(id int) *UserRoleUpdateOne
- func (c *UserRoleClient) Use(hooks ...Hook)
- type UserRoleCreate
- func (urc *UserRoleCreate) Exec(ctx context.Context) error
- func (urc *UserRoleCreate) ExecX(ctx context.Context)
- func (urc *UserRoleCreate) Mutation() *UserRoleMutation
- func (urc *UserRoleCreate) Save(ctx context.Context) (*UserRole, error)
- func (urc *UserRoleCreate) SaveX(ctx context.Context) *UserRole
- func (urc *UserRoleCreate) SetNillableRoleID(i *int64) *UserRoleCreate
- func (urc *UserRoleCreate) SetNillableUserID(i *int64) *UserRoleCreate
- func (urc *UserRoleCreate) SetRoleID(i int64) *UserRoleCreate
- func (urc *UserRoleCreate) SetUserID(i int64) *UserRoleCreate
- type UserRoleCreateBulk
- type UserRoleDelete
- type UserRoleDeleteOne
- type UserRoleGroupBy
- func (urgb *UserRoleGroupBy) Aggregate(fns ...AggregateFunc) *UserRoleGroupBy
- func (urgb *UserRoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (urgb *UserRoleGroupBy) BoolX(ctx context.Context) bool
- func (urgb *UserRoleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (urgb *UserRoleGroupBy) BoolsX(ctx context.Context) []bool
- func (urgb *UserRoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (urgb *UserRoleGroupBy) Float64X(ctx context.Context) float64
- func (urgb *UserRoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (urgb *UserRoleGroupBy) Float64sX(ctx context.Context) []float64
- func (urgb *UserRoleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (urgb *UserRoleGroupBy) IntX(ctx context.Context) int
- func (urgb *UserRoleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (urgb *UserRoleGroupBy) IntsX(ctx context.Context) []int
- func (urgb *UserRoleGroupBy) Scan(ctx context.Context, v interface{}) error
- func (urgb *UserRoleGroupBy) ScanX(ctx context.Context, v interface{})
- func (urgb *UserRoleGroupBy) String(ctx context.Context) (_ string, err error)
- func (urgb *UserRoleGroupBy) StringX(ctx context.Context) string
- func (urgb *UserRoleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (urgb *UserRoleGroupBy) StringsX(ctx context.Context) []string
- type UserRoleMutation
- func (m *UserRoleMutation) AddField(name string, value ent.Value) error
- func (m *UserRoleMutation) AddRoleID(i int64)
- func (m *UserRoleMutation) AddUserID(i int64)
- func (m *UserRoleMutation) AddedEdges() []string
- func (m *UserRoleMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserRoleMutation) AddedFields() []string
- func (m *UserRoleMutation) AddedIDs(name string) []ent.Value
- func (m *UserRoleMutation) AddedRoleID() (r int64, exists bool)
- func (m *UserRoleMutation) AddedUserID() (r int64, exists bool)
- func (m *UserRoleMutation) ClearEdge(name string) error
- func (m *UserRoleMutation) ClearField(name string) error
- func (m *UserRoleMutation) ClearedEdges() []string
- func (m *UserRoleMutation) ClearedFields() []string
- func (m UserRoleMutation) Client() *Client
- func (m *UserRoleMutation) EdgeCleared(name string) bool
- func (m *UserRoleMutation) Field(name string) (ent.Value, bool)
- func (m *UserRoleMutation) FieldCleared(name string) bool
- func (m *UserRoleMutation) Fields() []string
- func (m *UserRoleMutation) ID() (id int, exists bool)
- func (m *UserRoleMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserRoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserRoleMutation) OldRoleID(ctx context.Context) (v int64, err error)
- func (m *UserRoleMutation) OldUserID(ctx context.Context) (v int64, err error)
- func (m *UserRoleMutation) Op() Op
- func (m *UserRoleMutation) RemovedEdges() []string
- func (m *UserRoleMutation) RemovedIDs(name string) []ent.Value
- func (m *UserRoleMutation) ResetEdge(name string) error
- func (m *UserRoleMutation) ResetField(name string) error
- func (m *UserRoleMutation) ResetRoleID()
- func (m *UserRoleMutation) ResetUserID()
- func (m *UserRoleMutation) RoleID() (r int64, exists bool)
- func (m *UserRoleMutation) SetField(name string, value ent.Value) error
- func (m *UserRoleMutation) SetRoleID(i int64)
- func (m *UserRoleMutation) SetUserID(i int64)
- func (m UserRoleMutation) Tx() (*Tx, error)
- func (m *UserRoleMutation) Type() string
- func (m *UserRoleMutation) UserID() (r int64, exists bool)
- func (m *UserRoleMutation) Where(ps ...predicate.UserRole)
- type UserRoleQuery
- func (urq *UserRoleQuery) All(ctx context.Context) ([]*UserRole, error)
- func (urq *UserRoleQuery) AllX(ctx context.Context) []*UserRole
- func (urq *UserRoleQuery) Clone() *UserRoleQuery
- func (urq *UserRoleQuery) Count(ctx context.Context) (int, error)
- func (urq *UserRoleQuery) CountX(ctx context.Context) int
- func (urq *UserRoleQuery) Exist(ctx context.Context) (bool, error)
- func (urq *UserRoleQuery) ExistX(ctx context.Context) bool
- func (urq *UserRoleQuery) First(ctx context.Context) (*UserRole, error)
- func (urq *UserRoleQuery) FirstID(ctx context.Context) (id int, err error)
- func (urq *UserRoleQuery) FirstIDX(ctx context.Context) int
- func (urq *UserRoleQuery) FirstX(ctx context.Context) *UserRole
- func (urq *UserRoleQuery) GroupBy(field string, fields ...string) *UserRoleGroupBy
- func (urq *UserRoleQuery) IDs(ctx context.Context) ([]int, error)
- func (urq *UserRoleQuery) IDsX(ctx context.Context) []int
- func (urq *UserRoleQuery) Limit(limit int) *UserRoleQuery
- func (urq *UserRoleQuery) Offset(offset int) *UserRoleQuery
- func (urq *UserRoleQuery) Only(ctx context.Context) (*UserRole, error)
- func (urq *UserRoleQuery) OnlyID(ctx context.Context) (id int, err error)
- func (urq *UserRoleQuery) OnlyIDX(ctx context.Context) int
- func (urq *UserRoleQuery) OnlyX(ctx context.Context) *UserRole
- func (urq *UserRoleQuery) Order(o ...OrderFunc) *UserRoleQuery
- func (urq *UserRoleQuery) Select(fields ...string) *UserRoleSelect
- func (urq *UserRoleQuery) Unique(unique bool) *UserRoleQuery
- func (urq *UserRoleQuery) Where(ps ...predicate.UserRole) *UserRoleQuery
- type UserRoleSelect
- func (urs *UserRoleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (urs *UserRoleSelect) BoolX(ctx context.Context) bool
- func (urs *UserRoleSelect) Bools(ctx context.Context) ([]bool, error)
- func (urs *UserRoleSelect) BoolsX(ctx context.Context) []bool
- func (urs *UserRoleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (urs *UserRoleSelect) Float64X(ctx context.Context) float64
- func (urs *UserRoleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (urs *UserRoleSelect) Float64sX(ctx context.Context) []float64
- func (urs *UserRoleSelect) Int(ctx context.Context) (_ int, err error)
- func (urs *UserRoleSelect) IntX(ctx context.Context) int
- func (urs *UserRoleSelect) Ints(ctx context.Context) ([]int, error)
- func (urs *UserRoleSelect) IntsX(ctx context.Context) []int
- func (urs *UserRoleSelect) Scan(ctx context.Context, v interface{}) error
- func (urs *UserRoleSelect) ScanX(ctx context.Context, v interface{})
- func (urs *UserRoleSelect) String(ctx context.Context) (_ string, err error)
- func (urs *UserRoleSelect) StringX(ctx context.Context) string
- func (urs *UserRoleSelect) Strings(ctx context.Context) ([]string, error)
- func (urs *UserRoleSelect) StringsX(ctx context.Context) []string
- type UserRoleUpdate
- func (uru *UserRoleUpdate) AddRoleID(i int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) AddUserID(i int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) Exec(ctx context.Context) error
- func (uru *UserRoleUpdate) ExecX(ctx context.Context)
- func (uru *UserRoleUpdate) Mutation() *UserRoleMutation
- func (uru *UserRoleUpdate) Save(ctx context.Context) (int, error)
- func (uru *UserRoleUpdate) SaveX(ctx context.Context) int
- func (uru *UserRoleUpdate) SetNillableRoleID(i *int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) SetNillableUserID(i *int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) SetRoleID(i int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) SetUserID(i int64) *UserRoleUpdate
- func (uru *UserRoleUpdate) Where(ps ...predicate.UserRole) *UserRoleUpdate
- type UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) AddRoleID(i int64) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) AddUserID(i int64) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) Exec(ctx context.Context) error
- func (uruo *UserRoleUpdateOne) ExecX(ctx context.Context)
- func (uruo *UserRoleUpdateOne) Mutation() *UserRoleMutation
- func (uruo *UserRoleUpdateOne) Save(ctx context.Context) (*UserRole, error)
- func (uruo *UserRoleUpdateOne) SaveX(ctx context.Context) *UserRole
- func (uruo *UserRoleUpdateOne) Select(field string, fields ...string) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) SetNillableRoleID(i *int64) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) SetNillableUserID(i *int64) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) SetRoleID(i int64) *UserRoleUpdateOne
- func (uruo *UserRoleUpdateOne) SetUserID(i int64) *UserRoleUpdateOne
- type UserRoles
- type UserSelect
- func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *UserSelect) BoolX(ctx context.Context) bool
- func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *UserSelect) BoolsX(ctx context.Context) []bool
- func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *UserSelect) Float64X(ctx context.Context) float64
- func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *UserSelect) Float64sX(ctx context.Context) []float64
- func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (us *UserSelect) IntX(ctx context.Context) int
- func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (us *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (us *UserSelect) ScanX(ctx context.Context, v interface{})
- func (us *UserSelect) String(ctx context.Context) (_ string, err error)
- func (us *UserSelect) StringX(ctx context.Context) string
- func (us *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (us *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddCreatedBy(i int64) *UserUpdate
- func (uu *UserUpdate) AddRoleIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate
- func (uu *UserUpdate) AddUID(i int64) *UserUpdate
- func (uu *UserUpdate) AddUpdatedBy(i int64) *UserUpdate
- func (uu *UserUpdate) ClearRoles() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveRoleIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAvatar(s string) *UserUpdate
- func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetCreatedBy(i int64) *UserUpdate
- func (uu *UserUpdate) SetGender(u user.Gender) *UserUpdate
- func (uu *UserUpdate) SetNickname(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableCreatedBy(i *int64) *UserUpdate
- func (uu *UserUpdate) SetNillableGender(u *user.Gender) *UserUpdate
- func (uu *UserUpdate) SetNillableNickname(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableRemark(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableUID(i *int64) *UserUpdate
- func (uu *UserUpdate) SetNillableUpdatedBy(i *int64) *UserUpdate
- func (uu *UserUpdate) SetRemark(s string) *UserUpdate
- func (uu *UserUpdate) SetUID(i int64) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetUpdatedBy(i int64) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddCreatedBy(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRoleIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUID(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUpdatedBy(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCreatedBy(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetGender(u user.Gender) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedBy(i *int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableGender(u *user.Gender) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableNickname(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableRemark(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableUID(i *int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableUpdatedBy(i *int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetRemark(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUID(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedBy(i int64) *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. TypeApi = "Api" TypeDictData = "DictData" TypeDictType = "DictType" TypePermission = "Permission" TypeRole = "Role" TypeStaff = "Staff" TypeUser = "User" TypeUserRole = "UserRole" )
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 APICreate ¶
type APICreate struct {
// contains filtered or unexported fields
}
APICreate is the builder for creating a Api entity.
func (*APICreate) Mutation ¶
func (ac *APICreate) Mutation() *APIMutation
Mutation returns the APIMutation object of the builder.
func (*APICreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*APICreate) SetCreatedBy ¶
SetCreatedBy sets the "created_by" field.
func (*APICreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*APICreate) SetNillableCreatedBy ¶
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*APICreate) SetNillableDesc ¶
SetNillableDesc sets the "desc" field if the given value is not nil.
func (*APICreate) SetNillableGroup ¶
SetNillableGroup sets the "group" field if the given value is not nil.
func (*APICreate) SetNillableMethod ¶
SetNillableMethod sets the "method" field if the given value is not nil.
func (*APICreate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*APICreate) SetNillablePath ¶
SetNillablePath sets the "path" field if the given value is not nil.
func (*APICreate) SetNillablePermission ¶
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*APICreate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
func (*APICreate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*APICreate) SetNillableUpdatedBy ¶
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*APICreate) SetPermission ¶
SetPermission sets the "permission" field.
func (*APICreate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
func (*APICreate) SetUpdatedBy ¶
SetUpdatedBy sets the "updated_by" field.
type APICreateBulk ¶
type APICreateBulk struct {
// contains filtered or unexported fields
}
APICreateBulk is the builder for creating many Api entities in bulk.
func (*APICreateBulk) Exec ¶
func (acb *APICreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*APICreateBulk) ExecX ¶
func (acb *APICreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type APIDelete ¶
type APIDelete struct {
// contains filtered or unexported fields
}
APIDelete is the builder for deleting a Api entity.
func (*APIDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type APIDeleteOne ¶
type APIDeleteOne struct {
// contains filtered or unexported fields
}
APIDeleteOne is the builder for deleting a single Api entity.
func (*APIDeleteOne) Exec ¶
func (ado *APIDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*APIDeleteOne) ExecX ¶
func (ado *APIDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type APIGroupBy ¶
type APIGroupBy struct {
// contains filtered or unexported fields
}
APIGroupBy is the group-by builder for Api entities.
func (*APIGroupBy) Aggregate ¶
func (agb *APIGroupBy) Aggregate(fns ...AggregateFunc) *APIGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*APIGroupBy) Bool ¶
func (agb *APIGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) BoolX ¶
func (agb *APIGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*APIGroupBy) Bools ¶
func (agb *APIGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) BoolsX ¶
func (agb *APIGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*APIGroupBy) Float64 ¶
func (agb *APIGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) Float64X ¶
func (agb *APIGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*APIGroupBy) Float64s ¶
func (agb *APIGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) Float64sX ¶
func (agb *APIGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*APIGroupBy) Int ¶
func (agb *APIGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) IntX ¶
func (agb *APIGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*APIGroupBy) Ints ¶
func (agb *APIGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) IntsX ¶
func (agb *APIGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*APIGroupBy) Scan ¶
func (agb *APIGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*APIGroupBy) ScanX ¶
func (agb *APIGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*APIGroupBy) String ¶
func (agb *APIGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*APIGroupBy) StringX ¶
func (agb *APIGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type APIMutation ¶
type APIMutation struct {
// contains filtered or unexported fields
}
APIMutation represents an operation that mutates the Api nodes in the graph.
func (*APIMutation) AddCreatedBy ¶
func (m *APIMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
func (*APIMutation) AddField ¶
func (m *APIMutation) 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 (*APIMutation) AddStatus ¶
func (m *APIMutation) AddStatus(u int8)
AddStatus adds u to the "status" field.
func (*APIMutation) AddUpdatedBy ¶
func (m *APIMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*APIMutation) AddedCreatedBy ¶
func (m *APIMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
func (*APIMutation) AddedEdges ¶
func (m *APIMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*APIMutation) AddedField ¶
func (m *APIMutation) 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 (*APIMutation) AddedFields ¶
func (m *APIMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*APIMutation) AddedIDs ¶
func (m *APIMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*APIMutation) AddedStatus ¶
func (m *APIMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*APIMutation) AddedUpdatedBy ¶
func (m *APIMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*APIMutation) ClearEdge ¶
func (m *APIMutation) 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 (*APIMutation) ClearField ¶
func (m *APIMutation) 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 (*APIMutation) ClearedEdges ¶
func (m *APIMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*APIMutation) ClearedFields ¶
func (m *APIMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (APIMutation) Client ¶
func (m APIMutation) 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 (*APIMutation) CreatedAt ¶
func (m *APIMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*APIMutation) CreatedBy ¶
func (m *APIMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*APIMutation) Desc ¶
func (m *APIMutation) Desc() (r string, exists bool)
Desc returns the value of the "desc" field in the mutation.
func (*APIMutation) EdgeCleared ¶
func (m *APIMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*APIMutation) Field ¶
func (m *APIMutation) 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 (*APIMutation) FieldCleared ¶
func (m *APIMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*APIMutation) Fields ¶
func (m *APIMutation) 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 (*APIMutation) Group ¶
func (m *APIMutation) Group() (r string, exists bool)
Group returns the value of the "group" field in the mutation.
func (*APIMutation) ID ¶
func (m *APIMutation) ID() (id int64, 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 (*APIMutation) IDs ¶
func (m *APIMutation) IDs(ctx context.Context) ([]int64, 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 (*APIMutation) Method ¶
func (m *APIMutation) Method() (r string, exists bool)
Method returns the value of the "method" field in the mutation.
func (*APIMutation) Name ¶
func (m *APIMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*APIMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Api entity. If the Api 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 (*APIMutation) OldCreatedBy ¶
func (m *APIMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" field's value of the Api entity. If the Api 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 (*APIMutation) OldDesc ¶
func (m *APIMutation) OldDesc(ctx context.Context) (v string, err error)
OldDesc returns the old "desc" field's value of the Api entity. If the Api 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 (*APIMutation) 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 (*APIMutation) OldGroup ¶
func (m *APIMutation) OldGroup(ctx context.Context) (v string, err error)
OldGroup returns the old "group" field's value of the Api entity. If the Api 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 (*APIMutation) OldMethod ¶
func (m *APIMutation) OldMethod(ctx context.Context) (v string, err error)
OldMethod returns the old "method" field's value of the Api entity. If the Api 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 (*APIMutation) OldName ¶
func (m *APIMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Api entity. If the Api 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 (*APIMutation) OldPath ¶
func (m *APIMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" field's value of the Api entity. If the Api 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 (*APIMutation) OldPermission ¶
func (m *APIMutation) OldPermission(ctx context.Context) (v string, err error)
OldPermission returns the old "permission" field's value of the Api entity. If the Api 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 (*APIMutation) OldStatus ¶
func (m *APIMutation) OldStatus(ctx context.Context) (v uint8, err error)
OldStatus returns the old "status" field's value of the Api entity. If the Api 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 (*APIMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Api entity. If the Api 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 (*APIMutation) OldUpdatedBy ¶
func (m *APIMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" field's value of the Api entity. If the Api 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 (*APIMutation) Path ¶
func (m *APIMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*APIMutation) Permission ¶
func (m *APIMutation) Permission() (r string, exists bool)
Permission returns the value of the "permission" field in the mutation.
func (*APIMutation) RemovedEdges ¶
func (m *APIMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*APIMutation) RemovedIDs ¶
func (m *APIMutation) 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 (*APIMutation) ResetCreatedAt ¶
func (m *APIMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*APIMutation) ResetCreatedBy ¶
func (m *APIMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*APIMutation) ResetDesc ¶
func (m *APIMutation) ResetDesc()
ResetDesc resets all changes to the "desc" field.
func (*APIMutation) ResetEdge ¶
func (m *APIMutation) 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 (*APIMutation) ResetField ¶
func (m *APIMutation) 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 (*APIMutation) ResetGroup ¶
func (m *APIMutation) ResetGroup()
ResetGroup resets all changes to the "group" field.
func (*APIMutation) ResetMethod ¶
func (m *APIMutation) ResetMethod()
ResetMethod resets all changes to the "method" field.
func (*APIMutation) ResetName ¶
func (m *APIMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*APIMutation) ResetPath ¶
func (m *APIMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*APIMutation) ResetPermission ¶
func (m *APIMutation) ResetPermission()
ResetPermission resets all changes to the "permission" field.
func (*APIMutation) ResetStatus ¶
func (m *APIMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*APIMutation) ResetUpdatedAt ¶
func (m *APIMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*APIMutation) ResetUpdatedBy ¶
func (m *APIMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*APIMutation) SetCreatedAt ¶
func (m *APIMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*APIMutation) SetCreatedBy ¶
func (m *APIMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" field.
func (*APIMutation) SetDesc ¶
func (m *APIMutation) SetDesc(s string)
SetDesc sets the "desc" field.
func (*APIMutation) SetField ¶
func (m *APIMutation) 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 (*APIMutation) SetGroup ¶
func (m *APIMutation) SetGroup(s string)
SetGroup sets the "group" field.
func (*APIMutation) SetID ¶
func (m *APIMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Api entities.
func (*APIMutation) SetMethod ¶
func (m *APIMutation) SetMethod(s string)
SetMethod sets the "method" field.
func (*APIMutation) SetName ¶
func (m *APIMutation) SetName(s string)
SetName sets the "name" field.
func (*APIMutation) SetPath ¶
func (m *APIMutation) SetPath(s string)
SetPath sets the "path" field.
func (*APIMutation) SetPermission ¶
func (m *APIMutation) SetPermission(s string)
SetPermission sets the "permission" field.
func (*APIMutation) SetStatus ¶
func (m *APIMutation) SetStatus(u uint8)
SetStatus sets the "status" field.
func (*APIMutation) SetUpdatedAt ¶
func (m *APIMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*APIMutation) SetUpdatedBy ¶
func (m *APIMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" field.
func (*APIMutation) Status ¶
func (m *APIMutation) Status() (r uint8, exists bool)
Status returns the value of the "status" field in the mutation.
func (APIMutation) Tx ¶
func (m APIMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*APIMutation) Type ¶
func (m *APIMutation) Type() string
Type returns the node type of this mutation (Api).
func (*APIMutation) UpdatedAt ¶
func (m *APIMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*APIMutation) UpdatedBy ¶
func (m *APIMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" field in the mutation.
func (*APIMutation) Where ¶
func (m *APIMutation) Where(ps ...predicate.Api)
Where appends a list predicates to the APIMutation builder.
type APIQuery ¶
type APIQuery struct {
// contains filtered or unexported fields
}
APIQuery is the builder for querying Api entities.
func (*APIQuery) Clone ¶
Clone returns a duplicate of the APIQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*APIQuery) First ¶
First returns the first Api entity from the query. Returns a *NotFoundError when no Api was found.
func (*APIQuery) FirstID ¶
FirstID returns the first Api ID from the query. Returns a *NotFoundError when no Api ID was found.
func (*APIQuery) GroupBy ¶
func (aq *APIQuery) GroupBy(field string, fields ...string) *APIGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.API.Query(). GroupBy(api.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*APIQuery) Only ¶
Only returns a single Api entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Api entity is found. Returns a *NotFoundError when no Api entities are found.
func (*APIQuery) OnlyID ¶
OnlyID is like Only, but returns the only Api ID in the query. Returns a *NotSingularError when more than one Api ID is found. Returns a *NotFoundError when no entities are found.
func (*APIQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.API.Query(). Select(api.FieldCreatedAt). Scan(ctx, &v)
type APISelect ¶
type APISelect struct { *APIQuery // contains filtered or unexported fields }
APISelect is the builder for selecting fields of API entities.
func (*APISelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*APISelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*APISelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*APISelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*APISelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*APISelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*APISelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type APIUpdate ¶
type APIUpdate struct {
// contains filtered or unexported fields
}
APIUpdate is the builder for updating Api entities.
func (*APIUpdate) AddCreatedBy ¶
AddCreatedBy adds i to the "created_by" field.
func (*APIUpdate) AddUpdatedBy ¶
AddUpdatedBy adds i to the "updated_by" field.
func (*APIUpdate) Mutation ¶
func (au *APIUpdate) Mutation() *APIMutation
Mutation returns the APIMutation object of the builder.
func (*APIUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*APIUpdate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*APIUpdate) SetCreatedBy ¶
SetCreatedBy sets the "created_by" field.
func (*APIUpdate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*APIUpdate) SetNillableCreatedBy ¶
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*APIUpdate) SetNillableDesc ¶
SetNillableDesc sets the "desc" field if the given value is not nil.
func (*APIUpdate) SetNillableGroup ¶
SetNillableGroup sets the "group" field if the given value is not nil.
func (*APIUpdate) SetNillableMethod ¶
SetNillableMethod sets the "method" field if the given value is not nil.
func (*APIUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*APIUpdate) SetNillablePath ¶
SetNillablePath sets the "path" field if the given value is not nil.
func (*APIUpdate) SetNillablePermission ¶
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*APIUpdate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
func (*APIUpdate) SetNillableUpdatedBy ¶
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*APIUpdate) SetPermission ¶
SetPermission sets the "permission" field.
func (*APIUpdate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
func (*APIUpdate) SetUpdatedBy ¶
SetUpdatedBy sets the "updated_by" field.
type APIUpdateOne ¶
type APIUpdateOne struct {
// contains filtered or unexported fields
}
APIUpdateOne is the builder for updating a single Api entity.
func (*APIUpdateOne) AddCreatedBy ¶
func (auo *APIUpdateOne) AddCreatedBy(i int64) *APIUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*APIUpdateOne) AddStatus ¶
func (auo *APIUpdateOne) AddStatus(u int8) *APIUpdateOne
AddStatus adds u to the "status" field.
func (*APIUpdateOne) AddUpdatedBy ¶
func (auo *APIUpdateOne) AddUpdatedBy(i int64) *APIUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*APIUpdateOne) Exec ¶
func (auo *APIUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*APIUpdateOne) ExecX ¶
func (auo *APIUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*APIUpdateOne) Mutation ¶
func (auo *APIUpdateOne) Mutation() *APIMutation
Mutation returns the APIMutation object of the builder.
func (*APIUpdateOne) Save ¶
func (auo *APIUpdateOne) Save(ctx context.Context) (*Api, error)
Save executes the query and returns the updated Api entity.
func (*APIUpdateOne) SaveX ¶
func (auo *APIUpdateOne) SaveX(ctx context.Context) *Api
SaveX is like Save, but panics if an error occurs.
func (*APIUpdateOne) Select ¶
func (auo *APIUpdateOne) Select(field string, fields ...string) *APIUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*APIUpdateOne) SetCreatedAt ¶
func (auo *APIUpdateOne) SetCreatedAt(t time.Time) *APIUpdateOne
SetCreatedAt sets the "created_at" field.
func (*APIUpdateOne) SetCreatedBy ¶
func (auo *APIUpdateOne) SetCreatedBy(i int64) *APIUpdateOne
SetCreatedBy sets the "created_by" field.
func (*APIUpdateOne) SetDesc ¶
func (auo *APIUpdateOne) SetDesc(s string) *APIUpdateOne
SetDesc sets the "desc" field.
func (*APIUpdateOne) SetGroup ¶
func (auo *APIUpdateOne) SetGroup(s string) *APIUpdateOne
SetGroup sets the "group" field.
func (*APIUpdateOne) SetMethod ¶
func (auo *APIUpdateOne) SetMethod(s string) *APIUpdateOne
SetMethod sets the "method" field.
func (*APIUpdateOne) SetName ¶
func (auo *APIUpdateOne) SetName(s string) *APIUpdateOne
SetName sets the "name" field.
func (*APIUpdateOne) SetNillableCreatedAt ¶
func (auo *APIUpdateOne) SetNillableCreatedAt(t *time.Time) *APIUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*APIUpdateOne) SetNillableCreatedBy ¶
func (auo *APIUpdateOne) SetNillableCreatedBy(i *int64) *APIUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*APIUpdateOne) SetNillableDesc ¶
func (auo *APIUpdateOne) SetNillableDesc(s *string) *APIUpdateOne
SetNillableDesc sets the "desc" field if the given value is not nil.
func (*APIUpdateOne) SetNillableGroup ¶
func (auo *APIUpdateOne) SetNillableGroup(s *string) *APIUpdateOne
SetNillableGroup sets the "group" field if the given value is not nil.
func (*APIUpdateOne) SetNillableMethod ¶
func (auo *APIUpdateOne) SetNillableMethod(s *string) *APIUpdateOne
SetNillableMethod sets the "method" field if the given value is not nil.
func (*APIUpdateOne) SetNillableName ¶
func (auo *APIUpdateOne) SetNillableName(s *string) *APIUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*APIUpdateOne) SetNillablePath ¶
func (auo *APIUpdateOne) SetNillablePath(s *string) *APIUpdateOne
SetNillablePath sets the "path" field if the given value is not nil.
func (*APIUpdateOne) SetNillablePermission ¶
func (auo *APIUpdateOne) SetNillablePermission(s *string) *APIUpdateOne
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*APIUpdateOne) SetNillableStatus ¶
func (auo *APIUpdateOne) SetNillableStatus(u *uint8) *APIUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*APIUpdateOne) SetNillableUpdatedBy ¶
func (auo *APIUpdateOne) SetNillableUpdatedBy(i *int64) *APIUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*APIUpdateOne) SetPath ¶
func (auo *APIUpdateOne) SetPath(s string) *APIUpdateOne
SetPath sets the "path" field.
func (*APIUpdateOne) SetPermission ¶
func (auo *APIUpdateOne) SetPermission(s string) *APIUpdateOne
SetPermission sets the "permission" field.
func (*APIUpdateOne) SetStatus ¶
func (auo *APIUpdateOne) SetStatus(u uint8) *APIUpdateOne
SetStatus sets the "status" field.
func (*APIUpdateOne) SetUpdatedAt ¶
func (auo *APIUpdateOne) SetUpdatedAt(t time.Time) *APIUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*APIUpdateOne) SetUpdatedBy ¶
func (auo *APIUpdateOne) SetUpdatedBy(i int64) *APIUpdateOne
SetUpdatedBy sets the "updated_by" field.
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 Api ¶
type Api struct { // ID of the ent. // 自增id ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // Group holds the value of the "group" field. // 接口分组 Group string `json:"group,omitempty"` // Name holds the value of the "name" field. // 接口名称 Name string `json:"name,omitempty"` // Path holds the value of the "path" field. // 接口路径 Path string `json:"path,omitempty"` // Method holds the value of the "method" field. // 接口请求方式 Method string `json:"method,omitempty"` // Desc holds the value of the "desc" field. // 接口描述 Desc string `json:"desc,omitempty"` // Permission holds the value of the "permission" field. // 接口权限 Permission string `json:"permission,omitempty"` // Status holds the value of the "status" field. // 状态 0:禁用 1:启用 -1:删除 Status uint8 `json:"status,omitempty"` // contains filtered or unexported fields }
Api is the model entity for the Api schema.
func (*Api) Unwrap ¶
Unwrap unwraps the Api 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 (*Api) Update ¶
func (a *Api) Update() *APIUpdateOne
Update returns a builder for updating this Api. Note that you need to call Api.Unwrap() before calling this method if this Api was returned from a transaction, and the transaction was committed or rolled back.
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
ApiClient is a client for the Api schema.
func NewApiClient ¶
func NewApiClient(c config) *ApiClient
NewApiClient returns a client for the Api from the given config.
func (*ApiClient) CreateBulk ¶
func (c *ApiClient) CreateBulk(builders ...*APICreate) *APICreateBulk
CreateBulk returns a builder for creating a bulk of Api entities.
func (*ApiClient) DeleteOne ¶
func (c *ApiClient) DeleteOne(a *Api) *APIDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ApiClient) DeleteOneID ¶
func (c *ApiClient) DeleteOneID(id int64) *APIDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ApiClient) UpdateOne ¶
func (c *ApiClient) UpdateOne(a *Api) *APIUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ApiClient) UpdateOneID ¶
func (c *ApiClient) UpdateOneID(id int64) *APIUpdateOne
UpdateOneID returns an update builder for the given id.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Api is the client for interacting with the Api builders. Api *ApiClient // DictData is the client for interacting with the DictData builders. DictData *DictDataClient // DictType is the client for interacting with the DictType builders. DictType *DictTypeClient // Permission is the client for interacting with the Permission builders. Permission *PermissionClient // Role is the client for interacting with the Role builders. Role *RoleClient // Staff is the client for interacting with the Staff builders. Staff *StaffClient // User is the client for interacting with the User builders. User *UserClient // UserRole is the client for interacting with the UserRole builders. UserRole *UserRoleClient // 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(). Api. 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 DictData ¶
type DictData struct { // ID of the ent. // 字典数据id ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // DictTypeID holds the value of the "dict_type_id" field. // 字典类型id DictTypeID int64 `json:"dict_type_id,omitempty"` // Label holds the value of the "label" field. // 字典标签 Label string `json:"label,omitempty"` // Value holds the value of the "value" field. // 字典键值 Value string `json:"value,omitempty"` // Sort holds the value of the "sort" field. // 排序 Sort int8 `json:"sort,omitempty"` // Status holds the value of the "status" field. // 状态 0:禁用 1:启用 -1:删除 Status int8 `json:"status,omitempty"` // Remark holds the value of the "remark" field. // 备注 Remark string `json:"remark,omitempty"` // IsDefault holds the value of the "is_default" field. // 是否默认值 0:否 1:是 IsDefault int8 `json:"is_default,omitempty"` // contains filtered or unexported fields }
DictData is the model entity for the DictData schema.
func (*DictData) Unwrap ¶
Unwrap unwraps the DictData 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 (*DictData) Update ¶
func (dd *DictData) Update() *DictDataUpdateOne
Update returns a builder for updating this DictData. Note that you need to call DictData.Unwrap() before calling this method if this DictData was returned from a transaction, and the transaction was committed or rolled back.
type DictDataClient ¶
type DictDataClient struct {
// contains filtered or unexported fields
}
DictDataClient is a client for the DictData schema.
func NewDictDataClient ¶
func NewDictDataClient(c config) *DictDataClient
NewDictDataClient returns a client for the DictData from the given config.
func (*DictDataClient) Create ¶
func (c *DictDataClient) Create() *DictDataCreate
Create returns a create builder for DictData.
func (*DictDataClient) CreateBulk ¶
func (c *DictDataClient) CreateBulk(builders ...*DictDataCreate) *DictDataCreateBulk
CreateBulk returns a builder for creating a bulk of DictData entities.
func (*DictDataClient) Delete ¶
func (c *DictDataClient) Delete() *DictDataDelete
Delete returns a delete builder for DictData.
func (*DictDataClient) DeleteOne ¶
func (c *DictDataClient) DeleteOne(dd *DictData) *DictDataDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*DictDataClient) DeleteOneID ¶
func (c *DictDataClient) DeleteOneID(id int64) *DictDataDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*DictDataClient) GetX ¶
func (c *DictDataClient) GetX(ctx context.Context, id int64) *DictData
GetX is like Get, but panics if an error occurs.
func (*DictDataClient) Hooks ¶
func (c *DictDataClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DictDataClient) Query ¶
func (c *DictDataClient) Query() *DictDataQuery
Query returns a query builder for DictData.
func (*DictDataClient) Update ¶
func (c *DictDataClient) Update() *DictDataUpdate
Update returns an update builder for DictData.
func (*DictDataClient) UpdateOne ¶
func (c *DictDataClient) UpdateOne(dd *DictData) *DictDataUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DictDataClient) UpdateOneID ¶
func (c *DictDataClient) UpdateOneID(id int64) *DictDataUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DictDataClient) Use ¶
func (c *DictDataClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `dictdata.Hooks(f(g(h())))`.
type DictDataCreate ¶
type DictDataCreate struct {
// contains filtered or unexported fields
}
DictDataCreate is the builder for creating a DictData entity.
func (*DictDataCreate) Exec ¶
func (ddc *DictDataCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DictDataCreate) ExecX ¶
func (ddc *DictDataCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictDataCreate) Mutation ¶
func (ddc *DictDataCreate) Mutation() *DictDataMutation
Mutation returns the DictDataMutation object of the builder.
func (*DictDataCreate) Save ¶
func (ddc *DictDataCreate) Save(ctx context.Context) (*DictData, error)
Save creates the DictData in the database.
func (*DictDataCreate) SaveX ¶
func (ddc *DictDataCreate) SaveX(ctx context.Context) *DictData
SaveX calls Save and panics if Save returns an error.
func (*DictDataCreate) SetCreatedAt ¶
func (ddc *DictDataCreate) SetCreatedAt(t time.Time) *DictDataCreate
SetCreatedAt sets the "created_at" field.
func (*DictDataCreate) SetCreatedBy ¶
func (ddc *DictDataCreate) SetCreatedBy(i int64) *DictDataCreate
SetCreatedBy sets the "created_by" field.
func (*DictDataCreate) SetDictTypeID ¶
func (ddc *DictDataCreate) SetDictTypeID(i int64) *DictDataCreate
SetDictTypeID sets the "dict_type_id" field.
func (*DictDataCreate) SetID ¶
func (ddc *DictDataCreate) SetID(i int64) *DictDataCreate
SetID sets the "id" field.
func (*DictDataCreate) SetIsDefault ¶
func (ddc *DictDataCreate) SetIsDefault(i int8) *DictDataCreate
SetIsDefault sets the "is_default" field.
func (*DictDataCreate) SetLabel ¶
func (ddc *DictDataCreate) SetLabel(s string) *DictDataCreate
SetLabel sets the "label" field.
func (*DictDataCreate) SetNillableCreatedAt ¶
func (ddc *DictDataCreate) SetNillableCreatedAt(t *time.Time) *DictDataCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictDataCreate) SetNillableCreatedBy ¶
func (ddc *DictDataCreate) SetNillableCreatedBy(i *int64) *DictDataCreate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictDataCreate) SetNillableDictTypeID ¶
func (ddc *DictDataCreate) SetNillableDictTypeID(i *int64) *DictDataCreate
SetNillableDictTypeID sets the "dict_type_id" field if the given value is not nil.
func (*DictDataCreate) SetNillableIsDefault ¶
func (ddc *DictDataCreate) SetNillableIsDefault(i *int8) *DictDataCreate
SetNillableIsDefault sets the "is_default" field if the given value is not nil.
func (*DictDataCreate) SetNillableLabel ¶
func (ddc *DictDataCreate) SetNillableLabel(s *string) *DictDataCreate
SetNillableLabel sets the "label" field if the given value is not nil.
func (*DictDataCreate) SetNillableRemark ¶
func (ddc *DictDataCreate) SetNillableRemark(s *string) *DictDataCreate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictDataCreate) SetNillableSort ¶
func (ddc *DictDataCreate) SetNillableSort(i *int8) *DictDataCreate
SetNillableSort sets the "sort" field if the given value is not nil.
func (*DictDataCreate) SetNillableStatus ¶
func (ddc *DictDataCreate) SetNillableStatus(i *int8) *DictDataCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictDataCreate) SetNillableUpdatedAt ¶
func (ddc *DictDataCreate) SetNillableUpdatedAt(t *time.Time) *DictDataCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DictDataCreate) SetNillableUpdatedBy ¶
func (ddc *DictDataCreate) SetNillableUpdatedBy(i *int64) *DictDataCreate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictDataCreate) SetNillableValue ¶
func (ddc *DictDataCreate) SetNillableValue(s *string) *DictDataCreate
SetNillableValue sets the "value" field if the given value is not nil.
func (*DictDataCreate) SetRemark ¶
func (ddc *DictDataCreate) SetRemark(s string) *DictDataCreate
SetRemark sets the "remark" field.
func (*DictDataCreate) SetSort ¶
func (ddc *DictDataCreate) SetSort(i int8) *DictDataCreate
SetSort sets the "sort" field.
func (*DictDataCreate) SetStatus ¶
func (ddc *DictDataCreate) SetStatus(i int8) *DictDataCreate
SetStatus sets the "status" field.
func (*DictDataCreate) SetUpdatedAt ¶
func (ddc *DictDataCreate) SetUpdatedAt(t time.Time) *DictDataCreate
SetUpdatedAt sets the "updated_at" field.
func (*DictDataCreate) SetUpdatedBy ¶
func (ddc *DictDataCreate) SetUpdatedBy(i int64) *DictDataCreate
SetUpdatedBy sets the "updated_by" field.
func (*DictDataCreate) SetValue ¶
func (ddc *DictDataCreate) SetValue(s string) *DictDataCreate
SetValue sets the "value" field.
type DictDataCreateBulk ¶
type DictDataCreateBulk struct {
// contains filtered or unexported fields
}
DictDataCreateBulk is the builder for creating many DictData entities in bulk.
func (*DictDataCreateBulk) Exec ¶
func (ddcb *DictDataCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DictDataCreateBulk) ExecX ¶
func (ddcb *DictDataCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DictDataDelete ¶
type DictDataDelete struct {
// contains filtered or unexported fields
}
DictDataDelete is the builder for deleting a DictData entity.
func (*DictDataDelete) Exec ¶
func (ddd *DictDataDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DictDataDelete) ExecX ¶
func (ddd *DictDataDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DictDataDelete) Where ¶
func (ddd *DictDataDelete) Where(ps ...predicate.DictData) *DictDataDelete
Where appends a list predicates to the DictDataDelete builder.
type DictDataDeleteOne ¶
type DictDataDeleteOne struct {
// contains filtered or unexported fields
}
DictDataDeleteOne is the builder for deleting a single DictData entity.
func (*DictDataDeleteOne) Exec ¶
func (dddo *DictDataDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DictDataDeleteOne) ExecX ¶
func (dddo *DictDataDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DictDataGroupBy ¶
type DictDataGroupBy struct {
// contains filtered or unexported fields
}
DictDataGroupBy is the group-by builder for DictData entities.
func (*DictDataGroupBy) Aggregate ¶
func (ddgb *DictDataGroupBy) Aggregate(fns ...AggregateFunc) *DictDataGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DictDataGroupBy) Bool ¶
func (ddgb *DictDataGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) BoolX ¶
func (ddgb *DictDataGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DictDataGroupBy) Bools ¶
func (ddgb *DictDataGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) BoolsX ¶
func (ddgb *DictDataGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DictDataGroupBy) Float64 ¶
func (ddgb *DictDataGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) Float64X ¶
func (ddgb *DictDataGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DictDataGroupBy) Float64s ¶
func (ddgb *DictDataGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) Float64sX ¶
func (ddgb *DictDataGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DictDataGroupBy) Int ¶
func (ddgb *DictDataGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) IntX ¶
func (ddgb *DictDataGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DictDataGroupBy) Ints ¶
func (ddgb *DictDataGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) IntsX ¶
func (ddgb *DictDataGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DictDataGroupBy) Scan ¶
func (ddgb *DictDataGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*DictDataGroupBy) ScanX ¶
func (ddgb *DictDataGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DictDataGroupBy) String ¶
func (ddgb *DictDataGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictDataGroupBy) StringX ¶
func (ddgb *DictDataGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DictDataMutation ¶
type DictDataMutation struct {
// contains filtered or unexported fields
}
DictDataMutation represents an operation that mutates the DictData nodes in the graph.
func (*DictDataMutation) AddCreatedBy ¶
func (m *DictDataMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
func (*DictDataMutation) AddDictTypeID ¶
func (m *DictDataMutation) AddDictTypeID(i int64)
AddDictTypeID adds i to the "dict_type_id" field.
func (*DictDataMutation) AddField ¶
func (m *DictDataMutation) 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 (*DictDataMutation) AddIsDefault ¶
func (m *DictDataMutation) AddIsDefault(i int8)
AddIsDefault adds i to the "is_default" field.
func (*DictDataMutation) AddSort ¶
func (m *DictDataMutation) AddSort(i int8)
AddSort adds i to the "sort" field.
func (*DictDataMutation) AddStatus ¶
func (m *DictDataMutation) AddStatus(i int8)
AddStatus adds i to the "status" field.
func (*DictDataMutation) AddUpdatedBy ¶
func (m *DictDataMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*DictDataMutation) AddedCreatedBy ¶
func (m *DictDataMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
func (*DictDataMutation) AddedDictTypeID ¶
func (m *DictDataMutation) AddedDictTypeID() (r int64, exists bool)
AddedDictTypeID returns the value that was added to the "dict_type_id" field in this mutation.
func (*DictDataMutation) AddedEdges ¶
func (m *DictDataMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DictDataMutation) AddedField ¶
func (m *DictDataMutation) 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 (*DictDataMutation) AddedFields ¶
func (m *DictDataMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DictDataMutation) AddedIDs ¶
func (m *DictDataMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DictDataMutation) AddedIsDefault ¶
func (m *DictDataMutation) AddedIsDefault() (r int8, exists bool)
AddedIsDefault returns the value that was added to the "is_default" field in this mutation.
func (*DictDataMutation) AddedSort ¶
func (m *DictDataMutation) AddedSort() (r int8, exists bool)
AddedSort returns the value that was added to the "sort" field in this mutation.
func (*DictDataMutation) AddedStatus ¶
func (m *DictDataMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*DictDataMutation) AddedUpdatedBy ¶
func (m *DictDataMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*DictDataMutation) ClearEdge ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ClearField ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ClearedEdges ¶
func (m *DictDataMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DictDataMutation) ClearedFields ¶
func (m *DictDataMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DictDataMutation) Client ¶
func (m DictDataMutation) 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 (*DictDataMutation) CreatedAt ¶
func (m *DictDataMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*DictDataMutation) CreatedBy ¶
func (m *DictDataMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*DictDataMutation) DictTypeID ¶
func (m *DictDataMutation) DictTypeID() (r int64, exists bool)
DictTypeID returns the value of the "dict_type_id" field in the mutation.
func (*DictDataMutation) EdgeCleared ¶
func (m *DictDataMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DictDataMutation) Field ¶
func (m *DictDataMutation) 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 (*DictDataMutation) FieldCleared ¶
func (m *DictDataMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DictDataMutation) Fields ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ID ¶
func (m *DictDataMutation) ID() (id int64, 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 (*DictDataMutation) IDs ¶
func (m *DictDataMutation) IDs(ctx context.Context) ([]int64, 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 (*DictDataMutation) IsDefault ¶
func (m *DictDataMutation) IsDefault() (r int8, exists bool)
IsDefault returns the value of the "is_default" field in the mutation.
func (*DictDataMutation) Label ¶
func (m *DictDataMutation) Label() (r string, exists bool)
Label returns the value of the "label" field in the mutation.
func (*DictDataMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldCreatedBy ¶
func (m *DictDataMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldDictTypeID ¶
func (m *DictDataMutation) OldDictTypeID(ctx context.Context) (v int64, err error)
OldDictTypeID returns the old "dict_type_id" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) 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 (*DictDataMutation) OldIsDefault ¶
func (m *DictDataMutation) OldIsDefault(ctx context.Context) (v int8, err error)
OldIsDefault returns the old "is_default" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldLabel ¶
func (m *DictDataMutation) OldLabel(ctx context.Context) (v string, err error)
OldLabel returns the old "label" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldRemark ¶
func (m *DictDataMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldSort ¶
func (m *DictDataMutation) OldSort(ctx context.Context) (v int8, err error)
OldSort returns the old "sort" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldStatus ¶
func (m *DictDataMutation) OldStatus(ctx context.Context) (v int8, err error)
OldStatus returns the old "status" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldUpdatedBy ¶
func (m *DictDataMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) OldValue ¶
func (m *DictDataMutation) OldValue(ctx context.Context) (v string, err error)
OldValue returns the old "value" field's value of the DictData entity. If the DictData 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 (*DictDataMutation) Remark ¶
func (m *DictDataMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*DictDataMutation) RemovedEdges ¶
func (m *DictDataMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DictDataMutation) RemovedIDs ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ResetCreatedAt ¶
func (m *DictDataMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*DictDataMutation) ResetCreatedBy ¶
func (m *DictDataMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*DictDataMutation) ResetDictTypeID ¶
func (m *DictDataMutation) ResetDictTypeID()
ResetDictTypeID resets all changes to the "dict_type_id" field.
func (*DictDataMutation) ResetEdge ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ResetField ¶
func (m *DictDataMutation) 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 (*DictDataMutation) ResetIsDefault ¶
func (m *DictDataMutation) ResetIsDefault()
ResetIsDefault resets all changes to the "is_default" field.
func (*DictDataMutation) ResetLabel ¶
func (m *DictDataMutation) ResetLabel()
ResetLabel resets all changes to the "label" field.
func (*DictDataMutation) ResetRemark ¶
func (m *DictDataMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*DictDataMutation) ResetSort ¶
func (m *DictDataMutation) ResetSort()
ResetSort resets all changes to the "sort" field.
func (*DictDataMutation) ResetStatus ¶
func (m *DictDataMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*DictDataMutation) ResetUpdatedAt ¶
func (m *DictDataMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*DictDataMutation) ResetUpdatedBy ¶
func (m *DictDataMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*DictDataMutation) ResetValue ¶
func (m *DictDataMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*DictDataMutation) SetCreatedAt ¶
func (m *DictDataMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*DictDataMutation) SetCreatedBy ¶
func (m *DictDataMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" field.
func (*DictDataMutation) SetDictTypeID ¶
func (m *DictDataMutation) SetDictTypeID(i int64)
SetDictTypeID sets the "dict_type_id" field.
func (*DictDataMutation) SetField ¶
func (m *DictDataMutation) 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 (*DictDataMutation) SetID ¶
func (m *DictDataMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of DictData entities.
func (*DictDataMutation) SetIsDefault ¶
func (m *DictDataMutation) SetIsDefault(i int8)
SetIsDefault sets the "is_default" field.
func (*DictDataMutation) SetLabel ¶
func (m *DictDataMutation) SetLabel(s string)
SetLabel sets the "label" field.
func (*DictDataMutation) SetRemark ¶
func (m *DictDataMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*DictDataMutation) SetSort ¶
func (m *DictDataMutation) SetSort(i int8)
SetSort sets the "sort" field.
func (*DictDataMutation) SetStatus ¶
func (m *DictDataMutation) SetStatus(i int8)
SetStatus sets the "status" field.
func (*DictDataMutation) SetUpdatedAt ¶
func (m *DictDataMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*DictDataMutation) SetUpdatedBy ¶
func (m *DictDataMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" field.
func (*DictDataMutation) SetValue ¶
func (m *DictDataMutation) SetValue(s string)
SetValue sets the "value" field.
func (*DictDataMutation) Sort ¶
func (m *DictDataMutation) Sort() (r int8, exists bool)
Sort returns the value of the "sort" field in the mutation.
func (*DictDataMutation) Status ¶
func (m *DictDataMutation) Status() (r int8, exists bool)
Status returns the value of the "status" field in the mutation.
func (DictDataMutation) Tx ¶
func (m DictDataMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DictDataMutation) Type ¶
func (m *DictDataMutation) Type() string
Type returns the node type of this mutation (DictData).
func (*DictDataMutation) UpdatedAt ¶
func (m *DictDataMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*DictDataMutation) UpdatedBy ¶
func (m *DictDataMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" field in the mutation.
func (*DictDataMutation) Value ¶
func (m *DictDataMutation) Value() (r string, exists bool)
Value returns the value of the "value" field in the mutation.
func (*DictDataMutation) Where ¶
func (m *DictDataMutation) Where(ps ...predicate.DictData)
Where appends a list predicates to the DictDataMutation builder.
type DictDataQuery ¶
type DictDataQuery struct {
// contains filtered or unexported fields
}
DictDataQuery is the builder for querying DictData entities.
func (*DictDataQuery) All ¶
func (ddq *DictDataQuery) All(ctx context.Context) ([]*DictData, error)
All executes the query and returns a list of DictDataSlice.
func (*DictDataQuery) AllX ¶
func (ddq *DictDataQuery) AllX(ctx context.Context) []*DictData
AllX is like All, but panics if an error occurs.
func (*DictDataQuery) Clone ¶
func (ddq *DictDataQuery) Clone() *DictDataQuery
Clone returns a duplicate of the DictDataQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DictDataQuery) Count ¶
func (ddq *DictDataQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DictDataQuery) CountX ¶
func (ddq *DictDataQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DictDataQuery) Exist ¶
func (ddq *DictDataQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DictDataQuery) ExistX ¶
func (ddq *DictDataQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DictDataQuery) First ¶
func (ddq *DictDataQuery) First(ctx context.Context) (*DictData, error)
First returns the first DictData entity from the query. Returns a *NotFoundError when no DictData was found.
func (*DictDataQuery) FirstID ¶
func (ddq *DictDataQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first DictData ID from the query. Returns a *NotFoundError when no DictData ID was found.
func (*DictDataQuery) FirstIDX ¶
func (ddq *DictDataQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*DictDataQuery) FirstX ¶
func (ddq *DictDataQuery) FirstX(ctx context.Context) *DictData
FirstX is like First, but panics if an error occurs.
func (*DictDataQuery) GroupBy ¶
func (ddq *DictDataQuery) GroupBy(field string, fields ...string) *DictDataGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.DictData.Query(). GroupBy(dictdata.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DictDataQuery) IDs ¶
func (ddq *DictDataQuery) IDs(ctx context.Context) ([]int64, error)
IDs executes the query and returns a list of DictData IDs.
func (*DictDataQuery) IDsX ¶
func (ddq *DictDataQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*DictDataQuery) Limit ¶
func (ddq *DictDataQuery) Limit(limit int) *DictDataQuery
Limit adds a limit step to the query.
func (*DictDataQuery) Offset ¶
func (ddq *DictDataQuery) Offset(offset int) *DictDataQuery
Offset adds an offset step to the query.
func (*DictDataQuery) Only ¶
func (ddq *DictDataQuery) Only(ctx context.Context) (*DictData, error)
Only returns a single DictData entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DictData entity is found. Returns a *NotFoundError when no DictData entities are found.
func (*DictDataQuery) OnlyID ¶
func (ddq *DictDataQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only DictData ID in the query. Returns a *NotSingularError when more than one DictData ID is found. Returns a *NotFoundError when no entities are found.
func (*DictDataQuery) OnlyIDX ¶
func (ddq *DictDataQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DictDataQuery) OnlyX ¶
func (ddq *DictDataQuery) OnlyX(ctx context.Context) *DictData
OnlyX is like Only, but panics if an error occurs.
func (*DictDataQuery) Order ¶
func (ddq *DictDataQuery) Order(o ...OrderFunc) *DictDataQuery
Order adds an order step to the query.
func (*DictDataQuery) Select ¶
func (ddq *DictDataQuery) Select(fields ...string) *DictDataSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.DictData.Query(). Select(dictdata.FieldCreatedAt). Scan(ctx, &v)
func (*DictDataQuery) Unique ¶
func (ddq *DictDataQuery) Unique(unique bool) *DictDataQuery
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 (*DictDataQuery) Where ¶
func (ddq *DictDataQuery) Where(ps ...predicate.DictData) *DictDataQuery
Where adds a new predicate for the DictDataQuery builder.
type DictDataSelect ¶
type DictDataSelect struct { *DictDataQuery // contains filtered or unexported fields }
DictDataSelect is the builder for selecting fields of DictData entities.
func (*DictDataSelect) Bool ¶
func (dds *DictDataSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) BoolX ¶
func (dds *DictDataSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DictDataSelect) Bools ¶
func (dds *DictDataSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) BoolsX ¶
func (dds *DictDataSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DictDataSelect) Float64 ¶
func (dds *DictDataSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) Float64X ¶
func (dds *DictDataSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DictDataSelect) Float64s ¶
func (dds *DictDataSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) Float64sX ¶
func (dds *DictDataSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DictDataSelect) Int ¶
func (dds *DictDataSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) IntX ¶
func (dds *DictDataSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DictDataSelect) Ints ¶
func (dds *DictDataSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) IntsX ¶
func (dds *DictDataSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DictDataSelect) Scan ¶
func (dds *DictDataSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*DictDataSelect) ScanX ¶
func (dds *DictDataSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DictDataSelect) String ¶
func (dds *DictDataSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*DictDataSelect) StringX ¶
func (dds *DictDataSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DictDataUpdate ¶
type DictDataUpdate struct {
// contains filtered or unexported fields
}
DictDataUpdate is the builder for updating DictData entities.
func (*DictDataUpdate) AddCreatedBy ¶
func (ddu *DictDataUpdate) AddCreatedBy(i int64) *DictDataUpdate
AddCreatedBy adds i to the "created_by" field.
func (*DictDataUpdate) AddDictTypeID ¶
func (ddu *DictDataUpdate) AddDictTypeID(i int64) *DictDataUpdate
AddDictTypeID adds i to the "dict_type_id" field.
func (*DictDataUpdate) AddIsDefault ¶
func (ddu *DictDataUpdate) AddIsDefault(i int8) *DictDataUpdate
AddIsDefault adds i to the "is_default" field.
func (*DictDataUpdate) AddSort ¶
func (ddu *DictDataUpdate) AddSort(i int8) *DictDataUpdate
AddSort adds i to the "sort" field.
func (*DictDataUpdate) AddStatus ¶
func (ddu *DictDataUpdate) AddStatus(i int8) *DictDataUpdate
AddStatus adds i to the "status" field.
func (*DictDataUpdate) AddUpdatedBy ¶
func (ddu *DictDataUpdate) AddUpdatedBy(i int64) *DictDataUpdate
AddUpdatedBy adds i to the "updated_by" field.
func (*DictDataUpdate) Exec ¶
func (ddu *DictDataUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DictDataUpdate) ExecX ¶
func (ddu *DictDataUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictDataUpdate) Mutation ¶
func (ddu *DictDataUpdate) Mutation() *DictDataMutation
Mutation returns the DictDataMutation object of the builder.
func (*DictDataUpdate) Save ¶
func (ddu *DictDataUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DictDataUpdate) SaveX ¶
func (ddu *DictDataUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DictDataUpdate) SetCreatedAt ¶
func (ddu *DictDataUpdate) SetCreatedAt(t time.Time) *DictDataUpdate
SetCreatedAt sets the "created_at" field.
func (*DictDataUpdate) SetCreatedBy ¶
func (ddu *DictDataUpdate) SetCreatedBy(i int64) *DictDataUpdate
SetCreatedBy sets the "created_by" field.
func (*DictDataUpdate) SetDictTypeID ¶
func (ddu *DictDataUpdate) SetDictTypeID(i int64) *DictDataUpdate
SetDictTypeID sets the "dict_type_id" field.
func (*DictDataUpdate) SetIsDefault ¶
func (ddu *DictDataUpdate) SetIsDefault(i int8) *DictDataUpdate
SetIsDefault sets the "is_default" field.
func (*DictDataUpdate) SetLabel ¶
func (ddu *DictDataUpdate) SetLabel(s string) *DictDataUpdate
SetLabel sets the "label" field.
func (*DictDataUpdate) SetNillableCreatedAt ¶
func (ddu *DictDataUpdate) SetNillableCreatedAt(t *time.Time) *DictDataUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictDataUpdate) SetNillableCreatedBy ¶
func (ddu *DictDataUpdate) SetNillableCreatedBy(i *int64) *DictDataUpdate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictDataUpdate) SetNillableDictTypeID ¶
func (ddu *DictDataUpdate) SetNillableDictTypeID(i *int64) *DictDataUpdate
SetNillableDictTypeID sets the "dict_type_id" field if the given value is not nil.
func (*DictDataUpdate) SetNillableIsDefault ¶
func (ddu *DictDataUpdate) SetNillableIsDefault(i *int8) *DictDataUpdate
SetNillableIsDefault sets the "is_default" field if the given value is not nil.
func (*DictDataUpdate) SetNillableLabel ¶
func (ddu *DictDataUpdate) SetNillableLabel(s *string) *DictDataUpdate
SetNillableLabel sets the "label" field if the given value is not nil.
func (*DictDataUpdate) SetNillableRemark ¶
func (ddu *DictDataUpdate) SetNillableRemark(s *string) *DictDataUpdate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictDataUpdate) SetNillableSort ¶
func (ddu *DictDataUpdate) SetNillableSort(i *int8) *DictDataUpdate
SetNillableSort sets the "sort" field if the given value is not nil.
func (*DictDataUpdate) SetNillableStatus ¶
func (ddu *DictDataUpdate) SetNillableStatus(i *int8) *DictDataUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictDataUpdate) SetNillableUpdatedBy ¶
func (ddu *DictDataUpdate) SetNillableUpdatedBy(i *int64) *DictDataUpdate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictDataUpdate) SetNillableValue ¶
func (ddu *DictDataUpdate) SetNillableValue(s *string) *DictDataUpdate
SetNillableValue sets the "value" field if the given value is not nil.
func (*DictDataUpdate) SetRemark ¶
func (ddu *DictDataUpdate) SetRemark(s string) *DictDataUpdate
SetRemark sets the "remark" field.
func (*DictDataUpdate) SetSort ¶
func (ddu *DictDataUpdate) SetSort(i int8) *DictDataUpdate
SetSort sets the "sort" field.
func (*DictDataUpdate) SetStatus ¶
func (ddu *DictDataUpdate) SetStatus(i int8) *DictDataUpdate
SetStatus sets the "status" field.
func (*DictDataUpdate) SetUpdatedAt ¶
func (ddu *DictDataUpdate) SetUpdatedAt(t time.Time) *DictDataUpdate
SetUpdatedAt sets the "updated_at" field.
func (*DictDataUpdate) SetUpdatedBy ¶
func (ddu *DictDataUpdate) SetUpdatedBy(i int64) *DictDataUpdate
SetUpdatedBy sets the "updated_by" field.
func (*DictDataUpdate) SetValue ¶
func (ddu *DictDataUpdate) SetValue(s string) *DictDataUpdate
SetValue sets the "value" field.
func (*DictDataUpdate) Where ¶
func (ddu *DictDataUpdate) Where(ps ...predicate.DictData) *DictDataUpdate
Where appends a list predicates to the DictDataUpdate builder.
type DictDataUpdateOne ¶
type DictDataUpdateOne struct {
// contains filtered or unexported fields
}
DictDataUpdateOne is the builder for updating a single DictData entity.
func (*DictDataUpdateOne) AddCreatedBy ¶
func (dduo *DictDataUpdateOne) AddCreatedBy(i int64) *DictDataUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*DictDataUpdateOne) AddDictTypeID ¶
func (dduo *DictDataUpdateOne) AddDictTypeID(i int64) *DictDataUpdateOne
AddDictTypeID adds i to the "dict_type_id" field.
func (*DictDataUpdateOne) AddIsDefault ¶
func (dduo *DictDataUpdateOne) AddIsDefault(i int8) *DictDataUpdateOne
AddIsDefault adds i to the "is_default" field.
func (*DictDataUpdateOne) AddSort ¶
func (dduo *DictDataUpdateOne) AddSort(i int8) *DictDataUpdateOne
AddSort adds i to the "sort" field.
func (*DictDataUpdateOne) AddStatus ¶
func (dduo *DictDataUpdateOne) AddStatus(i int8) *DictDataUpdateOne
AddStatus adds i to the "status" field.
func (*DictDataUpdateOne) AddUpdatedBy ¶
func (dduo *DictDataUpdateOne) AddUpdatedBy(i int64) *DictDataUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*DictDataUpdateOne) Exec ¶
func (dduo *DictDataUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DictDataUpdateOne) ExecX ¶
func (dduo *DictDataUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictDataUpdateOne) Mutation ¶
func (dduo *DictDataUpdateOne) Mutation() *DictDataMutation
Mutation returns the DictDataMutation object of the builder.
func (*DictDataUpdateOne) Save ¶
func (dduo *DictDataUpdateOne) Save(ctx context.Context) (*DictData, error)
Save executes the query and returns the updated DictData entity.
func (*DictDataUpdateOne) SaveX ¶
func (dduo *DictDataUpdateOne) SaveX(ctx context.Context) *DictData
SaveX is like Save, but panics if an error occurs.
func (*DictDataUpdateOne) Select ¶
func (dduo *DictDataUpdateOne) Select(field string, fields ...string) *DictDataUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DictDataUpdateOne) SetCreatedAt ¶
func (dduo *DictDataUpdateOne) SetCreatedAt(t time.Time) *DictDataUpdateOne
SetCreatedAt sets the "created_at" field.
func (*DictDataUpdateOne) SetCreatedBy ¶
func (dduo *DictDataUpdateOne) SetCreatedBy(i int64) *DictDataUpdateOne
SetCreatedBy sets the "created_by" field.
func (*DictDataUpdateOne) SetDictTypeID ¶
func (dduo *DictDataUpdateOne) SetDictTypeID(i int64) *DictDataUpdateOne
SetDictTypeID sets the "dict_type_id" field.
func (*DictDataUpdateOne) SetIsDefault ¶
func (dduo *DictDataUpdateOne) SetIsDefault(i int8) *DictDataUpdateOne
SetIsDefault sets the "is_default" field.
func (*DictDataUpdateOne) SetLabel ¶
func (dduo *DictDataUpdateOne) SetLabel(s string) *DictDataUpdateOne
SetLabel sets the "label" field.
func (*DictDataUpdateOne) SetNillableCreatedAt ¶
func (dduo *DictDataUpdateOne) SetNillableCreatedAt(t *time.Time) *DictDataUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableCreatedBy ¶
func (dduo *DictDataUpdateOne) SetNillableCreatedBy(i *int64) *DictDataUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableDictTypeID ¶
func (dduo *DictDataUpdateOne) SetNillableDictTypeID(i *int64) *DictDataUpdateOne
SetNillableDictTypeID sets the "dict_type_id" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableIsDefault ¶
func (dduo *DictDataUpdateOne) SetNillableIsDefault(i *int8) *DictDataUpdateOne
SetNillableIsDefault sets the "is_default" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableLabel ¶
func (dduo *DictDataUpdateOne) SetNillableLabel(s *string) *DictDataUpdateOne
SetNillableLabel sets the "label" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableRemark ¶
func (dduo *DictDataUpdateOne) SetNillableRemark(s *string) *DictDataUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableSort ¶
func (dduo *DictDataUpdateOne) SetNillableSort(i *int8) *DictDataUpdateOne
SetNillableSort sets the "sort" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableStatus ¶
func (dduo *DictDataUpdateOne) SetNillableStatus(i *int8) *DictDataUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableUpdatedBy ¶
func (dduo *DictDataUpdateOne) SetNillableUpdatedBy(i *int64) *DictDataUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictDataUpdateOne) SetNillableValue ¶
func (dduo *DictDataUpdateOne) SetNillableValue(s *string) *DictDataUpdateOne
SetNillableValue sets the "value" field if the given value is not nil.
func (*DictDataUpdateOne) SetRemark ¶
func (dduo *DictDataUpdateOne) SetRemark(s string) *DictDataUpdateOne
SetRemark sets the "remark" field.
func (*DictDataUpdateOne) SetSort ¶
func (dduo *DictDataUpdateOne) SetSort(i int8) *DictDataUpdateOne
SetSort sets the "sort" field.
func (*DictDataUpdateOne) SetStatus ¶
func (dduo *DictDataUpdateOne) SetStatus(i int8) *DictDataUpdateOne
SetStatus sets the "status" field.
func (*DictDataUpdateOne) SetUpdatedAt ¶
func (dduo *DictDataUpdateOne) SetUpdatedAt(t time.Time) *DictDataUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*DictDataUpdateOne) SetUpdatedBy ¶
func (dduo *DictDataUpdateOne) SetUpdatedBy(i int64) *DictDataUpdateOne
SetUpdatedBy sets the "updated_by" field.
func (*DictDataUpdateOne) SetValue ¶
func (dduo *DictDataUpdateOne) SetValue(s string) *DictDataUpdateOne
SetValue sets the "value" field.
type DictType ¶
type DictType struct { // ID of the ent. // 字典类型id ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // Name holds the value of the "name" field. // 字典名称 Name string `json:"name,omitempty"` // Type holds the value of the "type" field. // 字典类型 Type string `json:"type,omitempty"` // Status holds the value of the "status" field. // 状态 0:禁用 1:启用 Status int8 `json:"status,omitempty"` // Remark holds the value of the "remark" field. // 备注 Remark string `json:"remark,omitempty"` // contains filtered or unexported fields }
DictType is the model entity for the DictType schema.
func (*DictType) Unwrap ¶
Unwrap unwraps the DictType 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 (*DictType) Update ¶
func (dt *DictType) Update() *DictTypeUpdateOne
Update returns a builder for updating this DictType. Note that you need to call DictType.Unwrap() before calling this method if this DictType was returned from a transaction, and the transaction was committed or rolled back.
type DictTypeClient ¶
type DictTypeClient struct {
// contains filtered or unexported fields
}
DictTypeClient is a client for the DictType schema.
func NewDictTypeClient ¶
func NewDictTypeClient(c config) *DictTypeClient
NewDictTypeClient returns a client for the DictType from the given config.
func (*DictTypeClient) Create ¶
func (c *DictTypeClient) Create() *DictTypeCreate
Create returns a create builder for DictType.
func (*DictTypeClient) CreateBulk ¶
func (c *DictTypeClient) CreateBulk(builders ...*DictTypeCreate) *DictTypeCreateBulk
CreateBulk returns a builder for creating a bulk of DictType entities.
func (*DictTypeClient) Delete ¶
func (c *DictTypeClient) Delete() *DictTypeDelete
Delete returns a delete builder for DictType.
func (*DictTypeClient) DeleteOne ¶
func (c *DictTypeClient) DeleteOne(dt *DictType) *DictTypeDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*DictTypeClient) DeleteOneID ¶
func (c *DictTypeClient) DeleteOneID(id int64) *DictTypeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*DictTypeClient) GetX ¶
func (c *DictTypeClient) GetX(ctx context.Context, id int64) *DictType
GetX is like Get, but panics if an error occurs.
func (*DictTypeClient) Hooks ¶
func (c *DictTypeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DictTypeClient) Query ¶
func (c *DictTypeClient) Query() *DictTypeQuery
Query returns a query builder for DictType.
func (*DictTypeClient) Update ¶
func (c *DictTypeClient) Update() *DictTypeUpdate
Update returns an update builder for DictType.
func (*DictTypeClient) UpdateOne ¶
func (c *DictTypeClient) UpdateOne(dt *DictType) *DictTypeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DictTypeClient) UpdateOneID ¶
func (c *DictTypeClient) UpdateOneID(id int64) *DictTypeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DictTypeClient) Use ¶
func (c *DictTypeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `dicttype.Hooks(f(g(h())))`.
type DictTypeCreate ¶
type DictTypeCreate struct {
// contains filtered or unexported fields
}
DictTypeCreate is the builder for creating a DictType entity.
func (*DictTypeCreate) Exec ¶
func (dtc *DictTypeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DictTypeCreate) ExecX ¶
func (dtc *DictTypeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictTypeCreate) Mutation ¶
func (dtc *DictTypeCreate) Mutation() *DictTypeMutation
Mutation returns the DictTypeMutation object of the builder.
func (*DictTypeCreate) Save ¶
func (dtc *DictTypeCreate) Save(ctx context.Context) (*DictType, error)
Save creates the DictType in the database.
func (*DictTypeCreate) SaveX ¶
func (dtc *DictTypeCreate) SaveX(ctx context.Context) *DictType
SaveX calls Save and panics if Save returns an error.
func (*DictTypeCreate) SetCreatedAt ¶
func (dtc *DictTypeCreate) SetCreatedAt(t time.Time) *DictTypeCreate
SetCreatedAt sets the "created_at" field.
func (*DictTypeCreate) SetCreatedBy ¶
func (dtc *DictTypeCreate) SetCreatedBy(i int64) *DictTypeCreate
SetCreatedBy sets the "created_by" field.
func (*DictTypeCreate) SetID ¶
func (dtc *DictTypeCreate) SetID(i int64) *DictTypeCreate
SetID sets the "id" field.
func (*DictTypeCreate) SetName ¶
func (dtc *DictTypeCreate) SetName(s string) *DictTypeCreate
SetName sets the "name" field.
func (*DictTypeCreate) SetNillableCreatedAt ¶
func (dtc *DictTypeCreate) SetNillableCreatedAt(t *time.Time) *DictTypeCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictTypeCreate) SetNillableCreatedBy ¶
func (dtc *DictTypeCreate) SetNillableCreatedBy(i *int64) *DictTypeCreate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictTypeCreate) SetNillableName ¶
func (dtc *DictTypeCreate) SetNillableName(s *string) *DictTypeCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*DictTypeCreate) SetNillableRemark ¶
func (dtc *DictTypeCreate) SetNillableRemark(s *string) *DictTypeCreate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictTypeCreate) SetNillableStatus ¶
func (dtc *DictTypeCreate) SetNillableStatus(i *int8) *DictTypeCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictTypeCreate) SetNillableType ¶
func (dtc *DictTypeCreate) SetNillableType(s *string) *DictTypeCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*DictTypeCreate) SetNillableUpdatedAt ¶
func (dtc *DictTypeCreate) SetNillableUpdatedAt(t *time.Time) *DictTypeCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DictTypeCreate) SetNillableUpdatedBy ¶
func (dtc *DictTypeCreate) SetNillableUpdatedBy(i *int64) *DictTypeCreate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictTypeCreate) SetRemark ¶
func (dtc *DictTypeCreate) SetRemark(s string) *DictTypeCreate
SetRemark sets the "remark" field.
func (*DictTypeCreate) SetStatus ¶
func (dtc *DictTypeCreate) SetStatus(i int8) *DictTypeCreate
SetStatus sets the "status" field.
func (*DictTypeCreate) SetType ¶
func (dtc *DictTypeCreate) SetType(s string) *DictTypeCreate
SetType sets the "type" field.
func (*DictTypeCreate) SetUpdatedAt ¶
func (dtc *DictTypeCreate) SetUpdatedAt(t time.Time) *DictTypeCreate
SetUpdatedAt sets the "updated_at" field.
func (*DictTypeCreate) SetUpdatedBy ¶
func (dtc *DictTypeCreate) SetUpdatedBy(i int64) *DictTypeCreate
SetUpdatedBy sets the "updated_by" field.
type DictTypeCreateBulk ¶
type DictTypeCreateBulk struct {
// contains filtered or unexported fields
}
DictTypeCreateBulk is the builder for creating many DictType entities in bulk.
func (*DictTypeCreateBulk) Exec ¶
func (dtcb *DictTypeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DictTypeCreateBulk) ExecX ¶
func (dtcb *DictTypeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DictTypeDelete ¶
type DictTypeDelete struct {
// contains filtered or unexported fields
}
DictTypeDelete is the builder for deleting a DictType entity.
func (*DictTypeDelete) Exec ¶
func (dtd *DictTypeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DictTypeDelete) ExecX ¶
func (dtd *DictTypeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DictTypeDelete) Where ¶
func (dtd *DictTypeDelete) Where(ps ...predicate.DictType) *DictTypeDelete
Where appends a list predicates to the DictTypeDelete builder.
type DictTypeDeleteOne ¶
type DictTypeDeleteOne struct {
// contains filtered or unexported fields
}
DictTypeDeleteOne is the builder for deleting a single DictType entity.
func (*DictTypeDeleteOne) Exec ¶
func (dtdo *DictTypeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DictTypeDeleteOne) ExecX ¶
func (dtdo *DictTypeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DictTypeGroupBy ¶
type DictTypeGroupBy struct {
// contains filtered or unexported fields
}
DictTypeGroupBy is the group-by builder for DictType entities.
func (*DictTypeGroupBy) Aggregate ¶
func (dtgb *DictTypeGroupBy) Aggregate(fns ...AggregateFunc) *DictTypeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DictTypeGroupBy) Bool ¶
func (dtgb *DictTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) BoolX ¶
func (dtgb *DictTypeGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DictTypeGroupBy) Bools ¶
func (dtgb *DictTypeGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) BoolsX ¶
func (dtgb *DictTypeGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DictTypeGroupBy) Float64 ¶
func (dtgb *DictTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) Float64X ¶
func (dtgb *DictTypeGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DictTypeGroupBy) Float64s ¶
func (dtgb *DictTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) Float64sX ¶
func (dtgb *DictTypeGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DictTypeGroupBy) Int ¶
func (dtgb *DictTypeGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) IntX ¶
func (dtgb *DictTypeGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DictTypeGroupBy) Ints ¶
func (dtgb *DictTypeGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) IntsX ¶
func (dtgb *DictTypeGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DictTypeGroupBy) Scan ¶
func (dtgb *DictTypeGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*DictTypeGroupBy) ScanX ¶
func (dtgb *DictTypeGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DictTypeGroupBy) String ¶
func (dtgb *DictTypeGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DictTypeGroupBy) StringX ¶
func (dtgb *DictTypeGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DictTypeMutation ¶
type DictTypeMutation struct {
// contains filtered or unexported fields
}
DictTypeMutation represents an operation that mutates the DictType nodes in the graph.
func (*DictTypeMutation) AddCreatedBy ¶
func (m *DictTypeMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
func (*DictTypeMutation) AddField ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) AddStatus ¶
func (m *DictTypeMutation) AddStatus(i int8)
AddStatus adds i to the "status" field.
func (*DictTypeMutation) AddUpdatedBy ¶
func (m *DictTypeMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*DictTypeMutation) AddedCreatedBy ¶
func (m *DictTypeMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
func (*DictTypeMutation) AddedEdges ¶
func (m *DictTypeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DictTypeMutation) AddedField ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) AddedFields ¶
func (m *DictTypeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DictTypeMutation) AddedIDs ¶
func (m *DictTypeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DictTypeMutation) AddedStatus ¶
func (m *DictTypeMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*DictTypeMutation) AddedUpdatedBy ¶
func (m *DictTypeMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*DictTypeMutation) ClearEdge ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) ClearField ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) ClearedEdges ¶
func (m *DictTypeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DictTypeMutation) ClearedFields ¶
func (m *DictTypeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DictTypeMutation) Client ¶
func (m DictTypeMutation) 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 (*DictTypeMutation) CreatedAt ¶
func (m *DictTypeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*DictTypeMutation) CreatedBy ¶
func (m *DictTypeMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*DictTypeMutation) EdgeCleared ¶
func (m *DictTypeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DictTypeMutation) Field ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) FieldCleared ¶
func (m *DictTypeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DictTypeMutation) Fields ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) GetType ¶
func (m *DictTypeMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*DictTypeMutation) ID ¶
func (m *DictTypeMutation) ID() (id int64, 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 (*DictTypeMutation) IDs ¶
func (m *DictTypeMutation) IDs(ctx context.Context) ([]int64, 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 (*DictTypeMutation) Name ¶
func (m *DictTypeMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*DictTypeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldCreatedBy ¶
func (m *DictTypeMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) 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 (*DictTypeMutation) OldName ¶
func (m *DictTypeMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldRemark ¶
func (m *DictTypeMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldStatus ¶
func (m *DictTypeMutation) OldStatus(ctx context.Context) (v int8, err error)
OldStatus returns the old "status" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldType ¶
func (m *DictTypeMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) OldUpdatedBy ¶
func (m *DictTypeMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" field's value of the DictType entity. If the DictType 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 (*DictTypeMutation) Remark ¶
func (m *DictTypeMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*DictTypeMutation) RemovedEdges ¶
func (m *DictTypeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DictTypeMutation) RemovedIDs ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) ResetCreatedAt ¶
func (m *DictTypeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*DictTypeMutation) ResetCreatedBy ¶
func (m *DictTypeMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*DictTypeMutation) ResetEdge ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) ResetField ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) ResetName ¶
func (m *DictTypeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*DictTypeMutation) ResetRemark ¶
func (m *DictTypeMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*DictTypeMutation) ResetStatus ¶
func (m *DictTypeMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*DictTypeMutation) ResetType ¶
func (m *DictTypeMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*DictTypeMutation) ResetUpdatedAt ¶
func (m *DictTypeMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*DictTypeMutation) ResetUpdatedBy ¶
func (m *DictTypeMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*DictTypeMutation) SetCreatedAt ¶
func (m *DictTypeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*DictTypeMutation) SetCreatedBy ¶
func (m *DictTypeMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" field.
func (*DictTypeMutation) SetField ¶
func (m *DictTypeMutation) 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 (*DictTypeMutation) SetID ¶
func (m *DictTypeMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of DictType entities.
func (*DictTypeMutation) SetName ¶
func (m *DictTypeMutation) SetName(s string)
SetName sets the "name" field.
func (*DictTypeMutation) SetRemark ¶
func (m *DictTypeMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*DictTypeMutation) SetStatus ¶
func (m *DictTypeMutation) SetStatus(i int8)
SetStatus sets the "status" field.
func (*DictTypeMutation) SetType ¶
func (m *DictTypeMutation) SetType(s string)
SetType sets the "type" field.
func (*DictTypeMutation) SetUpdatedAt ¶
func (m *DictTypeMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*DictTypeMutation) SetUpdatedBy ¶
func (m *DictTypeMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" field.
func (*DictTypeMutation) Status ¶
func (m *DictTypeMutation) Status() (r int8, exists bool)
Status returns the value of the "status" field in the mutation.
func (DictTypeMutation) Tx ¶
func (m DictTypeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DictTypeMutation) Type ¶
func (m *DictTypeMutation) Type() string
Type returns the node type of this mutation (DictType).
func (*DictTypeMutation) UpdatedAt ¶
func (m *DictTypeMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*DictTypeMutation) UpdatedBy ¶
func (m *DictTypeMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" field in the mutation.
func (*DictTypeMutation) Where ¶
func (m *DictTypeMutation) Where(ps ...predicate.DictType)
Where appends a list predicates to the DictTypeMutation builder.
type DictTypeQuery ¶
type DictTypeQuery struct {
// contains filtered or unexported fields
}
DictTypeQuery is the builder for querying DictType entities.
func (*DictTypeQuery) All ¶
func (dtq *DictTypeQuery) All(ctx context.Context) ([]*DictType, error)
All executes the query and returns a list of DictTypes.
func (*DictTypeQuery) AllX ¶
func (dtq *DictTypeQuery) AllX(ctx context.Context) []*DictType
AllX is like All, but panics if an error occurs.
func (*DictTypeQuery) Clone ¶
func (dtq *DictTypeQuery) Clone() *DictTypeQuery
Clone returns a duplicate of the DictTypeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DictTypeQuery) Count ¶
func (dtq *DictTypeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DictTypeQuery) CountX ¶
func (dtq *DictTypeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DictTypeQuery) Exist ¶
func (dtq *DictTypeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DictTypeQuery) ExistX ¶
func (dtq *DictTypeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DictTypeQuery) First ¶
func (dtq *DictTypeQuery) First(ctx context.Context) (*DictType, error)
First returns the first DictType entity from the query. Returns a *NotFoundError when no DictType was found.
func (*DictTypeQuery) FirstID ¶
func (dtq *DictTypeQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first DictType ID from the query. Returns a *NotFoundError when no DictType ID was found.
func (*DictTypeQuery) FirstIDX ¶
func (dtq *DictTypeQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*DictTypeQuery) FirstX ¶
func (dtq *DictTypeQuery) FirstX(ctx context.Context) *DictType
FirstX is like First, but panics if an error occurs.
func (*DictTypeQuery) GroupBy ¶
func (dtq *DictTypeQuery) GroupBy(field string, fields ...string) *DictTypeGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.DictType.Query(). GroupBy(dicttype.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DictTypeQuery) IDs ¶
func (dtq *DictTypeQuery) IDs(ctx context.Context) ([]int64, error)
IDs executes the query and returns a list of DictType IDs.
func (*DictTypeQuery) IDsX ¶
func (dtq *DictTypeQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*DictTypeQuery) Limit ¶
func (dtq *DictTypeQuery) Limit(limit int) *DictTypeQuery
Limit adds a limit step to the query.
func (*DictTypeQuery) Offset ¶
func (dtq *DictTypeQuery) Offset(offset int) *DictTypeQuery
Offset adds an offset step to the query.
func (*DictTypeQuery) Only ¶
func (dtq *DictTypeQuery) Only(ctx context.Context) (*DictType, error)
Only returns a single DictType entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DictType entity is found. Returns a *NotFoundError when no DictType entities are found.
func (*DictTypeQuery) OnlyID ¶
func (dtq *DictTypeQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only DictType ID in the query. Returns a *NotSingularError when more than one DictType ID is found. Returns a *NotFoundError when no entities are found.
func (*DictTypeQuery) OnlyIDX ¶
func (dtq *DictTypeQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DictTypeQuery) OnlyX ¶
func (dtq *DictTypeQuery) OnlyX(ctx context.Context) *DictType
OnlyX is like Only, but panics if an error occurs.
func (*DictTypeQuery) Order ¶
func (dtq *DictTypeQuery) Order(o ...OrderFunc) *DictTypeQuery
Order adds an order step to the query.
func (*DictTypeQuery) Select ¶
func (dtq *DictTypeQuery) Select(fields ...string) *DictTypeSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.DictType.Query(). Select(dicttype.FieldCreatedAt). Scan(ctx, &v)
func (*DictTypeQuery) Unique ¶
func (dtq *DictTypeQuery) Unique(unique bool) *DictTypeQuery
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 (*DictTypeQuery) Where ¶
func (dtq *DictTypeQuery) Where(ps ...predicate.DictType) *DictTypeQuery
Where adds a new predicate for the DictTypeQuery builder.
type DictTypeSelect ¶
type DictTypeSelect struct { *DictTypeQuery // contains filtered or unexported fields }
DictTypeSelect is the builder for selecting fields of DictType entities.
func (*DictTypeSelect) Bool ¶
func (dts *DictTypeSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) BoolX ¶
func (dts *DictTypeSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DictTypeSelect) Bools ¶
func (dts *DictTypeSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) BoolsX ¶
func (dts *DictTypeSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DictTypeSelect) Float64 ¶
func (dts *DictTypeSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) Float64X ¶
func (dts *DictTypeSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DictTypeSelect) Float64s ¶
func (dts *DictTypeSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) Float64sX ¶
func (dts *DictTypeSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DictTypeSelect) Int ¶
func (dts *DictTypeSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) IntX ¶
func (dts *DictTypeSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DictTypeSelect) Ints ¶
func (dts *DictTypeSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) IntsX ¶
func (dts *DictTypeSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DictTypeSelect) Scan ¶
func (dts *DictTypeSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*DictTypeSelect) ScanX ¶
func (dts *DictTypeSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DictTypeSelect) String ¶
func (dts *DictTypeSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*DictTypeSelect) StringX ¶
func (dts *DictTypeSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DictTypeUpdate ¶
type DictTypeUpdate struct {
// contains filtered or unexported fields
}
DictTypeUpdate is the builder for updating DictType entities.
func (*DictTypeUpdate) AddCreatedBy ¶
func (dtu *DictTypeUpdate) AddCreatedBy(i int64) *DictTypeUpdate
AddCreatedBy adds i to the "created_by" field.
func (*DictTypeUpdate) AddStatus ¶
func (dtu *DictTypeUpdate) AddStatus(i int8) *DictTypeUpdate
AddStatus adds i to the "status" field.
func (*DictTypeUpdate) AddUpdatedBy ¶
func (dtu *DictTypeUpdate) AddUpdatedBy(i int64) *DictTypeUpdate
AddUpdatedBy adds i to the "updated_by" field.
func (*DictTypeUpdate) Exec ¶
func (dtu *DictTypeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DictTypeUpdate) ExecX ¶
func (dtu *DictTypeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictTypeUpdate) Mutation ¶
func (dtu *DictTypeUpdate) Mutation() *DictTypeMutation
Mutation returns the DictTypeMutation object of the builder.
func (*DictTypeUpdate) Save ¶
func (dtu *DictTypeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DictTypeUpdate) SaveX ¶
func (dtu *DictTypeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DictTypeUpdate) SetCreatedAt ¶
func (dtu *DictTypeUpdate) SetCreatedAt(t time.Time) *DictTypeUpdate
SetCreatedAt sets the "created_at" field.
func (*DictTypeUpdate) SetCreatedBy ¶
func (dtu *DictTypeUpdate) SetCreatedBy(i int64) *DictTypeUpdate
SetCreatedBy sets the "created_by" field.
func (*DictTypeUpdate) SetName ¶
func (dtu *DictTypeUpdate) SetName(s string) *DictTypeUpdate
SetName sets the "name" field.
func (*DictTypeUpdate) SetNillableCreatedAt ¶
func (dtu *DictTypeUpdate) SetNillableCreatedAt(t *time.Time) *DictTypeUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableCreatedBy ¶
func (dtu *DictTypeUpdate) SetNillableCreatedBy(i *int64) *DictTypeUpdate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableName ¶
func (dtu *DictTypeUpdate) SetNillableName(s *string) *DictTypeUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableRemark ¶
func (dtu *DictTypeUpdate) SetNillableRemark(s *string) *DictTypeUpdate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableStatus ¶
func (dtu *DictTypeUpdate) SetNillableStatus(i *int8) *DictTypeUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableType ¶
func (dtu *DictTypeUpdate) SetNillableType(s *string) *DictTypeUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*DictTypeUpdate) SetNillableUpdatedBy ¶
func (dtu *DictTypeUpdate) SetNillableUpdatedBy(i *int64) *DictTypeUpdate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictTypeUpdate) SetRemark ¶
func (dtu *DictTypeUpdate) SetRemark(s string) *DictTypeUpdate
SetRemark sets the "remark" field.
func (*DictTypeUpdate) SetStatus ¶
func (dtu *DictTypeUpdate) SetStatus(i int8) *DictTypeUpdate
SetStatus sets the "status" field.
func (*DictTypeUpdate) SetType ¶
func (dtu *DictTypeUpdate) SetType(s string) *DictTypeUpdate
SetType sets the "type" field.
func (*DictTypeUpdate) SetUpdatedAt ¶
func (dtu *DictTypeUpdate) SetUpdatedAt(t time.Time) *DictTypeUpdate
SetUpdatedAt sets the "updated_at" field.
func (*DictTypeUpdate) SetUpdatedBy ¶
func (dtu *DictTypeUpdate) SetUpdatedBy(i int64) *DictTypeUpdate
SetUpdatedBy sets the "updated_by" field.
func (*DictTypeUpdate) Where ¶
func (dtu *DictTypeUpdate) Where(ps ...predicate.DictType) *DictTypeUpdate
Where appends a list predicates to the DictTypeUpdate builder.
type DictTypeUpdateOne ¶
type DictTypeUpdateOne struct {
// contains filtered or unexported fields
}
DictTypeUpdateOne is the builder for updating a single DictType entity.
func (*DictTypeUpdateOne) AddCreatedBy ¶
func (dtuo *DictTypeUpdateOne) AddCreatedBy(i int64) *DictTypeUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*DictTypeUpdateOne) AddStatus ¶
func (dtuo *DictTypeUpdateOne) AddStatus(i int8) *DictTypeUpdateOne
AddStatus adds i to the "status" field.
func (*DictTypeUpdateOne) AddUpdatedBy ¶
func (dtuo *DictTypeUpdateOne) AddUpdatedBy(i int64) *DictTypeUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*DictTypeUpdateOne) Exec ¶
func (dtuo *DictTypeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DictTypeUpdateOne) ExecX ¶
func (dtuo *DictTypeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DictTypeUpdateOne) Mutation ¶
func (dtuo *DictTypeUpdateOne) Mutation() *DictTypeMutation
Mutation returns the DictTypeMutation object of the builder.
func (*DictTypeUpdateOne) Save ¶
func (dtuo *DictTypeUpdateOne) Save(ctx context.Context) (*DictType, error)
Save executes the query and returns the updated DictType entity.
func (*DictTypeUpdateOne) SaveX ¶
func (dtuo *DictTypeUpdateOne) SaveX(ctx context.Context) *DictType
SaveX is like Save, but panics if an error occurs.
func (*DictTypeUpdateOne) Select ¶
func (dtuo *DictTypeUpdateOne) Select(field string, fields ...string) *DictTypeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DictTypeUpdateOne) SetCreatedAt ¶
func (dtuo *DictTypeUpdateOne) SetCreatedAt(t time.Time) *DictTypeUpdateOne
SetCreatedAt sets the "created_at" field.
func (*DictTypeUpdateOne) SetCreatedBy ¶
func (dtuo *DictTypeUpdateOne) SetCreatedBy(i int64) *DictTypeUpdateOne
SetCreatedBy sets the "created_by" field.
func (*DictTypeUpdateOne) SetName ¶
func (dtuo *DictTypeUpdateOne) SetName(s string) *DictTypeUpdateOne
SetName sets the "name" field.
func (*DictTypeUpdateOne) SetNillableCreatedAt ¶
func (dtuo *DictTypeUpdateOne) SetNillableCreatedAt(t *time.Time) *DictTypeUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableCreatedBy ¶
func (dtuo *DictTypeUpdateOne) SetNillableCreatedBy(i *int64) *DictTypeUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableName ¶
func (dtuo *DictTypeUpdateOne) SetNillableName(s *string) *DictTypeUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableRemark ¶
func (dtuo *DictTypeUpdateOne) SetNillableRemark(s *string) *DictTypeUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableStatus ¶
func (dtuo *DictTypeUpdateOne) SetNillableStatus(i *int8) *DictTypeUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableType ¶
func (dtuo *DictTypeUpdateOne) SetNillableType(s *string) *DictTypeUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*DictTypeUpdateOne) SetNillableUpdatedBy ¶
func (dtuo *DictTypeUpdateOne) SetNillableUpdatedBy(i *int64) *DictTypeUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*DictTypeUpdateOne) SetRemark ¶
func (dtuo *DictTypeUpdateOne) SetRemark(s string) *DictTypeUpdateOne
SetRemark sets the "remark" field.
func (*DictTypeUpdateOne) SetStatus ¶
func (dtuo *DictTypeUpdateOne) SetStatus(i int8) *DictTypeUpdateOne
SetStatus sets the "status" field.
func (*DictTypeUpdateOne) SetType ¶
func (dtuo *DictTypeUpdateOne) SetType(s string) *DictTypeUpdateOne
SetType sets the "type" field.
func (*DictTypeUpdateOne) SetUpdatedAt ¶
func (dtuo *DictTypeUpdateOne) SetUpdatedAt(t time.Time) *DictTypeUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*DictTypeUpdateOne) SetUpdatedBy ¶
func (dtuo *DictTypeUpdateOne) SetUpdatedBy(i int64) *DictTypeUpdateOne
SetUpdatedBy sets the "updated_by" 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 Permission ¶
type Permission struct { // ID of the ent. // id ID int64 `json:"id,omitempty"` // MenuID holds the value of the "menu_id" field. // 菜单ID MenuID int64 `json:"menu_id,omitempty"` // Name holds the value of the "name" field. // 权限名称 Name string `json:"name,omitempty"` // Permission holds the value of the "permission" field. // 权限 Permission string `json:"permission,omitempty"` // contains filtered or unexported fields }
Permission is the model entity for the Permission schema.
func (*Permission) String ¶
func (pe *Permission) String() string
String implements the fmt.Stringer.
func (*Permission) Unwrap ¶
func (pe *Permission) Unwrap() *Permission
Unwrap unwraps the Permission 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 (*Permission) Update ¶
func (pe *Permission) Update() *PermissionUpdateOne
Update returns a builder for updating this Permission. Note that you need to call Permission.Unwrap() before calling this method if this Permission was returned from a transaction, and the transaction was committed or rolled back.
type PermissionClient ¶
type PermissionClient struct {
// contains filtered or unexported fields
}
PermissionClient is a client for the Permission schema.
func NewPermissionClient ¶
func NewPermissionClient(c config) *PermissionClient
NewPermissionClient returns a client for the Permission from the given config.
func (*PermissionClient) Create ¶
func (c *PermissionClient) Create() *PermissionCreate
Create returns a create builder for Permission.
func (*PermissionClient) CreateBulk ¶
func (c *PermissionClient) CreateBulk(builders ...*PermissionCreate) *PermissionCreateBulk
CreateBulk returns a builder for creating a bulk of Permission entities.
func (*PermissionClient) Delete ¶
func (c *PermissionClient) Delete() *PermissionDelete
Delete returns a delete builder for Permission.
func (*PermissionClient) DeleteOne ¶
func (c *PermissionClient) DeleteOne(pe *Permission) *PermissionDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PermissionClient) DeleteOneID ¶
func (c *PermissionClient) DeleteOneID(id int64) *PermissionDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PermissionClient) Get ¶
func (c *PermissionClient) Get(ctx context.Context, id int64) (*Permission, error)
Get returns a Permission entity by its id.
func (*PermissionClient) GetX ¶
func (c *PermissionClient) GetX(ctx context.Context, id int64) *Permission
GetX is like Get, but panics if an error occurs.
func (*PermissionClient) Hooks ¶
func (c *PermissionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PermissionClient) Query ¶
func (c *PermissionClient) Query() *PermissionQuery
Query returns a query builder for Permission.
func (*PermissionClient) Update ¶
func (c *PermissionClient) Update() *PermissionUpdate
Update returns an update builder for Permission.
func (*PermissionClient) UpdateOne ¶
func (c *PermissionClient) UpdateOne(pe *Permission) *PermissionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PermissionClient) UpdateOneID ¶
func (c *PermissionClient) UpdateOneID(id int64) *PermissionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PermissionClient) Use ¶
func (c *PermissionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `permission.Hooks(f(g(h())))`.
type PermissionCreate ¶
type PermissionCreate struct {
// contains filtered or unexported fields
}
PermissionCreate is the builder for creating a Permission entity.
func (*PermissionCreate) Exec ¶
func (pc *PermissionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionCreate) ExecX ¶
func (pc *PermissionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionCreate) Mutation ¶
func (pc *PermissionCreate) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionCreate) Save ¶
func (pc *PermissionCreate) Save(ctx context.Context) (*Permission, error)
Save creates the Permission in the database.
func (*PermissionCreate) SaveX ¶
func (pc *PermissionCreate) SaveX(ctx context.Context) *Permission
SaveX calls Save and panics if Save returns an error.
func (*PermissionCreate) SetID ¶
func (pc *PermissionCreate) SetID(i int64) *PermissionCreate
SetID sets the "id" field.
func (*PermissionCreate) SetMenuID ¶
func (pc *PermissionCreate) SetMenuID(i int64) *PermissionCreate
SetMenuID sets the "menu_id" field.
func (*PermissionCreate) SetName ¶
func (pc *PermissionCreate) SetName(s string) *PermissionCreate
SetName sets the "name" field.
func (*PermissionCreate) SetNillableMenuID ¶
func (pc *PermissionCreate) SetNillableMenuID(i *int64) *PermissionCreate
SetNillableMenuID sets the "menu_id" field if the given value is not nil.
func (*PermissionCreate) SetNillableName ¶
func (pc *PermissionCreate) SetNillableName(s *string) *PermissionCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*PermissionCreate) SetNillablePermission ¶
func (pc *PermissionCreate) SetNillablePermission(s *string) *PermissionCreate
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*PermissionCreate) SetPermission ¶
func (pc *PermissionCreate) SetPermission(s string) *PermissionCreate
SetPermission sets the "permission" field.
type PermissionCreateBulk ¶
type PermissionCreateBulk struct {
// contains filtered or unexported fields
}
PermissionCreateBulk is the builder for creating many Permission entities in bulk.
func (*PermissionCreateBulk) Exec ¶
func (pcb *PermissionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionCreateBulk) ExecX ¶
func (pcb *PermissionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionCreateBulk) Save ¶
func (pcb *PermissionCreateBulk) Save(ctx context.Context) ([]*Permission, error)
Save creates the Permission entities in the database.
func (*PermissionCreateBulk) SaveX ¶
func (pcb *PermissionCreateBulk) SaveX(ctx context.Context) []*Permission
SaveX is like Save, but panics if an error occurs.
type PermissionDelete ¶
type PermissionDelete struct {
// contains filtered or unexported fields
}
PermissionDelete is the builder for deleting a Permission entity.
func (*PermissionDelete) Exec ¶
func (pd *PermissionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PermissionDelete) ExecX ¶
func (pd *PermissionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PermissionDelete) Where ¶
func (pd *PermissionDelete) Where(ps ...predicate.Permission) *PermissionDelete
Where appends a list predicates to the PermissionDelete builder.
type PermissionDeleteOne ¶
type PermissionDeleteOne struct {
// contains filtered or unexported fields
}
PermissionDeleteOne is the builder for deleting a single Permission entity.
func (*PermissionDeleteOne) Exec ¶
func (pdo *PermissionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PermissionDeleteOne) ExecX ¶
func (pdo *PermissionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PermissionGroupBy ¶
type PermissionGroupBy struct {
// contains filtered or unexported fields
}
PermissionGroupBy is the group-by builder for Permission entities.
func (*PermissionGroupBy) Aggregate ¶
func (pgb *PermissionGroupBy) Aggregate(fns ...AggregateFunc) *PermissionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PermissionGroupBy) Bool ¶
func (pgb *PermissionGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) BoolX ¶
func (pgb *PermissionGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PermissionGroupBy) Bools ¶
func (pgb *PermissionGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) BoolsX ¶
func (pgb *PermissionGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PermissionGroupBy) Float64 ¶
func (pgb *PermissionGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) Float64X ¶
func (pgb *PermissionGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PermissionGroupBy) Float64s ¶
func (pgb *PermissionGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) Float64sX ¶
func (pgb *PermissionGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PermissionGroupBy) Int ¶
func (pgb *PermissionGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) IntX ¶
func (pgb *PermissionGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PermissionGroupBy) Ints ¶
func (pgb *PermissionGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) IntsX ¶
func (pgb *PermissionGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PermissionGroupBy) Scan ¶
func (pgb *PermissionGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*PermissionGroupBy) ScanX ¶
func (pgb *PermissionGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PermissionGroupBy) String ¶
func (pgb *PermissionGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*PermissionGroupBy) StringX ¶
func (pgb *PermissionGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PermissionMutation ¶
type PermissionMutation struct {
// contains filtered or unexported fields
}
PermissionMutation represents an operation that mutates the Permission nodes in the graph.
func (*PermissionMutation) AddField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) AddMenuID ¶
func (m *PermissionMutation) AddMenuID(i int64)
AddMenuID adds i to the "menu_id" field.
func (*PermissionMutation) AddedEdges ¶
func (m *PermissionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PermissionMutation) AddedField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) AddedFields ¶
func (m *PermissionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PermissionMutation) AddedIDs ¶
func (m *PermissionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PermissionMutation) AddedMenuID ¶
func (m *PermissionMutation) AddedMenuID() (r int64, exists bool)
AddedMenuID returns the value that was added to the "menu_id" field in this mutation.
func (*PermissionMutation) ClearEdge ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ClearField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ClearedEdges ¶
func (m *PermissionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PermissionMutation) ClearedFields ¶
func (m *PermissionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PermissionMutation) Client ¶
func (m PermissionMutation) 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 (*PermissionMutation) EdgeCleared ¶
func (m *PermissionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PermissionMutation) Field ¶
func (m *PermissionMutation) 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 (*PermissionMutation) FieldCleared ¶
func (m *PermissionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PermissionMutation) Fields ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ID ¶
func (m *PermissionMutation) ID() (id int64, 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 (*PermissionMutation) IDs ¶
func (m *PermissionMutation) IDs(ctx context.Context) ([]int64, 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 (*PermissionMutation) MenuID ¶
func (m *PermissionMutation) MenuID() (r int64, exists bool)
MenuID returns the value of the "menu_id" field in the mutation.
func (*PermissionMutation) Name ¶
func (m *PermissionMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PermissionMutation) 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 (*PermissionMutation) OldMenuID ¶
func (m *PermissionMutation) OldMenuID(ctx context.Context) (v int64, err error)
OldMenuID returns the old "menu_id" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldName ¶
func (m *PermissionMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldPermission ¶
func (m *PermissionMutation) OldPermission(ctx context.Context) (v string, err error)
OldPermission returns the old "permission" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) Permission ¶
func (m *PermissionMutation) Permission() (r string, exists bool)
Permission returns the value of the "permission" field in the mutation.
func (*PermissionMutation) RemovedEdges ¶
func (m *PermissionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PermissionMutation) RemovedIDs ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ResetEdge ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ResetField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ResetMenuID ¶
func (m *PermissionMutation) ResetMenuID()
ResetMenuID resets all changes to the "menu_id" field.
func (*PermissionMutation) ResetName ¶
func (m *PermissionMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PermissionMutation) ResetPermission ¶
func (m *PermissionMutation) ResetPermission()
ResetPermission resets all changes to the "permission" field.
func (*PermissionMutation) SetField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) SetID ¶
func (m *PermissionMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Permission entities.
func (*PermissionMutation) SetMenuID ¶
func (m *PermissionMutation) SetMenuID(i int64)
SetMenuID sets the "menu_id" field.
func (*PermissionMutation) SetName ¶
func (m *PermissionMutation) SetName(s string)
SetName sets the "name" field.
func (*PermissionMutation) SetPermission ¶
func (m *PermissionMutation) SetPermission(s string)
SetPermission sets the "permission" field.
func (PermissionMutation) Tx ¶
func (m PermissionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PermissionMutation) Type ¶
func (m *PermissionMutation) Type() string
Type returns the node type of this mutation (Permission).
func (*PermissionMutation) Where ¶
func (m *PermissionMutation) Where(ps ...predicate.Permission)
Where appends a list predicates to the PermissionMutation builder.
type PermissionQuery ¶
type PermissionQuery struct {
// contains filtered or unexported fields
}
PermissionQuery is the builder for querying Permission entities.
func (*PermissionQuery) All ¶
func (pq *PermissionQuery) All(ctx context.Context) ([]*Permission, error)
All executes the query and returns a list of Permissions.
func (*PermissionQuery) AllX ¶
func (pq *PermissionQuery) AllX(ctx context.Context) []*Permission
AllX is like All, but panics if an error occurs.
func (*PermissionQuery) Clone ¶
func (pq *PermissionQuery) Clone() *PermissionQuery
Clone returns a duplicate of the PermissionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PermissionQuery) Count ¶
func (pq *PermissionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PermissionQuery) CountX ¶
func (pq *PermissionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PermissionQuery) Exist ¶
func (pq *PermissionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PermissionQuery) ExistX ¶
func (pq *PermissionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PermissionQuery) First ¶
func (pq *PermissionQuery) First(ctx context.Context) (*Permission, error)
First returns the first Permission entity from the query. Returns a *NotFoundError when no Permission was found.
func (*PermissionQuery) FirstID ¶
func (pq *PermissionQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Permission ID from the query. Returns a *NotFoundError when no Permission ID was found.
func (*PermissionQuery) FirstIDX ¶
func (pq *PermissionQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*PermissionQuery) FirstX ¶
func (pq *PermissionQuery) FirstX(ctx context.Context) *Permission
FirstX is like First, but panics if an error occurs.
func (*PermissionQuery) GroupBy ¶
func (pq *PermissionQuery) GroupBy(field string, fields ...string) *PermissionGroupBy
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 { MenuID int64 `json:"menu_id,omitempty"` Count int `json:"count,omitempty"` } client.Permission.Query(). GroupBy(permission.FieldMenuID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PermissionQuery) IDs ¶
func (pq *PermissionQuery) IDs(ctx context.Context) ([]int64, error)
IDs executes the query and returns a list of Permission IDs.
func (*PermissionQuery) IDsX ¶
func (pq *PermissionQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*PermissionQuery) Limit ¶
func (pq *PermissionQuery) Limit(limit int) *PermissionQuery
Limit adds a limit step to the query.
func (*PermissionQuery) Offset ¶
func (pq *PermissionQuery) Offset(offset int) *PermissionQuery
Offset adds an offset step to the query.
func (*PermissionQuery) Only ¶
func (pq *PermissionQuery) Only(ctx context.Context) (*Permission, error)
Only returns a single Permission entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Permission entity is found. Returns a *NotFoundError when no Permission entities are found.
func (*PermissionQuery) OnlyID ¶
func (pq *PermissionQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Permission ID in the query. Returns a *NotSingularError when more than one Permission ID is found. Returns a *NotFoundError when no entities are found.
func (*PermissionQuery) OnlyIDX ¶
func (pq *PermissionQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PermissionQuery) OnlyX ¶
func (pq *PermissionQuery) OnlyX(ctx context.Context) *Permission
OnlyX is like Only, but panics if an error occurs.
func (*PermissionQuery) Order ¶
func (pq *PermissionQuery) Order(o ...OrderFunc) *PermissionQuery
Order adds an order step to the query.
func (*PermissionQuery) Select ¶
func (pq *PermissionQuery) Select(fields ...string) *PermissionSelect
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 { MenuID int64 `json:"menu_id,omitempty"` } client.Permission.Query(). Select(permission.FieldMenuID). Scan(ctx, &v)
func (*PermissionQuery) Unique ¶
func (pq *PermissionQuery) Unique(unique bool) *PermissionQuery
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 (*PermissionQuery) Where ¶
func (pq *PermissionQuery) Where(ps ...predicate.Permission) *PermissionQuery
Where adds a new predicate for the PermissionQuery builder.
type PermissionSelect ¶
type PermissionSelect struct { *PermissionQuery // contains filtered or unexported fields }
PermissionSelect is the builder for selecting fields of Permission entities.
func (*PermissionSelect) Bool ¶
func (ps *PermissionSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) BoolX ¶
func (ps *PermissionSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*PermissionSelect) Bools ¶
func (ps *PermissionSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) BoolsX ¶
func (ps *PermissionSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*PermissionSelect) Float64 ¶
func (ps *PermissionSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Float64X ¶
func (ps *PermissionSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*PermissionSelect) Float64s ¶
func (ps *PermissionSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Float64sX ¶
func (ps *PermissionSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*PermissionSelect) Int ¶
func (ps *PermissionSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) IntX ¶
func (ps *PermissionSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*PermissionSelect) Ints ¶
func (ps *PermissionSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) IntsX ¶
func (ps *PermissionSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*PermissionSelect) Scan ¶
func (ps *PermissionSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*PermissionSelect) ScanX ¶
func (ps *PermissionSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*PermissionSelect) String ¶
func (ps *PermissionSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) StringX ¶
func (ps *PermissionSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type PermissionUpdate ¶
type PermissionUpdate struct {
// contains filtered or unexported fields
}
PermissionUpdate is the builder for updating Permission entities.
func (*PermissionUpdate) AddMenuID ¶
func (pu *PermissionUpdate) AddMenuID(i int64) *PermissionUpdate
AddMenuID adds i to the "menu_id" field.
func (*PermissionUpdate) Exec ¶
func (pu *PermissionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionUpdate) ExecX ¶
func (pu *PermissionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionUpdate) Mutation ¶
func (pu *PermissionUpdate) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionUpdate) Save ¶
func (pu *PermissionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PermissionUpdate) SaveX ¶
func (pu *PermissionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PermissionUpdate) SetMenuID ¶
func (pu *PermissionUpdate) SetMenuID(i int64) *PermissionUpdate
SetMenuID sets the "menu_id" field.
func (*PermissionUpdate) SetName ¶
func (pu *PermissionUpdate) SetName(s string) *PermissionUpdate
SetName sets the "name" field.
func (*PermissionUpdate) SetNillableMenuID ¶
func (pu *PermissionUpdate) SetNillableMenuID(i *int64) *PermissionUpdate
SetNillableMenuID sets the "menu_id" field if the given value is not nil.
func (*PermissionUpdate) SetNillableName ¶
func (pu *PermissionUpdate) SetNillableName(s *string) *PermissionUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*PermissionUpdate) SetNillablePermission ¶
func (pu *PermissionUpdate) SetNillablePermission(s *string) *PermissionUpdate
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*PermissionUpdate) SetPermission ¶
func (pu *PermissionUpdate) SetPermission(s string) *PermissionUpdate
SetPermission sets the "permission" field.
func (*PermissionUpdate) Where ¶
func (pu *PermissionUpdate) Where(ps ...predicate.Permission) *PermissionUpdate
Where appends a list predicates to the PermissionUpdate builder.
type PermissionUpdateOne ¶
type PermissionUpdateOne struct {
// contains filtered or unexported fields
}
PermissionUpdateOne is the builder for updating a single Permission entity.
func (*PermissionUpdateOne) AddMenuID ¶
func (puo *PermissionUpdateOne) AddMenuID(i int64) *PermissionUpdateOne
AddMenuID adds i to the "menu_id" field.
func (*PermissionUpdateOne) Exec ¶
func (puo *PermissionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PermissionUpdateOne) ExecX ¶
func (puo *PermissionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionUpdateOne) Mutation ¶
func (puo *PermissionUpdateOne) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionUpdateOne) Save ¶
func (puo *PermissionUpdateOne) Save(ctx context.Context) (*Permission, error)
Save executes the query and returns the updated Permission entity.
func (*PermissionUpdateOne) SaveX ¶
func (puo *PermissionUpdateOne) SaveX(ctx context.Context) *Permission
SaveX is like Save, but panics if an error occurs.
func (*PermissionUpdateOne) Select ¶
func (puo *PermissionUpdateOne) Select(field string, fields ...string) *PermissionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PermissionUpdateOne) SetMenuID ¶
func (puo *PermissionUpdateOne) SetMenuID(i int64) *PermissionUpdateOne
SetMenuID sets the "menu_id" field.
func (*PermissionUpdateOne) SetName ¶
func (puo *PermissionUpdateOne) SetName(s string) *PermissionUpdateOne
SetName sets the "name" field.
func (*PermissionUpdateOne) SetNillableMenuID ¶
func (puo *PermissionUpdateOne) SetNillableMenuID(i *int64) *PermissionUpdateOne
SetNillableMenuID sets the "menu_id" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillableName ¶
func (puo *PermissionUpdateOne) SetNillableName(s *string) *PermissionUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillablePermission ¶
func (puo *PermissionUpdateOne) SetNillablePermission(s *string) *PermissionUpdateOne
SetNillablePermission sets the "permission" field if the given value is not nil.
func (*PermissionUpdateOne) SetPermission ¶
func (puo *PermissionUpdateOne) SetPermission(s string) *PermissionUpdateOne
SetPermission sets the "permission" field.
type Role ¶
type Role struct { // ID of the ent. // 角色id ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // Name holds the value of the "name" field. // 角色名称 Name string `json:"name,omitempty"` // Sort holds the value of the "sort" field. // 排序 Sort int8 `json:"sort,omitempty"` // Status holds the value of the "status" field. // 状态 0:禁用 1:启用 Status int8 `json:"status,omitempty"` // Remark holds the value of the "remark" field. // 备注 Remark string `json:"remark,omitempty"` // contains filtered or unexported fields }
Role is the model entity for the Role schema.
func (*Role) Unwrap ¶
Unwrap unwraps the Role 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 (*Role) Update ¶
func (r *Role) Update() *RoleUpdateOne
Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.
type RoleClient ¶
type RoleClient struct {
// contains filtered or unexported fields
}
RoleClient is a client for the Role schema.
func NewRoleClient ¶
func NewRoleClient(c config) *RoleClient
NewRoleClient returns a client for the Role from the given config.
func (*RoleClient) Create ¶
func (c *RoleClient) Create() *RoleCreate
Create returns a create builder for Role.
func (*RoleClient) CreateBulk ¶
func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
CreateBulk returns a builder for creating a bulk of Role entities.
func (*RoleClient) Delete ¶
func (c *RoleClient) Delete() *RoleDelete
Delete returns a delete builder for Role.
func (*RoleClient) DeleteOne ¶
func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*RoleClient) DeleteOneID ¶
func (c *RoleClient) DeleteOneID(id int64) *RoleDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RoleClient) GetX ¶
func (c *RoleClient) GetX(ctx context.Context, id int64) *Role
GetX is like Get, but panics if an error occurs.
func (*RoleClient) Query ¶
func (c *RoleClient) Query() *RoleQuery
Query returns a query builder for Role.
func (*RoleClient) Update ¶
func (c *RoleClient) Update() *RoleUpdate
Update returns an update builder for Role.
func (*RoleClient) UpdateOne ¶
func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RoleClient) UpdateOneID ¶
func (c *RoleClient) UpdateOneID(id int64) *RoleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RoleClient) Use ¶
func (c *RoleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.
type RoleCreate ¶
type RoleCreate struct {
// contains filtered or unexported fields
}
RoleCreate is the builder for creating a Role entity.
func (*RoleCreate) Exec ¶
func (rc *RoleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreate) ExecX ¶
func (rc *RoleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleCreate) Mutation ¶
func (rc *RoleCreate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleCreate) Save ¶
func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
Save creates the Role in the database.
func (*RoleCreate) SaveX ¶
func (rc *RoleCreate) SaveX(ctx context.Context) *Role
SaveX calls Save and panics if Save returns an error.
func (*RoleCreate) SetCreatedAt ¶
func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate
SetCreatedAt sets the "created_at" field.
func (*RoleCreate) SetCreatedBy ¶
func (rc *RoleCreate) SetCreatedBy(i int64) *RoleCreate
SetCreatedBy sets the "created_by" field.
func (*RoleCreate) SetID ¶
func (rc *RoleCreate) SetID(i int64) *RoleCreate
SetID sets the "id" field.
func (*RoleCreate) SetName ¶
func (rc *RoleCreate) SetName(s string) *RoleCreate
SetName sets the "name" field.
func (*RoleCreate) SetNillableCreatedAt ¶
func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleCreate) SetNillableCreatedBy ¶
func (rc *RoleCreate) SetNillableCreatedBy(i *int64) *RoleCreate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*RoleCreate) SetNillableName ¶
func (rc *RoleCreate) SetNillableName(s *string) *RoleCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleCreate) SetNillableRemark ¶
func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleCreate) SetNillableSort ¶
func (rc *RoleCreate) SetNillableSort(i *int8) *RoleCreate
SetNillableSort sets the "sort" field if the given value is not nil.
func (*RoleCreate) SetNillableStatus ¶
func (rc *RoleCreate) SetNillableStatus(i *int8) *RoleCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*RoleCreate) SetNillableUpdatedAt ¶
func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*RoleCreate) SetNillableUpdatedBy ¶
func (rc *RoleCreate) SetNillableUpdatedBy(i *int64) *RoleCreate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*RoleCreate) SetRemark ¶
func (rc *RoleCreate) SetRemark(s string) *RoleCreate
SetRemark sets the "remark" field.
func (*RoleCreate) SetSort ¶
func (rc *RoleCreate) SetSort(i int8) *RoleCreate
SetSort sets the "sort" field.
func (*RoleCreate) SetStatus ¶
func (rc *RoleCreate) SetStatus(i int8) *RoleCreate
SetStatus sets the "status" field.
func (*RoleCreate) SetUpdatedAt ¶
func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate
SetUpdatedAt sets the "updated_at" field.
func (*RoleCreate) SetUpdatedBy ¶
func (rc *RoleCreate) SetUpdatedBy(i int64) *RoleCreate
SetUpdatedBy sets the "updated_by" field.
type RoleCreateBulk ¶
type RoleCreateBulk struct {
// contains filtered or unexported fields
}
RoleCreateBulk is the builder for creating many Role entities in bulk.
func (*RoleCreateBulk) Exec ¶
func (rcb *RoleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreateBulk) ExecX ¶
func (rcb *RoleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RoleDelete ¶
type RoleDelete struct {
// contains filtered or unexported fields
}
RoleDelete is the builder for deleting a Role entity.
func (*RoleDelete) Exec ¶
func (rd *RoleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RoleDelete) ExecX ¶
func (rd *RoleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RoleDelete) Where ¶
func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete
Where appends a list predicates to the RoleDelete builder.
type RoleDeleteOne ¶
type RoleDeleteOne struct {
// contains filtered or unexported fields
}
RoleDeleteOne is the builder for deleting a single Role entity.
func (*RoleDeleteOne) Exec ¶
func (rdo *RoleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RoleDeleteOne) ExecX ¶
func (rdo *RoleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RoleGroupBy ¶
type RoleGroupBy struct {
// contains filtered or unexported fields
}
RoleGroupBy is the group-by builder for Role entities.
func (*RoleGroupBy) Aggregate ¶
func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RoleGroupBy) Bool ¶
func (rgb *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) BoolX ¶
func (rgb *RoleGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RoleGroupBy) Bools ¶
func (rgb *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) BoolsX ¶
func (rgb *RoleGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RoleGroupBy) Float64 ¶
func (rgb *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) Float64X ¶
func (rgb *RoleGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RoleGroupBy) Float64s ¶
func (rgb *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) Float64sX ¶
func (rgb *RoleGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RoleGroupBy) Int ¶
func (rgb *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) IntX ¶
func (rgb *RoleGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RoleGroupBy) Ints ¶
func (rgb *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) IntsX ¶
func (rgb *RoleGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RoleGroupBy) Scan ¶
func (rgb *RoleGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RoleGroupBy) ScanX ¶
func (rgb *RoleGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RoleGroupBy) String ¶
func (rgb *RoleGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) StringX ¶
func (rgb *RoleGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RoleMutation ¶
type RoleMutation struct {
// contains filtered or unexported fields
}
RoleMutation represents an operation that mutates the Role nodes in the graph.
func (*RoleMutation) AddCreatedBy ¶
func (m *RoleMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
func (*RoleMutation) AddField ¶
func (m *RoleMutation) 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 (*RoleMutation) AddSort ¶
func (m *RoleMutation) AddSort(i int8)
AddSort adds i to the "sort" field.
func (*RoleMutation) AddStatus ¶
func (m *RoleMutation) AddStatus(i int8)
AddStatus adds i to the "status" field.
func (*RoleMutation) AddUpdatedBy ¶
func (m *RoleMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*RoleMutation) AddedCreatedBy ¶
func (m *RoleMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
func (*RoleMutation) AddedEdges ¶
func (m *RoleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RoleMutation) AddedField ¶
func (m *RoleMutation) 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 (*RoleMutation) AddedFields ¶
func (m *RoleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RoleMutation) AddedIDs ¶
func (m *RoleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RoleMutation) AddedSort ¶
func (m *RoleMutation) AddedSort() (r int8, exists bool)
AddedSort returns the value that was added to the "sort" field in this mutation.
func (*RoleMutation) AddedStatus ¶
func (m *RoleMutation) AddedStatus() (r int8, exists bool)
AddedStatus returns the value that was added to the "status" field in this mutation.
func (*RoleMutation) AddedUpdatedBy ¶
func (m *RoleMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*RoleMutation) ClearEdge ¶
func (m *RoleMutation) 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 (*RoleMutation) ClearField ¶
func (m *RoleMutation) 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 (*RoleMutation) ClearedEdges ¶
func (m *RoleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RoleMutation) ClearedFields ¶
func (m *RoleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RoleMutation) Client ¶
func (m RoleMutation) 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 (*RoleMutation) CreatedAt ¶
func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*RoleMutation) CreatedBy ¶
func (m *RoleMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*RoleMutation) EdgeCleared ¶
func (m *RoleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RoleMutation) Field ¶
func (m *RoleMutation) 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 (*RoleMutation) FieldCleared ¶
func (m *RoleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RoleMutation) Fields ¶
func (m *RoleMutation) 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 (*RoleMutation) ID ¶
func (m *RoleMutation) ID() (id int64, 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 (*RoleMutation) IDs ¶
func (m *RoleMutation) IDs(ctx context.Context) ([]int64, 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 (*RoleMutation) Name ¶
func (m *RoleMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RoleMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Role entity. If the Role 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 (*RoleMutation) OldCreatedBy ¶
func (m *RoleMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" field's value of the Role entity. If the Role 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 (*RoleMutation) 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 (*RoleMutation) OldName ¶
func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Role entity. If the Role 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 (*RoleMutation) OldRemark ¶
func (m *RoleMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" field's value of the Role entity. If the Role 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 (*RoleMutation) OldSort ¶
func (m *RoleMutation) OldSort(ctx context.Context) (v int8, err error)
OldSort returns the old "sort" field's value of the Role entity. If the Role 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 (*RoleMutation) OldStatus ¶
func (m *RoleMutation) OldStatus(ctx context.Context) (v int8, err error)
OldStatus returns the old "status" field's value of the Role entity. If the Role 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 (*RoleMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Role entity. If the Role 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 (*RoleMutation) OldUpdatedBy ¶
func (m *RoleMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" field's value of the Role entity. If the Role 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 (*RoleMutation) Remark ¶
func (m *RoleMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*RoleMutation) RemovedEdges ¶
func (m *RoleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RoleMutation) RemovedIDs ¶
func (m *RoleMutation) 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 (*RoleMutation) ResetCreatedAt ¶
func (m *RoleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*RoleMutation) ResetCreatedBy ¶
func (m *RoleMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*RoleMutation) ResetEdge ¶
func (m *RoleMutation) 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 (*RoleMutation) ResetField ¶
func (m *RoleMutation) 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 (*RoleMutation) ResetName ¶
func (m *RoleMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RoleMutation) ResetRemark ¶
func (m *RoleMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*RoleMutation) ResetSort ¶
func (m *RoleMutation) ResetSort()
ResetSort resets all changes to the "sort" field.
func (*RoleMutation) ResetStatus ¶
func (m *RoleMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*RoleMutation) ResetUpdatedAt ¶
func (m *RoleMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*RoleMutation) ResetUpdatedBy ¶
func (m *RoleMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*RoleMutation) SetCreatedAt ¶
func (m *RoleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*RoleMutation) SetCreatedBy ¶
func (m *RoleMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" field.
func (*RoleMutation) SetField ¶
func (m *RoleMutation) 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 (*RoleMutation) SetID ¶
func (m *RoleMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Role entities.
func (*RoleMutation) SetName ¶
func (m *RoleMutation) SetName(s string)
SetName sets the "name" field.
func (*RoleMutation) SetRemark ¶
func (m *RoleMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*RoleMutation) SetSort ¶
func (m *RoleMutation) SetSort(i int8)
SetSort sets the "sort" field.
func (*RoleMutation) SetStatus ¶
func (m *RoleMutation) SetStatus(i int8)
SetStatus sets the "status" field.
func (*RoleMutation) SetUpdatedAt ¶
func (m *RoleMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*RoleMutation) SetUpdatedBy ¶
func (m *RoleMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" field.
func (*RoleMutation) Sort ¶
func (m *RoleMutation) Sort() (r int8, exists bool)
Sort returns the value of the "sort" field in the mutation.
func (*RoleMutation) Status ¶
func (m *RoleMutation) Status() (r int8, exists bool)
Status returns the value of the "status" field in the mutation.
func (RoleMutation) Tx ¶
func (m RoleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RoleMutation) Type ¶
func (m *RoleMutation) Type() string
Type returns the node type of this mutation (Role).
func (*RoleMutation) UpdatedAt ¶
func (m *RoleMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*RoleMutation) UpdatedBy ¶
func (m *RoleMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" field in the mutation.
func (*RoleMutation) Where ¶
func (m *RoleMutation) Where(ps ...predicate.Role)
Where appends a list predicates to the RoleMutation builder.
type RoleQuery ¶
type RoleQuery struct {
// contains filtered or unexported fields
}
RoleQuery is the builder for querying Role entities.
func (*RoleQuery) Clone ¶
Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RoleQuery) First ¶
First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.
func (*RoleQuery) FirstID ¶
FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.
func (*RoleQuery) GroupBy ¶
func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RoleQuery) Only ¶
Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.
func (*RoleQuery) OnlyID ¶
OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.
func (*RoleQuery) Select ¶
func (rq *RoleQuery) Select(fields ...string) *RoleSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Role.Query(). Select(role.FieldCreatedAt). Scan(ctx, &v)
type RoleSelect ¶
type RoleSelect struct { *RoleQuery // contains filtered or unexported fields }
RoleSelect is the builder for selecting fields of Role entities.
func (*RoleSelect) Bool ¶
func (rs *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleSelect) BoolX ¶
func (rs *RoleSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RoleSelect) Bools ¶
func (rs *RoleSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleSelect) BoolsX ¶
func (rs *RoleSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RoleSelect) Float64 ¶
func (rs *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64X ¶
func (rs *RoleSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RoleSelect) Float64s ¶
func (rs *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64sX ¶
func (rs *RoleSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RoleSelect) Int ¶
func (rs *RoleSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleSelect) IntX ¶
func (rs *RoleSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RoleSelect) Ints ¶
func (rs *RoleSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleSelect) IntsX ¶
func (rs *RoleSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RoleSelect) Scan ¶
func (rs *RoleSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RoleSelect) ScanX ¶
func (rs *RoleSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RoleSelect) String ¶
func (rs *RoleSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*RoleSelect) StringX ¶
func (rs *RoleSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RoleUpdate ¶
type RoleUpdate struct {
// contains filtered or unexported fields
}
RoleUpdate is the builder for updating Role entities.
func (*RoleUpdate) AddCreatedBy ¶
func (ru *RoleUpdate) AddCreatedBy(i int64) *RoleUpdate
AddCreatedBy adds i to the "created_by" field.
func (*RoleUpdate) AddSort ¶
func (ru *RoleUpdate) AddSort(i int8) *RoleUpdate
AddSort adds i to the "sort" field.
func (*RoleUpdate) AddStatus ¶
func (ru *RoleUpdate) AddStatus(i int8) *RoleUpdate
AddStatus adds i to the "status" field.
func (*RoleUpdate) AddUpdatedBy ¶
func (ru *RoleUpdate) AddUpdatedBy(i int64) *RoleUpdate
AddUpdatedBy adds i to the "updated_by" field.
func (*RoleUpdate) Exec ¶
func (ru *RoleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleUpdate) ExecX ¶
func (ru *RoleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdate) Mutation ¶
func (ru *RoleUpdate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdate) Save ¶
func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RoleUpdate) SaveX ¶
func (ru *RoleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RoleUpdate) SetCreatedAt ¶
func (ru *RoleUpdate) SetCreatedAt(t time.Time) *RoleUpdate
SetCreatedAt sets the "created_at" field.
func (*RoleUpdate) SetCreatedBy ¶
func (ru *RoleUpdate) SetCreatedBy(i int64) *RoleUpdate
SetCreatedBy sets the "created_by" field.
func (*RoleUpdate) SetName ¶
func (ru *RoleUpdate) SetName(s string) *RoleUpdate
SetName sets the "name" field.
func (*RoleUpdate) SetNillableCreatedAt ¶
func (ru *RoleUpdate) SetNillableCreatedAt(t *time.Time) *RoleUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleUpdate) SetNillableCreatedBy ¶
func (ru *RoleUpdate) SetNillableCreatedBy(i *int64) *RoleUpdate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*RoleUpdate) SetNillableName ¶
func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdate) SetNillableRemark ¶
func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleUpdate) SetNillableSort ¶
func (ru *RoleUpdate) SetNillableSort(i *int8) *RoleUpdate
SetNillableSort sets the "sort" field if the given value is not nil.
func (*RoleUpdate) SetNillableStatus ¶
func (ru *RoleUpdate) SetNillableStatus(i *int8) *RoleUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*RoleUpdate) SetNillableUpdatedBy ¶
func (ru *RoleUpdate) SetNillableUpdatedBy(i *int64) *RoleUpdate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*RoleUpdate) SetRemark ¶
func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate
SetRemark sets the "remark" field.
func (*RoleUpdate) SetSort ¶
func (ru *RoleUpdate) SetSort(i int8) *RoleUpdate
SetSort sets the "sort" field.
func (*RoleUpdate) SetStatus ¶
func (ru *RoleUpdate) SetStatus(i int8) *RoleUpdate
SetStatus sets the "status" field.
func (*RoleUpdate) SetUpdatedAt ¶
func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate
SetUpdatedAt sets the "updated_at" field.
func (*RoleUpdate) SetUpdatedBy ¶
func (ru *RoleUpdate) SetUpdatedBy(i int64) *RoleUpdate
SetUpdatedBy sets the "updated_by" field.
func (*RoleUpdate) Where ¶
func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
Where appends a list predicates to the RoleUpdate builder.
type RoleUpdateOne ¶
type RoleUpdateOne struct {
// contains filtered or unexported fields
}
RoleUpdateOne is the builder for updating a single Role entity.
func (*RoleUpdateOne) AddCreatedBy ¶
func (ruo *RoleUpdateOne) AddCreatedBy(i int64) *RoleUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*RoleUpdateOne) AddSort ¶
func (ruo *RoleUpdateOne) AddSort(i int8) *RoleUpdateOne
AddSort adds i to the "sort" field.
func (*RoleUpdateOne) AddStatus ¶
func (ruo *RoleUpdateOne) AddStatus(i int8) *RoleUpdateOne
AddStatus adds i to the "status" field.
func (*RoleUpdateOne) AddUpdatedBy ¶
func (ruo *RoleUpdateOne) AddUpdatedBy(i int64) *RoleUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*RoleUpdateOne) Exec ¶
func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RoleUpdateOne) ExecX ¶
func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdateOne) Mutation ¶
func (ruo *RoleUpdateOne) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdateOne) Save ¶
func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)
Save executes the query and returns the updated Role entity.
func (*RoleUpdateOne) SaveX ¶
func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role
SaveX is like Save, but panics if an error occurs.
func (*RoleUpdateOne) Select ¶
func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RoleUpdateOne) SetCreatedAt ¶
func (ruo *RoleUpdateOne) SetCreatedAt(t time.Time) *RoleUpdateOne
SetCreatedAt sets the "created_at" field.
func (*RoleUpdateOne) SetCreatedBy ¶
func (ruo *RoleUpdateOne) SetCreatedBy(i int64) *RoleUpdateOne
SetCreatedBy sets the "created_by" field.
func (*RoleUpdateOne) SetName ¶
func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
SetName sets the "name" field.
func (*RoleUpdateOne) SetNillableCreatedAt ¶
func (ruo *RoleUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableCreatedBy ¶
func (ruo *RoleUpdateOne) SetNillableCreatedBy(i *int64) *RoleUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableName ¶
func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableRemark ¶
func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableSort ¶
func (ruo *RoleUpdateOne) SetNillableSort(i *int8) *RoleUpdateOne
SetNillableSort sets the "sort" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableStatus ¶
func (ruo *RoleUpdateOne) SetNillableStatus(i *int8) *RoleUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableUpdatedBy ¶
func (ruo *RoleUpdateOne) SetNillableUpdatedBy(i *int64) *RoleUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*RoleUpdateOne) SetRemark ¶
func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne
SetRemark sets the "remark" field.
func (*RoleUpdateOne) SetSort ¶
func (ruo *RoleUpdateOne) SetSort(i int8) *RoleUpdateOne
SetSort sets the "sort" field.
func (*RoleUpdateOne) SetStatus ¶
func (ruo *RoleUpdateOne) SetStatus(i int8) *RoleUpdateOne
SetStatus sets the "status" field.
func (*RoleUpdateOne) SetUpdatedAt ¶
func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*RoleUpdateOne) SetUpdatedBy ¶
func (ruo *RoleUpdateOne) SetUpdatedBy(i int64) *RoleUpdateOne
SetUpdatedBy sets the "updated_by" field.
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 Staff ¶
type Staff struct { // ID of the ent. // 自增id ID int64 `json:"id,omitempty"` // UID holds the value of the "uid" field. // 账号id UID int64 `json:"uid,omitempty"` // Name holds the value of the "name" field. // 员工姓名 Name string `json:"name,omitempty"` // Phone holds the value of the "phone" field. // 员工手机号 Phone string `json:"phone,omitempty"` // Email holds the value of the "email" field. // 员工邮箱 Email string `json:"email,omitempty"` // Nickname holds the value of the "nickname" field. // 员工昵称 Nickname string `json:"nickname,omitempty"` // Avatar holds the value of the "avatar" field. // 员工头像(相对路径) Avatar string `json:"avatar,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // contains filtered or unexported fields }
Staff is the model entity for the Staff schema.
func (*Staff) Unwrap ¶
Unwrap unwraps the Staff 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 (*Staff) Update ¶
func (s *Staff) Update() *StaffUpdateOne
Update returns a builder for updating this Staff. Note that you need to call Staff.Unwrap() before calling this method if this Staff was returned from a transaction, and the transaction was committed or rolled back.
type StaffClient ¶
type StaffClient struct {
// contains filtered or unexported fields
}
StaffClient is a client for the Staff schema.
func NewStaffClient ¶
func NewStaffClient(c config) *StaffClient
NewStaffClient returns a client for the Staff from the given config.
func (*StaffClient) Create ¶
func (c *StaffClient) Create() *StaffCreate
Create returns a create builder for Staff.
func (*StaffClient) CreateBulk ¶
func (c *StaffClient) CreateBulk(builders ...*StaffCreate) *StaffCreateBulk
CreateBulk returns a builder for creating a bulk of Staff entities.
func (*StaffClient) Delete ¶
func (c *StaffClient) Delete() *StaffDelete
Delete returns a delete builder for Staff.
func (*StaffClient) DeleteOne ¶
func (c *StaffClient) DeleteOne(s *Staff) *StaffDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*StaffClient) DeleteOneID ¶
func (c *StaffClient) DeleteOneID(id int64) *StaffDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*StaffClient) GetX ¶
func (c *StaffClient) GetX(ctx context.Context, id int64) *Staff
GetX is like Get, but panics if an error occurs.
func (*StaffClient) Query ¶
func (c *StaffClient) Query() *StaffQuery
Query returns a query builder for Staff.
func (*StaffClient) Update ¶
func (c *StaffClient) Update() *StaffUpdate
Update returns an update builder for Staff.
func (*StaffClient) UpdateOne ¶
func (c *StaffClient) UpdateOne(s *Staff) *StaffUpdateOne
UpdateOne returns an update builder for the given entity.
func (*StaffClient) UpdateOneID ¶
func (c *StaffClient) UpdateOneID(id int64) *StaffUpdateOne
UpdateOneID returns an update builder for the given id.
func (*StaffClient) Use ¶
func (c *StaffClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `staff.Hooks(f(g(h())))`.
type StaffCreate ¶
type StaffCreate struct {
// contains filtered or unexported fields
}
StaffCreate is the builder for creating a Staff entity.
func (*StaffCreate) Exec ¶
func (sc *StaffCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*StaffCreate) ExecX ¶
func (sc *StaffCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StaffCreate) Mutation ¶
func (sc *StaffCreate) Mutation() *StaffMutation
Mutation returns the StaffMutation object of the builder.
func (*StaffCreate) Save ¶
func (sc *StaffCreate) Save(ctx context.Context) (*Staff, error)
Save creates the Staff in the database.
func (*StaffCreate) SaveX ¶
func (sc *StaffCreate) SaveX(ctx context.Context) *Staff
SaveX calls Save and panics if Save returns an error.
func (*StaffCreate) SetAvatar ¶
func (sc *StaffCreate) SetAvatar(s string) *StaffCreate
SetAvatar sets the "avatar" field.
func (*StaffCreate) SetCreatedAt ¶
func (sc *StaffCreate) SetCreatedAt(t time.Time) *StaffCreate
SetCreatedAt sets the "created_at" field.
func (*StaffCreate) SetCreatedBy ¶
func (sc *StaffCreate) SetCreatedBy(i int64) *StaffCreate
SetCreatedBy sets the "created_by" field.
func (*StaffCreate) SetEmail ¶
func (sc *StaffCreate) SetEmail(s string) *StaffCreate
SetEmail sets the "email" field.
func (*StaffCreate) SetID ¶
func (sc *StaffCreate) SetID(i int64) *StaffCreate
SetID sets the "id" field.
func (*StaffCreate) SetName ¶
func (sc *StaffCreate) SetName(s string) *StaffCreate
SetName sets the "name" field.
func (*StaffCreate) SetNickname ¶
func (sc *StaffCreate) SetNickname(s string) *StaffCreate
SetNickname sets the "nickname" field.
func (*StaffCreate) SetNillableAvatar ¶
func (sc *StaffCreate) SetNillableAvatar(s *string) *StaffCreate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*StaffCreate) SetNillableCreatedAt ¶
func (sc *StaffCreate) SetNillableCreatedAt(t *time.Time) *StaffCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StaffCreate) SetNillableCreatedBy ¶
func (sc *StaffCreate) SetNillableCreatedBy(i *int64) *StaffCreate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*StaffCreate) SetNillableEmail ¶
func (sc *StaffCreate) SetNillableEmail(s *string) *StaffCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*StaffCreate) SetNillableName ¶
func (sc *StaffCreate) SetNillableName(s *string) *StaffCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*StaffCreate) SetNillableNickname ¶
func (sc *StaffCreate) SetNillableNickname(s *string) *StaffCreate
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*StaffCreate) SetNillablePhone ¶
func (sc *StaffCreate) SetNillablePhone(s *string) *StaffCreate
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*StaffCreate) SetNillableUID ¶
func (sc *StaffCreate) SetNillableUID(i *int64) *StaffCreate
SetNillableUID sets the "uid" field if the given value is not nil.
func (*StaffCreate) SetNillableUpdatedAt ¶
func (sc *StaffCreate) SetNillableUpdatedAt(t *time.Time) *StaffCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*StaffCreate) SetNillableUpdatedBy ¶
func (sc *StaffCreate) SetNillableUpdatedBy(i *int64) *StaffCreate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*StaffCreate) SetPhone ¶
func (sc *StaffCreate) SetPhone(s string) *StaffCreate
SetPhone sets the "phone" field.
func (*StaffCreate) SetUID ¶
func (sc *StaffCreate) SetUID(i int64) *StaffCreate
SetUID sets the "uid" field.
func (*StaffCreate) SetUpdatedAt ¶
func (sc *StaffCreate) SetUpdatedAt(t time.Time) *StaffCreate
SetUpdatedAt sets the "updated_at" field.
func (*StaffCreate) SetUpdatedBy ¶
func (sc *StaffCreate) SetUpdatedBy(i int64) *StaffCreate
SetUpdatedBy sets the "updated_by" field.
type StaffCreateBulk ¶
type StaffCreateBulk struct {
// contains filtered or unexported fields
}
StaffCreateBulk is the builder for creating many Staff entities in bulk.
func (*StaffCreateBulk) Exec ¶
func (scb *StaffCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*StaffCreateBulk) ExecX ¶
func (scb *StaffCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type StaffDelete ¶
type StaffDelete struct {
// contains filtered or unexported fields
}
StaffDelete is the builder for deleting a Staff entity.
func (*StaffDelete) Exec ¶
func (sd *StaffDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*StaffDelete) ExecX ¶
func (sd *StaffDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*StaffDelete) Where ¶
func (sd *StaffDelete) Where(ps ...predicate.Staff) *StaffDelete
Where appends a list predicates to the StaffDelete builder.
type StaffDeleteOne ¶
type StaffDeleteOne struct {
// contains filtered or unexported fields
}
StaffDeleteOne is the builder for deleting a single Staff entity.
func (*StaffDeleteOne) Exec ¶
func (sdo *StaffDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*StaffDeleteOne) ExecX ¶
func (sdo *StaffDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type StaffGroupBy ¶
type StaffGroupBy struct {
// contains filtered or unexported fields
}
StaffGroupBy is the group-by builder for Staff entities.
func (*StaffGroupBy) Aggregate ¶
func (sgb *StaffGroupBy) Aggregate(fns ...AggregateFunc) *StaffGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*StaffGroupBy) Bool ¶
func (sgb *StaffGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) BoolX ¶
func (sgb *StaffGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*StaffGroupBy) Bools ¶
func (sgb *StaffGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) BoolsX ¶
func (sgb *StaffGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*StaffGroupBy) Float64 ¶
func (sgb *StaffGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) Float64X ¶
func (sgb *StaffGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*StaffGroupBy) Float64s ¶
func (sgb *StaffGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) Float64sX ¶
func (sgb *StaffGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*StaffGroupBy) Int ¶
func (sgb *StaffGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) IntX ¶
func (sgb *StaffGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*StaffGroupBy) Ints ¶
func (sgb *StaffGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) IntsX ¶
func (sgb *StaffGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*StaffGroupBy) Scan ¶
func (sgb *StaffGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*StaffGroupBy) ScanX ¶
func (sgb *StaffGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*StaffGroupBy) String ¶
func (sgb *StaffGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StaffGroupBy) StringX ¶
func (sgb *StaffGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type StaffMutation ¶
type StaffMutation struct {
// contains filtered or unexported fields
}
StaffMutation represents an operation that mutates the Staff nodes in the graph.
func (*StaffMutation) AddCreatedBy ¶
func (m *StaffMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
func (*StaffMutation) AddField ¶
func (m *StaffMutation) 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 (*StaffMutation) AddUID ¶
func (m *StaffMutation) AddUID(i int64)
AddUID adds i to the "uid" field.
func (*StaffMutation) AddUpdatedBy ¶
func (m *StaffMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*StaffMutation) AddedCreatedBy ¶
func (m *StaffMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
func (*StaffMutation) AddedEdges ¶
func (m *StaffMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*StaffMutation) AddedField ¶
func (m *StaffMutation) 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 (*StaffMutation) AddedFields ¶
func (m *StaffMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*StaffMutation) AddedIDs ¶
func (m *StaffMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*StaffMutation) AddedUID ¶
func (m *StaffMutation) AddedUID() (r int64, exists bool)
AddedUID returns the value that was added to the "uid" field in this mutation.
func (*StaffMutation) AddedUpdatedBy ¶
func (m *StaffMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*StaffMutation) Avatar ¶
func (m *StaffMutation) Avatar() (r string, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*StaffMutation) ClearEdge ¶
func (m *StaffMutation) 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 (*StaffMutation) ClearField ¶
func (m *StaffMutation) 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 (*StaffMutation) ClearedEdges ¶
func (m *StaffMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*StaffMutation) ClearedFields ¶
func (m *StaffMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (StaffMutation) Client ¶
func (m StaffMutation) 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 (*StaffMutation) CreatedAt ¶
func (m *StaffMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*StaffMutation) CreatedBy ¶
func (m *StaffMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*StaffMutation) EdgeCleared ¶
func (m *StaffMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*StaffMutation) Email ¶
func (m *StaffMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*StaffMutation) Field ¶
func (m *StaffMutation) 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 (*StaffMutation) FieldCleared ¶
func (m *StaffMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*StaffMutation) Fields ¶
func (m *StaffMutation) 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 (*StaffMutation) ID ¶
func (m *StaffMutation) ID() (id int64, 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 (*StaffMutation) IDs ¶
func (m *StaffMutation) IDs(ctx context.Context) ([]int64, 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 (*StaffMutation) Name ¶
func (m *StaffMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*StaffMutation) Nickname ¶
func (m *StaffMutation) Nickname() (r string, exists bool)
Nickname returns the value of the "nickname" field in the mutation.
func (*StaffMutation) OldAvatar ¶
func (m *StaffMutation) OldAvatar(ctx context.Context) (v string, err error)
OldAvatar returns the old "avatar" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldCreatedBy ¶
func (m *StaffMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldEmail ¶
func (m *StaffMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the Staff entity. If the Staff 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 (*StaffMutation) 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 (*StaffMutation) OldName ¶
func (m *StaffMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldNickname ¶
func (m *StaffMutation) OldNickname(ctx context.Context) (v string, err error)
OldNickname returns the old "nickname" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldPhone ¶
func (m *StaffMutation) OldPhone(ctx context.Context) (v string, err error)
OldPhone returns the old "phone" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldUID ¶
func (m *StaffMutation) OldUID(ctx context.Context) (v int64, err error)
OldUID returns the old "uid" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Staff entity. If the Staff 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 (*StaffMutation) OldUpdatedBy ¶
func (m *StaffMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" field's value of the Staff entity. If the Staff 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 (*StaffMutation) Phone ¶
func (m *StaffMutation) Phone() (r string, exists bool)
Phone returns the value of the "phone" field in the mutation.
func (*StaffMutation) RemovedEdges ¶
func (m *StaffMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*StaffMutation) RemovedIDs ¶
func (m *StaffMutation) 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 (*StaffMutation) ResetAvatar ¶
func (m *StaffMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*StaffMutation) ResetCreatedAt ¶
func (m *StaffMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*StaffMutation) ResetCreatedBy ¶
func (m *StaffMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*StaffMutation) ResetEdge ¶
func (m *StaffMutation) 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 (*StaffMutation) ResetEmail ¶
func (m *StaffMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*StaffMutation) ResetField ¶
func (m *StaffMutation) 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 (*StaffMutation) ResetName ¶
func (m *StaffMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*StaffMutation) ResetNickname ¶
func (m *StaffMutation) ResetNickname()
ResetNickname resets all changes to the "nickname" field.
func (*StaffMutation) ResetPhone ¶
func (m *StaffMutation) ResetPhone()
ResetPhone resets all changes to the "phone" field.
func (*StaffMutation) ResetUID ¶
func (m *StaffMutation) ResetUID()
ResetUID resets all changes to the "uid" field.
func (*StaffMutation) ResetUpdatedAt ¶
func (m *StaffMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*StaffMutation) ResetUpdatedBy ¶
func (m *StaffMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*StaffMutation) SetAvatar ¶
func (m *StaffMutation) SetAvatar(s string)
SetAvatar sets the "avatar" field.
func (*StaffMutation) SetCreatedAt ¶
func (m *StaffMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*StaffMutation) SetCreatedBy ¶
func (m *StaffMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" field.
func (*StaffMutation) SetEmail ¶
func (m *StaffMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*StaffMutation) SetField ¶
func (m *StaffMutation) 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 (*StaffMutation) SetID ¶
func (m *StaffMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Staff entities.
func (*StaffMutation) SetName ¶
func (m *StaffMutation) SetName(s string)
SetName sets the "name" field.
func (*StaffMutation) SetNickname ¶
func (m *StaffMutation) SetNickname(s string)
SetNickname sets the "nickname" field.
func (*StaffMutation) SetPhone ¶
func (m *StaffMutation) SetPhone(s string)
SetPhone sets the "phone" field.
func (*StaffMutation) SetUpdatedAt ¶
func (m *StaffMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*StaffMutation) SetUpdatedBy ¶
func (m *StaffMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" field.
func (StaffMutation) Tx ¶
func (m StaffMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*StaffMutation) Type ¶
func (m *StaffMutation) Type() string
Type returns the node type of this mutation (Staff).
func (*StaffMutation) UID ¶
func (m *StaffMutation) UID() (r int64, exists bool)
UID returns the value of the "uid" field in the mutation.
func (*StaffMutation) UpdatedAt ¶
func (m *StaffMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*StaffMutation) UpdatedBy ¶
func (m *StaffMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" field in the mutation.
func (*StaffMutation) Where ¶
func (m *StaffMutation) Where(ps ...predicate.Staff)
Where appends a list predicates to the StaffMutation builder.
type StaffQuery ¶
type StaffQuery struct {
// contains filtered or unexported fields
}
StaffQuery is the builder for querying Staff entities.
func (*StaffQuery) All ¶
func (sq *StaffQuery) All(ctx context.Context) ([]*Staff, error)
All executes the query and returns a list of Staffs.
func (*StaffQuery) AllX ¶
func (sq *StaffQuery) AllX(ctx context.Context) []*Staff
AllX is like All, but panics if an error occurs.
func (*StaffQuery) Clone ¶
func (sq *StaffQuery) Clone() *StaffQuery
Clone returns a duplicate of the StaffQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*StaffQuery) Count ¶
func (sq *StaffQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*StaffQuery) CountX ¶
func (sq *StaffQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*StaffQuery) Exist ¶
func (sq *StaffQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*StaffQuery) ExistX ¶
func (sq *StaffQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*StaffQuery) First ¶
func (sq *StaffQuery) First(ctx context.Context) (*Staff, error)
First returns the first Staff entity from the query. Returns a *NotFoundError when no Staff was found.
func (*StaffQuery) FirstID ¶
func (sq *StaffQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Staff ID from the query. Returns a *NotFoundError when no Staff ID was found.
func (*StaffQuery) FirstIDX ¶
func (sq *StaffQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*StaffQuery) FirstX ¶
func (sq *StaffQuery) FirstX(ctx context.Context) *Staff
FirstX is like First, but panics if an error occurs.
func (*StaffQuery) GroupBy ¶
func (sq *StaffQuery) GroupBy(field string, fields ...string) *StaffGroupBy
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 { UID int64 `json:"uid,omitempty"` Count int `json:"count,omitempty"` } client.Staff.Query(). GroupBy(staff.FieldUID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*StaffQuery) IDs ¶
func (sq *StaffQuery) IDs(ctx context.Context) ([]int64, error)
IDs executes the query and returns a list of Staff IDs.
func (*StaffQuery) IDsX ¶
func (sq *StaffQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*StaffQuery) Limit ¶
func (sq *StaffQuery) Limit(limit int) *StaffQuery
Limit adds a limit step to the query.
func (*StaffQuery) Offset ¶
func (sq *StaffQuery) Offset(offset int) *StaffQuery
Offset adds an offset step to the query.
func (*StaffQuery) Only ¶
func (sq *StaffQuery) Only(ctx context.Context) (*Staff, error)
Only returns a single Staff entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Staff entity is found. Returns a *NotFoundError when no Staff entities are found.
func (*StaffQuery) OnlyID ¶
func (sq *StaffQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Staff ID in the query. Returns a *NotSingularError when more than one Staff ID is found. Returns a *NotFoundError when no entities are found.
func (*StaffQuery) OnlyIDX ¶
func (sq *StaffQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*StaffQuery) OnlyX ¶
func (sq *StaffQuery) OnlyX(ctx context.Context) *Staff
OnlyX is like Only, but panics if an error occurs.
func (*StaffQuery) Order ¶
func (sq *StaffQuery) Order(o ...OrderFunc) *StaffQuery
Order adds an order step to the query.
func (*StaffQuery) Select ¶
func (sq *StaffQuery) Select(fields ...string) *StaffSelect
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 { UID int64 `json:"uid,omitempty"` } client.Staff.Query(). Select(staff.FieldUID). Scan(ctx, &v)
func (*StaffQuery) Unique ¶
func (sq *StaffQuery) Unique(unique bool) *StaffQuery
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 (*StaffQuery) Where ¶
func (sq *StaffQuery) Where(ps ...predicate.Staff) *StaffQuery
Where adds a new predicate for the StaffQuery builder.
type StaffSelect ¶
type StaffSelect struct { *StaffQuery // contains filtered or unexported fields }
StaffSelect is the builder for selecting fields of Staff entities.
func (*StaffSelect) Bool ¶
func (ss *StaffSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StaffSelect) BoolX ¶
func (ss *StaffSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*StaffSelect) Bools ¶
func (ss *StaffSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StaffSelect) BoolsX ¶
func (ss *StaffSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*StaffSelect) Float64 ¶
func (ss *StaffSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StaffSelect) Float64X ¶
func (ss *StaffSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*StaffSelect) Float64s ¶
func (ss *StaffSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StaffSelect) Float64sX ¶
func (ss *StaffSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*StaffSelect) Int ¶
func (ss *StaffSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StaffSelect) IntX ¶
func (ss *StaffSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*StaffSelect) Ints ¶
func (ss *StaffSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StaffSelect) IntsX ¶
func (ss *StaffSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*StaffSelect) Scan ¶
func (ss *StaffSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*StaffSelect) ScanX ¶
func (ss *StaffSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*StaffSelect) String ¶
func (ss *StaffSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*StaffSelect) StringX ¶
func (ss *StaffSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type StaffUpdate ¶
type StaffUpdate struct {
// contains filtered or unexported fields
}
StaffUpdate is the builder for updating Staff entities.
func (*StaffUpdate) AddCreatedBy ¶
func (su *StaffUpdate) AddCreatedBy(i int64) *StaffUpdate
AddCreatedBy adds i to the "created_by" field.
func (*StaffUpdate) AddUID ¶
func (su *StaffUpdate) AddUID(i int64) *StaffUpdate
AddUID adds i to the "uid" field.
func (*StaffUpdate) AddUpdatedBy ¶
func (su *StaffUpdate) AddUpdatedBy(i int64) *StaffUpdate
AddUpdatedBy adds i to the "updated_by" field.
func (*StaffUpdate) Exec ¶
func (su *StaffUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*StaffUpdate) ExecX ¶
func (su *StaffUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StaffUpdate) Mutation ¶
func (su *StaffUpdate) Mutation() *StaffMutation
Mutation returns the StaffMutation object of the builder.
func (*StaffUpdate) Save ¶
func (su *StaffUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*StaffUpdate) SaveX ¶
func (su *StaffUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*StaffUpdate) SetAvatar ¶
func (su *StaffUpdate) SetAvatar(s string) *StaffUpdate
SetAvatar sets the "avatar" field.
func (*StaffUpdate) SetCreatedAt ¶
func (su *StaffUpdate) SetCreatedAt(t time.Time) *StaffUpdate
SetCreatedAt sets the "created_at" field.
func (*StaffUpdate) SetCreatedBy ¶
func (su *StaffUpdate) SetCreatedBy(i int64) *StaffUpdate
SetCreatedBy sets the "created_by" field.
func (*StaffUpdate) SetEmail ¶
func (su *StaffUpdate) SetEmail(s string) *StaffUpdate
SetEmail sets the "email" field.
func (*StaffUpdate) SetName ¶
func (su *StaffUpdate) SetName(s string) *StaffUpdate
SetName sets the "name" field.
func (*StaffUpdate) SetNickname ¶
func (su *StaffUpdate) SetNickname(s string) *StaffUpdate
SetNickname sets the "nickname" field.
func (*StaffUpdate) SetNillableAvatar ¶
func (su *StaffUpdate) SetNillableAvatar(s *string) *StaffUpdate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*StaffUpdate) SetNillableCreatedAt ¶
func (su *StaffUpdate) SetNillableCreatedAt(t *time.Time) *StaffUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StaffUpdate) SetNillableCreatedBy ¶
func (su *StaffUpdate) SetNillableCreatedBy(i *int64) *StaffUpdate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*StaffUpdate) SetNillableEmail ¶
func (su *StaffUpdate) SetNillableEmail(s *string) *StaffUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*StaffUpdate) SetNillableName ¶
func (su *StaffUpdate) SetNillableName(s *string) *StaffUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*StaffUpdate) SetNillableNickname ¶
func (su *StaffUpdate) SetNillableNickname(s *string) *StaffUpdate
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*StaffUpdate) SetNillablePhone ¶
func (su *StaffUpdate) SetNillablePhone(s *string) *StaffUpdate
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*StaffUpdate) SetNillableUID ¶
func (su *StaffUpdate) SetNillableUID(i *int64) *StaffUpdate
SetNillableUID sets the "uid" field if the given value is not nil.
func (*StaffUpdate) SetNillableUpdatedBy ¶
func (su *StaffUpdate) SetNillableUpdatedBy(i *int64) *StaffUpdate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*StaffUpdate) SetPhone ¶
func (su *StaffUpdate) SetPhone(s string) *StaffUpdate
SetPhone sets the "phone" field.
func (*StaffUpdate) SetUID ¶
func (su *StaffUpdate) SetUID(i int64) *StaffUpdate
SetUID sets the "uid" field.
func (*StaffUpdate) SetUpdatedAt ¶
func (su *StaffUpdate) SetUpdatedAt(t time.Time) *StaffUpdate
SetUpdatedAt sets the "updated_at" field.
func (*StaffUpdate) SetUpdatedBy ¶
func (su *StaffUpdate) SetUpdatedBy(i int64) *StaffUpdate
SetUpdatedBy sets the "updated_by" field.
func (*StaffUpdate) Where ¶
func (su *StaffUpdate) Where(ps ...predicate.Staff) *StaffUpdate
Where appends a list predicates to the StaffUpdate builder.
type StaffUpdateOne ¶
type StaffUpdateOne struct {
// contains filtered or unexported fields
}
StaffUpdateOne is the builder for updating a single Staff entity.
func (*StaffUpdateOne) AddCreatedBy ¶
func (suo *StaffUpdateOne) AddCreatedBy(i int64) *StaffUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*StaffUpdateOne) AddUID ¶
func (suo *StaffUpdateOne) AddUID(i int64) *StaffUpdateOne
AddUID adds i to the "uid" field.
func (*StaffUpdateOne) AddUpdatedBy ¶
func (suo *StaffUpdateOne) AddUpdatedBy(i int64) *StaffUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*StaffUpdateOne) Exec ¶
func (suo *StaffUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*StaffUpdateOne) ExecX ¶
func (suo *StaffUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StaffUpdateOne) Mutation ¶
func (suo *StaffUpdateOne) Mutation() *StaffMutation
Mutation returns the StaffMutation object of the builder.
func (*StaffUpdateOne) Save ¶
func (suo *StaffUpdateOne) Save(ctx context.Context) (*Staff, error)
Save executes the query and returns the updated Staff entity.
func (*StaffUpdateOne) SaveX ¶
func (suo *StaffUpdateOne) SaveX(ctx context.Context) *Staff
SaveX is like Save, but panics if an error occurs.
func (*StaffUpdateOne) Select ¶
func (suo *StaffUpdateOne) Select(field string, fields ...string) *StaffUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*StaffUpdateOne) SetAvatar ¶
func (suo *StaffUpdateOne) SetAvatar(s string) *StaffUpdateOne
SetAvatar sets the "avatar" field.
func (*StaffUpdateOne) SetCreatedAt ¶
func (suo *StaffUpdateOne) SetCreatedAt(t time.Time) *StaffUpdateOne
SetCreatedAt sets the "created_at" field.
func (*StaffUpdateOne) SetCreatedBy ¶
func (suo *StaffUpdateOne) SetCreatedBy(i int64) *StaffUpdateOne
SetCreatedBy sets the "created_by" field.
func (*StaffUpdateOne) SetEmail ¶
func (suo *StaffUpdateOne) SetEmail(s string) *StaffUpdateOne
SetEmail sets the "email" field.
func (*StaffUpdateOne) SetName ¶
func (suo *StaffUpdateOne) SetName(s string) *StaffUpdateOne
SetName sets the "name" field.
func (*StaffUpdateOne) SetNickname ¶
func (suo *StaffUpdateOne) SetNickname(s string) *StaffUpdateOne
SetNickname sets the "nickname" field.
func (*StaffUpdateOne) SetNillableAvatar ¶
func (suo *StaffUpdateOne) SetNillableAvatar(s *string) *StaffUpdateOne
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableCreatedAt ¶
func (suo *StaffUpdateOne) SetNillableCreatedAt(t *time.Time) *StaffUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableCreatedBy ¶
func (suo *StaffUpdateOne) SetNillableCreatedBy(i *int64) *StaffUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableEmail ¶
func (suo *StaffUpdateOne) SetNillableEmail(s *string) *StaffUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableName ¶
func (suo *StaffUpdateOne) SetNillableName(s *string) *StaffUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableNickname ¶
func (suo *StaffUpdateOne) SetNillableNickname(s *string) *StaffUpdateOne
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*StaffUpdateOne) SetNillablePhone ¶
func (suo *StaffUpdateOne) SetNillablePhone(s *string) *StaffUpdateOne
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableUID ¶
func (suo *StaffUpdateOne) SetNillableUID(i *int64) *StaffUpdateOne
SetNillableUID sets the "uid" field if the given value is not nil.
func (*StaffUpdateOne) SetNillableUpdatedBy ¶
func (suo *StaffUpdateOne) SetNillableUpdatedBy(i *int64) *StaffUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*StaffUpdateOne) SetPhone ¶
func (suo *StaffUpdateOne) SetPhone(s string) *StaffUpdateOne
SetPhone sets the "phone" field.
func (*StaffUpdateOne) SetUID ¶
func (suo *StaffUpdateOne) SetUID(i int64) *StaffUpdateOne
SetUID sets the "uid" field.
func (*StaffUpdateOne) SetUpdatedAt ¶
func (suo *StaffUpdateOne) SetUpdatedAt(t time.Time) *StaffUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*StaffUpdateOne) SetUpdatedBy ¶
func (suo *StaffUpdateOne) SetUpdatedBy(i int64) *StaffUpdateOne
SetUpdatedBy sets the "updated_by" field.
type Tx ¶
type Tx struct { // Api is the client for interacting with the Api builders. Api *ApiClient // DictData is the client for interacting with the DictData builders. DictData *DictDataClient // DictType is the client for interacting with the DictType builders. DictType *DictTypeClient // Permission is the client for interacting with the Permission builders. Permission *PermissionClient // Role is the client for interacting with the Role builders. Role *RoleClient // Staff is the client for interacting with the Staff builders. Staff *StaffClient // User is the client for interacting with the User builders. User *UserClient // UserRole is the client for interacting with the UserRole builders. UserRole *UserRoleClient // 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 ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. // 创建时间 CreatedAt time.Time `json:"created_at,omitempty"` // CreatedBy holds the value of the "created_by" field. // 更新人 CreatedBy int64 `json:"created_by,omitempty"` // UpdatedAt holds the value of the "updated_at" field. // 更新时间 UpdatedAt time.Time `json:"updated_at,omitempty"` // UpdatedBy holds the value of the "updated_by" field. // 更新人 UpdatedBy int64 `json:"updated_by,omitempty"` // UID holds the value of the "uid" field. // 账号id UID int64 `json:"uid,omitempty"` // Nickname holds the value of the "nickname" field. // 昵称 Nickname string `json:"nickname,omitempty"` // Avatar holds the value of the "avatar" field. // 头像 Avatar string `json:"avatar,omitempty"` // Gender holds the value of the "gender" field. // 性别 Gender user.Gender `json:"gender,omitempty"` // Remark holds the value of the "remark" field. // 备注 Remark string `json:"remark,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) QueryRoles ¶
QueryRoles queries the "roles" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int64) *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) QueryRoles ¶
func (c *UserClient) QueryRoles(u *User) *RoleQuery
QueryRoles queries the roles 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 int64) *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) AddRoleIDs ¶
func (uc *UserCreate) AddRoleIDs(ids ...int64) *UserCreate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserCreate) AddRoles ¶
func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate
AddRoles adds the "roles" edges to the Role entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAvatar ¶
func (uc *UserCreate) SetAvatar(s string) *UserCreate
SetAvatar sets the "avatar" field.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetCreatedBy ¶
func (uc *UserCreate) SetCreatedBy(i int64) *UserCreate
SetCreatedBy sets the "created_by" field.
func (*UserCreate) SetGender ¶
func (uc *UserCreate) SetGender(u user.Gender) *UserCreate
SetGender sets the "gender" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(i int64) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetNickname ¶
func (uc *UserCreate) SetNickname(s string) *UserCreate
SetNickname sets the "nickname" field.
func (*UserCreate) SetNillableAvatar ¶
func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableCreatedBy ¶
func (uc *UserCreate) SetNillableCreatedBy(i *int64) *UserCreate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*UserCreate) SetNillableGender ¶
func (uc *UserCreate) SetNillableGender(u *user.Gender) *UserCreate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserCreate) SetNillableNickname ¶
func (uc *UserCreate) SetNillableNickname(s *string) *UserCreate
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*UserCreate) SetNillableRemark ¶
func (uc *UserCreate) SetNillableRemark(s *string) *UserCreate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*UserCreate) SetNillableUID ¶
func (uc *UserCreate) SetNillableUID(i *int64) *UserCreate
SetNillableUID sets the "uid" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedBy ¶
func (uc *UserCreate) SetNillableUpdatedBy(i *int64) *UserCreate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*UserCreate) SetRemark ¶
func (uc *UserCreate) SetRemark(s string) *UserCreate
SetRemark sets the "remark" field.
func (*UserCreate) SetUID ¶
func (uc *UserCreate) SetUID(i int64) *UserCreate
SetUID sets the "uid" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserCreate) SetUpdatedBy ¶
func (uc *UserCreate) SetUpdatedBy(i int64) *UserCreate
SetUpdatedBy sets the "updated_by" 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 { // Roles holds the value of the roles edge. Roles []*Role `json:"roles,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) RolesOrErr ¶
RolesOrErr returns the Roles 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 ¶
func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolX ¶
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶
func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolsX ¶
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶
func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64X ¶
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶
func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64sX ¶
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶
func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntX ¶
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶
func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntsX ¶
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) ScanX ¶
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶
func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) StringX ¶
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddCreatedBy ¶
func (m *UserMutation) AddCreatedBy(i int64)
AddCreatedBy adds i to the "created_by" field.
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) AddRoleIDs ¶
func (m *UserMutation) AddRoleIDs(ids ...int64)
AddRoleIDs adds the "roles" edge to the Role entity by ids.
func (*UserMutation) AddUID ¶
func (m *UserMutation) AddUID(i int64)
AddUID adds i to the "uid" field.
func (*UserMutation) AddUpdatedBy ¶
func (m *UserMutation) AddUpdatedBy(i int64)
AddUpdatedBy adds i to the "updated_by" field.
func (*UserMutation) AddedCreatedBy ¶
func (m *UserMutation) AddedCreatedBy() (r int64, exists bool)
AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.
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) AddedUID ¶
func (m *UserMutation) AddedUID() (r int64, exists bool)
AddedUID returns the value that was added to the "uid" field in this mutation.
func (*UserMutation) AddedUpdatedBy ¶
func (m *UserMutation) AddedUpdatedBy() (r int64, exists bool)
AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.
func (*UserMutation) Avatar ¶
func (m *UserMutation) Avatar() (r string, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearRoles ¶
func (m *UserMutation) ClearRoles()
ClearRoles clears the "roles" edge to the Role 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) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) CreatedBy ¶
func (m *UserMutation) CreatedBy() (r int64, exists bool)
CreatedBy returns the value of the "created_by" 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) 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) Gender ¶
func (m *UserMutation) Gender() (r user.Gender, exists bool)
Gender returns the value of the "gender" field in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int64, 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) ([]int64, 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) Nickname ¶
func (m *UserMutation) Nickname() (r string, exists bool)
Nickname returns the value of the "nickname" field in the mutation.
func (*UserMutation) OldAvatar ¶
func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)
OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldCreatedBy ¶
func (m *UserMutation) OldCreatedBy(ctx context.Context) (v int64, err error)
OldCreatedBy returns the old "created_by" 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) OldGender ¶
OldGender returns the old "gender" 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) 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) OldRemark ¶
func (m *UserMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" 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) OldUID ¶
func (m *UserMutation) OldUID(ctx context.Context) (v int64, err error)
OldUID returns the old "uid" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedBy ¶
func (m *UserMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)
OldUpdatedBy returns the old "updated_by" 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) Remark ¶
func (m *UserMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*UserMutation) RemoveRoleIDs ¶
func (m *UserMutation) RemoveRoleIDs(ids ...int64)
RemoveRoleIDs removes the "roles" edge to the Role 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) RemovedRolesIDs ¶
func (m *UserMutation) RemovedRolesIDs() (ids []int64)
RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.
func (*UserMutation) ResetAvatar ¶
func (m *UserMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetCreatedBy ¶
func (m *UserMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" 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) 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) ResetGender ¶
func (m *UserMutation) ResetGender()
ResetGender resets all changes to the "gender" field.
func (*UserMutation) ResetNickname ¶
func (m *UserMutation) ResetNickname()
ResetNickname resets all changes to the "nickname" field.
func (*UserMutation) ResetRemark ¶
func (m *UserMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*UserMutation) ResetRoles ¶
func (m *UserMutation) ResetRoles()
ResetRoles resets all changes to the "roles" edge.
func (*UserMutation) ResetUID ¶
func (m *UserMutation) ResetUID()
ResetUID resets all changes to the "uid" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetUpdatedBy ¶
func (m *UserMutation) ResetUpdatedBy()
ResetUpdatedBy resets all changes to the "updated_by" field.
func (*UserMutation) RolesCleared ¶
func (m *UserMutation) RolesCleared() bool
RolesCleared reports if the "roles" edge to the Role entity was cleared.
func (*UserMutation) RolesIDs ¶
func (m *UserMutation) RolesIDs() (ids []int64)
RolesIDs returns the "roles" edge IDs in the mutation.
func (*UserMutation) SetAvatar ¶
func (m *UserMutation) SetAvatar(s string)
SetAvatar sets the "avatar" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetCreatedBy ¶
func (m *UserMutation) SetCreatedBy(i int64)
SetCreatedBy sets the "created_by" 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) SetGender ¶
func (m *UserMutation) SetGender(u user.Gender)
SetGender sets the "gender" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetNickname ¶
func (m *UserMutation) SetNickname(s string)
SetNickname sets the "nickname" field.
func (*UserMutation) SetRemark ¶
func (m *UserMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) SetUpdatedBy ¶
func (m *UserMutation) SetUpdatedBy(i int64)
SetUpdatedBy sets the "updated_by" 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) UID ¶
func (m *UserMutation) UID() (r int64, exists bool)
UID returns the value of the "uid" field in the mutation.
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) UpdatedBy ¶
func (m *UserMutation) UpdatedBy() (r int64, exists bool)
UpdatedBy returns the value of the "updated_by" 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) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryRoles ¶
QueryRoles chains the current query on the "roles" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type UserRole ¶
type UserRole struct { // ID of the ent. ID int `json:"id,omitempty"` // UserID holds the value of the "user_id" field. // 用户ID UserID int64 `json:"user_id,omitempty"` // RoleID holds the value of the "role_id" field. // 角色ID RoleID int64 `json:"role_id,omitempty"` // contains filtered or unexported fields }
UserRole is the model entity for the UserRole schema.
func (*UserRole) Unwrap ¶
Unwrap unwraps the UserRole 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 (*UserRole) Update ¶
func (ur *UserRole) Update() *UserRoleUpdateOne
Update returns a builder for updating this UserRole. Note that you need to call UserRole.Unwrap() before calling this method if this UserRole was returned from a transaction, and the transaction was committed or rolled back.
type UserRoleClient ¶
type UserRoleClient struct {
// contains filtered or unexported fields
}
UserRoleClient is a client for the UserRole schema.
func NewUserRoleClient ¶
func NewUserRoleClient(c config) *UserRoleClient
NewUserRoleClient returns a client for the UserRole from the given config.
func (*UserRoleClient) Create ¶
func (c *UserRoleClient) Create() *UserRoleCreate
Create returns a create builder for UserRole.
func (*UserRoleClient) CreateBulk ¶
func (c *UserRoleClient) CreateBulk(builders ...*UserRoleCreate) *UserRoleCreateBulk
CreateBulk returns a builder for creating a bulk of UserRole entities.
func (*UserRoleClient) Delete ¶
func (c *UserRoleClient) Delete() *UserRoleDelete
Delete returns a delete builder for UserRole.
func (*UserRoleClient) DeleteOne ¶
func (c *UserRoleClient) DeleteOne(ur *UserRole) *UserRoleDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserRoleClient) DeleteOneID ¶
func (c *UserRoleClient) DeleteOneID(id int) *UserRoleDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserRoleClient) GetX ¶
func (c *UserRoleClient) GetX(ctx context.Context, id int) *UserRole
GetX is like Get, but panics if an error occurs.
func (*UserRoleClient) Hooks ¶
func (c *UserRoleClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserRoleClient) Query ¶
func (c *UserRoleClient) Query() *UserRoleQuery
Query returns a query builder for UserRole.
func (*UserRoleClient) Update ¶
func (c *UserRoleClient) Update() *UserRoleUpdate
Update returns an update builder for UserRole.
func (*UserRoleClient) UpdateOne ¶
func (c *UserRoleClient) UpdateOne(ur *UserRole) *UserRoleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserRoleClient) UpdateOneID ¶
func (c *UserRoleClient) UpdateOneID(id int) *UserRoleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserRoleClient) Use ¶
func (c *UserRoleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userrole.Hooks(f(g(h())))`.
type UserRoleCreate ¶
type UserRoleCreate struct {
// contains filtered or unexported fields
}
UserRoleCreate is the builder for creating a UserRole entity.
func (*UserRoleCreate) Exec ¶
func (urc *UserRoleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserRoleCreate) ExecX ¶
func (urc *UserRoleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserRoleCreate) Mutation ¶
func (urc *UserRoleCreate) Mutation() *UserRoleMutation
Mutation returns the UserRoleMutation object of the builder.
func (*UserRoleCreate) Save ¶
func (urc *UserRoleCreate) Save(ctx context.Context) (*UserRole, error)
Save creates the UserRole in the database.
func (*UserRoleCreate) SaveX ¶
func (urc *UserRoleCreate) SaveX(ctx context.Context) *UserRole
SaveX calls Save and panics if Save returns an error.
func (*UserRoleCreate) SetNillableRoleID ¶
func (urc *UserRoleCreate) SetNillableRoleID(i *int64) *UserRoleCreate
SetNillableRoleID sets the "role_id" field if the given value is not nil.
func (*UserRoleCreate) SetNillableUserID ¶
func (urc *UserRoleCreate) SetNillableUserID(i *int64) *UserRoleCreate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*UserRoleCreate) SetRoleID ¶
func (urc *UserRoleCreate) SetRoleID(i int64) *UserRoleCreate
SetRoleID sets the "role_id" field.
func (*UserRoleCreate) SetUserID ¶
func (urc *UserRoleCreate) SetUserID(i int64) *UserRoleCreate
SetUserID sets the "user_id" field.
type UserRoleCreateBulk ¶
type UserRoleCreateBulk struct {
// contains filtered or unexported fields
}
UserRoleCreateBulk is the builder for creating many UserRole entities in bulk.
func (*UserRoleCreateBulk) Exec ¶
func (urcb *UserRoleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserRoleCreateBulk) ExecX ¶
func (urcb *UserRoleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserRoleDelete ¶
type UserRoleDelete struct {
// contains filtered or unexported fields
}
UserRoleDelete is the builder for deleting a UserRole entity.
func (*UserRoleDelete) Exec ¶
func (urd *UserRoleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserRoleDelete) ExecX ¶
func (urd *UserRoleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserRoleDelete) Where ¶
func (urd *UserRoleDelete) Where(ps ...predicate.UserRole) *UserRoleDelete
Where appends a list predicates to the UserRoleDelete builder.
type UserRoleDeleteOne ¶
type UserRoleDeleteOne struct {
// contains filtered or unexported fields
}
UserRoleDeleteOne is the builder for deleting a single UserRole entity.
func (*UserRoleDeleteOne) Exec ¶
func (urdo *UserRoleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserRoleDeleteOne) ExecX ¶
func (urdo *UserRoleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserRoleGroupBy ¶
type UserRoleGroupBy struct {
// contains filtered or unexported fields
}
UserRoleGroupBy is the group-by builder for UserRole entities.
func (*UserRoleGroupBy) Aggregate ¶
func (urgb *UserRoleGroupBy) Aggregate(fns ...AggregateFunc) *UserRoleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserRoleGroupBy) Bool ¶
func (urgb *UserRoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) BoolX ¶
func (urgb *UserRoleGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserRoleGroupBy) Bools ¶
func (urgb *UserRoleGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) BoolsX ¶
func (urgb *UserRoleGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserRoleGroupBy) Float64 ¶
func (urgb *UserRoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) Float64X ¶
func (urgb *UserRoleGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserRoleGroupBy) Float64s ¶
func (urgb *UserRoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) Float64sX ¶
func (urgb *UserRoleGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserRoleGroupBy) Int ¶
func (urgb *UserRoleGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) IntX ¶
func (urgb *UserRoleGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserRoleGroupBy) Ints ¶
func (urgb *UserRoleGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) IntsX ¶
func (urgb *UserRoleGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserRoleGroupBy) Scan ¶
func (urgb *UserRoleGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserRoleGroupBy) ScanX ¶
func (urgb *UserRoleGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserRoleGroupBy) String ¶
func (urgb *UserRoleGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserRoleGroupBy) StringX ¶
func (urgb *UserRoleGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserRoleMutation ¶
type UserRoleMutation struct {
// contains filtered or unexported fields
}
UserRoleMutation represents an operation that mutates the UserRole nodes in the graph.
func (*UserRoleMutation) AddField ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) AddRoleID ¶
func (m *UserRoleMutation) AddRoleID(i int64)
AddRoleID adds i to the "role_id" field.
func (*UserRoleMutation) AddUserID ¶
func (m *UserRoleMutation) AddUserID(i int64)
AddUserID adds i to the "user_id" field.
func (*UserRoleMutation) AddedEdges ¶
func (m *UserRoleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserRoleMutation) AddedField ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) AddedFields ¶
func (m *UserRoleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserRoleMutation) AddedIDs ¶
func (m *UserRoleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserRoleMutation) AddedRoleID ¶
func (m *UserRoleMutation) AddedRoleID() (r int64, exists bool)
AddedRoleID returns the value that was added to the "role_id" field in this mutation.
func (*UserRoleMutation) AddedUserID ¶
func (m *UserRoleMutation) AddedUserID() (r int64, exists bool)
AddedUserID returns the value that was added to the "user_id" field in this mutation.
func (*UserRoleMutation) ClearEdge ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ClearField ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ClearedEdges ¶
func (m *UserRoleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserRoleMutation) ClearedFields ¶
func (m *UserRoleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserRoleMutation) Client ¶
func (m UserRoleMutation) 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 (*UserRoleMutation) EdgeCleared ¶
func (m *UserRoleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserRoleMutation) Field ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) FieldCleared ¶
func (m *UserRoleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserRoleMutation) Fields ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ID ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) IDs ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) 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 (*UserRoleMutation) OldRoleID ¶
func (m *UserRoleMutation) OldRoleID(ctx context.Context) (v int64, err error)
OldRoleID returns the old "role_id" field's value of the UserRole entity. If the UserRole 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 (*UserRoleMutation) OldUserID ¶
func (m *UserRoleMutation) OldUserID(ctx context.Context) (v int64, err error)
OldUserID returns the old "user_id" field's value of the UserRole entity. If the UserRole 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 (*UserRoleMutation) RemovedEdges ¶
func (m *UserRoleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserRoleMutation) RemovedIDs ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ResetEdge ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ResetField ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) ResetRoleID ¶
func (m *UserRoleMutation) ResetRoleID()
ResetRoleID resets all changes to the "role_id" field.
func (*UserRoleMutation) ResetUserID ¶
func (m *UserRoleMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*UserRoleMutation) RoleID ¶
func (m *UserRoleMutation) RoleID() (r int64, exists bool)
RoleID returns the value of the "role_id" field in the mutation.
func (*UserRoleMutation) SetField ¶
func (m *UserRoleMutation) 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 (*UserRoleMutation) SetRoleID ¶
func (m *UserRoleMutation) SetRoleID(i int64)
SetRoleID sets the "role_id" field.
func (*UserRoleMutation) SetUserID ¶
func (m *UserRoleMutation) SetUserID(i int64)
SetUserID sets the "user_id" field.
func (UserRoleMutation) Tx ¶
func (m UserRoleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserRoleMutation) Type ¶
func (m *UserRoleMutation) Type() string
Type returns the node type of this mutation (UserRole).
func (*UserRoleMutation) UserID ¶
func (m *UserRoleMutation) UserID() (r int64, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*UserRoleMutation) Where ¶
func (m *UserRoleMutation) Where(ps ...predicate.UserRole)
Where appends a list predicates to the UserRoleMutation builder.
type UserRoleQuery ¶
type UserRoleQuery struct {
// contains filtered or unexported fields
}
UserRoleQuery is the builder for querying UserRole entities.
func (*UserRoleQuery) All ¶
func (urq *UserRoleQuery) All(ctx context.Context) ([]*UserRole, error)
All executes the query and returns a list of UserRoles.
func (*UserRoleQuery) AllX ¶
func (urq *UserRoleQuery) AllX(ctx context.Context) []*UserRole
AllX is like All, but panics if an error occurs.
func (*UserRoleQuery) Clone ¶
func (urq *UserRoleQuery) Clone() *UserRoleQuery
Clone returns a duplicate of the UserRoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserRoleQuery) Count ¶
func (urq *UserRoleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserRoleQuery) CountX ¶
func (urq *UserRoleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserRoleQuery) Exist ¶
func (urq *UserRoleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserRoleQuery) ExistX ¶
func (urq *UserRoleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserRoleQuery) First ¶
func (urq *UserRoleQuery) First(ctx context.Context) (*UserRole, error)
First returns the first UserRole entity from the query. Returns a *NotFoundError when no UserRole was found.
func (*UserRoleQuery) FirstID ¶
func (urq *UserRoleQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first UserRole ID from the query. Returns a *NotFoundError when no UserRole ID was found.
func (*UserRoleQuery) FirstIDX ¶
func (urq *UserRoleQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserRoleQuery) FirstX ¶
func (urq *UserRoleQuery) FirstX(ctx context.Context) *UserRole
FirstX is like First, but panics if an error occurs.
func (*UserRoleQuery) GroupBy ¶
func (urq *UserRoleQuery) GroupBy(field string, fields ...string) *UserRoleGroupBy
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 { UserID int64 `json:"user_id,omitempty"` Count int `json:"count,omitempty"` } client.UserRole.Query(). GroupBy(userrole.FieldUserID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserRoleQuery) IDs ¶
func (urq *UserRoleQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of UserRole IDs.
func (*UserRoleQuery) IDsX ¶
func (urq *UserRoleQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*UserRoleQuery) Limit ¶
func (urq *UserRoleQuery) Limit(limit int) *UserRoleQuery
Limit adds a limit step to the query.
func (*UserRoleQuery) Offset ¶
func (urq *UserRoleQuery) Offset(offset int) *UserRoleQuery
Offset adds an offset step to the query.
func (*UserRoleQuery) Only ¶
func (urq *UserRoleQuery) Only(ctx context.Context) (*UserRole, error)
Only returns a single UserRole entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserRole entity is found. Returns a *NotFoundError when no UserRole entities are found.
func (*UserRoleQuery) OnlyID ¶
func (urq *UserRoleQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only UserRole ID in the query. Returns a *NotSingularError when more than one UserRole ID is found. Returns a *NotFoundError when no entities are found.
func (*UserRoleQuery) OnlyIDX ¶
func (urq *UserRoleQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserRoleQuery) OnlyX ¶
func (urq *UserRoleQuery) OnlyX(ctx context.Context) *UserRole
OnlyX is like Only, but panics if an error occurs.
func (*UserRoleQuery) Order ¶
func (urq *UserRoleQuery) Order(o ...OrderFunc) *UserRoleQuery
Order adds an order step to the query.
func (*UserRoleQuery) Select ¶
func (urq *UserRoleQuery) Select(fields ...string) *UserRoleSelect
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 { UserID int64 `json:"user_id,omitempty"` } client.UserRole.Query(). Select(userrole.FieldUserID). Scan(ctx, &v)
func (*UserRoleQuery) Unique ¶
func (urq *UserRoleQuery) Unique(unique bool) *UserRoleQuery
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 (*UserRoleQuery) Where ¶
func (urq *UserRoleQuery) Where(ps ...predicate.UserRole) *UserRoleQuery
Where adds a new predicate for the UserRoleQuery builder.
type UserRoleSelect ¶
type UserRoleSelect struct { *UserRoleQuery // contains filtered or unexported fields }
UserRoleSelect is the builder for selecting fields of UserRole entities.
func (*UserRoleSelect) Bool ¶
func (urs *UserRoleSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) BoolX ¶
func (urs *UserRoleSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserRoleSelect) Bools ¶
func (urs *UserRoleSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) BoolsX ¶
func (urs *UserRoleSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserRoleSelect) Float64 ¶
func (urs *UserRoleSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) Float64X ¶
func (urs *UserRoleSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserRoleSelect) Float64s ¶
func (urs *UserRoleSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) Float64sX ¶
func (urs *UserRoleSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserRoleSelect) Int ¶
func (urs *UserRoleSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) IntX ¶
func (urs *UserRoleSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserRoleSelect) Ints ¶
func (urs *UserRoleSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) IntsX ¶
func (urs *UserRoleSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserRoleSelect) Scan ¶
func (urs *UserRoleSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserRoleSelect) ScanX ¶
func (urs *UserRoleSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserRoleSelect) String ¶
func (urs *UserRoleSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserRoleSelect) StringX ¶
func (urs *UserRoleSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserRoleUpdate ¶
type UserRoleUpdate struct {
// contains filtered or unexported fields
}
UserRoleUpdate is the builder for updating UserRole entities.
func (*UserRoleUpdate) AddRoleID ¶
func (uru *UserRoleUpdate) AddRoleID(i int64) *UserRoleUpdate
AddRoleID adds i to the "role_id" field.
func (*UserRoleUpdate) AddUserID ¶
func (uru *UserRoleUpdate) AddUserID(i int64) *UserRoleUpdate
AddUserID adds i to the "user_id" field.
func (*UserRoleUpdate) Exec ¶
func (uru *UserRoleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserRoleUpdate) ExecX ¶
func (uru *UserRoleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserRoleUpdate) Mutation ¶
func (uru *UserRoleUpdate) Mutation() *UserRoleMutation
Mutation returns the UserRoleMutation object of the builder.
func (*UserRoleUpdate) Save ¶
func (uru *UserRoleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserRoleUpdate) SaveX ¶
func (uru *UserRoleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserRoleUpdate) SetNillableRoleID ¶
func (uru *UserRoleUpdate) SetNillableRoleID(i *int64) *UserRoleUpdate
SetNillableRoleID sets the "role_id" field if the given value is not nil.
func (*UserRoleUpdate) SetNillableUserID ¶
func (uru *UserRoleUpdate) SetNillableUserID(i *int64) *UserRoleUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*UserRoleUpdate) SetRoleID ¶
func (uru *UserRoleUpdate) SetRoleID(i int64) *UserRoleUpdate
SetRoleID sets the "role_id" field.
func (*UserRoleUpdate) SetUserID ¶
func (uru *UserRoleUpdate) SetUserID(i int64) *UserRoleUpdate
SetUserID sets the "user_id" field.
func (*UserRoleUpdate) Where ¶
func (uru *UserRoleUpdate) Where(ps ...predicate.UserRole) *UserRoleUpdate
Where appends a list predicates to the UserRoleUpdate builder.
type UserRoleUpdateOne ¶
type UserRoleUpdateOne struct {
// contains filtered or unexported fields
}
UserRoleUpdateOne is the builder for updating a single UserRole entity.
func (*UserRoleUpdateOne) AddRoleID ¶
func (uruo *UserRoleUpdateOne) AddRoleID(i int64) *UserRoleUpdateOne
AddRoleID adds i to the "role_id" field.
func (*UserRoleUpdateOne) AddUserID ¶
func (uruo *UserRoleUpdateOne) AddUserID(i int64) *UserRoleUpdateOne
AddUserID adds i to the "user_id" field.
func (*UserRoleUpdateOne) Exec ¶
func (uruo *UserRoleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserRoleUpdateOne) ExecX ¶
func (uruo *UserRoleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserRoleUpdateOne) Mutation ¶
func (uruo *UserRoleUpdateOne) Mutation() *UserRoleMutation
Mutation returns the UserRoleMutation object of the builder.
func (*UserRoleUpdateOne) Save ¶
func (uruo *UserRoleUpdateOne) Save(ctx context.Context) (*UserRole, error)
Save executes the query and returns the updated UserRole entity.
func (*UserRoleUpdateOne) SaveX ¶
func (uruo *UserRoleUpdateOne) SaveX(ctx context.Context) *UserRole
SaveX is like Save, but panics if an error occurs.
func (*UserRoleUpdateOne) Select ¶
func (uruo *UserRoleUpdateOne) Select(field string, fields ...string) *UserRoleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserRoleUpdateOne) SetNillableRoleID ¶
func (uruo *UserRoleUpdateOne) SetNillableRoleID(i *int64) *UserRoleUpdateOne
SetNillableRoleID sets the "role_id" field if the given value is not nil.
func (*UserRoleUpdateOne) SetNillableUserID ¶
func (uruo *UserRoleUpdateOne) SetNillableUserID(i *int64) *UserRoleUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*UserRoleUpdateOne) SetRoleID ¶
func (uruo *UserRoleUpdateOne) SetRoleID(i int64) *UserRoleUpdateOne
SetRoleID sets the "role_id" field.
func (*UserRoleUpdateOne) SetUserID ¶
func (uruo *UserRoleUpdateOne) SetUserID(i int64) *UserRoleUpdateOne
SetUserID sets the "user_id" field.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) ScanX ¶
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddCreatedBy ¶
func (uu *UserUpdate) AddCreatedBy(i int64) *UserUpdate
AddCreatedBy adds i to the "created_by" field.
func (*UserUpdate) AddRoleIDs ¶
func (uu *UserUpdate) AddRoleIDs(ids ...int64) *UserUpdate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserUpdate) AddRoles ¶
func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate
AddRoles adds the "roles" edges to the Role entity.
func (*UserUpdate) AddUID ¶
func (uu *UserUpdate) AddUID(i int64) *UserUpdate
AddUID adds i to the "uid" field.
func (*UserUpdate) AddUpdatedBy ¶
func (uu *UserUpdate) AddUpdatedBy(i int64) *UserUpdate
AddUpdatedBy adds i to the "updated_by" field.
func (*UserUpdate) ClearRoles ¶
func (uu *UserUpdate) ClearRoles() *UserUpdate
ClearRoles clears all "roles" edges to the Role 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) RemoveRoleIDs ¶
func (uu *UserUpdate) RemoveRoleIDs(ids ...int64) *UserUpdate
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*UserUpdate) RemoveRoles ¶
func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate
RemoveRoles removes "roles" edges to Role entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAvatar ¶
func (uu *UserUpdate) SetAvatar(s string) *UserUpdate
SetAvatar sets the "avatar" field.
func (*UserUpdate) SetCreatedAt ¶
func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
SetCreatedAt sets the "created_at" field.
func (*UserUpdate) SetCreatedBy ¶
func (uu *UserUpdate) SetCreatedBy(i int64) *UserUpdate
SetCreatedBy sets the "created_by" field.
func (*UserUpdate) SetGender ¶
func (uu *UserUpdate) SetGender(u user.Gender) *UserUpdate
SetGender sets the "gender" field.
func (*UserUpdate) SetNickname ¶
func (uu *UserUpdate) SetNickname(s string) *UserUpdate
SetNickname sets the "nickname" field.
func (*UserUpdate) SetNillableAvatar ¶
func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserUpdate) SetNillableCreatedAt ¶
func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdate) SetNillableCreatedBy ¶
func (uu *UserUpdate) SetNillableCreatedBy(i *int64) *UserUpdate
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*UserUpdate) SetNillableGender ¶
func (uu *UserUpdate) SetNillableGender(u *user.Gender) *UserUpdate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserUpdate) SetNillableNickname ¶
func (uu *UserUpdate) SetNillableNickname(s *string) *UserUpdate
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*UserUpdate) SetNillableRemark ¶
func (uu *UserUpdate) SetNillableRemark(s *string) *UserUpdate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*UserUpdate) SetNillableUID ¶
func (uu *UserUpdate) SetNillableUID(i *int64) *UserUpdate
SetNillableUID sets the "uid" field if the given value is not nil.
func (*UserUpdate) SetNillableUpdatedBy ¶
func (uu *UserUpdate) SetNillableUpdatedBy(i *int64) *UserUpdate
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*UserUpdate) SetRemark ¶
func (uu *UserUpdate) SetRemark(s string) *UserUpdate
SetRemark sets the "remark" field.
func (*UserUpdate) SetUID ¶
func (uu *UserUpdate) SetUID(i int64) *UserUpdate
SetUID sets the "uid" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) SetUpdatedBy ¶
func (uu *UserUpdate) SetUpdatedBy(i int64) *UserUpdate
SetUpdatedBy sets the "updated_by" 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) AddCreatedBy ¶
func (uuo *UserUpdateOne) AddCreatedBy(i int64) *UserUpdateOne
AddCreatedBy adds i to the "created_by" field.
func (*UserUpdateOne) AddRoleIDs ¶
func (uuo *UserUpdateOne) AddRoleIDs(ids ...int64) *UserUpdateOne
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserUpdateOne) AddRoles ¶
func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne
AddRoles adds the "roles" edges to the Role entity.
func (*UserUpdateOne) AddUID ¶
func (uuo *UserUpdateOne) AddUID(i int64) *UserUpdateOne
AddUID adds i to the "uid" field.
func (*UserUpdateOne) AddUpdatedBy ¶
func (uuo *UserUpdateOne) AddUpdatedBy(i int64) *UserUpdateOne
AddUpdatedBy adds i to the "updated_by" field.
func (*UserUpdateOne) ClearRoles ¶
func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne
ClearRoles clears all "roles" edges to the Role 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) RemoveRoleIDs ¶
func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int64) *UserUpdateOne
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*UserUpdateOne) RemoveRoles ¶
func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne
RemoveRoles removes "roles" edges to Role entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAvatar ¶
func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne
SetAvatar sets the "avatar" field.
func (*UserUpdateOne) SetCreatedAt ¶
func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
SetCreatedAt sets the "created_at" field.
func (*UserUpdateOne) SetCreatedBy ¶
func (uuo *UserUpdateOne) SetCreatedBy(i int64) *UserUpdateOne
SetCreatedBy sets the "created_by" field.
func (*UserUpdateOne) SetGender ¶
func (uuo *UserUpdateOne) SetGender(u user.Gender) *UserUpdateOne
SetGender sets the "gender" field.
func (*UserUpdateOne) SetNickname ¶
func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne
SetNickname sets the "nickname" field.
func (*UserUpdateOne) SetNillableAvatar ¶
func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserUpdateOne) SetNillableCreatedAt ¶
func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdateOne) SetNillableCreatedBy ¶
func (uuo *UserUpdateOne) SetNillableCreatedBy(i *int64) *UserUpdateOne
SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (*UserUpdateOne) SetNillableGender ¶
func (uuo *UserUpdateOne) SetNillableGender(u *user.Gender) *UserUpdateOne
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserUpdateOne) SetNillableNickname ¶
func (uuo *UserUpdateOne) SetNillableNickname(s *string) *UserUpdateOne
SetNillableNickname sets the "nickname" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRemark ¶
func (uuo *UserUpdateOne) SetNillableRemark(s *string) *UserUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUID ¶
func (uuo *UserUpdateOne) SetNillableUID(i *int64) *UserUpdateOne
SetNillableUID sets the "uid" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUpdatedBy ¶
func (uuo *UserUpdateOne) SetNillableUpdatedBy(i *int64) *UserUpdateOne
SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (*UserUpdateOne) SetRemark ¶
func (uuo *UserUpdateOne) SetRemark(s string) *UserUpdateOne
SetRemark sets the "remark" field.
func (*UserUpdateOne) SetUID ¶
func (uuo *UserUpdateOne) SetUID(i int64) *UserUpdateOne
SetUID sets the "uid" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) SetUpdatedBy ¶
func (uuo *UserUpdateOne) SetUpdatedBy(i int64) *UserUpdateOne
SetUpdatedBy sets the "updated_by" 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.
Source Files ¶
- api.go
- api_create.go
- api_delete.go
- api_query.go
- api_update.go
- client.go
- config.go
- context.go
- dictdata.go
- dictdata_create.go
- dictdata_delete.go
- dictdata_query.go
- dictdata_update.go
- dicttype.go
- dicttype_create.go
- dicttype_delete.go
- dicttype_query.go
- dicttype_update.go
- ent.go
- mutation.go
- permission.go
- permission_create.go
- permission_delete.go
- permission_query.go
- permission_update.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- runtime.go
- staff.go
- staff_create.go
- staff_delete.go
- staff_query.go
- staff_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go
- userrole.go
- userrole_create.go
- userrole_delete.go
- userrole_query.go
- userrole_update.go