Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Authorization
- type AuthorizationClient
- func (c *AuthorizationClient) Create() *AuthorizationCreate
- func (c *AuthorizationClient) CreateBulk(builders ...*AuthorizationCreate) *AuthorizationCreateBulk
- func (c *AuthorizationClient) Delete() *AuthorizationDelete
- func (c *AuthorizationClient) DeleteOne(a *Authorization) *AuthorizationDeleteOne
- func (c *AuthorizationClient) DeleteOneID(id int) *AuthorizationDeleteOne
- func (c *AuthorizationClient) Get(ctx context.Context, id int) (*Authorization, error)
- func (c *AuthorizationClient) GetX(ctx context.Context, id int) *Authorization
- func (c *AuthorizationClient) Hooks() []Hook
- func (c *AuthorizationClient) Intercept(interceptors ...Interceptor)
- func (c *AuthorizationClient) Interceptors() []Interceptor
- func (c *AuthorizationClient) Query() *AuthorizationQuery
- func (c *AuthorizationClient) QueryResource(a *Authorization) *ResourceQuery
- func (c *AuthorizationClient) Update() *AuthorizationUpdate
- func (c *AuthorizationClient) UpdateOne(a *Authorization) *AuthorizationUpdateOne
- func (c *AuthorizationClient) UpdateOneID(id int) *AuthorizationUpdateOne
- func (c *AuthorizationClient) Use(hooks ...Hook)
- type AuthorizationCreate
- func (ac *AuthorizationCreate) AddResource(r ...*Resource) *AuthorizationCreate
- func (ac *AuthorizationCreate) AddResourceIDs(ids ...int) *AuthorizationCreate
- func (ac *AuthorizationCreate) Exec(ctx context.Context) error
- func (ac *AuthorizationCreate) ExecX(ctx context.Context)
- func (ac *AuthorizationCreate) Mutation() *AuthorizationMutation
- func (ac *AuthorizationCreate) Save(ctx context.Context) (*Authorization, error)
- func (ac *AuthorizationCreate) SaveX(ctx context.Context) *Authorization
- func (ac *AuthorizationCreate) SetClientID(s string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetClientName(s string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetClientSecret(s string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetDomain(s string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetGrantType(s []string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetRedirectURL(s string) *AuthorizationCreate
- func (ac *AuthorizationCreate) SetScope(s []string) *AuthorizationCreate
- type AuthorizationCreateBulk
- type AuthorizationDelete
- type AuthorizationDeleteOne
- type AuthorizationEdges
- type AuthorizationGroupBy
- func (agb *AuthorizationGroupBy) Aggregate(fns ...AggregateFunc) *AuthorizationGroupBy
- func (s *AuthorizationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AuthorizationGroupBy) BoolX(ctx context.Context) bool
- func (s *AuthorizationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AuthorizationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AuthorizationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AuthorizationGroupBy) Float64X(ctx context.Context) float64
- func (s *AuthorizationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AuthorizationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AuthorizationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AuthorizationGroupBy) IntX(ctx context.Context) int
- func (s *AuthorizationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AuthorizationGroupBy) IntsX(ctx context.Context) []int
- func (agb *AuthorizationGroupBy) Scan(ctx context.Context, v any) error
- func (s *AuthorizationGroupBy) ScanX(ctx context.Context, v any)
- func (s *AuthorizationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AuthorizationGroupBy) StringX(ctx context.Context) string
- func (s *AuthorizationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AuthorizationGroupBy) StringsX(ctx context.Context) []string
- type AuthorizationMutation
- func (m *AuthorizationMutation) AddField(name string, value ent.Value) error
- func (m *AuthorizationMutation) AddResourceIDs(ids ...int)
- func (m *AuthorizationMutation) AddedEdges() []string
- func (m *AuthorizationMutation) AddedField(name string) (ent.Value, bool)
- func (m *AuthorizationMutation) AddedFields() []string
- func (m *AuthorizationMutation) AddedIDs(name string) []ent.Value
- func (m *AuthorizationMutation) AppendGrantType(s []string)
- func (m *AuthorizationMutation) AppendScope(s []string)
- func (m *AuthorizationMutation) AppendedGrantType() ([]string, bool)
- func (m *AuthorizationMutation) AppendedScope() ([]string, bool)
- func (m *AuthorizationMutation) ClearEdge(name string) error
- func (m *AuthorizationMutation) ClearField(name string) error
- func (m *AuthorizationMutation) ClearResource()
- func (m *AuthorizationMutation) ClearedEdges() []string
- func (m *AuthorizationMutation) ClearedFields() []string
- func (m AuthorizationMutation) Client() *Client
- func (m *AuthorizationMutation) ClientID() (r string, exists bool)
- func (m *AuthorizationMutation) ClientName() (r string, exists bool)
- func (m *AuthorizationMutation) ClientSecret() (r string, exists bool)
- func (m *AuthorizationMutation) Domain() (r string, exists bool)
- func (m *AuthorizationMutation) EdgeCleared(name string) bool
- func (m *AuthorizationMutation) Field(name string) (ent.Value, bool)
- func (m *AuthorizationMutation) FieldCleared(name string) bool
- func (m *AuthorizationMutation) Fields() []string
- func (m *AuthorizationMutation) GrantType() (r []string, exists bool)
- func (m *AuthorizationMutation) ID() (id int, exists bool)
- func (m *AuthorizationMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AuthorizationMutation) OldClientID(ctx context.Context) (v string, err error)
- func (m *AuthorizationMutation) OldClientName(ctx context.Context) (v string, err error)
- func (m *AuthorizationMutation) OldClientSecret(ctx context.Context) (v string, err error)
- func (m *AuthorizationMutation) OldDomain(ctx context.Context) (v string, err error)
- func (m *AuthorizationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AuthorizationMutation) OldGrantType(ctx context.Context) (v []string, err error)
- func (m *AuthorizationMutation) OldRedirectURL(ctx context.Context) (v string, err error)
- func (m *AuthorizationMutation) OldScope(ctx context.Context) (v []string, err error)
- func (m *AuthorizationMutation) Op() Op
- func (m *AuthorizationMutation) RedirectURL() (r string, exists bool)
- func (m *AuthorizationMutation) RemoveResourceIDs(ids ...int)
- func (m *AuthorizationMutation) RemovedEdges() []string
- func (m *AuthorizationMutation) RemovedIDs(name string) []ent.Value
- func (m *AuthorizationMutation) RemovedResourceIDs() (ids []int)
- func (m *AuthorizationMutation) ResetClientID()
- func (m *AuthorizationMutation) ResetClientName()
- func (m *AuthorizationMutation) ResetClientSecret()
- func (m *AuthorizationMutation) ResetDomain()
- func (m *AuthorizationMutation) ResetEdge(name string) error
- func (m *AuthorizationMutation) ResetField(name string) error
- func (m *AuthorizationMutation) ResetGrantType()
- func (m *AuthorizationMutation) ResetRedirectURL()
- func (m *AuthorizationMutation) ResetResource()
- func (m *AuthorizationMutation) ResetScope()
- func (m *AuthorizationMutation) ResourceCleared() bool
- func (m *AuthorizationMutation) ResourceIDs() (ids []int)
- func (m *AuthorizationMutation) Scope() (r []string, exists bool)
- func (m *AuthorizationMutation) SetClientID(s string)
- func (m *AuthorizationMutation) SetClientName(s string)
- func (m *AuthorizationMutation) SetClientSecret(s string)
- func (m *AuthorizationMutation) SetDomain(s string)
- func (m *AuthorizationMutation) SetField(name string, value ent.Value) error
- func (m *AuthorizationMutation) SetGrantType(s []string)
- func (m *AuthorizationMutation) SetOp(op Op)
- func (m *AuthorizationMutation) SetRedirectURL(s string)
- func (m *AuthorizationMutation) SetScope(s []string)
- func (m AuthorizationMutation) Tx() (*Tx, error)
- func (m *AuthorizationMutation) Type() string
- func (m *AuthorizationMutation) Where(ps ...predicate.Authorization)
- func (m *AuthorizationMutation) WhereP(ps ...func(*sql.Selector))
- type AuthorizationQuery
- func (aq *AuthorizationQuery) Aggregate(fns ...AggregateFunc) *AuthorizationSelect
- func (aq *AuthorizationQuery) All(ctx context.Context) ([]*Authorization, error)
- func (aq *AuthorizationQuery) AllX(ctx context.Context) []*Authorization
- func (aq *AuthorizationQuery) Clone() *AuthorizationQuery
- func (aq *AuthorizationQuery) Count(ctx context.Context) (int, error)
- func (aq *AuthorizationQuery) CountX(ctx context.Context) int
- func (aq *AuthorizationQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AuthorizationQuery) ExistX(ctx context.Context) bool
- func (aq *AuthorizationQuery) First(ctx context.Context) (*Authorization, error)
- func (aq *AuthorizationQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AuthorizationQuery) FirstIDX(ctx context.Context) int
- func (aq *AuthorizationQuery) FirstX(ctx context.Context) *Authorization
- func (aq *AuthorizationQuery) GroupBy(field string, fields ...string) *AuthorizationGroupBy
- func (aq *AuthorizationQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AuthorizationQuery) IDsX(ctx context.Context) []int
- func (aq *AuthorizationQuery) Limit(limit int) *AuthorizationQuery
- func (aq *AuthorizationQuery) Offset(offset int) *AuthorizationQuery
- func (aq *AuthorizationQuery) Only(ctx context.Context) (*Authorization, error)
- func (aq *AuthorizationQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AuthorizationQuery) OnlyIDX(ctx context.Context) int
- func (aq *AuthorizationQuery) OnlyX(ctx context.Context) *Authorization
- func (aq *AuthorizationQuery) Order(o ...OrderFunc) *AuthorizationQuery
- func (aq *AuthorizationQuery) QueryResource() *ResourceQuery
- func (aq *AuthorizationQuery) Select(fields ...string) *AuthorizationSelect
- func (aq *AuthorizationQuery) Unique(unique bool) *AuthorizationQuery
- func (aq *AuthorizationQuery) Where(ps ...predicate.Authorization) *AuthorizationQuery
- func (aq *AuthorizationQuery) WithResource(opts ...func(*ResourceQuery)) *AuthorizationQuery
- type AuthorizationSelect
- func (as *AuthorizationSelect) Aggregate(fns ...AggregateFunc) *AuthorizationSelect
- func (s *AuthorizationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AuthorizationSelect) BoolX(ctx context.Context) bool
- func (s *AuthorizationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AuthorizationSelect) BoolsX(ctx context.Context) []bool
- func (s *AuthorizationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AuthorizationSelect) Float64X(ctx context.Context) float64
- func (s *AuthorizationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AuthorizationSelect) Float64sX(ctx context.Context) []float64
- func (s *AuthorizationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AuthorizationSelect) IntX(ctx context.Context) int
- func (s *AuthorizationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AuthorizationSelect) IntsX(ctx context.Context) []int
- func (as *AuthorizationSelect) Scan(ctx context.Context, v any) error
- func (s *AuthorizationSelect) ScanX(ctx context.Context, v any)
- func (s *AuthorizationSelect) String(ctx context.Context) (_ string, err error)
- func (s *AuthorizationSelect) StringX(ctx context.Context) string
- func (s *AuthorizationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AuthorizationSelect) StringsX(ctx context.Context) []string
- type AuthorizationUpdate
- func (au *AuthorizationUpdate) AddResource(r ...*Resource) *AuthorizationUpdate
- func (au *AuthorizationUpdate) AddResourceIDs(ids ...int) *AuthorizationUpdate
- func (au *AuthorizationUpdate) AppendGrantType(s []string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) AppendScope(s []string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) ClearResource() *AuthorizationUpdate
- func (au *AuthorizationUpdate) Exec(ctx context.Context) error
- func (au *AuthorizationUpdate) ExecX(ctx context.Context)
- func (au *AuthorizationUpdate) Mutation() *AuthorizationMutation
- func (au *AuthorizationUpdate) RemoveResource(r ...*Resource) *AuthorizationUpdate
- func (au *AuthorizationUpdate) RemoveResourceIDs(ids ...int) *AuthorizationUpdate
- func (au *AuthorizationUpdate) Save(ctx context.Context) (int, error)
- func (au *AuthorizationUpdate) SaveX(ctx context.Context) int
- func (au *AuthorizationUpdate) SetClientID(s string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetClientName(s string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetClientSecret(s string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetDomain(s string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetGrantType(s []string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetRedirectURL(s string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) SetScope(s []string) *AuthorizationUpdate
- func (au *AuthorizationUpdate) Where(ps ...predicate.Authorization) *AuthorizationUpdate
- type AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) AddResource(r ...*Resource) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) AddResourceIDs(ids ...int) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) AppendGrantType(s []string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) AppendScope(s []string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) ClearResource() *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) Exec(ctx context.Context) error
- func (auo *AuthorizationUpdateOne) ExecX(ctx context.Context)
- func (auo *AuthorizationUpdateOne) Mutation() *AuthorizationMutation
- func (auo *AuthorizationUpdateOne) RemoveResource(r ...*Resource) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) RemoveResourceIDs(ids ...int) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) Save(ctx context.Context) (*Authorization, error)
- func (auo *AuthorizationUpdateOne) SaveX(ctx context.Context) *Authorization
- func (auo *AuthorizationUpdateOne) Select(field string, fields ...string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetClientID(s string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetClientName(s string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetClientSecret(s string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetDomain(s string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetGrantType(s []string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetRedirectURL(s string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) SetScope(s []string) *AuthorizationUpdateOne
- func (auo *AuthorizationUpdateOne) Where(ps ...predicate.Authorization) *AuthorizationUpdateOne
- type Authorizations
- type Campus
- type CampusClient
- func (c *CampusClient) Create() *CampusCreate
- func (c *CampusClient) CreateBulk(builders ...*CampusCreate) *CampusCreateBulk
- func (c *CampusClient) Delete() *CampusDelete
- func (c *CampusClient) DeleteOne(ca *Campus) *CampusDeleteOne
- func (c *CampusClient) DeleteOneID(id int) *CampusDeleteOne
- func (c *CampusClient) Get(ctx context.Context, id int) (*Campus, error)
- func (c *CampusClient) GetX(ctx context.Context, id int) *Campus
- func (c *CampusClient) Hooks() []Hook
- func (c *CampusClient) Intercept(interceptors ...Interceptor)
- func (c *CampusClient) Interceptors() []Interceptor
- func (c *CampusClient) Query() *CampusQuery
- func (c *CampusClient) QueryClass(ca *Campus) *ClassQuery
- func (c *CampusClient) Update() *CampusUpdate
- func (c *CampusClient) UpdateOne(ca *Campus) *CampusUpdateOne
- func (c *CampusClient) UpdateOneID(id int) *CampusUpdateOne
- func (c *CampusClient) Use(hooks ...Hook)
- type CampusCreate
- func (cc *CampusCreate) Exec(ctx context.Context) error
- func (cc *CampusCreate) ExecX(ctx context.Context)
- func (cc *CampusCreate) Mutation() *CampusMutation
- func (cc *CampusCreate) Save(ctx context.Context) (*Campus, error)
- func (cc *CampusCreate) SaveX(ctx context.Context) *Campus
- func (cc *CampusCreate) SetAddress(s string) *CampusCreate
- func (cc *CampusCreate) SetClass(c *Class) *CampusCreate
- func (cc *CampusCreate) SetClassID(id int) *CampusCreate
- func (cc *CampusCreate) SetName(s string) *CampusCreate
- func (cc *CampusCreate) SetNillableClassID(id *int) *CampusCreate
- type CampusCreateBulk
- type CampusDelete
- type CampusDeleteOne
- type CampusEdges
- type CampusGroupBy
- func (cgb *CampusGroupBy) Aggregate(fns ...AggregateFunc) *CampusGroupBy
- func (s *CampusGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CampusGroupBy) BoolX(ctx context.Context) bool
- func (s *CampusGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CampusGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CampusGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CampusGroupBy) Float64X(ctx context.Context) float64
- func (s *CampusGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CampusGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CampusGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CampusGroupBy) IntX(ctx context.Context) int
- func (s *CampusGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CampusGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CampusGroupBy) Scan(ctx context.Context, v any) error
- func (s *CampusGroupBy) ScanX(ctx context.Context, v any)
- func (s *CampusGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CampusGroupBy) StringX(ctx context.Context) string
- func (s *CampusGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CampusGroupBy) StringsX(ctx context.Context) []string
- type CampusMutation
- func (m *CampusMutation) AddField(name string, value ent.Value) error
- func (m *CampusMutation) AddedEdges() []string
- func (m *CampusMutation) AddedField(name string) (ent.Value, bool)
- func (m *CampusMutation) AddedFields() []string
- func (m *CampusMutation) AddedIDs(name string) []ent.Value
- func (m *CampusMutation) Address() (r string, exists bool)
- func (m *CampusMutation) ClassCleared() bool
- func (m *CampusMutation) ClassID() (id int, exists bool)
- func (m *CampusMutation) ClassIDs() (ids []int)
- func (m *CampusMutation) ClearClass()
- func (m *CampusMutation) ClearEdge(name string) error
- func (m *CampusMutation) ClearField(name string) error
- func (m *CampusMutation) ClearedEdges() []string
- func (m *CampusMutation) ClearedFields() []string
- func (m CampusMutation) Client() *Client
- func (m *CampusMutation) EdgeCleared(name string) bool
- func (m *CampusMutation) Field(name string) (ent.Value, bool)
- func (m *CampusMutation) FieldCleared(name string) bool
- func (m *CampusMutation) Fields() []string
- func (m *CampusMutation) ID() (id int, exists bool)
- func (m *CampusMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CampusMutation) Name() (r string, exists bool)
- func (m *CampusMutation) OldAddress(ctx context.Context) (v string, err error)
- func (m *CampusMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CampusMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CampusMutation) Op() Op
- func (m *CampusMutation) RemovedEdges() []string
- func (m *CampusMutation) RemovedIDs(name string) []ent.Value
- func (m *CampusMutation) ResetAddress()
- func (m *CampusMutation) ResetClass()
- func (m *CampusMutation) ResetEdge(name string) error
- func (m *CampusMutation) ResetField(name string) error
- func (m *CampusMutation) ResetName()
- func (m *CampusMutation) SetAddress(s string)
- func (m *CampusMutation) SetClassID(id int)
- func (m *CampusMutation) SetField(name string, value ent.Value) error
- func (m *CampusMutation) SetName(s string)
- func (m *CampusMutation) SetOp(op Op)
- func (m CampusMutation) Tx() (*Tx, error)
- func (m *CampusMutation) Type() string
- func (m *CampusMutation) Where(ps ...predicate.Campus)
- func (m *CampusMutation) WhereP(ps ...func(*sql.Selector))
- type CampusQuery
- func (cq *CampusQuery) Aggregate(fns ...AggregateFunc) *CampusSelect
- func (cq *CampusQuery) All(ctx context.Context) ([]*Campus, error)
- func (cq *CampusQuery) AllX(ctx context.Context) []*Campus
- func (cq *CampusQuery) Clone() *CampusQuery
- func (cq *CampusQuery) Count(ctx context.Context) (int, error)
- func (cq *CampusQuery) CountX(ctx context.Context) int
- func (cq *CampusQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CampusQuery) ExistX(ctx context.Context) bool
- func (cq *CampusQuery) First(ctx context.Context) (*Campus, error)
- func (cq *CampusQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CampusQuery) FirstIDX(ctx context.Context) int
- func (cq *CampusQuery) FirstX(ctx context.Context) *Campus
- func (cq *CampusQuery) GroupBy(field string, fields ...string) *CampusGroupBy
- func (cq *CampusQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CampusQuery) IDsX(ctx context.Context) []int
- func (cq *CampusQuery) Limit(limit int) *CampusQuery
- func (cq *CampusQuery) Offset(offset int) *CampusQuery
- func (cq *CampusQuery) Only(ctx context.Context) (*Campus, error)
- func (cq *CampusQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CampusQuery) OnlyIDX(ctx context.Context) int
- func (cq *CampusQuery) OnlyX(ctx context.Context) *Campus
- func (cq *CampusQuery) Order(o ...OrderFunc) *CampusQuery
- func (cq *CampusQuery) QueryClass() *ClassQuery
- func (cq *CampusQuery) Select(fields ...string) *CampusSelect
- func (cq *CampusQuery) Unique(unique bool) *CampusQuery
- func (cq *CampusQuery) Where(ps ...predicate.Campus) *CampusQuery
- func (cq *CampusQuery) WithClass(opts ...func(*ClassQuery)) *CampusQuery
- type CampusSelect
- func (cs *CampusSelect) Aggregate(fns ...AggregateFunc) *CampusSelect
- func (s *CampusSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CampusSelect) BoolX(ctx context.Context) bool
- func (s *CampusSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CampusSelect) BoolsX(ctx context.Context) []bool
- func (s *CampusSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CampusSelect) Float64X(ctx context.Context) float64
- func (s *CampusSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CampusSelect) Float64sX(ctx context.Context) []float64
- func (s *CampusSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CampusSelect) IntX(ctx context.Context) int
- func (s *CampusSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CampusSelect) IntsX(ctx context.Context) []int
- func (cs *CampusSelect) Scan(ctx context.Context, v any) error
- func (s *CampusSelect) ScanX(ctx context.Context, v any)
- func (s *CampusSelect) String(ctx context.Context) (_ string, err error)
- func (s *CampusSelect) StringX(ctx context.Context) string
- func (s *CampusSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CampusSelect) StringsX(ctx context.Context) []string
- type CampusSlice
- type CampusUpdate
- func (cu *CampusUpdate) ClearClass() *CampusUpdate
- func (cu *CampusUpdate) Exec(ctx context.Context) error
- func (cu *CampusUpdate) ExecX(ctx context.Context)
- func (cu *CampusUpdate) Mutation() *CampusMutation
- func (cu *CampusUpdate) Save(ctx context.Context) (int, error)
- func (cu *CampusUpdate) SaveX(ctx context.Context) int
- func (cu *CampusUpdate) SetAddress(s string) *CampusUpdate
- func (cu *CampusUpdate) SetClass(c *Class) *CampusUpdate
- func (cu *CampusUpdate) SetClassID(id int) *CampusUpdate
- func (cu *CampusUpdate) SetName(s string) *CampusUpdate
- func (cu *CampusUpdate) SetNillableClassID(id *int) *CampusUpdate
- func (cu *CampusUpdate) Where(ps ...predicate.Campus) *CampusUpdate
- type CampusUpdateOne
- func (cuo *CampusUpdateOne) ClearClass() *CampusUpdateOne
- func (cuo *CampusUpdateOne) Exec(ctx context.Context) error
- func (cuo *CampusUpdateOne) ExecX(ctx context.Context)
- func (cuo *CampusUpdateOne) Mutation() *CampusMutation
- func (cuo *CampusUpdateOne) Save(ctx context.Context) (*Campus, error)
- func (cuo *CampusUpdateOne) SaveX(ctx context.Context) *Campus
- func (cuo *CampusUpdateOne) Select(field string, fields ...string) *CampusUpdateOne
- func (cuo *CampusUpdateOne) SetAddress(s string) *CampusUpdateOne
- func (cuo *CampusUpdateOne) SetClass(c *Class) *CampusUpdateOne
- func (cuo *CampusUpdateOne) SetClassID(id int) *CampusUpdateOne
- func (cuo *CampusUpdateOne) SetName(s string) *CampusUpdateOne
- func (cuo *CampusUpdateOne) SetNillableClassID(id *int) *CampusUpdateOne
- func (cuo *CampusUpdateOne) Where(ps ...predicate.Campus) *CampusUpdateOne
- type Certificate
- type CertificateClient
- func (c *CertificateClient) Create() *CertificateCreate
- func (c *CertificateClient) CreateBulk(builders ...*CertificateCreate) *CertificateCreateBulk
- func (c *CertificateClient) Delete() *CertificateDelete
- func (c *CertificateClient) DeleteOne(ce *Certificate) *CertificateDeleteOne
- func (c *CertificateClient) DeleteOneID(id int) *CertificateDeleteOne
- func (c *CertificateClient) Get(ctx context.Context, id int) (*Certificate, error)
- func (c *CertificateClient) GetX(ctx context.Context, id int) *Certificate
- func (c *CertificateClient) Hooks() []Hook
- func (c *CertificateClient) Intercept(interceptors ...Interceptor)
- func (c *CertificateClient) Interceptors() []Interceptor
- func (c *CertificateClient) Query() *CertificateQuery
- func (c *CertificateClient) QueryStudent(ce *Certificate) *StudentQuery
- func (c *CertificateClient) Update() *CertificateUpdate
- func (c *CertificateClient) UpdateOne(ce *Certificate) *CertificateUpdateOne
- func (c *CertificateClient) UpdateOneID(id int) *CertificateUpdateOne
- func (c *CertificateClient) Use(hooks ...Hook)
- type CertificateCreate
- func (cc *CertificateCreate) Exec(ctx context.Context) error
- func (cc *CertificateCreate) ExecX(ctx context.Context)
- func (cc *CertificateCreate) Mutation() *CertificateMutation
- func (cc *CertificateCreate) Save(ctx context.Context) (*Certificate, error)
- func (cc *CertificateCreate) SaveX(ctx context.Context) *Certificate
- func (cc *CertificateCreate) SetAwardCategory(s string) *CertificateCreate
- func (cc *CertificateCreate) SetCertificateImage(b []byte) *CertificateCreate
- func (cc *CertificateCreate) SetCertificateLevel(s string) *CertificateCreate
- func (cc *CertificateCreate) SetCertificateType(s string) *CertificateCreate
- func (cc *CertificateCreate) SetCertificateType2(s string) *CertificateCreate
- func (cc *CertificateCreate) SetCode(s string) *CertificateCreate
- func (cc *CertificateCreate) SetDepartment(s string) *CertificateCreate
- func (cc *CertificateCreate) SetDescription(s string) *CertificateCreate
- func (cc *CertificateCreate) SetIssueDate(s string) *CertificateCreate
- func (cc *CertificateCreate) SetName(s string) *CertificateCreate
- func (cc *CertificateCreate) SetNillableStudentID(id *int) *CertificateCreate
- func (cc *CertificateCreate) SetStudent(s *Student) *CertificateCreate
- func (cc *CertificateCreate) SetStudentID(id int) *CertificateCreate
- type CertificateCreateBulk
- type CertificateDelete
- type CertificateDeleteOne
- type CertificateEdges
- type CertificateGroupBy
- func (cgb *CertificateGroupBy) Aggregate(fns ...AggregateFunc) *CertificateGroupBy
- func (s *CertificateGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CertificateGroupBy) BoolX(ctx context.Context) bool
- func (s *CertificateGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CertificateGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CertificateGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CertificateGroupBy) Float64X(ctx context.Context) float64
- func (s *CertificateGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CertificateGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CertificateGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CertificateGroupBy) IntX(ctx context.Context) int
- func (s *CertificateGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CertificateGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CertificateGroupBy) Scan(ctx context.Context, v any) error
- func (s *CertificateGroupBy) ScanX(ctx context.Context, v any)
- func (s *CertificateGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CertificateGroupBy) StringX(ctx context.Context) string
- func (s *CertificateGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CertificateGroupBy) StringsX(ctx context.Context) []string
- type CertificateMutation
- func (m *CertificateMutation) AddField(name string, value ent.Value) error
- func (m *CertificateMutation) AddedEdges() []string
- func (m *CertificateMutation) AddedField(name string) (ent.Value, bool)
- func (m *CertificateMutation) AddedFields() []string
- func (m *CertificateMutation) AddedIDs(name string) []ent.Value
- func (m *CertificateMutation) AwardCategory() (r string, exists bool)
- func (m *CertificateMutation) CertificateImage() (r []byte, exists bool)
- func (m *CertificateMutation) CertificateLevel() (r string, exists bool)
- func (m *CertificateMutation) CertificateType() (r string, exists bool)
- func (m *CertificateMutation) CertificateType2() (r string, exists bool)
- func (m *CertificateMutation) ClearEdge(name string) error
- func (m *CertificateMutation) ClearField(name string) error
- func (m *CertificateMutation) ClearStudent()
- func (m *CertificateMutation) ClearedEdges() []string
- func (m *CertificateMutation) ClearedFields() []string
- func (m CertificateMutation) Client() *Client
- func (m *CertificateMutation) Code() (r string, exists bool)
- func (m *CertificateMutation) Department() (r string, exists bool)
- func (m *CertificateMutation) Description() (r string, exists bool)
- func (m *CertificateMutation) EdgeCleared(name string) bool
- func (m *CertificateMutation) Field(name string) (ent.Value, bool)
- func (m *CertificateMutation) FieldCleared(name string) bool
- func (m *CertificateMutation) Fields() []string
- func (m *CertificateMutation) ID() (id int, exists bool)
- func (m *CertificateMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CertificateMutation) IssueDate() (r string, exists bool)
- func (m *CertificateMutation) Name() (r string, exists bool)
- func (m *CertificateMutation) OldAwardCategory(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldCertificateImage(ctx context.Context) (v []byte, err error)
- func (m *CertificateMutation) OldCertificateLevel(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldCertificateType(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldCertificateType2(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldDepartment(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CertificateMutation) OldIssueDate(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CertificateMutation) Op() Op
- func (m *CertificateMutation) RemovedEdges() []string
- func (m *CertificateMutation) RemovedIDs(name string) []ent.Value
- func (m *CertificateMutation) ResetAwardCategory()
- func (m *CertificateMutation) ResetCertificateImage()
- func (m *CertificateMutation) ResetCertificateLevel()
- func (m *CertificateMutation) ResetCertificateType()
- func (m *CertificateMutation) ResetCertificateType2()
- func (m *CertificateMutation) ResetCode()
- func (m *CertificateMutation) ResetDepartment()
- func (m *CertificateMutation) ResetDescription()
- func (m *CertificateMutation) ResetEdge(name string) error
- func (m *CertificateMutation) ResetField(name string) error
- func (m *CertificateMutation) ResetIssueDate()
- func (m *CertificateMutation) ResetName()
- func (m *CertificateMutation) ResetStudent()
- func (m *CertificateMutation) SetAwardCategory(s string)
- func (m *CertificateMutation) SetCertificateImage(b []byte)
- func (m *CertificateMutation) SetCertificateLevel(s string)
- func (m *CertificateMutation) SetCertificateType(s string)
- func (m *CertificateMutation) SetCertificateType2(s string)
- func (m *CertificateMutation) SetCode(s string)
- func (m *CertificateMutation) SetDepartment(s string)
- func (m *CertificateMutation) SetDescription(s string)
- func (m *CertificateMutation) SetField(name string, value ent.Value) error
- func (m *CertificateMutation) SetIssueDate(s string)
- func (m *CertificateMutation) SetName(s string)
- func (m *CertificateMutation) SetOp(op Op)
- func (m *CertificateMutation) SetStudentID(id int)
- func (m *CertificateMutation) StudentCleared() bool
- func (m *CertificateMutation) StudentID() (id int, exists bool)
- func (m *CertificateMutation) StudentIDs() (ids []int)
- func (m CertificateMutation) Tx() (*Tx, error)
- func (m *CertificateMutation) Type() string
- func (m *CertificateMutation) Where(ps ...predicate.Certificate)
- func (m *CertificateMutation) WhereP(ps ...func(*sql.Selector))
- type CertificateQuery
- func (cq *CertificateQuery) Aggregate(fns ...AggregateFunc) *CertificateSelect
- func (cq *CertificateQuery) All(ctx context.Context) ([]*Certificate, error)
- func (cq *CertificateQuery) AllX(ctx context.Context) []*Certificate
- func (cq *CertificateQuery) Clone() *CertificateQuery
- func (cq *CertificateQuery) Count(ctx context.Context) (int, error)
- func (cq *CertificateQuery) CountX(ctx context.Context) int
- func (cq *CertificateQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CertificateQuery) ExistX(ctx context.Context) bool
- func (cq *CertificateQuery) First(ctx context.Context) (*Certificate, error)
- func (cq *CertificateQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CertificateQuery) FirstIDX(ctx context.Context) int
- func (cq *CertificateQuery) FirstX(ctx context.Context) *Certificate
- func (cq *CertificateQuery) GroupBy(field string, fields ...string) *CertificateGroupBy
- func (cq *CertificateQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CertificateQuery) IDsX(ctx context.Context) []int
- func (cq *CertificateQuery) Limit(limit int) *CertificateQuery
- func (cq *CertificateQuery) Offset(offset int) *CertificateQuery
- func (cq *CertificateQuery) Only(ctx context.Context) (*Certificate, error)
- func (cq *CertificateQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CertificateQuery) OnlyIDX(ctx context.Context) int
- func (cq *CertificateQuery) OnlyX(ctx context.Context) *Certificate
- func (cq *CertificateQuery) Order(o ...OrderFunc) *CertificateQuery
- func (cq *CertificateQuery) QueryStudent() *StudentQuery
- func (cq *CertificateQuery) Select(fields ...string) *CertificateSelect
- func (cq *CertificateQuery) Unique(unique bool) *CertificateQuery
- func (cq *CertificateQuery) Where(ps ...predicate.Certificate) *CertificateQuery
- func (cq *CertificateQuery) WithStudent(opts ...func(*StudentQuery)) *CertificateQuery
- type CertificateSelect
- func (cs *CertificateSelect) Aggregate(fns ...AggregateFunc) *CertificateSelect
- func (s *CertificateSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CertificateSelect) BoolX(ctx context.Context) bool
- func (s *CertificateSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CertificateSelect) BoolsX(ctx context.Context) []bool
- func (s *CertificateSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CertificateSelect) Float64X(ctx context.Context) float64
- func (s *CertificateSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CertificateSelect) Float64sX(ctx context.Context) []float64
- func (s *CertificateSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CertificateSelect) IntX(ctx context.Context) int
- func (s *CertificateSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CertificateSelect) IntsX(ctx context.Context) []int
- func (cs *CertificateSelect) Scan(ctx context.Context, v any) error
- func (s *CertificateSelect) ScanX(ctx context.Context, v any)
- func (s *CertificateSelect) String(ctx context.Context) (_ string, err error)
- func (s *CertificateSelect) StringX(ctx context.Context) string
- func (s *CertificateSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CertificateSelect) StringsX(ctx context.Context) []string
- type CertificateUpdate
- func (cu *CertificateUpdate) ClearStudent() *CertificateUpdate
- func (cu *CertificateUpdate) Exec(ctx context.Context) error
- func (cu *CertificateUpdate) ExecX(ctx context.Context)
- func (cu *CertificateUpdate) Mutation() *CertificateMutation
- func (cu *CertificateUpdate) Save(ctx context.Context) (int, error)
- func (cu *CertificateUpdate) SaveX(ctx context.Context) int
- func (cu *CertificateUpdate) SetAwardCategory(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetCertificateImage(b []byte) *CertificateUpdate
- func (cu *CertificateUpdate) SetCertificateLevel(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetCertificateType(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetCertificateType2(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetCode(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetDepartment(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetDescription(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetIssueDate(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetName(s string) *CertificateUpdate
- func (cu *CertificateUpdate) SetNillableStudentID(id *int) *CertificateUpdate
- func (cu *CertificateUpdate) SetStudent(s *Student) *CertificateUpdate
- func (cu *CertificateUpdate) SetStudentID(id int) *CertificateUpdate
- func (cu *CertificateUpdate) Where(ps ...predicate.Certificate) *CertificateUpdate
- type CertificateUpdateOne
- func (cuo *CertificateUpdateOne) ClearStudent() *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) Exec(ctx context.Context) error
- func (cuo *CertificateUpdateOne) ExecX(ctx context.Context)
- func (cuo *CertificateUpdateOne) Mutation() *CertificateMutation
- func (cuo *CertificateUpdateOne) Save(ctx context.Context) (*Certificate, error)
- func (cuo *CertificateUpdateOne) SaveX(ctx context.Context) *Certificate
- func (cuo *CertificateUpdateOne) Select(field string, fields ...string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetAwardCategory(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetCertificateImage(b []byte) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetCertificateLevel(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetCertificateType(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetCertificateType2(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetCode(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetDepartment(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetDescription(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetIssueDate(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetName(s string) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetNillableStudentID(id *int) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetStudent(s *Student) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) SetStudentID(id int) *CertificateUpdateOne
- func (cuo *CertificateUpdateOne) Where(ps ...predicate.Certificate) *CertificateUpdateOne
- type Certificates
- type Class
- func (c *Class) QueryCampus() *CampusQuery
- func (c *Class) QueryClassLeader() *ClassLeaderQuery
- func (c *Class) QueryDepartment() *DepartmentQuery
- func (c *Class) QueryMajor() *MajorQuery
- func (c *Class) QueryMajorDirection() *MajorDirectionQuery
- func (c *Class) QueryStudent() *StudentQuery
- func (c *Class) QueryTutor() *TutorQuery
- func (c *Class) String() string
- func (c *Class) Unwrap() *Class
- func (c *Class) Update() *ClassUpdateOne
- type ClassClient
- func (c *ClassClient) Create() *ClassCreate
- func (c *ClassClient) CreateBulk(builders ...*ClassCreate) *ClassCreateBulk
- func (c *ClassClient) Delete() *ClassDelete
- func (c *ClassClient) DeleteOne(cl *Class) *ClassDeleteOne
- func (c *ClassClient) DeleteOneID(id int) *ClassDeleteOne
- func (c *ClassClient) Get(ctx context.Context, id int) (*Class, error)
- func (c *ClassClient) GetX(ctx context.Context, id int) *Class
- func (c *ClassClient) Hooks() []Hook
- func (c *ClassClient) Intercept(interceptors ...Interceptor)
- func (c *ClassClient) Interceptors() []Interceptor
- func (c *ClassClient) Query() *ClassQuery
- func (c *ClassClient) QueryCampus(cl *Class) *CampusQuery
- func (c *ClassClient) QueryClassLeader(cl *Class) *ClassLeaderQuery
- func (c *ClassClient) QueryDepartment(cl *Class) *DepartmentQuery
- func (c *ClassClient) QueryMajor(cl *Class) *MajorQuery
- func (c *ClassClient) QueryMajorDirection(cl *Class) *MajorDirectionQuery
- func (c *ClassClient) QueryStudent(cl *Class) *StudentQuery
- func (c *ClassClient) QueryTutor(cl *Class) *TutorQuery
- func (c *ClassClient) Update() *ClassUpdate
- func (c *ClassClient) UpdateOne(cl *Class) *ClassUpdateOne
- func (c *ClassClient) UpdateOneID(id int) *ClassUpdateOne
- func (c *ClassClient) Use(hooks ...Hook)
- type ClassCreate
- func (cc *ClassCreate) AddStudent(s ...*Student) *ClassCreate
- func (cc *ClassCreate) AddStudentIDs(ids ...int) *ClassCreate
- func (cc *ClassCreate) Exec(ctx context.Context) error
- func (cc *ClassCreate) ExecX(ctx context.Context)
- func (cc *ClassCreate) Mutation() *ClassMutation
- func (cc *ClassCreate) Save(ctx context.Context) (*Class, error)
- func (cc *ClassCreate) SaveX(ctx context.Context) *Class
- func (cc *ClassCreate) SetCampus(c *Campus) *ClassCreate
- func (cc *ClassCreate) SetCampusID(id int) *ClassCreate
- func (cc *ClassCreate) SetClassLeader(c *ClassLeader) *ClassCreate
- func (cc *ClassCreate) SetClassLeaderID(id int) *ClassCreate
- func (cc *ClassCreate) SetCode(s string) *ClassCreate
- func (cc *ClassCreate) SetDepartment(d *Department) *ClassCreate
- func (cc *ClassCreate) SetDepartmentID(id int) *ClassCreate
- func (cc *ClassCreate) SetDescription(s string) *ClassCreate
- func (cc *ClassCreate) SetMajor(m *Major) *ClassCreate
- func (cc *ClassCreate) SetMajorDirection(m *MajorDirection) *ClassCreate
- func (cc *ClassCreate) SetMajorDirectionID(id int) *ClassCreate
- func (cc *ClassCreate) SetMajorID(id int) *ClassCreate
- func (cc *ClassCreate) SetName(s string) *ClassCreate
- func (cc *ClassCreate) SetNillableCampusID(id *int) *ClassCreate
- func (cc *ClassCreate) SetNillableClassLeaderID(id *int) *ClassCreate
- func (cc *ClassCreate) SetNillableDepartmentID(id *int) *ClassCreate
- func (cc *ClassCreate) SetNillableMajorDirectionID(id *int) *ClassCreate
- func (cc *ClassCreate) SetNillableMajorID(id *int) *ClassCreate
- func (cc *ClassCreate) SetNillableTutorID(id *int) *ClassCreate
- func (cc *ClassCreate) SetTutor(t *Tutor) *ClassCreate
- func (cc *ClassCreate) SetTutorID(id int) *ClassCreate
- func (cc *ClassCreate) SetType(s string) *ClassCreate
- type ClassCreateBulk
- type ClassDelete
- type ClassDeleteOne
- type ClassEdges
- func (e ClassEdges) CampusOrErr() (*Campus, error)
- func (e ClassEdges) ClassLeaderOrErr() (*ClassLeader, error)
- func (e ClassEdges) DepartmentOrErr() (*Department, error)
- func (e ClassEdges) MajorDirectionOrErr() (*MajorDirection, error)
- func (e ClassEdges) MajorOrErr() (*Major, error)
- func (e ClassEdges) StudentOrErr() ([]*Student, error)
- func (e ClassEdges) TutorOrErr() (*Tutor, error)
- type ClassGroupBy
- func (cgb *ClassGroupBy) Aggregate(fns ...AggregateFunc) *ClassGroupBy
- func (s *ClassGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ClassGroupBy) BoolX(ctx context.Context) bool
- func (s *ClassGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ClassGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ClassGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ClassGroupBy) Float64X(ctx context.Context) float64
- func (s *ClassGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ClassGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ClassGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ClassGroupBy) IntX(ctx context.Context) int
- func (s *ClassGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ClassGroupBy) IntsX(ctx context.Context) []int
- func (cgb *ClassGroupBy) Scan(ctx context.Context, v any) error
- func (s *ClassGroupBy) ScanX(ctx context.Context, v any)
- func (s *ClassGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ClassGroupBy) StringX(ctx context.Context) string
- func (s *ClassGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ClassGroupBy) StringsX(ctx context.Context) []string
- type ClassLeader
- type ClassLeaderClient
- func (c *ClassLeaderClient) Create() *ClassLeaderCreate
- func (c *ClassLeaderClient) CreateBulk(builders ...*ClassLeaderCreate) *ClassLeaderCreateBulk
- func (c *ClassLeaderClient) Delete() *ClassLeaderDelete
- func (c *ClassLeaderClient) DeleteOne(cl *ClassLeader) *ClassLeaderDeleteOne
- func (c *ClassLeaderClient) DeleteOneID(id int) *ClassLeaderDeleteOne
- func (c *ClassLeaderClient) Get(ctx context.Context, id int) (*ClassLeader, error)
- func (c *ClassLeaderClient) GetX(ctx context.Context, id int) *ClassLeader
- func (c *ClassLeaderClient) Hooks() []Hook
- func (c *ClassLeaderClient) Intercept(interceptors ...Interceptor)
- func (c *ClassLeaderClient) Interceptors() []Interceptor
- func (c *ClassLeaderClient) Query() *ClassLeaderQuery
- func (c *ClassLeaderClient) QueryClass(cl *ClassLeader) *ClassQuery
- func (c *ClassLeaderClient) QueryStudent(cl *ClassLeader) *StudentQuery
- func (c *ClassLeaderClient) Update() *ClassLeaderUpdate
- func (c *ClassLeaderClient) UpdateOne(cl *ClassLeader) *ClassLeaderUpdateOne
- func (c *ClassLeaderClient) UpdateOneID(id int) *ClassLeaderUpdateOne
- func (c *ClassLeaderClient) Use(hooks ...Hook)
- type ClassLeaderCreate
- func (clc *ClassLeaderCreate) Exec(ctx context.Context) error
- func (clc *ClassLeaderCreate) ExecX(ctx context.Context)
- func (clc *ClassLeaderCreate) Mutation() *ClassLeaderMutation
- func (clc *ClassLeaderCreate) Save(ctx context.Context) (*ClassLeader, error)
- func (clc *ClassLeaderCreate) SaveX(ctx context.Context) *ClassLeader
- func (clc *ClassLeaderCreate) SetClass(c *Class) *ClassLeaderCreate
- func (clc *ClassLeaderCreate) SetClassID(id int) *ClassLeaderCreate
- func (clc *ClassLeaderCreate) SetNillableClassID(id *int) *ClassLeaderCreate
- func (clc *ClassLeaderCreate) SetNillableStudentID(id *int) *ClassLeaderCreate
- func (clc *ClassLeaderCreate) SetStudent(s *Student) *ClassLeaderCreate
- func (clc *ClassLeaderCreate) SetStudentID(id int) *ClassLeaderCreate
- type ClassLeaderCreateBulk
- type ClassLeaderDelete
- type ClassLeaderDeleteOne
- type ClassLeaderEdges
- type ClassLeaderGroupBy
- func (clgb *ClassLeaderGroupBy) Aggregate(fns ...AggregateFunc) *ClassLeaderGroupBy
- func (s *ClassLeaderGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ClassLeaderGroupBy) BoolX(ctx context.Context) bool
- func (s *ClassLeaderGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ClassLeaderGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ClassLeaderGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ClassLeaderGroupBy) Float64X(ctx context.Context) float64
- func (s *ClassLeaderGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ClassLeaderGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ClassLeaderGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ClassLeaderGroupBy) IntX(ctx context.Context) int
- func (s *ClassLeaderGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ClassLeaderGroupBy) IntsX(ctx context.Context) []int
- func (clgb *ClassLeaderGroupBy) Scan(ctx context.Context, v any) error
- func (s *ClassLeaderGroupBy) ScanX(ctx context.Context, v any)
- func (s *ClassLeaderGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ClassLeaderGroupBy) StringX(ctx context.Context) string
- func (s *ClassLeaderGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ClassLeaderGroupBy) StringsX(ctx context.Context) []string
- type ClassLeaderMutation
- func (m *ClassLeaderMutation) AddField(name string, value ent.Value) error
- func (m *ClassLeaderMutation) AddedEdges() []string
- func (m *ClassLeaderMutation) AddedField(name string) (ent.Value, bool)
- func (m *ClassLeaderMutation) AddedFields() []string
- func (m *ClassLeaderMutation) AddedIDs(name string) []ent.Value
- func (m *ClassLeaderMutation) ClassCleared() bool
- func (m *ClassLeaderMutation) ClassID() (id int, exists bool)
- func (m *ClassLeaderMutation) ClassIDs() (ids []int)
- func (m *ClassLeaderMutation) ClearClass()
- func (m *ClassLeaderMutation) ClearEdge(name string) error
- func (m *ClassLeaderMutation) ClearField(name string) error
- func (m *ClassLeaderMutation) ClearStudent()
- func (m *ClassLeaderMutation) ClearedEdges() []string
- func (m *ClassLeaderMutation) ClearedFields() []string
- func (m ClassLeaderMutation) Client() *Client
- func (m *ClassLeaderMutation) EdgeCleared(name string) bool
- func (m *ClassLeaderMutation) Field(name string) (ent.Value, bool)
- func (m *ClassLeaderMutation) FieldCleared(name string) bool
- func (m *ClassLeaderMutation) Fields() []string
- func (m *ClassLeaderMutation) ID() (id int, exists bool)
- func (m *ClassLeaderMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ClassLeaderMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ClassLeaderMutation) Op() Op
- func (m *ClassLeaderMutation) RemovedEdges() []string
- func (m *ClassLeaderMutation) RemovedIDs(name string) []ent.Value
- func (m *ClassLeaderMutation) ResetClass()
- func (m *ClassLeaderMutation) ResetEdge(name string) error
- func (m *ClassLeaderMutation) ResetField(name string) error
- func (m *ClassLeaderMutation) ResetStudent()
- func (m *ClassLeaderMutation) SetClassID(id int)
- func (m *ClassLeaderMutation) SetField(name string, value ent.Value) error
- func (m *ClassLeaderMutation) SetOp(op Op)
- func (m *ClassLeaderMutation) SetStudentID(id int)
- func (m *ClassLeaderMutation) StudentCleared() bool
- func (m *ClassLeaderMutation) StudentID() (id int, exists bool)
- func (m *ClassLeaderMutation) StudentIDs() (ids []int)
- func (m ClassLeaderMutation) Tx() (*Tx, error)
- func (m *ClassLeaderMutation) Type() string
- func (m *ClassLeaderMutation) Where(ps ...predicate.ClassLeader)
- func (m *ClassLeaderMutation) WhereP(ps ...func(*sql.Selector))
- type ClassLeaderQuery
- func (clq *ClassLeaderQuery) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect
- func (clq *ClassLeaderQuery) All(ctx context.Context) ([]*ClassLeader, error)
- func (clq *ClassLeaderQuery) AllX(ctx context.Context) []*ClassLeader
- func (clq *ClassLeaderQuery) Clone() *ClassLeaderQuery
- func (clq *ClassLeaderQuery) Count(ctx context.Context) (int, error)
- func (clq *ClassLeaderQuery) CountX(ctx context.Context) int
- func (clq *ClassLeaderQuery) Exist(ctx context.Context) (bool, error)
- func (clq *ClassLeaderQuery) ExistX(ctx context.Context) bool
- func (clq *ClassLeaderQuery) First(ctx context.Context) (*ClassLeader, error)
- func (clq *ClassLeaderQuery) FirstID(ctx context.Context) (id int, err error)
- func (clq *ClassLeaderQuery) FirstIDX(ctx context.Context) int
- func (clq *ClassLeaderQuery) FirstX(ctx context.Context) *ClassLeader
- func (clq *ClassLeaderQuery) GroupBy(field string, fields ...string) *ClassLeaderGroupBy
- func (clq *ClassLeaderQuery) IDs(ctx context.Context) (ids []int, err error)
- func (clq *ClassLeaderQuery) IDsX(ctx context.Context) []int
- func (clq *ClassLeaderQuery) Limit(limit int) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) Offset(offset int) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) Only(ctx context.Context) (*ClassLeader, error)
- func (clq *ClassLeaderQuery) OnlyID(ctx context.Context) (id int, err error)
- func (clq *ClassLeaderQuery) OnlyIDX(ctx context.Context) int
- func (clq *ClassLeaderQuery) OnlyX(ctx context.Context) *ClassLeader
- func (clq *ClassLeaderQuery) Order(o ...OrderFunc) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) QueryClass() *ClassQuery
- func (clq *ClassLeaderQuery) QueryStudent() *StudentQuery
- func (clq *ClassLeaderQuery) Select(fields ...string) *ClassLeaderSelect
- func (clq *ClassLeaderQuery) Unique(unique bool) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) Where(ps ...predicate.ClassLeader) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) WithClass(opts ...func(*ClassQuery)) *ClassLeaderQuery
- func (clq *ClassLeaderQuery) WithStudent(opts ...func(*StudentQuery)) *ClassLeaderQuery
- type ClassLeaderSelect
- func (cls *ClassLeaderSelect) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect
- func (s *ClassLeaderSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ClassLeaderSelect) BoolX(ctx context.Context) bool
- func (s *ClassLeaderSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ClassLeaderSelect) BoolsX(ctx context.Context) []bool
- func (s *ClassLeaderSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ClassLeaderSelect) Float64X(ctx context.Context) float64
- func (s *ClassLeaderSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ClassLeaderSelect) Float64sX(ctx context.Context) []float64
- func (s *ClassLeaderSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ClassLeaderSelect) IntX(ctx context.Context) int
- func (s *ClassLeaderSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ClassLeaderSelect) IntsX(ctx context.Context) []int
- func (cls *ClassLeaderSelect) Scan(ctx context.Context, v any) error
- func (s *ClassLeaderSelect) ScanX(ctx context.Context, v any)
- func (s *ClassLeaderSelect) String(ctx context.Context) (_ string, err error)
- func (s *ClassLeaderSelect) StringX(ctx context.Context) string
- func (s *ClassLeaderSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ClassLeaderSelect) StringsX(ctx context.Context) []string
- type ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) ClearClass() *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) ClearStudent() *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) Exec(ctx context.Context) error
- func (clu *ClassLeaderUpdate) ExecX(ctx context.Context)
- func (clu *ClassLeaderUpdate) Mutation() *ClassLeaderMutation
- func (clu *ClassLeaderUpdate) Save(ctx context.Context) (int, error)
- func (clu *ClassLeaderUpdate) SaveX(ctx context.Context) int
- func (clu *ClassLeaderUpdate) SetClass(c *Class) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) SetClassID(id int) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) SetNillableClassID(id *int) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) SetNillableStudentID(id *int) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) SetStudent(s *Student) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) SetStudentID(id int) *ClassLeaderUpdate
- func (clu *ClassLeaderUpdate) Where(ps ...predicate.ClassLeader) *ClassLeaderUpdate
- type ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) ClearClass() *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) ClearStudent() *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) Exec(ctx context.Context) error
- func (cluo *ClassLeaderUpdateOne) ExecX(ctx context.Context)
- func (cluo *ClassLeaderUpdateOne) Mutation() *ClassLeaderMutation
- func (cluo *ClassLeaderUpdateOne) Save(ctx context.Context) (*ClassLeader, error)
- func (cluo *ClassLeaderUpdateOne) SaveX(ctx context.Context) *ClassLeader
- func (cluo *ClassLeaderUpdateOne) Select(field string, fields ...string) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetClass(c *Class) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetClassID(id int) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetNillableClassID(id *int) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetNillableStudentID(id *int) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetStudent(s *Student) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) SetStudentID(id int) *ClassLeaderUpdateOne
- func (cluo *ClassLeaderUpdateOne) Where(ps ...predicate.ClassLeader) *ClassLeaderUpdateOne
- type ClassLeaders
- type ClassMutation
- func (m *ClassMutation) AddField(name string, value ent.Value) error
- func (m *ClassMutation) AddStudentIDs(ids ...int)
- func (m *ClassMutation) AddedEdges() []string
- func (m *ClassMutation) AddedField(name string) (ent.Value, bool)
- func (m *ClassMutation) AddedFields() []string
- func (m *ClassMutation) AddedIDs(name string) []ent.Value
- func (m *ClassMutation) CampusCleared() bool
- func (m *ClassMutation) CampusID() (id int, exists bool)
- func (m *ClassMutation) CampusIDs() (ids []int)
- func (m *ClassMutation) ClassLeaderCleared() bool
- func (m *ClassMutation) ClassLeaderID() (id int, exists bool)
- func (m *ClassMutation) ClassLeaderIDs() (ids []int)
- func (m *ClassMutation) ClearCampus()
- func (m *ClassMutation) ClearClassLeader()
- func (m *ClassMutation) ClearDepartment()
- func (m *ClassMutation) ClearEdge(name string) error
- func (m *ClassMutation) ClearField(name string) error
- func (m *ClassMutation) ClearMajor()
- func (m *ClassMutation) ClearMajorDirection()
- func (m *ClassMutation) ClearStudent()
- func (m *ClassMutation) ClearTutor()
- func (m *ClassMutation) ClearedEdges() []string
- func (m *ClassMutation) ClearedFields() []string
- func (m ClassMutation) Client() *Client
- func (m *ClassMutation) Code() (r string, exists bool)
- func (m *ClassMutation) DepartmentCleared() bool
- func (m *ClassMutation) DepartmentID() (id int, exists bool)
- func (m *ClassMutation) DepartmentIDs() (ids []int)
- func (m *ClassMutation) Description() (r string, exists bool)
- func (m *ClassMutation) EdgeCleared(name string) bool
- func (m *ClassMutation) Field(name string) (ent.Value, bool)
- func (m *ClassMutation) FieldCleared(name string) bool
- func (m *ClassMutation) Fields() []string
- func (m *ClassMutation) GetType() (r string, exists bool)
- func (m *ClassMutation) ID() (id int, exists bool)
- func (m *ClassMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ClassMutation) MajorCleared() bool
- func (m *ClassMutation) MajorDirectionCleared() bool
- func (m *ClassMutation) MajorDirectionID() (id int, exists bool)
- func (m *ClassMutation) MajorDirectionIDs() (ids []int)
- func (m *ClassMutation) MajorID() (id int, exists bool)
- func (m *ClassMutation) MajorIDs() (ids []int)
- func (m *ClassMutation) Name() (r string, exists bool)
- func (m *ClassMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *ClassMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ClassMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ClassMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ClassMutation) OldType(ctx context.Context) (v string, err error)
- func (m *ClassMutation) Op() Op
- func (m *ClassMutation) RemoveStudentIDs(ids ...int)
- func (m *ClassMutation) RemovedEdges() []string
- func (m *ClassMutation) RemovedIDs(name string) []ent.Value
- func (m *ClassMutation) RemovedStudentIDs() (ids []int)
- func (m *ClassMutation) ResetCampus()
- func (m *ClassMutation) ResetClassLeader()
- func (m *ClassMutation) ResetCode()
- func (m *ClassMutation) ResetDepartment()
- func (m *ClassMutation) ResetDescription()
- func (m *ClassMutation) ResetEdge(name string) error
- func (m *ClassMutation) ResetField(name string) error
- func (m *ClassMutation) ResetMajor()
- func (m *ClassMutation) ResetMajorDirection()
- func (m *ClassMutation) ResetName()
- func (m *ClassMutation) ResetStudent()
- func (m *ClassMutation) ResetTutor()
- func (m *ClassMutation) ResetType()
- func (m *ClassMutation) SetCampusID(id int)
- func (m *ClassMutation) SetClassLeaderID(id int)
- func (m *ClassMutation) SetCode(s string)
- func (m *ClassMutation) SetDepartmentID(id int)
- func (m *ClassMutation) SetDescription(s string)
- func (m *ClassMutation) SetField(name string, value ent.Value) error
- func (m *ClassMutation) SetMajorDirectionID(id int)
- func (m *ClassMutation) SetMajorID(id int)
- func (m *ClassMutation) SetName(s string)
- func (m *ClassMutation) SetOp(op Op)
- func (m *ClassMutation) SetTutorID(id int)
- func (m *ClassMutation) SetType(s string)
- func (m *ClassMutation) StudentCleared() bool
- func (m *ClassMutation) StudentIDs() (ids []int)
- func (m *ClassMutation) TutorCleared() bool
- func (m *ClassMutation) TutorID() (id int, exists bool)
- func (m *ClassMutation) TutorIDs() (ids []int)
- func (m ClassMutation) Tx() (*Tx, error)
- func (m *ClassMutation) Type() string
- func (m *ClassMutation) Where(ps ...predicate.Class)
- func (m *ClassMutation) WhereP(ps ...func(*sql.Selector))
- type ClassQuery
- func (cq *ClassQuery) Aggregate(fns ...AggregateFunc) *ClassSelect
- func (cq *ClassQuery) All(ctx context.Context) ([]*Class, error)
- func (cq *ClassQuery) AllX(ctx context.Context) []*Class
- func (cq *ClassQuery) Clone() *ClassQuery
- func (cq *ClassQuery) Count(ctx context.Context) (int, error)
- func (cq *ClassQuery) CountX(ctx context.Context) int
- func (cq *ClassQuery) Exist(ctx context.Context) (bool, error)
- func (cq *ClassQuery) ExistX(ctx context.Context) bool
- func (cq *ClassQuery) First(ctx context.Context) (*Class, error)
- func (cq *ClassQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *ClassQuery) FirstIDX(ctx context.Context) int
- func (cq *ClassQuery) FirstX(ctx context.Context) *Class
- func (cq *ClassQuery) GroupBy(field string, fields ...string) *ClassGroupBy
- func (cq *ClassQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *ClassQuery) IDsX(ctx context.Context) []int
- func (cq *ClassQuery) Limit(limit int) *ClassQuery
- func (cq *ClassQuery) Offset(offset int) *ClassQuery
- func (cq *ClassQuery) Only(ctx context.Context) (*Class, error)
- func (cq *ClassQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *ClassQuery) OnlyIDX(ctx context.Context) int
- func (cq *ClassQuery) OnlyX(ctx context.Context) *Class
- func (cq *ClassQuery) Order(o ...OrderFunc) *ClassQuery
- func (cq *ClassQuery) QueryCampus() *CampusQuery
- func (cq *ClassQuery) QueryClassLeader() *ClassLeaderQuery
- func (cq *ClassQuery) QueryDepartment() *DepartmentQuery
- func (cq *ClassQuery) QueryMajor() *MajorQuery
- func (cq *ClassQuery) QueryMajorDirection() *MajorDirectionQuery
- func (cq *ClassQuery) QueryStudent() *StudentQuery
- func (cq *ClassQuery) QueryTutor() *TutorQuery
- func (cq *ClassQuery) Select(fields ...string) *ClassSelect
- func (cq *ClassQuery) Unique(unique bool) *ClassQuery
- func (cq *ClassQuery) Where(ps ...predicate.Class) *ClassQuery
- func (cq *ClassQuery) WithCampus(opts ...func(*CampusQuery)) *ClassQuery
- func (cq *ClassQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *ClassQuery
- func (cq *ClassQuery) WithDepartment(opts ...func(*DepartmentQuery)) *ClassQuery
- func (cq *ClassQuery) WithMajor(opts ...func(*MajorQuery)) *ClassQuery
- func (cq *ClassQuery) WithMajorDirection(opts ...func(*MajorDirectionQuery)) *ClassQuery
- func (cq *ClassQuery) WithStudent(opts ...func(*StudentQuery)) *ClassQuery
- func (cq *ClassQuery) WithTutor(opts ...func(*TutorQuery)) *ClassQuery
- type ClassSelect
- func (cs *ClassSelect) Aggregate(fns ...AggregateFunc) *ClassSelect
- func (s *ClassSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ClassSelect) BoolX(ctx context.Context) bool
- func (s *ClassSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ClassSelect) BoolsX(ctx context.Context) []bool
- func (s *ClassSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ClassSelect) Float64X(ctx context.Context) float64
- func (s *ClassSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ClassSelect) Float64sX(ctx context.Context) []float64
- func (s *ClassSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ClassSelect) IntX(ctx context.Context) int
- func (s *ClassSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ClassSelect) IntsX(ctx context.Context) []int
- func (cs *ClassSelect) Scan(ctx context.Context, v any) error
- func (s *ClassSelect) ScanX(ctx context.Context, v any)
- func (s *ClassSelect) String(ctx context.Context) (_ string, err error)
- func (s *ClassSelect) StringX(ctx context.Context) string
- func (s *ClassSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ClassSelect) StringsX(ctx context.Context) []string
- type ClassUpdate
- func (cu *ClassUpdate) AddStudent(s ...*Student) *ClassUpdate
- func (cu *ClassUpdate) AddStudentIDs(ids ...int) *ClassUpdate
- func (cu *ClassUpdate) ClearCampus() *ClassUpdate
- func (cu *ClassUpdate) ClearClassLeader() *ClassUpdate
- func (cu *ClassUpdate) ClearDepartment() *ClassUpdate
- func (cu *ClassUpdate) ClearMajor() *ClassUpdate
- func (cu *ClassUpdate) ClearMajorDirection() *ClassUpdate
- func (cu *ClassUpdate) ClearStudent() *ClassUpdate
- func (cu *ClassUpdate) ClearTutor() *ClassUpdate
- func (cu *ClassUpdate) Exec(ctx context.Context) error
- func (cu *ClassUpdate) ExecX(ctx context.Context)
- func (cu *ClassUpdate) Mutation() *ClassMutation
- func (cu *ClassUpdate) RemoveStudent(s ...*Student) *ClassUpdate
- func (cu *ClassUpdate) RemoveStudentIDs(ids ...int) *ClassUpdate
- func (cu *ClassUpdate) Save(ctx context.Context) (int, error)
- func (cu *ClassUpdate) SaveX(ctx context.Context) int
- func (cu *ClassUpdate) SetCampus(c *Campus) *ClassUpdate
- func (cu *ClassUpdate) SetCampusID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetClassLeader(c *ClassLeader) *ClassUpdate
- func (cu *ClassUpdate) SetClassLeaderID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetCode(s string) *ClassUpdate
- func (cu *ClassUpdate) SetDepartment(d *Department) *ClassUpdate
- func (cu *ClassUpdate) SetDepartmentID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetDescription(s string) *ClassUpdate
- func (cu *ClassUpdate) SetMajor(m *Major) *ClassUpdate
- func (cu *ClassUpdate) SetMajorDirection(m *MajorDirection) *ClassUpdate
- func (cu *ClassUpdate) SetMajorDirectionID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetMajorID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetName(s string) *ClassUpdate
- func (cu *ClassUpdate) SetNillableCampusID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetNillableClassLeaderID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetNillableDepartmentID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetNillableMajorDirectionID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetNillableMajorID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetNillableTutorID(id *int) *ClassUpdate
- func (cu *ClassUpdate) SetTutor(t *Tutor) *ClassUpdate
- func (cu *ClassUpdate) SetTutorID(id int) *ClassUpdate
- func (cu *ClassUpdate) SetType(s string) *ClassUpdate
- func (cu *ClassUpdate) Where(ps ...predicate.Class) *ClassUpdate
- type ClassUpdateOne
- func (cuo *ClassUpdateOne) AddStudent(s ...*Student) *ClassUpdateOne
- func (cuo *ClassUpdateOne) AddStudentIDs(ids ...int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearCampus() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearClassLeader() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearDepartment() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearMajor() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearMajorDirection() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearStudent() *ClassUpdateOne
- func (cuo *ClassUpdateOne) ClearTutor() *ClassUpdateOne
- func (cuo *ClassUpdateOne) Exec(ctx context.Context) error
- func (cuo *ClassUpdateOne) ExecX(ctx context.Context)
- func (cuo *ClassUpdateOne) Mutation() *ClassMutation
- func (cuo *ClassUpdateOne) RemoveStudent(s ...*Student) *ClassUpdateOne
- func (cuo *ClassUpdateOne) RemoveStudentIDs(ids ...int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) Save(ctx context.Context) (*Class, error)
- func (cuo *ClassUpdateOne) SaveX(ctx context.Context) *Class
- func (cuo *ClassUpdateOne) Select(field string, fields ...string) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetCampus(c *Campus) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetCampusID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetClassLeader(c *ClassLeader) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetClassLeaderID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetCode(s string) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetDepartment(d *Department) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetDepartmentID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetDescription(s string) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetMajor(m *Major) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetMajorDirection(m *MajorDirection) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetMajorDirectionID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetMajorID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetName(s string) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableCampusID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableClassLeaderID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableDepartmentID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableMajorDirectionID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableMajorID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetNillableTutorID(id *int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetTutor(t *Tutor) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetTutorID(id int) *ClassUpdateOne
- func (cuo *ClassUpdateOne) SetType(s string) *ClassUpdateOne
- func (cuo *ClassUpdateOne) Where(ps ...predicate.Class) *ClassUpdateOne
- type Classes
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Department
- type DepartmentClient
- func (c *DepartmentClient) Create() *DepartmentCreate
- func (c *DepartmentClient) CreateBulk(builders ...*DepartmentCreate) *DepartmentCreateBulk
- func (c *DepartmentClient) Delete() *DepartmentDelete
- func (c *DepartmentClient) DeleteOne(d *Department) *DepartmentDeleteOne
- func (c *DepartmentClient) DeleteOneID(id int) *DepartmentDeleteOne
- func (c *DepartmentClient) Get(ctx context.Context, id int) (*Department, error)
- func (c *DepartmentClient) GetX(ctx context.Context, id int) *Department
- func (c *DepartmentClient) Hooks() []Hook
- func (c *DepartmentClient) Intercept(interceptors ...Interceptor)
- func (c *DepartmentClient) Interceptors() []Interceptor
- func (c *DepartmentClient) Query() *DepartmentQuery
- func (c *DepartmentClient) QueryClass(d *Department) *ClassQuery
- func (c *DepartmentClient) QueryMajor(d *Department) *MajorQuery
- func (c *DepartmentClient) QueryStudent(d *Department) *StudentQuery
- func (c *DepartmentClient) Update() *DepartmentUpdate
- func (c *DepartmentClient) UpdateOne(d *Department) *DepartmentUpdateOne
- func (c *DepartmentClient) UpdateOneID(id int) *DepartmentUpdateOne
- func (c *DepartmentClient) Use(hooks ...Hook)
- type DepartmentCreate
- func (dc *DepartmentCreate) AddClasIDs(ids ...int) *DepartmentCreate
- func (dc *DepartmentCreate) AddClass(c ...*Class) *DepartmentCreate
- func (dc *DepartmentCreate) AddMajor(m ...*Major) *DepartmentCreate
- func (dc *DepartmentCreate) AddMajorIDs(ids ...int) *DepartmentCreate
- func (dc *DepartmentCreate) AddStudent(s ...*Student) *DepartmentCreate
- func (dc *DepartmentCreate) AddStudentIDs(ids ...int) *DepartmentCreate
- func (dc *DepartmentCreate) Exec(ctx context.Context) error
- func (dc *DepartmentCreate) ExecX(ctx context.Context)
- func (dc *DepartmentCreate) Mutation() *DepartmentMutation
- func (dc *DepartmentCreate) Save(ctx context.Context) (*Department, error)
- func (dc *DepartmentCreate) SaveX(ctx context.Context) *Department
- func (dc *DepartmentCreate) SetCode(s string) *DepartmentCreate
- func (dc *DepartmentCreate) SetDescription(s string) *DepartmentCreate
- func (dc *DepartmentCreate) SetName(s string) *DepartmentCreate
- type DepartmentCreateBulk
- type DepartmentDelete
- type DepartmentDeleteOne
- type DepartmentEdges
- type DepartmentGroupBy
- func (dgb *DepartmentGroupBy) Aggregate(fns ...AggregateFunc) *DepartmentGroupBy
- func (s *DepartmentGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DepartmentGroupBy) BoolX(ctx context.Context) bool
- func (s *DepartmentGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DepartmentGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DepartmentGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DepartmentGroupBy) Float64X(ctx context.Context) float64
- func (s *DepartmentGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DepartmentGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DepartmentGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DepartmentGroupBy) IntX(ctx context.Context) int
- func (s *DepartmentGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DepartmentGroupBy) IntsX(ctx context.Context) []int
- func (dgb *DepartmentGroupBy) Scan(ctx context.Context, v any) error
- func (s *DepartmentGroupBy) ScanX(ctx context.Context, v any)
- func (s *DepartmentGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DepartmentGroupBy) StringX(ctx context.Context) string
- func (s *DepartmentGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DepartmentGroupBy) StringsX(ctx context.Context) []string
- type DepartmentMutation
- func (m *DepartmentMutation) AddClasIDs(ids ...int)
- func (m *DepartmentMutation) AddField(name string, value ent.Value) error
- func (m *DepartmentMutation) AddMajorIDs(ids ...int)
- func (m *DepartmentMutation) AddStudentIDs(ids ...int)
- func (m *DepartmentMutation) AddedEdges() []string
- func (m *DepartmentMutation) AddedField(name string) (ent.Value, bool)
- func (m *DepartmentMutation) AddedFields() []string
- func (m *DepartmentMutation) AddedIDs(name string) []ent.Value
- func (m *DepartmentMutation) ClassCleared() bool
- func (m *DepartmentMutation) ClassIDs() (ids []int)
- func (m *DepartmentMutation) ClearClass()
- func (m *DepartmentMutation) ClearEdge(name string) error
- func (m *DepartmentMutation) ClearField(name string) error
- func (m *DepartmentMutation) ClearMajor()
- func (m *DepartmentMutation) ClearStudent()
- func (m *DepartmentMutation) ClearedEdges() []string
- func (m *DepartmentMutation) ClearedFields() []string
- func (m DepartmentMutation) Client() *Client
- func (m *DepartmentMutation) Code() (r string, exists bool)
- func (m *DepartmentMutation) Description() (r string, exists bool)
- func (m *DepartmentMutation) EdgeCleared(name string) bool
- func (m *DepartmentMutation) Field(name string) (ent.Value, bool)
- func (m *DepartmentMutation) FieldCleared(name string) bool
- func (m *DepartmentMutation) Fields() []string
- func (m *DepartmentMutation) ID() (id int, exists bool)
- func (m *DepartmentMutation) IDs(ctx context.Context) ([]int, error)
- func (m *DepartmentMutation) MajorCleared() bool
- func (m *DepartmentMutation) MajorIDs() (ids []int)
- func (m *DepartmentMutation) Name() (r string, exists bool)
- func (m *DepartmentMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *DepartmentMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *DepartmentMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DepartmentMutation) OldName(ctx context.Context) (v string, err error)
- func (m *DepartmentMutation) Op() Op
- func (m *DepartmentMutation) RemoveClasIDs(ids ...int)
- func (m *DepartmentMutation) RemoveMajorIDs(ids ...int)
- func (m *DepartmentMutation) RemoveStudentIDs(ids ...int)
- func (m *DepartmentMutation) RemovedClassIDs() (ids []int)
- func (m *DepartmentMutation) RemovedEdges() []string
- func (m *DepartmentMutation) RemovedIDs(name string) []ent.Value
- func (m *DepartmentMutation) RemovedMajorIDs() (ids []int)
- func (m *DepartmentMutation) RemovedStudentIDs() (ids []int)
- func (m *DepartmentMutation) ResetClass()
- func (m *DepartmentMutation) ResetCode()
- func (m *DepartmentMutation) ResetDescription()
- func (m *DepartmentMutation) ResetEdge(name string) error
- func (m *DepartmentMutation) ResetField(name string) error
- func (m *DepartmentMutation) ResetMajor()
- func (m *DepartmentMutation) ResetName()
- func (m *DepartmentMutation) ResetStudent()
- func (m *DepartmentMutation) SetCode(s string)
- func (m *DepartmentMutation) SetDescription(s string)
- func (m *DepartmentMutation) SetField(name string, value ent.Value) error
- func (m *DepartmentMutation) SetName(s string)
- func (m *DepartmentMutation) SetOp(op Op)
- func (m *DepartmentMutation) StudentCleared() bool
- func (m *DepartmentMutation) StudentIDs() (ids []int)
- func (m DepartmentMutation) Tx() (*Tx, error)
- func (m *DepartmentMutation) Type() string
- func (m *DepartmentMutation) Where(ps ...predicate.Department)
- func (m *DepartmentMutation) WhereP(ps ...func(*sql.Selector))
- type DepartmentQuery
- func (dq *DepartmentQuery) Aggregate(fns ...AggregateFunc) *DepartmentSelect
- func (dq *DepartmentQuery) All(ctx context.Context) ([]*Department, error)
- func (dq *DepartmentQuery) AllX(ctx context.Context) []*Department
- func (dq *DepartmentQuery) Clone() *DepartmentQuery
- func (dq *DepartmentQuery) Count(ctx context.Context) (int, error)
- func (dq *DepartmentQuery) CountX(ctx context.Context) int
- func (dq *DepartmentQuery) Exist(ctx context.Context) (bool, error)
- func (dq *DepartmentQuery) ExistX(ctx context.Context) bool
- func (dq *DepartmentQuery) First(ctx context.Context) (*Department, error)
- func (dq *DepartmentQuery) FirstID(ctx context.Context) (id int, err error)
- func (dq *DepartmentQuery) FirstIDX(ctx context.Context) int
- func (dq *DepartmentQuery) FirstX(ctx context.Context) *Department
- func (dq *DepartmentQuery) GroupBy(field string, fields ...string) *DepartmentGroupBy
- func (dq *DepartmentQuery) IDs(ctx context.Context) (ids []int, err error)
- func (dq *DepartmentQuery) IDsX(ctx context.Context) []int
- func (dq *DepartmentQuery) Limit(limit int) *DepartmentQuery
- func (dq *DepartmentQuery) Offset(offset int) *DepartmentQuery
- func (dq *DepartmentQuery) Only(ctx context.Context) (*Department, error)
- func (dq *DepartmentQuery) OnlyID(ctx context.Context) (id int, err error)
- func (dq *DepartmentQuery) OnlyIDX(ctx context.Context) int
- func (dq *DepartmentQuery) OnlyX(ctx context.Context) *Department
- func (dq *DepartmentQuery) Order(o ...OrderFunc) *DepartmentQuery
- func (dq *DepartmentQuery) QueryClass() *ClassQuery
- func (dq *DepartmentQuery) QueryMajor() *MajorQuery
- func (dq *DepartmentQuery) QueryStudent() *StudentQuery
- func (dq *DepartmentQuery) Select(fields ...string) *DepartmentSelect
- func (dq *DepartmentQuery) Unique(unique bool) *DepartmentQuery
- func (dq *DepartmentQuery) Where(ps ...predicate.Department) *DepartmentQuery
- func (dq *DepartmentQuery) WithClass(opts ...func(*ClassQuery)) *DepartmentQuery
- func (dq *DepartmentQuery) WithMajor(opts ...func(*MajorQuery)) *DepartmentQuery
- func (dq *DepartmentQuery) WithStudent(opts ...func(*StudentQuery)) *DepartmentQuery
- type DepartmentSelect
- func (ds *DepartmentSelect) Aggregate(fns ...AggregateFunc) *DepartmentSelect
- func (s *DepartmentSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DepartmentSelect) BoolX(ctx context.Context) bool
- func (s *DepartmentSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DepartmentSelect) BoolsX(ctx context.Context) []bool
- func (s *DepartmentSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DepartmentSelect) Float64X(ctx context.Context) float64
- func (s *DepartmentSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DepartmentSelect) Float64sX(ctx context.Context) []float64
- func (s *DepartmentSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DepartmentSelect) IntX(ctx context.Context) int
- func (s *DepartmentSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DepartmentSelect) IntsX(ctx context.Context) []int
- func (ds *DepartmentSelect) Scan(ctx context.Context, v any) error
- func (s *DepartmentSelect) ScanX(ctx context.Context, v any)
- func (s *DepartmentSelect) String(ctx context.Context) (_ string, err error)
- func (s *DepartmentSelect) StringX(ctx context.Context) string
- func (s *DepartmentSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DepartmentSelect) StringsX(ctx context.Context) []string
- type DepartmentUpdate
- func (du *DepartmentUpdate) AddClasIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) AddClass(c ...*Class) *DepartmentUpdate
- func (du *DepartmentUpdate) AddMajor(m ...*Major) *DepartmentUpdate
- func (du *DepartmentUpdate) AddMajorIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) AddStudent(s ...*Student) *DepartmentUpdate
- func (du *DepartmentUpdate) AddStudentIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) ClearClass() *DepartmentUpdate
- func (du *DepartmentUpdate) ClearMajor() *DepartmentUpdate
- func (du *DepartmentUpdate) ClearStudent() *DepartmentUpdate
- func (du *DepartmentUpdate) Exec(ctx context.Context) error
- func (du *DepartmentUpdate) ExecX(ctx context.Context)
- func (du *DepartmentUpdate) Mutation() *DepartmentMutation
- func (du *DepartmentUpdate) RemoveClasIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveClass(c ...*Class) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveMajor(m ...*Major) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveMajorIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveStudent(s ...*Student) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveStudentIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) Save(ctx context.Context) (int, error)
- func (du *DepartmentUpdate) SaveX(ctx context.Context) int
- func (du *DepartmentUpdate) SetCode(s string) *DepartmentUpdate
- func (du *DepartmentUpdate) SetDescription(s string) *DepartmentUpdate
- func (du *DepartmentUpdate) SetName(s string) *DepartmentUpdate
- func (du *DepartmentUpdate) Where(ps ...predicate.Department) *DepartmentUpdate
- type DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddClasIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddClass(c ...*Class) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddMajor(m ...*Major) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddMajorIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddStudent(s ...*Student) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddStudentIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) ClearClass() *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) ClearMajor() *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) ClearStudent() *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) Exec(ctx context.Context) error
- func (duo *DepartmentUpdateOne) ExecX(ctx context.Context)
- func (duo *DepartmentUpdateOne) Mutation() *DepartmentMutation
- func (duo *DepartmentUpdateOne) RemoveClasIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveClass(c ...*Class) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveMajor(m ...*Major) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveMajorIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveStudent(s ...*Student) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveStudentIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) Save(ctx context.Context) (*Department, error)
- func (duo *DepartmentUpdateOne) SaveX(ctx context.Context) *Department
- func (duo *DepartmentUpdateOne) Select(field string, fields ...string) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetCode(s string) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetDescription(s string) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetName(s string) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) Where(ps ...predicate.Department) *DepartmentUpdateOne
- type Departments
- type EducationLevel
- type EducationLevelClient
- func (c *EducationLevelClient) Create() *EducationLevelCreate
- func (c *EducationLevelClient) CreateBulk(builders ...*EducationLevelCreate) *EducationLevelCreateBulk
- func (c *EducationLevelClient) Delete() *EducationLevelDelete
- func (c *EducationLevelClient) DeleteOne(el *EducationLevel) *EducationLevelDeleteOne
- func (c *EducationLevelClient) DeleteOneID(id int) *EducationLevelDeleteOne
- func (c *EducationLevelClient) Get(ctx context.Context, id int) (*EducationLevel, error)
- func (c *EducationLevelClient) GetX(ctx context.Context, id int) *EducationLevel
- func (c *EducationLevelClient) Hooks() []Hook
- func (c *EducationLevelClient) Intercept(interceptors ...Interceptor)
- func (c *EducationLevelClient) Interceptors() []Interceptor
- func (c *EducationLevelClient) Query() *EducationLevelQuery
- func (c *EducationLevelClient) QueryStudent(el *EducationLevel) *StudentQuery
- func (c *EducationLevelClient) Update() *EducationLevelUpdate
- func (c *EducationLevelClient) UpdateOne(el *EducationLevel) *EducationLevelUpdateOne
- func (c *EducationLevelClient) UpdateOneID(id int) *EducationLevelUpdateOne
- func (c *EducationLevelClient) Use(hooks ...Hook)
- type EducationLevelCreate
- func (elc *EducationLevelCreate) Exec(ctx context.Context) error
- func (elc *EducationLevelCreate) ExecX(ctx context.Context)
- func (elc *EducationLevelCreate) Mutation() *EducationLevelMutation
- func (elc *EducationLevelCreate) Save(ctx context.Context) (*EducationLevel, error)
- func (elc *EducationLevelCreate) SaveX(ctx context.Context) *EducationLevel
- func (elc *EducationLevelCreate) SetName(s string) *EducationLevelCreate
- func (elc *EducationLevelCreate) SetNillableStudentID(id *int) *EducationLevelCreate
- func (elc *EducationLevelCreate) SetStudent(s *Student) *EducationLevelCreate
- func (elc *EducationLevelCreate) SetStudentID(id int) *EducationLevelCreate
- type EducationLevelCreateBulk
- func (elcb *EducationLevelCreateBulk) Exec(ctx context.Context) error
- func (elcb *EducationLevelCreateBulk) ExecX(ctx context.Context)
- func (elcb *EducationLevelCreateBulk) Save(ctx context.Context) ([]*EducationLevel, error)
- func (elcb *EducationLevelCreateBulk) SaveX(ctx context.Context) []*EducationLevel
- type EducationLevelDelete
- type EducationLevelDeleteOne
- type EducationLevelEdges
- type EducationLevelGroupBy
- func (elgb *EducationLevelGroupBy) Aggregate(fns ...AggregateFunc) *EducationLevelGroupBy
- func (s *EducationLevelGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *EducationLevelGroupBy) BoolX(ctx context.Context) bool
- func (s *EducationLevelGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *EducationLevelGroupBy) BoolsX(ctx context.Context) []bool
- func (s *EducationLevelGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *EducationLevelGroupBy) Float64X(ctx context.Context) float64
- func (s *EducationLevelGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *EducationLevelGroupBy) Float64sX(ctx context.Context) []float64
- func (s *EducationLevelGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *EducationLevelGroupBy) IntX(ctx context.Context) int
- func (s *EducationLevelGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *EducationLevelGroupBy) IntsX(ctx context.Context) []int
- func (elgb *EducationLevelGroupBy) Scan(ctx context.Context, v any) error
- func (s *EducationLevelGroupBy) ScanX(ctx context.Context, v any)
- func (s *EducationLevelGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *EducationLevelGroupBy) StringX(ctx context.Context) string
- func (s *EducationLevelGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *EducationLevelGroupBy) StringsX(ctx context.Context) []string
- type EducationLevelMutation
- func (m *EducationLevelMutation) AddField(name string, value ent.Value) error
- func (m *EducationLevelMutation) AddedEdges() []string
- func (m *EducationLevelMutation) AddedField(name string) (ent.Value, bool)
- func (m *EducationLevelMutation) AddedFields() []string
- func (m *EducationLevelMutation) AddedIDs(name string) []ent.Value
- func (m *EducationLevelMutation) ClearEdge(name string) error
- func (m *EducationLevelMutation) ClearField(name string) error
- func (m *EducationLevelMutation) ClearStudent()
- func (m *EducationLevelMutation) ClearedEdges() []string
- func (m *EducationLevelMutation) ClearedFields() []string
- func (m EducationLevelMutation) Client() *Client
- func (m *EducationLevelMutation) EdgeCleared(name string) bool
- func (m *EducationLevelMutation) Field(name string) (ent.Value, bool)
- func (m *EducationLevelMutation) FieldCleared(name string) bool
- func (m *EducationLevelMutation) Fields() []string
- func (m *EducationLevelMutation) ID() (id int, exists bool)
- func (m *EducationLevelMutation) IDs(ctx context.Context) ([]int, error)
- func (m *EducationLevelMutation) Name() (r string, exists bool)
- func (m *EducationLevelMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EducationLevelMutation) OldName(ctx context.Context) (v string, err error)
- func (m *EducationLevelMutation) Op() Op
- func (m *EducationLevelMutation) RemovedEdges() []string
- func (m *EducationLevelMutation) RemovedIDs(name string) []ent.Value
- func (m *EducationLevelMutation) ResetEdge(name string) error
- func (m *EducationLevelMutation) ResetField(name string) error
- func (m *EducationLevelMutation) ResetName()
- func (m *EducationLevelMutation) ResetStudent()
- func (m *EducationLevelMutation) SetField(name string, value ent.Value) error
- func (m *EducationLevelMutation) SetName(s string)
- func (m *EducationLevelMutation) SetOp(op Op)
- func (m *EducationLevelMutation) SetStudentID(id int)
- func (m *EducationLevelMutation) StudentCleared() bool
- func (m *EducationLevelMutation) StudentID() (id int, exists bool)
- func (m *EducationLevelMutation) StudentIDs() (ids []int)
- func (m EducationLevelMutation) Tx() (*Tx, error)
- func (m *EducationLevelMutation) Type() string
- func (m *EducationLevelMutation) Where(ps ...predicate.EducationLevel)
- func (m *EducationLevelMutation) WhereP(ps ...func(*sql.Selector))
- type EducationLevelQuery
- func (elq *EducationLevelQuery) Aggregate(fns ...AggregateFunc) *EducationLevelSelect
- func (elq *EducationLevelQuery) All(ctx context.Context) ([]*EducationLevel, error)
- func (elq *EducationLevelQuery) AllX(ctx context.Context) []*EducationLevel
- func (elq *EducationLevelQuery) Clone() *EducationLevelQuery
- func (elq *EducationLevelQuery) Count(ctx context.Context) (int, error)
- func (elq *EducationLevelQuery) CountX(ctx context.Context) int
- func (elq *EducationLevelQuery) Exist(ctx context.Context) (bool, error)
- func (elq *EducationLevelQuery) ExistX(ctx context.Context) bool
- func (elq *EducationLevelQuery) First(ctx context.Context) (*EducationLevel, error)
- func (elq *EducationLevelQuery) FirstID(ctx context.Context) (id int, err error)
- func (elq *EducationLevelQuery) FirstIDX(ctx context.Context) int
- func (elq *EducationLevelQuery) FirstX(ctx context.Context) *EducationLevel
- func (elq *EducationLevelQuery) GroupBy(field string, fields ...string) *EducationLevelGroupBy
- func (elq *EducationLevelQuery) IDs(ctx context.Context) (ids []int, err error)
- func (elq *EducationLevelQuery) IDsX(ctx context.Context) []int
- func (elq *EducationLevelQuery) Limit(limit int) *EducationLevelQuery
- func (elq *EducationLevelQuery) Offset(offset int) *EducationLevelQuery
- func (elq *EducationLevelQuery) Only(ctx context.Context) (*EducationLevel, error)
- func (elq *EducationLevelQuery) OnlyID(ctx context.Context) (id int, err error)
- func (elq *EducationLevelQuery) OnlyIDX(ctx context.Context) int
- func (elq *EducationLevelQuery) OnlyX(ctx context.Context) *EducationLevel
- func (elq *EducationLevelQuery) Order(o ...OrderFunc) *EducationLevelQuery
- func (elq *EducationLevelQuery) QueryStudent() *StudentQuery
- func (elq *EducationLevelQuery) Select(fields ...string) *EducationLevelSelect
- func (elq *EducationLevelQuery) Unique(unique bool) *EducationLevelQuery
- func (elq *EducationLevelQuery) Where(ps ...predicate.EducationLevel) *EducationLevelQuery
- func (elq *EducationLevelQuery) WithStudent(opts ...func(*StudentQuery)) *EducationLevelQuery
- type EducationLevelSelect
- func (els *EducationLevelSelect) Aggregate(fns ...AggregateFunc) *EducationLevelSelect
- func (s *EducationLevelSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *EducationLevelSelect) BoolX(ctx context.Context) bool
- func (s *EducationLevelSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *EducationLevelSelect) BoolsX(ctx context.Context) []bool
- func (s *EducationLevelSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *EducationLevelSelect) Float64X(ctx context.Context) float64
- func (s *EducationLevelSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *EducationLevelSelect) Float64sX(ctx context.Context) []float64
- func (s *EducationLevelSelect) Int(ctx context.Context) (_ int, err error)
- func (s *EducationLevelSelect) IntX(ctx context.Context) int
- func (s *EducationLevelSelect) Ints(ctx context.Context) ([]int, error)
- func (s *EducationLevelSelect) IntsX(ctx context.Context) []int
- func (els *EducationLevelSelect) Scan(ctx context.Context, v any) error
- func (s *EducationLevelSelect) ScanX(ctx context.Context, v any)
- func (s *EducationLevelSelect) String(ctx context.Context) (_ string, err error)
- func (s *EducationLevelSelect) StringX(ctx context.Context) string
- func (s *EducationLevelSelect) Strings(ctx context.Context) ([]string, error)
- func (s *EducationLevelSelect) StringsX(ctx context.Context) []string
- type EducationLevelUpdate
- func (elu *EducationLevelUpdate) ClearStudent() *EducationLevelUpdate
- func (elu *EducationLevelUpdate) Exec(ctx context.Context) error
- func (elu *EducationLevelUpdate) ExecX(ctx context.Context)
- func (elu *EducationLevelUpdate) Mutation() *EducationLevelMutation
- func (elu *EducationLevelUpdate) Save(ctx context.Context) (int, error)
- func (elu *EducationLevelUpdate) SaveX(ctx context.Context) int
- func (elu *EducationLevelUpdate) SetName(s string) *EducationLevelUpdate
- func (elu *EducationLevelUpdate) SetNillableStudentID(id *int) *EducationLevelUpdate
- func (elu *EducationLevelUpdate) SetStudent(s *Student) *EducationLevelUpdate
- func (elu *EducationLevelUpdate) SetStudentID(id int) *EducationLevelUpdate
- func (elu *EducationLevelUpdate) Where(ps ...predicate.EducationLevel) *EducationLevelUpdate
- type EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) ClearStudent() *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) Exec(ctx context.Context) error
- func (eluo *EducationLevelUpdateOne) ExecX(ctx context.Context)
- func (eluo *EducationLevelUpdateOne) Mutation() *EducationLevelMutation
- func (eluo *EducationLevelUpdateOne) Save(ctx context.Context) (*EducationLevel, error)
- func (eluo *EducationLevelUpdateOne) SaveX(ctx context.Context) *EducationLevel
- func (eluo *EducationLevelUpdateOne) Select(field string, fields ...string) *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) SetName(s string) *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) SetNillableStudentID(id *int) *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) SetStudent(s *Student) *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) SetStudentID(id int) *EducationLevelUpdateOne
- func (eluo *EducationLevelUpdateOne) Where(ps ...predicate.EducationLevel) *EducationLevelUpdateOne
- type EducationLevels
- type EnrollmentStatus
- type EnrollmentStatusClient
- func (c *EnrollmentStatusClient) Create() *EnrollmentStatusCreate
- func (c *EnrollmentStatusClient) CreateBulk(builders ...*EnrollmentStatusCreate) *EnrollmentStatusCreateBulk
- func (c *EnrollmentStatusClient) Delete() *EnrollmentStatusDelete
- func (c *EnrollmentStatusClient) DeleteOne(es *EnrollmentStatus) *EnrollmentStatusDeleteOne
- func (c *EnrollmentStatusClient) DeleteOneID(id int) *EnrollmentStatusDeleteOne
- func (c *EnrollmentStatusClient) Get(ctx context.Context, id int) (*EnrollmentStatus, error)
- func (c *EnrollmentStatusClient) GetX(ctx context.Context, id int) *EnrollmentStatus
- func (c *EnrollmentStatusClient) Hooks() []Hook
- func (c *EnrollmentStatusClient) Intercept(interceptors ...Interceptor)
- func (c *EnrollmentStatusClient) Interceptors() []Interceptor
- func (c *EnrollmentStatusClient) Query() *EnrollmentStatusQuery
- func (c *EnrollmentStatusClient) QueryStudent(es *EnrollmentStatus) *StudentQuery
- func (c *EnrollmentStatusClient) Update() *EnrollmentStatusUpdate
- func (c *EnrollmentStatusClient) UpdateOne(es *EnrollmentStatus) *EnrollmentStatusUpdateOne
- func (c *EnrollmentStatusClient) UpdateOneID(id int) *EnrollmentStatusUpdateOne
- func (c *EnrollmentStatusClient) Use(hooks ...Hook)
- type EnrollmentStatusCreate
- func (esc *EnrollmentStatusCreate) Exec(ctx context.Context) error
- func (esc *EnrollmentStatusCreate) ExecX(ctx context.Context)
- func (esc *EnrollmentStatusCreate) Mutation() *EnrollmentStatusMutation
- func (esc *EnrollmentStatusCreate) Save(ctx context.Context) (*EnrollmentStatus, error)
- func (esc *EnrollmentStatusCreate) SaveX(ctx context.Context) *EnrollmentStatus
- func (esc *EnrollmentStatusCreate) SetName(s string) *EnrollmentStatusCreate
- func (esc *EnrollmentStatusCreate) SetNillableStudentID(id *int) *EnrollmentStatusCreate
- func (esc *EnrollmentStatusCreate) SetStudent(s *Student) *EnrollmentStatusCreate
- func (esc *EnrollmentStatusCreate) SetStudentID(id int) *EnrollmentStatusCreate
- type EnrollmentStatusCreateBulk
- func (escb *EnrollmentStatusCreateBulk) Exec(ctx context.Context) error
- func (escb *EnrollmentStatusCreateBulk) ExecX(ctx context.Context)
- func (escb *EnrollmentStatusCreateBulk) Save(ctx context.Context) ([]*EnrollmentStatus, error)
- func (escb *EnrollmentStatusCreateBulk) SaveX(ctx context.Context) []*EnrollmentStatus
- type EnrollmentStatusDelete
- type EnrollmentStatusDeleteOne
- type EnrollmentStatusEdges
- type EnrollmentStatusGroupBy
- func (esgb *EnrollmentStatusGroupBy) Aggregate(fns ...AggregateFunc) *EnrollmentStatusGroupBy
- func (s *EnrollmentStatusGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *EnrollmentStatusGroupBy) BoolX(ctx context.Context) bool
- func (s *EnrollmentStatusGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *EnrollmentStatusGroupBy) BoolsX(ctx context.Context) []bool
- func (s *EnrollmentStatusGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *EnrollmentStatusGroupBy) Float64X(ctx context.Context) float64
- func (s *EnrollmentStatusGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *EnrollmentStatusGroupBy) Float64sX(ctx context.Context) []float64
- func (s *EnrollmentStatusGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *EnrollmentStatusGroupBy) IntX(ctx context.Context) int
- func (s *EnrollmentStatusGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *EnrollmentStatusGroupBy) IntsX(ctx context.Context) []int
- func (esgb *EnrollmentStatusGroupBy) Scan(ctx context.Context, v any) error
- func (s *EnrollmentStatusGroupBy) ScanX(ctx context.Context, v any)
- func (s *EnrollmentStatusGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *EnrollmentStatusGroupBy) StringX(ctx context.Context) string
- func (s *EnrollmentStatusGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *EnrollmentStatusGroupBy) StringsX(ctx context.Context) []string
- type EnrollmentStatusMutation
- func (m *EnrollmentStatusMutation) AddField(name string, value ent.Value) error
- func (m *EnrollmentStatusMutation) AddedEdges() []string
- func (m *EnrollmentStatusMutation) AddedField(name string) (ent.Value, bool)
- func (m *EnrollmentStatusMutation) AddedFields() []string
- func (m *EnrollmentStatusMutation) AddedIDs(name string) []ent.Value
- func (m *EnrollmentStatusMutation) ClearEdge(name string) error
- func (m *EnrollmentStatusMutation) ClearField(name string) error
- func (m *EnrollmentStatusMutation) ClearStudent()
- func (m *EnrollmentStatusMutation) ClearedEdges() []string
- func (m *EnrollmentStatusMutation) ClearedFields() []string
- func (m EnrollmentStatusMutation) Client() *Client
- func (m *EnrollmentStatusMutation) EdgeCleared(name string) bool
- func (m *EnrollmentStatusMutation) Field(name string) (ent.Value, bool)
- func (m *EnrollmentStatusMutation) FieldCleared(name string) bool
- func (m *EnrollmentStatusMutation) Fields() []string
- func (m *EnrollmentStatusMutation) ID() (id int, exists bool)
- func (m *EnrollmentStatusMutation) IDs(ctx context.Context) ([]int, error)
- func (m *EnrollmentStatusMutation) Name() (r string, exists bool)
- func (m *EnrollmentStatusMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EnrollmentStatusMutation) OldName(ctx context.Context) (v string, err error)
- func (m *EnrollmentStatusMutation) Op() Op
- func (m *EnrollmentStatusMutation) RemovedEdges() []string
- func (m *EnrollmentStatusMutation) RemovedIDs(name string) []ent.Value
- func (m *EnrollmentStatusMutation) ResetEdge(name string) error
- func (m *EnrollmentStatusMutation) ResetField(name string) error
- func (m *EnrollmentStatusMutation) ResetName()
- func (m *EnrollmentStatusMutation) ResetStudent()
- func (m *EnrollmentStatusMutation) SetField(name string, value ent.Value) error
- func (m *EnrollmentStatusMutation) SetName(s string)
- func (m *EnrollmentStatusMutation) SetOp(op Op)
- func (m *EnrollmentStatusMutation) SetStudentID(id int)
- func (m *EnrollmentStatusMutation) StudentCleared() bool
- func (m *EnrollmentStatusMutation) StudentID() (id int, exists bool)
- func (m *EnrollmentStatusMutation) StudentIDs() (ids []int)
- func (m EnrollmentStatusMutation) Tx() (*Tx, error)
- func (m *EnrollmentStatusMutation) Type() string
- func (m *EnrollmentStatusMutation) Where(ps ...predicate.EnrollmentStatus)
- func (m *EnrollmentStatusMutation) WhereP(ps ...func(*sql.Selector))
- type EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) Aggregate(fns ...AggregateFunc) *EnrollmentStatusSelect
- func (esq *EnrollmentStatusQuery) All(ctx context.Context) ([]*EnrollmentStatus, error)
- func (esq *EnrollmentStatusQuery) AllX(ctx context.Context) []*EnrollmentStatus
- func (esq *EnrollmentStatusQuery) Clone() *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) Count(ctx context.Context) (int, error)
- func (esq *EnrollmentStatusQuery) CountX(ctx context.Context) int
- func (esq *EnrollmentStatusQuery) Exist(ctx context.Context) (bool, error)
- func (esq *EnrollmentStatusQuery) ExistX(ctx context.Context) bool
- func (esq *EnrollmentStatusQuery) First(ctx context.Context) (*EnrollmentStatus, error)
- func (esq *EnrollmentStatusQuery) FirstID(ctx context.Context) (id int, err error)
- func (esq *EnrollmentStatusQuery) FirstIDX(ctx context.Context) int
- func (esq *EnrollmentStatusQuery) FirstX(ctx context.Context) *EnrollmentStatus
- func (esq *EnrollmentStatusQuery) GroupBy(field string, fields ...string) *EnrollmentStatusGroupBy
- func (esq *EnrollmentStatusQuery) IDs(ctx context.Context) (ids []int, err error)
- func (esq *EnrollmentStatusQuery) IDsX(ctx context.Context) []int
- func (esq *EnrollmentStatusQuery) Limit(limit int) *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) Offset(offset int) *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) Only(ctx context.Context) (*EnrollmentStatus, error)
- func (esq *EnrollmentStatusQuery) OnlyID(ctx context.Context) (id int, err error)
- func (esq *EnrollmentStatusQuery) OnlyIDX(ctx context.Context) int
- func (esq *EnrollmentStatusQuery) OnlyX(ctx context.Context) *EnrollmentStatus
- func (esq *EnrollmentStatusQuery) Order(o ...OrderFunc) *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) QueryStudent() *StudentQuery
- func (esq *EnrollmentStatusQuery) Select(fields ...string) *EnrollmentStatusSelect
- func (esq *EnrollmentStatusQuery) Unique(unique bool) *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusQuery
- func (esq *EnrollmentStatusQuery) WithStudent(opts ...func(*StudentQuery)) *EnrollmentStatusQuery
- type EnrollmentStatusSelect
- func (ess *EnrollmentStatusSelect) Aggregate(fns ...AggregateFunc) *EnrollmentStatusSelect
- func (s *EnrollmentStatusSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *EnrollmentStatusSelect) BoolX(ctx context.Context) bool
- func (s *EnrollmentStatusSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *EnrollmentStatusSelect) BoolsX(ctx context.Context) []bool
- func (s *EnrollmentStatusSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *EnrollmentStatusSelect) Float64X(ctx context.Context) float64
- func (s *EnrollmentStatusSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *EnrollmentStatusSelect) Float64sX(ctx context.Context) []float64
- func (s *EnrollmentStatusSelect) Int(ctx context.Context) (_ int, err error)
- func (s *EnrollmentStatusSelect) IntX(ctx context.Context) int
- func (s *EnrollmentStatusSelect) Ints(ctx context.Context) ([]int, error)
- func (s *EnrollmentStatusSelect) IntsX(ctx context.Context) []int
- func (ess *EnrollmentStatusSelect) Scan(ctx context.Context, v any) error
- func (s *EnrollmentStatusSelect) ScanX(ctx context.Context, v any)
- func (s *EnrollmentStatusSelect) String(ctx context.Context) (_ string, err error)
- func (s *EnrollmentStatusSelect) StringX(ctx context.Context) string
- func (s *EnrollmentStatusSelect) Strings(ctx context.Context) ([]string, error)
- func (s *EnrollmentStatusSelect) StringsX(ctx context.Context) []string
- type EnrollmentStatusSlice
- type EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) ClearStudent() *EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) Exec(ctx context.Context) error
- func (esu *EnrollmentStatusUpdate) ExecX(ctx context.Context)
- func (esu *EnrollmentStatusUpdate) Mutation() *EnrollmentStatusMutation
- func (esu *EnrollmentStatusUpdate) Save(ctx context.Context) (int, error)
- func (esu *EnrollmentStatusUpdate) SaveX(ctx context.Context) int
- func (esu *EnrollmentStatusUpdate) SetName(s string) *EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) SetNillableStudentID(id *int) *EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) SetStudent(s *Student) *EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) SetStudentID(id int) *EnrollmentStatusUpdate
- func (esu *EnrollmentStatusUpdate) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusUpdate
- type EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) ClearStudent() *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) Exec(ctx context.Context) error
- func (esuo *EnrollmentStatusUpdateOne) ExecX(ctx context.Context)
- func (esuo *EnrollmentStatusUpdateOne) Mutation() *EnrollmentStatusMutation
- func (esuo *EnrollmentStatusUpdateOne) Save(ctx context.Context) (*EnrollmentStatus, error)
- func (esuo *EnrollmentStatusUpdateOne) SaveX(ctx context.Context) *EnrollmentStatus
- func (esuo *EnrollmentStatusUpdateOne) Select(field string, fields ...string) *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) SetName(s string) *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) SetNillableStudentID(id *int) *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) SetStudent(s *Student) *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) SetStudentID(id int) *EnrollmentStatusUpdateOne
- func (esuo *EnrollmentStatusUpdateOne) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusUpdateOne
- type FamilyInfo
- type FamilyInfoClient
- func (c *FamilyInfoClient) Create() *FamilyInfoCreate
- func (c *FamilyInfoClient) CreateBulk(builders ...*FamilyInfoCreate) *FamilyInfoCreateBulk
- func (c *FamilyInfoClient) Delete() *FamilyInfoDelete
- func (c *FamilyInfoClient) DeleteOne(fi *FamilyInfo) *FamilyInfoDeleteOne
- func (c *FamilyInfoClient) DeleteOneID(id int) *FamilyInfoDeleteOne
- func (c *FamilyInfoClient) Get(ctx context.Context, id int) (*FamilyInfo, error)
- func (c *FamilyInfoClient) GetX(ctx context.Context, id int) *FamilyInfo
- func (c *FamilyInfoClient) Hooks() []Hook
- func (c *FamilyInfoClient) Intercept(interceptors ...Interceptor)
- func (c *FamilyInfoClient) Interceptors() []Interceptor
- func (c *FamilyInfoClient) Query() *FamilyInfoQuery
- func (c *FamilyInfoClient) QueryStudent(fi *FamilyInfo) *StudentQuery
- func (c *FamilyInfoClient) Update() *FamilyInfoUpdate
- func (c *FamilyInfoClient) UpdateOne(fi *FamilyInfo) *FamilyInfoUpdateOne
- func (c *FamilyInfoClient) UpdateOneID(id int) *FamilyInfoUpdateOne
- func (c *FamilyInfoClient) Use(hooks ...Hook)
- type FamilyInfoCreate
- func (fic *FamilyInfoCreate) Exec(ctx context.Context) error
- func (fic *FamilyInfoCreate) ExecX(ctx context.Context)
- func (fic *FamilyInfoCreate) Mutation() *FamilyInfoMutation
- func (fic *FamilyInfoCreate) Save(ctx context.Context) (*FamilyInfo, error)
- func (fic *FamilyInfoCreate) SaveX(ctx context.Context) *FamilyInfo
- func (fic *FamilyInfoCreate) SetAge(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetContactNumber(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetHealth(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetIDCard(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetName(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetNillableStudentID(id *int) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetOccupation(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetPost(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetRelationship(s string) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetStudent(s *Student) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetStudentID(id int) *FamilyInfoCreate
- func (fic *FamilyInfoCreate) SetWorkUnit(s string) *FamilyInfoCreate
- type FamilyInfoCreateBulk
- type FamilyInfoDelete
- type FamilyInfoDeleteOne
- type FamilyInfoEdges
- type FamilyInfoGroupBy
- func (figb *FamilyInfoGroupBy) Aggregate(fns ...AggregateFunc) *FamilyInfoGroupBy
- func (s *FamilyInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FamilyInfoGroupBy) BoolX(ctx context.Context) bool
- func (s *FamilyInfoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FamilyInfoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FamilyInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FamilyInfoGroupBy) Float64X(ctx context.Context) float64
- func (s *FamilyInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FamilyInfoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FamilyInfoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FamilyInfoGroupBy) IntX(ctx context.Context) int
- func (s *FamilyInfoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FamilyInfoGroupBy) IntsX(ctx context.Context) []int
- func (figb *FamilyInfoGroupBy) Scan(ctx context.Context, v any) error
- func (s *FamilyInfoGroupBy) ScanX(ctx context.Context, v any)
- func (s *FamilyInfoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FamilyInfoGroupBy) StringX(ctx context.Context) string
- func (s *FamilyInfoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FamilyInfoGroupBy) StringsX(ctx context.Context) []string
- type FamilyInfoMutation
- func (m *FamilyInfoMutation) AddField(name string, value ent.Value) error
- func (m *FamilyInfoMutation) AddedEdges() []string
- func (m *FamilyInfoMutation) AddedField(name string) (ent.Value, bool)
- func (m *FamilyInfoMutation) AddedFields() []string
- func (m *FamilyInfoMutation) AddedIDs(name string) []ent.Value
- func (m *FamilyInfoMutation) Age() (r string, exists bool)
- func (m *FamilyInfoMutation) ClearEdge(name string) error
- func (m *FamilyInfoMutation) ClearField(name string) error
- func (m *FamilyInfoMutation) ClearStudent()
- func (m *FamilyInfoMutation) ClearedEdges() []string
- func (m *FamilyInfoMutation) ClearedFields() []string
- func (m FamilyInfoMutation) Client() *Client
- func (m *FamilyInfoMutation) ContactNumber() (r string, exists bool)
- func (m *FamilyInfoMutation) EdgeCleared(name string) bool
- func (m *FamilyInfoMutation) Field(name string) (ent.Value, bool)
- func (m *FamilyInfoMutation) FieldCleared(name string) bool
- func (m *FamilyInfoMutation) Fields() []string
- func (m *FamilyInfoMutation) Health() (r string, exists bool)
- func (m *FamilyInfoMutation) ID() (id int, exists bool)
- func (m *FamilyInfoMutation) IDCard() (r string, exists bool)
- func (m *FamilyInfoMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FamilyInfoMutation) Name() (r string, exists bool)
- func (m *FamilyInfoMutation) Occupation() (r string, exists bool)
- func (m *FamilyInfoMutation) OldAge(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldContactNumber(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FamilyInfoMutation) OldHealth(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldIDCard(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldOccupation(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldPost(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldRelationship(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) OldWorkUnit(ctx context.Context) (v string, err error)
- func (m *FamilyInfoMutation) Op() Op
- func (m *FamilyInfoMutation) Post() (r string, exists bool)
- func (m *FamilyInfoMutation) Relationship() (r string, exists bool)
- func (m *FamilyInfoMutation) RemovedEdges() []string
- func (m *FamilyInfoMutation) RemovedIDs(name string) []ent.Value
- func (m *FamilyInfoMutation) ResetAge()
- func (m *FamilyInfoMutation) ResetContactNumber()
- func (m *FamilyInfoMutation) ResetEdge(name string) error
- func (m *FamilyInfoMutation) ResetField(name string) error
- func (m *FamilyInfoMutation) ResetHealth()
- func (m *FamilyInfoMutation) ResetIDCard()
- func (m *FamilyInfoMutation) ResetName()
- func (m *FamilyInfoMutation) ResetOccupation()
- func (m *FamilyInfoMutation) ResetPost()
- func (m *FamilyInfoMutation) ResetRelationship()
- func (m *FamilyInfoMutation) ResetStudent()
- func (m *FamilyInfoMutation) ResetWorkUnit()
- func (m *FamilyInfoMutation) SetAge(s string)
- func (m *FamilyInfoMutation) SetContactNumber(s string)
- func (m *FamilyInfoMutation) SetField(name string, value ent.Value) error
- func (m *FamilyInfoMutation) SetHealth(s string)
- func (m *FamilyInfoMutation) SetIDCard(s string)
- func (m *FamilyInfoMutation) SetName(s string)
- func (m *FamilyInfoMutation) SetOccupation(s string)
- func (m *FamilyInfoMutation) SetOp(op Op)
- func (m *FamilyInfoMutation) SetPost(s string)
- func (m *FamilyInfoMutation) SetRelationship(s string)
- func (m *FamilyInfoMutation) SetStudentID(id int)
- func (m *FamilyInfoMutation) SetWorkUnit(s string)
- func (m *FamilyInfoMutation) StudentCleared() bool
- func (m *FamilyInfoMutation) StudentID() (id int, exists bool)
- func (m *FamilyInfoMutation) StudentIDs() (ids []int)
- func (m FamilyInfoMutation) Tx() (*Tx, error)
- func (m *FamilyInfoMutation) Type() string
- func (m *FamilyInfoMutation) Where(ps ...predicate.FamilyInfo)
- func (m *FamilyInfoMutation) WhereP(ps ...func(*sql.Selector))
- func (m *FamilyInfoMutation) WorkUnit() (r string, exists bool)
- type FamilyInfoQuery
- func (fiq *FamilyInfoQuery) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect
- func (fiq *FamilyInfoQuery) All(ctx context.Context) ([]*FamilyInfo, error)
- func (fiq *FamilyInfoQuery) AllX(ctx context.Context) []*FamilyInfo
- func (fiq *FamilyInfoQuery) Clone() *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) Count(ctx context.Context) (int, error)
- func (fiq *FamilyInfoQuery) CountX(ctx context.Context) int
- func (fiq *FamilyInfoQuery) Exist(ctx context.Context) (bool, error)
- func (fiq *FamilyInfoQuery) ExistX(ctx context.Context) bool
- func (fiq *FamilyInfoQuery) First(ctx context.Context) (*FamilyInfo, error)
- func (fiq *FamilyInfoQuery) FirstID(ctx context.Context) (id int, err error)
- func (fiq *FamilyInfoQuery) FirstIDX(ctx context.Context) int
- func (fiq *FamilyInfoQuery) FirstX(ctx context.Context) *FamilyInfo
- func (fiq *FamilyInfoQuery) GroupBy(field string, fields ...string) *FamilyInfoGroupBy
- func (fiq *FamilyInfoQuery) IDs(ctx context.Context) (ids []int, err error)
- func (fiq *FamilyInfoQuery) IDsX(ctx context.Context) []int
- func (fiq *FamilyInfoQuery) Limit(limit int) *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) Offset(offset int) *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) Only(ctx context.Context) (*FamilyInfo, error)
- func (fiq *FamilyInfoQuery) OnlyID(ctx context.Context) (id int, err error)
- func (fiq *FamilyInfoQuery) OnlyIDX(ctx context.Context) int
- func (fiq *FamilyInfoQuery) OnlyX(ctx context.Context) *FamilyInfo
- func (fiq *FamilyInfoQuery) Order(o ...OrderFunc) *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) QueryStudent() *StudentQuery
- func (fiq *FamilyInfoQuery) Select(fields ...string) *FamilyInfoSelect
- func (fiq *FamilyInfoQuery) Unique(unique bool) *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) Where(ps ...predicate.FamilyInfo) *FamilyInfoQuery
- func (fiq *FamilyInfoQuery) WithStudent(opts ...func(*StudentQuery)) *FamilyInfoQuery
- type FamilyInfoSelect
- func (fis *FamilyInfoSelect) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect
- func (s *FamilyInfoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FamilyInfoSelect) BoolX(ctx context.Context) bool
- func (s *FamilyInfoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FamilyInfoSelect) BoolsX(ctx context.Context) []bool
- func (s *FamilyInfoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FamilyInfoSelect) Float64X(ctx context.Context) float64
- func (s *FamilyInfoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FamilyInfoSelect) Float64sX(ctx context.Context) []float64
- func (s *FamilyInfoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FamilyInfoSelect) IntX(ctx context.Context) int
- func (s *FamilyInfoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FamilyInfoSelect) IntsX(ctx context.Context) []int
- func (fis *FamilyInfoSelect) Scan(ctx context.Context, v any) error
- func (s *FamilyInfoSelect) ScanX(ctx context.Context, v any)
- func (s *FamilyInfoSelect) String(ctx context.Context) (_ string, err error)
- func (s *FamilyInfoSelect) StringX(ctx context.Context) string
- func (s *FamilyInfoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FamilyInfoSelect) StringsX(ctx context.Context) []string
- type FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) ClearStudent() *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) Exec(ctx context.Context) error
- func (fiu *FamilyInfoUpdate) ExecX(ctx context.Context)
- func (fiu *FamilyInfoUpdate) Mutation() *FamilyInfoMutation
- func (fiu *FamilyInfoUpdate) Save(ctx context.Context) (int, error)
- func (fiu *FamilyInfoUpdate) SaveX(ctx context.Context) int
- func (fiu *FamilyInfoUpdate) SetAge(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetContactNumber(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetHealth(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetIDCard(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetName(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetNillableStudentID(id *int) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetOccupation(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetPost(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetRelationship(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetStudent(s *Student) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetStudentID(id int) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) SetWorkUnit(s string) *FamilyInfoUpdate
- func (fiu *FamilyInfoUpdate) Where(ps ...predicate.FamilyInfo) *FamilyInfoUpdate
- type FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) ClearStudent() *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) Exec(ctx context.Context) error
- func (fiuo *FamilyInfoUpdateOne) ExecX(ctx context.Context)
- func (fiuo *FamilyInfoUpdateOne) Mutation() *FamilyInfoMutation
- func (fiuo *FamilyInfoUpdateOne) Save(ctx context.Context) (*FamilyInfo, error)
- func (fiuo *FamilyInfoUpdateOne) SaveX(ctx context.Context) *FamilyInfo
- func (fiuo *FamilyInfoUpdateOne) Select(field string, fields ...string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetAge(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetContactNumber(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetHealth(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetIDCard(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetName(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetNillableStudentID(id *int) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetOccupation(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetPost(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetRelationship(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetStudent(s *Student) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetStudentID(id int) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) SetWorkUnit(s string) *FamilyInfoUpdateOne
- func (fiuo *FamilyInfoUpdateOne) Where(ps ...predicate.FamilyInfo) *FamilyInfoUpdateOne
- type FamilyInfos
- type Hook
- type InterceptFunc
- type Interceptor
- type Major
- type MajorClient
- func (c *MajorClient) Create() *MajorCreate
- func (c *MajorClient) CreateBulk(builders ...*MajorCreate) *MajorCreateBulk
- func (c *MajorClient) Delete() *MajorDelete
- func (c *MajorClient) DeleteOne(m *Major) *MajorDeleteOne
- func (c *MajorClient) DeleteOneID(id int) *MajorDeleteOne
- func (c *MajorClient) Get(ctx context.Context, id int) (*Major, error)
- func (c *MajorClient) GetX(ctx context.Context, id int) *Major
- func (c *MajorClient) Hooks() []Hook
- func (c *MajorClient) Intercept(interceptors ...Interceptor)
- func (c *MajorClient) Interceptors() []Interceptor
- func (c *MajorClient) Query() *MajorQuery
- func (c *MajorClient) QueryClass(m *Major) *ClassQuery
- func (c *MajorClient) QueryDepartment(m *Major) *DepartmentQuery
- func (c *MajorClient) QueryStudent(m *Major) *StudentQuery
- func (c *MajorClient) Update() *MajorUpdate
- func (c *MajorClient) UpdateOne(m *Major) *MajorUpdateOne
- func (c *MajorClient) UpdateOneID(id int) *MajorUpdateOne
- func (c *MajorClient) Use(hooks ...Hook)
- type MajorCreate
- func (mc *MajorCreate) AddClasIDs(ids ...int) *MajorCreate
- func (mc *MajorCreate) AddClass(c ...*Class) *MajorCreate
- func (mc *MajorCreate) AddStudent(s ...*Student) *MajorCreate
- func (mc *MajorCreate) AddStudentIDs(ids ...int) *MajorCreate
- func (mc *MajorCreate) Exec(ctx context.Context) error
- func (mc *MajorCreate) ExecX(ctx context.Context)
- func (mc *MajorCreate) Mutation() *MajorMutation
- func (mc *MajorCreate) Save(ctx context.Context) (*Major, error)
- func (mc *MajorCreate) SaveX(ctx context.Context) *Major
- func (mc *MajorCreate) SetCode(s string) *MajorCreate
- func (mc *MajorCreate) SetDepartment(d *Department) *MajorCreate
- func (mc *MajorCreate) SetDepartmentID(id int) *MajorCreate
- func (mc *MajorCreate) SetDescription(s string) *MajorCreate
- func (mc *MajorCreate) SetEnrollmentType(s string) *MajorCreate
- func (mc *MajorCreate) SetIsMajorCategory(b bool) *MajorCreate
- func (mc *MajorCreate) SetMajorCategory(s string) *MajorCreate
- func (mc *MajorCreate) SetName(s string) *MajorCreate
- func (mc *MajorCreate) SetNillableDepartmentID(id *int) *MajorCreate
- func (mc *MajorCreate) SetSpecialType(s string) *MajorCreate
- type MajorCreateBulk
- type MajorDelete
- type MajorDeleteOne
- type MajorDirection
- type MajorDirectionClient
- func (c *MajorDirectionClient) Create() *MajorDirectionCreate
- func (c *MajorDirectionClient) CreateBulk(builders ...*MajorDirectionCreate) *MajorDirectionCreateBulk
- func (c *MajorDirectionClient) Delete() *MajorDirectionDelete
- func (c *MajorDirectionClient) DeleteOne(md *MajorDirection) *MajorDirectionDeleteOne
- func (c *MajorDirectionClient) DeleteOneID(id int) *MajorDirectionDeleteOne
- func (c *MajorDirectionClient) Get(ctx context.Context, id int) (*MajorDirection, error)
- func (c *MajorDirectionClient) GetX(ctx context.Context, id int) *MajorDirection
- func (c *MajorDirectionClient) Hooks() []Hook
- func (c *MajorDirectionClient) Intercept(interceptors ...Interceptor)
- func (c *MajorDirectionClient) Interceptors() []Interceptor
- func (c *MajorDirectionClient) Query() *MajorDirectionQuery
- func (c *MajorDirectionClient) QueryClass(md *MajorDirection) *ClassQuery
- func (c *MajorDirectionClient) Update() *MajorDirectionUpdate
- func (c *MajorDirectionClient) UpdateOne(md *MajorDirection) *MajorDirectionUpdateOne
- func (c *MajorDirectionClient) UpdateOneID(id int) *MajorDirectionUpdateOne
- func (c *MajorDirectionClient) Use(hooks ...Hook)
- type MajorDirectionCreate
- func (mdc *MajorDirectionCreate) Exec(ctx context.Context) error
- func (mdc *MajorDirectionCreate) ExecX(ctx context.Context)
- func (mdc *MajorDirectionCreate) Mutation() *MajorDirectionMutation
- func (mdc *MajorDirectionCreate) Save(ctx context.Context) (*MajorDirection, error)
- func (mdc *MajorDirectionCreate) SaveX(ctx context.Context) *MajorDirection
- func (mdc *MajorDirectionCreate) SetClass(c *Class) *MajorDirectionCreate
- func (mdc *MajorDirectionCreate) SetClassID(id int) *MajorDirectionCreate
- func (mdc *MajorDirectionCreate) SetName(s string) *MajorDirectionCreate
- func (mdc *MajorDirectionCreate) SetNillableClassID(id *int) *MajorDirectionCreate
- type MajorDirectionCreateBulk
- func (mdcb *MajorDirectionCreateBulk) Exec(ctx context.Context) error
- func (mdcb *MajorDirectionCreateBulk) ExecX(ctx context.Context)
- func (mdcb *MajorDirectionCreateBulk) Save(ctx context.Context) ([]*MajorDirection, error)
- func (mdcb *MajorDirectionCreateBulk) SaveX(ctx context.Context) []*MajorDirection
- type MajorDirectionDelete
- type MajorDirectionDeleteOne
- type MajorDirectionEdges
- type MajorDirectionGroupBy
- func (mdgb *MajorDirectionGroupBy) Aggregate(fns ...AggregateFunc) *MajorDirectionGroupBy
- func (s *MajorDirectionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MajorDirectionGroupBy) BoolX(ctx context.Context) bool
- func (s *MajorDirectionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MajorDirectionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MajorDirectionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MajorDirectionGroupBy) Float64X(ctx context.Context) float64
- func (s *MajorDirectionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MajorDirectionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MajorDirectionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MajorDirectionGroupBy) IntX(ctx context.Context) int
- func (s *MajorDirectionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MajorDirectionGroupBy) IntsX(ctx context.Context) []int
- func (mdgb *MajorDirectionGroupBy) Scan(ctx context.Context, v any) error
- func (s *MajorDirectionGroupBy) ScanX(ctx context.Context, v any)
- func (s *MajorDirectionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MajorDirectionGroupBy) StringX(ctx context.Context) string
- func (s *MajorDirectionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MajorDirectionGroupBy) StringsX(ctx context.Context) []string
- type MajorDirectionMutation
- func (m *MajorDirectionMutation) AddField(name string, value ent.Value) error
- func (m *MajorDirectionMutation) AddedEdges() []string
- func (m *MajorDirectionMutation) AddedField(name string) (ent.Value, bool)
- func (m *MajorDirectionMutation) AddedFields() []string
- func (m *MajorDirectionMutation) AddedIDs(name string) []ent.Value
- func (m *MajorDirectionMutation) ClassCleared() bool
- func (m *MajorDirectionMutation) ClassID() (id int, exists bool)
- func (m *MajorDirectionMutation) ClassIDs() (ids []int)
- func (m *MajorDirectionMutation) ClearClass()
- func (m *MajorDirectionMutation) ClearEdge(name string) error
- func (m *MajorDirectionMutation) ClearField(name string) error
- func (m *MajorDirectionMutation) ClearedEdges() []string
- func (m *MajorDirectionMutation) ClearedFields() []string
- func (m MajorDirectionMutation) Client() *Client
- func (m *MajorDirectionMutation) EdgeCleared(name string) bool
- func (m *MajorDirectionMutation) Field(name string) (ent.Value, bool)
- func (m *MajorDirectionMutation) FieldCleared(name string) bool
- func (m *MajorDirectionMutation) Fields() []string
- func (m *MajorDirectionMutation) ID() (id int, exists bool)
- func (m *MajorDirectionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MajorDirectionMutation) Name() (r string, exists bool)
- func (m *MajorDirectionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MajorDirectionMutation) OldName(ctx context.Context) (v string, err error)
- func (m *MajorDirectionMutation) Op() Op
- func (m *MajorDirectionMutation) RemovedEdges() []string
- func (m *MajorDirectionMutation) RemovedIDs(name string) []ent.Value
- func (m *MajorDirectionMutation) ResetClass()
- func (m *MajorDirectionMutation) ResetEdge(name string) error
- func (m *MajorDirectionMutation) ResetField(name string) error
- func (m *MajorDirectionMutation) ResetName()
- func (m *MajorDirectionMutation) SetClassID(id int)
- func (m *MajorDirectionMutation) SetField(name string, value ent.Value) error
- func (m *MajorDirectionMutation) SetName(s string)
- func (m *MajorDirectionMutation) SetOp(op Op)
- func (m MajorDirectionMutation) Tx() (*Tx, error)
- func (m *MajorDirectionMutation) Type() string
- func (m *MajorDirectionMutation) Where(ps ...predicate.MajorDirection)
- func (m *MajorDirectionMutation) WhereP(ps ...func(*sql.Selector))
- type MajorDirectionQuery
- func (mdq *MajorDirectionQuery) Aggregate(fns ...AggregateFunc) *MajorDirectionSelect
- func (mdq *MajorDirectionQuery) All(ctx context.Context) ([]*MajorDirection, error)
- func (mdq *MajorDirectionQuery) AllX(ctx context.Context) []*MajorDirection
- func (mdq *MajorDirectionQuery) Clone() *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) Count(ctx context.Context) (int, error)
- func (mdq *MajorDirectionQuery) CountX(ctx context.Context) int
- func (mdq *MajorDirectionQuery) Exist(ctx context.Context) (bool, error)
- func (mdq *MajorDirectionQuery) ExistX(ctx context.Context) bool
- func (mdq *MajorDirectionQuery) First(ctx context.Context) (*MajorDirection, error)
- func (mdq *MajorDirectionQuery) FirstID(ctx context.Context) (id int, err error)
- func (mdq *MajorDirectionQuery) FirstIDX(ctx context.Context) int
- func (mdq *MajorDirectionQuery) FirstX(ctx context.Context) *MajorDirection
- func (mdq *MajorDirectionQuery) GroupBy(field string, fields ...string) *MajorDirectionGroupBy
- func (mdq *MajorDirectionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mdq *MajorDirectionQuery) IDsX(ctx context.Context) []int
- func (mdq *MajorDirectionQuery) Limit(limit int) *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) Offset(offset int) *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) Only(ctx context.Context) (*MajorDirection, error)
- func (mdq *MajorDirectionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mdq *MajorDirectionQuery) OnlyIDX(ctx context.Context) int
- func (mdq *MajorDirectionQuery) OnlyX(ctx context.Context) *MajorDirection
- func (mdq *MajorDirectionQuery) Order(o ...OrderFunc) *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) QueryClass() *ClassQuery
- func (mdq *MajorDirectionQuery) Select(fields ...string) *MajorDirectionSelect
- func (mdq *MajorDirectionQuery) Unique(unique bool) *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) Where(ps ...predicate.MajorDirection) *MajorDirectionQuery
- func (mdq *MajorDirectionQuery) WithClass(opts ...func(*ClassQuery)) *MajorDirectionQuery
- type MajorDirectionSelect
- func (mds *MajorDirectionSelect) Aggregate(fns ...AggregateFunc) *MajorDirectionSelect
- func (s *MajorDirectionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MajorDirectionSelect) BoolX(ctx context.Context) bool
- func (s *MajorDirectionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MajorDirectionSelect) BoolsX(ctx context.Context) []bool
- func (s *MajorDirectionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MajorDirectionSelect) Float64X(ctx context.Context) float64
- func (s *MajorDirectionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MajorDirectionSelect) Float64sX(ctx context.Context) []float64
- func (s *MajorDirectionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MajorDirectionSelect) IntX(ctx context.Context) int
- func (s *MajorDirectionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MajorDirectionSelect) IntsX(ctx context.Context) []int
- func (mds *MajorDirectionSelect) Scan(ctx context.Context, v any) error
- func (s *MajorDirectionSelect) ScanX(ctx context.Context, v any)
- func (s *MajorDirectionSelect) String(ctx context.Context) (_ string, err error)
- func (s *MajorDirectionSelect) StringX(ctx context.Context) string
- func (s *MajorDirectionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MajorDirectionSelect) StringsX(ctx context.Context) []string
- type MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) ClearClass() *MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) Exec(ctx context.Context) error
- func (mdu *MajorDirectionUpdate) ExecX(ctx context.Context)
- func (mdu *MajorDirectionUpdate) Mutation() *MajorDirectionMutation
- func (mdu *MajorDirectionUpdate) Save(ctx context.Context) (int, error)
- func (mdu *MajorDirectionUpdate) SaveX(ctx context.Context) int
- func (mdu *MajorDirectionUpdate) SetClass(c *Class) *MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) SetClassID(id int) *MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) SetName(s string) *MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) SetNillableClassID(id *int) *MajorDirectionUpdate
- func (mdu *MajorDirectionUpdate) Where(ps ...predicate.MajorDirection) *MajorDirectionUpdate
- type MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) ClearClass() *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) Exec(ctx context.Context) error
- func (mduo *MajorDirectionUpdateOne) ExecX(ctx context.Context)
- func (mduo *MajorDirectionUpdateOne) Mutation() *MajorDirectionMutation
- func (mduo *MajorDirectionUpdateOne) Save(ctx context.Context) (*MajorDirection, error)
- func (mduo *MajorDirectionUpdateOne) SaveX(ctx context.Context) *MajorDirection
- func (mduo *MajorDirectionUpdateOne) Select(field string, fields ...string) *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) SetClass(c *Class) *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) SetClassID(id int) *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) SetName(s string) *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) SetNillableClassID(id *int) *MajorDirectionUpdateOne
- func (mduo *MajorDirectionUpdateOne) Where(ps ...predicate.MajorDirection) *MajorDirectionUpdateOne
- type MajorDirections
- type MajorEdges
- type MajorGroupBy
- func (mgb *MajorGroupBy) Aggregate(fns ...AggregateFunc) *MajorGroupBy
- func (s *MajorGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MajorGroupBy) BoolX(ctx context.Context) bool
- func (s *MajorGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MajorGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MajorGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MajorGroupBy) Float64X(ctx context.Context) float64
- func (s *MajorGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MajorGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MajorGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MajorGroupBy) IntX(ctx context.Context) int
- func (s *MajorGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MajorGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MajorGroupBy) Scan(ctx context.Context, v any) error
- func (s *MajorGroupBy) ScanX(ctx context.Context, v any)
- func (s *MajorGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MajorGroupBy) StringX(ctx context.Context) string
- func (s *MajorGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MajorGroupBy) StringsX(ctx context.Context) []string
- type MajorMutation
- func (m *MajorMutation) AddClasIDs(ids ...int)
- func (m *MajorMutation) AddField(name string, value ent.Value) error
- func (m *MajorMutation) AddStudentIDs(ids ...int)
- func (m *MajorMutation) AddedEdges() []string
- func (m *MajorMutation) AddedField(name string) (ent.Value, bool)
- func (m *MajorMutation) AddedFields() []string
- func (m *MajorMutation) AddedIDs(name string) []ent.Value
- func (m *MajorMutation) ClassCleared() bool
- func (m *MajorMutation) ClassIDs() (ids []int)
- func (m *MajorMutation) ClearClass()
- func (m *MajorMutation) ClearDepartment()
- func (m *MajorMutation) ClearEdge(name string) error
- func (m *MajorMutation) ClearField(name string) error
- func (m *MajorMutation) ClearStudent()
- func (m *MajorMutation) ClearedEdges() []string
- func (m *MajorMutation) ClearedFields() []string
- func (m MajorMutation) Client() *Client
- func (m *MajorMutation) Code() (r string, exists bool)
- func (m *MajorMutation) DepartmentCleared() bool
- func (m *MajorMutation) DepartmentID() (id int, exists bool)
- func (m *MajorMutation) DepartmentIDs() (ids []int)
- func (m *MajorMutation) Description() (r string, exists bool)
- func (m *MajorMutation) EdgeCleared(name string) bool
- func (m *MajorMutation) EnrollmentType() (r string, exists bool)
- func (m *MajorMutation) Field(name string) (ent.Value, bool)
- func (m *MajorMutation) FieldCleared(name string) bool
- func (m *MajorMutation) Fields() []string
- func (m *MajorMutation) ID() (id int, exists bool)
- func (m *MajorMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MajorMutation) IsMajorCategory() (r bool, exists bool)
- func (m *MajorMutation) MajorCategory() (r string, exists bool)
- func (m *MajorMutation) Name() (r string, exists bool)
- func (m *MajorMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *MajorMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *MajorMutation) OldEnrollmentType(ctx context.Context) (v string, err error)
- func (m *MajorMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MajorMutation) OldIsMajorCategory(ctx context.Context) (v bool, err error)
- func (m *MajorMutation) OldMajorCategory(ctx context.Context) (v string, err error)
- func (m *MajorMutation) OldName(ctx context.Context) (v string, err error)
- func (m *MajorMutation) OldSpecialType(ctx context.Context) (v string, err error)
- func (m *MajorMutation) Op() Op
- func (m *MajorMutation) RemoveClasIDs(ids ...int)
- func (m *MajorMutation) RemoveStudentIDs(ids ...int)
- func (m *MajorMutation) RemovedClassIDs() (ids []int)
- func (m *MajorMutation) RemovedEdges() []string
- func (m *MajorMutation) RemovedIDs(name string) []ent.Value
- func (m *MajorMutation) RemovedStudentIDs() (ids []int)
- func (m *MajorMutation) ResetClass()
- func (m *MajorMutation) ResetCode()
- func (m *MajorMutation) ResetDepartment()
- func (m *MajorMutation) ResetDescription()
- func (m *MajorMutation) ResetEdge(name string) error
- func (m *MajorMutation) ResetEnrollmentType()
- func (m *MajorMutation) ResetField(name string) error
- func (m *MajorMutation) ResetIsMajorCategory()
- func (m *MajorMutation) ResetMajorCategory()
- func (m *MajorMutation) ResetName()
- func (m *MajorMutation) ResetSpecialType()
- func (m *MajorMutation) ResetStudent()
- func (m *MajorMutation) SetCode(s string)
- func (m *MajorMutation) SetDepartmentID(id int)
- func (m *MajorMutation) SetDescription(s string)
- func (m *MajorMutation) SetEnrollmentType(s string)
- func (m *MajorMutation) SetField(name string, value ent.Value) error
- func (m *MajorMutation) SetIsMajorCategory(b bool)
- func (m *MajorMutation) SetMajorCategory(s string)
- func (m *MajorMutation) SetName(s string)
- func (m *MajorMutation) SetOp(op Op)
- func (m *MajorMutation) SetSpecialType(s string)
- func (m *MajorMutation) SpecialType() (r string, exists bool)
- func (m *MajorMutation) StudentCleared() bool
- func (m *MajorMutation) StudentIDs() (ids []int)
- func (m MajorMutation) Tx() (*Tx, error)
- func (m *MajorMutation) Type() string
- func (m *MajorMutation) Where(ps ...predicate.Major)
- func (m *MajorMutation) WhereP(ps ...func(*sql.Selector))
- type MajorQuery
- func (mq *MajorQuery) Aggregate(fns ...AggregateFunc) *MajorSelect
- func (mq *MajorQuery) All(ctx context.Context) ([]*Major, error)
- func (mq *MajorQuery) AllX(ctx context.Context) []*Major
- func (mq *MajorQuery) Clone() *MajorQuery
- func (mq *MajorQuery) Count(ctx context.Context) (int, error)
- func (mq *MajorQuery) CountX(ctx context.Context) int
- func (mq *MajorQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MajorQuery) ExistX(ctx context.Context) bool
- func (mq *MajorQuery) First(ctx context.Context) (*Major, error)
- func (mq *MajorQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MajorQuery) FirstIDX(ctx context.Context) int
- func (mq *MajorQuery) FirstX(ctx context.Context) *Major
- func (mq *MajorQuery) GroupBy(field string, fields ...string) *MajorGroupBy
- func (mq *MajorQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mq *MajorQuery) IDsX(ctx context.Context) []int
- func (mq *MajorQuery) Limit(limit int) *MajorQuery
- func (mq *MajorQuery) Offset(offset int) *MajorQuery
- func (mq *MajorQuery) Only(ctx context.Context) (*Major, error)
- func (mq *MajorQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MajorQuery) OnlyIDX(ctx context.Context) int
- func (mq *MajorQuery) OnlyX(ctx context.Context) *Major
- func (mq *MajorQuery) Order(o ...OrderFunc) *MajorQuery
- func (mq *MajorQuery) QueryClass() *ClassQuery
- func (mq *MajorQuery) QueryDepartment() *DepartmentQuery
- func (mq *MajorQuery) QueryStudent() *StudentQuery
- func (mq *MajorQuery) Select(fields ...string) *MajorSelect
- func (mq *MajorQuery) Unique(unique bool) *MajorQuery
- func (mq *MajorQuery) Where(ps ...predicate.Major) *MajorQuery
- func (mq *MajorQuery) WithClass(opts ...func(*ClassQuery)) *MajorQuery
- func (mq *MajorQuery) WithDepartment(opts ...func(*DepartmentQuery)) *MajorQuery
- func (mq *MajorQuery) WithStudent(opts ...func(*StudentQuery)) *MajorQuery
- type MajorSelect
- func (ms *MajorSelect) Aggregate(fns ...AggregateFunc) *MajorSelect
- func (s *MajorSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MajorSelect) BoolX(ctx context.Context) bool
- func (s *MajorSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MajorSelect) BoolsX(ctx context.Context) []bool
- func (s *MajorSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MajorSelect) Float64X(ctx context.Context) float64
- func (s *MajorSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MajorSelect) Float64sX(ctx context.Context) []float64
- func (s *MajorSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MajorSelect) IntX(ctx context.Context) int
- func (s *MajorSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MajorSelect) IntsX(ctx context.Context) []int
- func (ms *MajorSelect) Scan(ctx context.Context, v any) error
- func (s *MajorSelect) ScanX(ctx context.Context, v any)
- func (s *MajorSelect) String(ctx context.Context) (_ string, err error)
- func (s *MajorSelect) StringX(ctx context.Context) string
- func (s *MajorSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MajorSelect) StringsX(ctx context.Context) []string
- type MajorUpdate
- func (mu *MajorUpdate) AddClasIDs(ids ...int) *MajorUpdate
- func (mu *MajorUpdate) AddClass(c ...*Class) *MajorUpdate
- func (mu *MajorUpdate) AddStudent(s ...*Student) *MajorUpdate
- func (mu *MajorUpdate) AddStudentIDs(ids ...int) *MajorUpdate
- func (mu *MajorUpdate) ClearClass() *MajorUpdate
- func (mu *MajorUpdate) ClearDepartment() *MajorUpdate
- func (mu *MajorUpdate) ClearStudent() *MajorUpdate
- func (mu *MajorUpdate) Exec(ctx context.Context) error
- func (mu *MajorUpdate) ExecX(ctx context.Context)
- func (mu *MajorUpdate) Mutation() *MajorMutation
- func (mu *MajorUpdate) RemoveClasIDs(ids ...int) *MajorUpdate
- func (mu *MajorUpdate) RemoveClass(c ...*Class) *MajorUpdate
- func (mu *MajorUpdate) RemoveStudent(s ...*Student) *MajorUpdate
- func (mu *MajorUpdate) RemoveStudentIDs(ids ...int) *MajorUpdate
- func (mu *MajorUpdate) Save(ctx context.Context) (int, error)
- func (mu *MajorUpdate) SaveX(ctx context.Context) int
- func (mu *MajorUpdate) SetCode(s string) *MajorUpdate
- func (mu *MajorUpdate) SetDepartment(d *Department) *MajorUpdate
- func (mu *MajorUpdate) SetDepartmentID(id int) *MajorUpdate
- func (mu *MajorUpdate) SetDescription(s string) *MajorUpdate
- func (mu *MajorUpdate) SetEnrollmentType(s string) *MajorUpdate
- func (mu *MajorUpdate) SetIsMajorCategory(b bool) *MajorUpdate
- func (mu *MajorUpdate) SetMajorCategory(s string) *MajorUpdate
- func (mu *MajorUpdate) SetName(s string) *MajorUpdate
- func (mu *MajorUpdate) SetNillableDepartmentID(id *int) *MajorUpdate
- func (mu *MajorUpdate) SetSpecialType(s string) *MajorUpdate
- func (mu *MajorUpdate) Where(ps ...predicate.Major) *MajorUpdate
- type MajorUpdateOne
- func (muo *MajorUpdateOne) AddClasIDs(ids ...int) *MajorUpdateOne
- func (muo *MajorUpdateOne) AddClass(c ...*Class) *MajorUpdateOne
- func (muo *MajorUpdateOne) AddStudent(s ...*Student) *MajorUpdateOne
- func (muo *MajorUpdateOne) AddStudentIDs(ids ...int) *MajorUpdateOne
- func (muo *MajorUpdateOne) ClearClass() *MajorUpdateOne
- func (muo *MajorUpdateOne) ClearDepartment() *MajorUpdateOne
- func (muo *MajorUpdateOne) ClearStudent() *MajorUpdateOne
- func (muo *MajorUpdateOne) Exec(ctx context.Context) error
- func (muo *MajorUpdateOne) ExecX(ctx context.Context)
- func (muo *MajorUpdateOne) Mutation() *MajorMutation
- func (muo *MajorUpdateOne) RemoveClasIDs(ids ...int) *MajorUpdateOne
- func (muo *MajorUpdateOne) RemoveClass(c ...*Class) *MajorUpdateOne
- func (muo *MajorUpdateOne) RemoveStudent(s ...*Student) *MajorUpdateOne
- func (muo *MajorUpdateOne) RemoveStudentIDs(ids ...int) *MajorUpdateOne
- func (muo *MajorUpdateOne) Save(ctx context.Context) (*Major, error)
- func (muo *MajorUpdateOne) SaveX(ctx context.Context) *Major
- func (muo *MajorUpdateOne) Select(field string, fields ...string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetCode(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetDepartment(d *Department) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetDepartmentID(id int) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetDescription(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetEnrollmentType(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetIsMajorCategory(b bool) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetMajorCategory(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetName(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetNillableDepartmentID(id *int) *MajorUpdateOne
- func (muo *MajorUpdateOne) SetSpecialType(s string) *MajorUpdateOne
- func (muo *MajorUpdateOne) Where(ps ...predicate.Major) *MajorUpdateOne
- type Majors
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type PracticalExperience
- type PracticalExperienceClient
- func (c *PracticalExperienceClient) Create() *PracticalExperienceCreate
- func (c *PracticalExperienceClient) CreateBulk(builders ...*PracticalExperienceCreate) *PracticalExperienceCreateBulk
- func (c *PracticalExperienceClient) Delete() *PracticalExperienceDelete
- func (c *PracticalExperienceClient) DeleteOne(pe *PracticalExperience) *PracticalExperienceDeleteOne
- func (c *PracticalExperienceClient) DeleteOneID(id int) *PracticalExperienceDeleteOne
- func (c *PracticalExperienceClient) Get(ctx context.Context, id int) (*PracticalExperience, error)
- func (c *PracticalExperienceClient) GetX(ctx context.Context, id int) *PracticalExperience
- func (c *PracticalExperienceClient) Hooks() []Hook
- func (c *PracticalExperienceClient) Intercept(interceptors ...Interceptor)
- func (c *PracticalExperienceClient) Interceptors() []Interceptor
- func (c *PracticalExperienceClient) Query() *PracticalExperienceQuery
- func (c *PracticalExperienceClient) QueryStudent(pe *PracticalExperience) *StudentQuery
- func (c *PracticalExperienceClient) Update() *PracticalExperienceUpdate
- func (c *PracticalExperienceClient) UpdateOne(pe *PracticalExperience) *PracticalExperienceUpdateOne
- func (c *PracticalExperienceClient) UpdateOneID(id int) *PracticalExperienceUpdateOne
- func (c *PracticalExperienceClient) Use(hooks ...Hook)
- type PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) Exec(ctx context.Context) error
- func (pec *PracticalExperienceCreate) ExecX(ctx context.Context)
- func (pec *PracticalExperienceCreate) Mutation() *PracticalExperienceMutation
- func (pec *PracticalExperienceCreate) Save(ctx context.Context) (*PracticalExperience, error)
- func (pec *PracticalExperienceCreate) SaveX(ctx context.Context) *PracticalExperience
- func (pec *PracticalExperienceCreate) SetDescribe(s string) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetEndTime(s string) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetName(s string) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetNillableStudentID(id *int) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetStartTime(s string) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetStudent(s *Student) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetStudentID(id int) *PracticalExperienceCreate
- func (pec *PracticalExperienceCreate) SetUnit(s string) *PracticalExperienceCreate
- type PracticalExperienceCreateBulk
- func (pecb *PracticalExperienceCreateBulk) Exec(ctx context.Context) error
- func (pecb *PracticalExperienceCreateBulk) ExecX(ctx context.Context)
- func (pecb *PracticalExperienceCreateBulk) Save(ctx context.Context) ([]*PracticalExperience, error)
- func (pecb *PracticalExperienceCreateBulk) SaveX(ctx context.Context) []*PracticalExperience
- type PracticalExperienceDelete
- type PracticalExperienceDeleteOne
- type PracticalExperienceEdges
- type PracticalExperienceGroupBy
- func (pegb *PracticalExperienceGroupBy) Aggregate(fns ...AggregateFunc) *PracticalExperienceGroupBy
- func (s *PracticalExperienceGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PracticalExperienceGroupBy) BoolX(ctx context.Context) bool
- func (s *PracticalExperienceGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PracticalExperienceGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PracticalExperienceGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PracticalExperienceGroupBy) Float64X(ctx context.Context) float64
- func (s *PracticalExperienceGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PracticalExperienceGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PracticalExperienceGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PracticalExperienceGroupBy) IntX(ctx context.Context) int
- func (s *PracticalExperienceGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PracticalExperienceGroupBy) IntsX(ctx context.Context) []int
- func (pegb *PracticalExperienceGroupBy) Scan(ctx context.Context, v any) error
- func (s *PracticalExperienceGroupBy) ScanX(ctx context.Context, v any)
- func (s *PracticalExperienceGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PracticalExperienceGroupBy) StringX(ctx context.Context) string
- func (s *PracticalExperienceGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PracticalExperienceGroupBy) StringsX(ctx context.Context) []string
- type PracticalExperienceMutation
- func (m *PracticalExperienceMutation) AddField(name string, value ent.Value) error
- func (m *PracticalExperienceMutation) AddedEdges() []string
- func (m *PracticalExperienceMutation) AddedField(name string) (ent.Value, bool)
- func (m *PracticalExperienceMutation) AddedFields() []string
- func (m *PracticalExperienceMutation) AddedIDs(name string) []ent.Value
- func (m *PracticalExperienceMutation) ClearEdge(name string) error
- func (m *PracticalExperienceMutation) ClearField(name string) error
- func (m *PracticalExperienceMutation) ClearStudent()
- func (m *PracticalExperienceMutation) ClearedEdges() []string
- func (m *PracticalExperienceMutation) ClearedFields() []string
- func (m PracticalExperienceMutation) Client() *Client
- func (m *PracticalExperienceMutation) Describe() (r string, exists bool)
- func (m *PracticalExperienceMutation) EdgeCleared(name string) bool
- func (m *PracticalExperienceMutation) EndTime() (r string, exists bool)
- func (m *PracticalExperienceMutation) Field(name string) (ent.Value, bool)
- func (m *PracticalExperienceMutation) FieldCleared(name string) bool
- func (m *PracticalExperienceMutation) Fields() []string
- func (m *PracticalExperienceMutation) ID() (id int, exists bool)
- func (m *PracticalExperienceMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PracticalExperienceMutation) Name() (r string, exists bool)
- func (m *PracticalExperienceMutation) OldDescribe(ctx context.Context) (v string, err error)
- func (m *PracticalExperienceMutation) OldEndTime(ctx context.Context) (v string, err error)
- func (m *PracticalExperienceMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PracticalExperienceMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PracticalExperienceMutation) OldStartTime(ctx context.Context) (v string, err error)
- func (m *PracticalExperienceMutation) OldUnit(ctx context.Context) (v string, err error)
- func (m *PracticalExperienceMutation) Op() Op
- func (m *PracticalExperienceMutation) RemovedEdges() []string
- func (m *PracticalExperienceMutation) RemovedIDs(name string) []ent.Value
- func (m *PracticalExperienceMutation) ResetDescribe()
- func (m *PracticalExperienceMutation) ResetEdge(name string) error
- func (m *PracticalExperienceMutation) ResetEndTime()
- func (m *PracticalExperienceMutation) ResetField(name string) error
- func (m *PracticalExperienceMutation) ResetName()
- func (m *PracticalExperienceMutation) ResetStartTime()
- func (m *PracticalExperienceMutation) ResetStudent()
- func (m *PracticalExperienceMutation) ResetUnit()
- func (m *PracticalExperienceMutation) SetDescribe(s string)
- func (m *PracticalExperienceMutation) SetEndTime(s string)
- func (m *PracticalExperienceMutation) SetField(name string, value ent.Value) error
- func (m *PracticalExperienceMutation) SetName(s string)
- func (m *PracticalExperienceMutation) SetOp(op Op)
- func (m *PracticalExperienceMutation) SetStartTime(s string)
- func (m *PracticalExperienceMutation) SetStudentID(id int)
- func (m *PracticalExperienceMutation) SetUnit(s string)
- func (m *PracticalExperienceMutation) StartTime() (r string, exists bool)
- func (m *PracticalExperienceMutation) StudentCleared() bool
- func (m *PracticalExperienceMutation) StudentID() (id int, exists bool)
- func (m *PracticalExperienceMutation) StudentIDs() (ids []int)
- func (m PracticalExperienceMutation) Tx() (*Tx, error)
- func (m *PracticalExperienceMutation) Type() string
- func (m *PracticalExperienceMutation) Unit() (r string, exists bool)
- func (m *PracticalExperienceMutation) Where(ps ...predicate.PracticalExperience)
- func (m *PracticalExperienceMutation) WhereP(ps ...func(*sql.Selector))
- type PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) Aggregate(fns ...AggregateFunc) *PracticalExperienceSelect
- func (peq *PracticalExperienceQuery) All(ctx context.Context) ([]*PracticalExperience, error)
- func (peq *PracticalExperienceQuery) AllX(ctx context.Context) []*PracticalExperience
- func (peq *PracticalExperienceQuery) Clone() *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) Count(ctx context.Context) (int, error)
- func (peq *PracticalExperienceQuery) CountX(ctx context.Context) int
- func (peq *PracticalExperienceQuery) Exist(ctx context.Context) (bool, error)
- func (peq *PracticalExperienceQuery) ExistX(ctx context.Context) bool
- func (peq *PracticalExperienceQuery) First(ctx context.Context) (*PracticalExperience, error)
- func (peq *PracticalExperienceQuery) FirstID(ctx context.Context) (id int, err error)
- func (peq *PracticalExperienceQuery) FirstIDX(ctx context.Context) int
- func (peq *PracticalExperienceQuery) FirstX(ctx context.Context) *PracticalExperience
- func (peq *PracticalExperienceQuery) GroupBy(field string, fields ...string) *PracticalExperienceGroupBy
- func (peq *PracticalExperienceQuery) IDs(ctx context.Context) (ids []int, err error)
- func (peq *PracticalExperienceQuery) IDsX(ctx context.Context) []int
- func (peq *PracticalExperienceQuery) Limit(limit int) *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) Offset(offset int) *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) Only(ctx context.Context) (*PracticalExperience, error)
- func (peq *PracticalExperienceQuery) OnlyID(ctx context.Context) (id int, err error)
- func (peq *PracticalExperienceQuery) OnlyIDX(ctx context.Context) int
- func (peq *PracticalExperienceQuery) OnlyX(ctx context.Context) *PracticalExperience
- func (peq *PracticalExperienceQuery) Order(o ...OrderFunc) *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) QueryStudent() *StudentQuery
- func (peq *PracticalExperienceQuery) Select(fields ...string) *PracticalExperienceSelect
- func (peq *PracticalExperienceQuery) Unique(unique bool) *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) Where(ps ...predicate.PracticalExperience) *PracticalExperienceQuery
- func (peq *PracticalExperienceQuery) WithStudent(opts ...func(*StudentQuery)) *PracticalExperienceQuery
- type PracticalExperienceSelect
- func (pes *PracticalExperienceSelect) Aggregate(fns ...AggregateFunc) *PracticalExperienceSelect
- func (s *PracticalExperienceSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PracticalExperienceSelect) BoolX(ctx context.Context) bool
- func (s *PracticalExperienceSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PracticalExperienceSelect) BoolsX(ctx context.Context) []bool
- func (s *PracticalExperienceSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PracticalExperienceSelect) Float64X(ctx context.Context) float64
- func (s *PracticalExperienceSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PracticalExperienceSelect) Float64sX(ctx context.Context) []float64
- func (s *PracticalExperienceSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PracticalExperienceSelect) IntX(ctx context.Context) int
- func (s *PracticalExperienceSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PracticalExperienceSelect) IntsX(ctx context.Context) []int
- func (pes *PracticalExperienceSelect) Scan(ctx context.Context, v any) error
- func (s *PracticalExperienceSelect) ScanX(ctx context.Context, v any)
- func (s *PracticalExperienceSelect) String(ctx context.Context) (_ string, err error)
- func (s *PracticalExperienceSelect) StringX(ctx context.Context) string
- func (s *PracticalExperienceSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PracticalExperienceSelect) StringsX(ctx context.Context) []string
- type PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) ClearStudent() *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) Exec(ctx context.Context) error
- func (peu *PracticalExperienceUpdate) ExecX(ctx context.Context)
- func (peu *PracticalExperienceUpdate) Mutation() *PracticalExperienceMutation
- func (peu *PracticalExperienceUpdate) Save(ctx context.Context) (int, error)
- func (peu *PracticalExperienceUpdate) SaveX(ctx context.Context) int
- func (peu *PracticalExperienceUpdate) SetDescribe(s string) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetEndTime(s string) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetName(s string) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetNillableStudentID(id *int) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetStartTime(s string) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetStudent(s *Student) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetStudentID(id int) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) SetUnit(s string) *PracticalExperienceUpdate
- func (peu *PracticalExperienceUpdate) Where(ps ...predicate.PracticalExperience) *PracticalExperienceUpdate
- type PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) ClearStudent() *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) Exec(ctx context.Context) error
- func (peuo *PracticalExperienceUpdateOne) ExecX(ctx context.Context)
- func (peuo *PracticalExperienceUpdateOne) Mutation() *PracticalExperienceMutation
- func (peuo *PracticalExperienceUpdateOne) Save(ctx context.Context) (*PracticalExperience, error)
- func (peuo *PracticalExperienceUpdateOne) SaveX(ctx context.Context) *PracticalExperience
- func (peuo *PracticalExperienceUpdateOne) Select(field string, fields ...string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetDescribe(s string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetEndTime(s string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetName(s string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetNillableStudentID(id *int) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetStartTime(s string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetStudent(s *Student) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetStudentID(id int) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) SetUnit(s string) *PracticalExperienceUpdateOne
- func (peuo *PracticalExperienceUpdateOne) Where(ps ...predicate.PracticalExperience) *PracticalExperienceUpdateOne
- type PracticalExperiences
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type Resource
- type ResourceClient
- func (c *ResourceClient) Create() *ResourceCreate
- func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk
- func (c *ResourceClient) Delete() *ResourceDelete
- func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne
- func (c *ResourceClient) DeleteOneID(id int) *ResourceDeleteOne
- func (c *ResourceClient) Get(ctx context.Context, id int) (*Resource, error)
- func (c *ResourceClient) GetX(ctx context.Context, id int) *Resource
- func (c *ResourceClient) Hooks() []Hook
- func (c *ResourceClient) Intercept(interceptors ...Interceptor)
- func (c *ResourceClient) Interceptors() []Interceptor
- func (c *ResourceClient) Query() *ResourceQuery
- func (c *ResourceClient) QueryAuthorization(r *Resource) *AuthorizationQuery
- func (c *ResourceClient) QueryRole(r *Resource) *RoleQuery
- func (c *ResourceClient) QueryUser(r *Resource) *UserQuery
- func (c *ResourceClient) Update() *ResourceUpdate
- func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne
- func (c *ResourceClient) UpdateOneID(id int) *ResourceUpdateOne
- func (c *ResourceClient) Use(hooks ...Hook)
- type ResourceCreate
- func (rc *ResourceCreate) AddAuthorization(a ...*Authorization) *ResourceCreate
- func (rc *ResourceCreate) AddAuthorizationIDs(ids ...int) *ResourceCreate
- func (rc *ResourceCreate) AddRole(r ...*Role) *ResourceCreate
- func (rc *ResourceCreate) AddRoleIDs(ids ...int) *ResourceCreate
- func (rc *ResourceCreate) AddUser(u ...*User) *ResourceCreate
- func (rc *ResourceCreate) AddUserIDs(ids ...int) *ResourceCreate
- func (rc *ResourceCreate) Exec(ctx context.Context) error
- func (rc *ResourceCreate) ExecX(ctx context.Context)
- func (rc *ResourceCreate) Mutation() *ResourceMutation
- func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)
- func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource
- func (rc *ResourceCreate) SetResourceName(s string) *ResourceCreate
- func (rc *ResourceCreate) SetResourceValue(s string) *ResourceCreate
- type ResourceCreateBulk
- type ResourceDelete
- type ResourceDeleteOne
- type ResourceEdges
- type ResourceGroupBy
- func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy
- func (s *ResourceGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ResourceGroupBy) BoolX(ctx context.Context) bool
- func (s *ResourceGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ResourceGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ResourceGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ResourceGroupBy) Float64X(ctx context.Context) float64
- func (s *ResourceGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ResourceGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ResourceGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ResourceGroupBy) IntX(ctx context.Context) int
- func (s *ResourceGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ResourceGroupBy) IntsX(ctx context.Context) []int
- func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error
- func (s *ResourceGroupBy) ScanX(ctx context.Context, v any)
- func (s *ResourceGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ResourceGroupBy) StringX(ctx context.Context) string
- func (s *ResourceGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ResourceGroupBy) StringsX(ctx context.Context) []string
- type ResourceMutation
- func (m *ResourceMutation) AddAuthorizationIDs(ids ...int)
- func (m *ResourceMutation) AddField(name string, value ent.Value) error
- func (m *ResourceMutation) AddRoleIDs(ids ...int)
- func (m *ResourceMutation) AddUserIDs(ids ...int)
- func (m *ResourceMutation) AddedEdges() []string
- func (m *ResourceMutation) AddedField(name string) (ent.Value, bool)
- func (m *ResourceMutation) AddedFields() []string
- func (m *ResourceMutation) AddedIDs(name string) []ent.Value
- func (m *ResourceMutation) AuthorizationCleared() bool
- func (m *ResourceMutation) AuthorizationIDs() (ids []int)
- func (m *ResourceMutation) ClearAuthorization()
- func (m *ResourceMutation) ClearEdge(name string) error
- func (m *ResourceMutation) ClearField(name string) error
- func (m *ResourceMutation) ClearRole()
- func (m *ResourceMutation) ClearUser()
- func (m *ResourceMutation) ClearedEdges() []string
- func (m *ResourceMutation) ClearedFields() []string
- func (m ResourceMutation) Client() *Client
- func (m *ResourceMutation) EdgeCleared(name string) bool
- func (m *ResourceMutation) Field(name string) (ent.Value, bool)
- func (m *ResourceMutation) FieldCleared(name string) bool
- func (m *ResourceMutation) Fields() []string
- func (m *ResourceMutation) ID() (id int, exists bool)
- func (m *ResourceMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ResourceMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ResourceMutation) OldResourceName(ctx context.Context) (v string, err error)
- func (m *ResourceMutation) OldResourceValue(ctx context.Context) (v string, err error)
- func (m *ResourceMutation) Op() Op
- func (m *ResourceMutation) RemoveAuthorizationIDs(ids ...int)
- func (m *ResourceMutation) RemoveRoleIDs(ids ...int)
- func (m *ResourceMutation) RemoveUserIDs(ids ...int)
- func (m *ResourceMutation) RemovedAuthorizationIDs() (ids []int)
- func (m *ResourceMutation) RemovedEdges() []string
- func (m *ResourceMutation) RemovedIDs(name string) []ent.Value
- func (m *ResourceMutation) RemovedRoleIDs() (ids []int)
- func (m *ResourceMutation) RemovedUserIDs() (ids []int)
- func (m *ResourceMutation) ResetAuthorization()
- func (m *ResourceMutation) ResetEdge(name string) error
- func (m *ResourceMutation) ResetField(name string) error
- func (m *ResourceMutation) ResetResourceName()
- func (m *ResourceMutation) ResetResourceValue()
- func (m *ResourceMutation) ResetRole()
- func (m *ResourceMutation) ResetUser()
- func (m *ResourceMutation) ResourceName() (r string, exists bool)
- func (m *ResourceMutation) ResourceValue() (r string, exists bool)
- func (m *ResourceMutation) RoleCleared() bool
- func (m *ResourceMutation) RoleIDs() (ids []int)
- func (m *ResourceMutation) SetField(name string, value ent.Value) error
- func (m *ResourceMutation) SetOp(op Op)
- func (m *ResourceMutation) SetResourceName(s string)
- func (m *ResourceMutation) SetResourceValue(s string)
- func (m ResourceMutation) Tx() (*Tx, error)
- func (m *ResourceMutation) Type() string
- func (m *ResourceMutation) UserCleared() bool
- func (m *ResourceMutation) UserIDs() (ids []int)
- func (m *ResourceMutation) Where(ps ...predicate.Resource)
- func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))
- type ResourceQuery
- func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect
- func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)
- func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource
- func (rq *ResourceQuery) Clone() *ResourceQuery
- func (rq *ResourceQuery) Count(ctx context.Context) (int, error)
- func (rq *ResourceQuery) CountX(ctx context.Context) int
- func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)
- func (rq *ResourceQuery) ExistX(ctx context.Context) bool
- func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)
- func (rq *ResourceQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *ResourceQuery) FirstIDX(ctx context.Context) int
- func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource
- func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy
- func (rq *ResourceQuery) IDs(ctx context.Context) (ids []int, err error)
- func (rq *ResourceQuery) IDsX(ctx context.Context) []int
- func (rq *ResourceQuery) Limit(limit int) *ResourceQuery
- func (rq *ResourceQuery) Offset(offset int) *ResourceQuery
- func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)
- func (rq *ResourceQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *ResourceQuery) OnlyIDX(ctx context.Context) int
- func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource
- func (rq *ResourceQuery) Order(o ...OrderFunc) *ResourceQuery
- func (rq *ResourceQuery) QueryAuthorization() *AuthorizationQuery
- func (rq *ResourceQuery) QueryRole() *RoleQuery
- func (rq *ResourceQuery) QueryUser() *UserQuery
- func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect
- func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery
- func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery
- func (rq *ResourceQuery) WithAuthorization(opts ...func(*AuthorizationQuery)) *ResourceQuery
- func (rq *ResourceQuery) WithRole(opts ...func(*RoleQuery)) *ResourceQuery
- func (rq *ResourceQuery) WithUser(opts ...func(*UserQuery)) *ResourceQuery
- type ResourceSelect
- func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect
- func (s *ResourceSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ResourceSelect) BoolX(ctx context.Context) bool
- func (s *ResourceSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ResourceSelect) BoolsX(ctx context.Context) []bool
- func (s *ResourceSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ResourceSelect) Float64X(ctx context.Context) float64
- func (s *ResourceSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ResourceSelect) Float64sX(ctx context.Context) []float64
- func (s *ResourceSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ResourceSelect) IntX(ctx context.Context) int
- func (s *ResourceSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ResourceSelect) IntsX(ctx context.Context) []int
- func (rs *ResourceSelect) Scan(ctx context.Context, v any) error
- func (s *ResourceSelect) ScanX(ctx context.Context, v any)
- func (s *ResourceSelect) String(ctx context.Context) (_ string, err error)
- func (s *ResourceSelect) StringX(ctx context.Context) string
- func (s *ResourceSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ResourceSelect) StringsX(ctx context.Context) []string
- type ResourceUpdate
- func (ru *ResourceUpdate) AddAuthorization(a ...*Authorization) *ResourceUpdate
- func (ru *ResourceUpdate) AddAuthorizationIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) AddRole(r ...*Role) *ResourceUpdate
- func (ru *ResourceUpdate) AddRoleIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) AddUser(u ...*User) *ResourceUpdate
- func (ru *ResourceUpdate) AddUserIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) ClearAuthorization() *ResourceUpdate
- func (ru *ResourceUpdate) ClearRole() *ResourceUpdate
- func (ru *ResourceUpdate) ClearUser() *ResourceUpdate
- func (ru *ResourceUpdate) Exec(ctx context.Context) error
- func (ru *ResourceUpdate) ExecX(ctx context.Context)
- func (ru *ResourceUpdate) Mutation() *ResourceMutation
- func (ru *ResourceUpdate) RemoveAuthorization(a ...*Authorization) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveAuthorizationIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveRole(r ...*Role) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveRoleIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveUser(u ...*User) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveUserIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)
- func (ru *ResourceUpdate) SaveX(ctx context.Context) int
- func (ru *ResourceUpdate) SetResourceName(s string) *ResourceUpdate
- func (ru *ResourceUpdate) SetResourceValue(s string) *ResourceUpdate
- func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate
- type ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddAuthorization(a ...*Authorization) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddAuthorizationIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddRole(r ...*Role) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddRoleIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddUser(u ...*User) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddUserIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) ClearAuthorization() *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) ClearRole() *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) ClearUser() *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error
- func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)
- func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation
- func (ruo *ResourceUpdateOne) RemoveAuthorization(a ...*Authorization) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveAuthorizationIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveRole(r ...*Role) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveRoleIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveUser(u ...*User) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveUserIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)
- func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource
- func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetResourceName(s string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetResourceValue(s string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Where(ps ...predicate.Resource) *ResourceUpdateOne
- type Resources
- 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 int) *RoleDeleteOne
- func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id int) *Role
- func (c *RoleClient) Hooks() []Hook
- func (c *RoleClient) Intercept(interceptors ...Interceptor)
- func (c *RoleClient) Interceptors() []Interceptor
- func (c *RoleClient) Query() *RoleQuery
- func (c *RoleClient) QueryResource(r *Role) *ResourceQuery
- func (c *RoleClient) QueryUser(r *Role) *UserQuery
- func (c *RoleClient) Update() *RoleUpdate
- func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
- func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne
- func (c *RoleClient) Use(hooks ...Hook)
- type RoleCreate
- func (rc *RoleCreate) AddResource(r ...*Resource) *RoleCreate
- func (rc *RoleCreate) AddResourceIDs(ids ...int) *RoleCreate
- func (rc *RoleCreate) AddUser(u ...*User) *RoleCreate
- func (rc *RoleCreate) AddUserIDs(ids ...int) *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) SetRoleName(s string) *RoleCreate
- func (rc *RoleCreate) SetRoleValue(s string) *RoleCreate
- type RoleCreateBulk
- type RoleDelete
- type RoleDeleteOne
- type RoleEdges
- type RoleGroupBy
- func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
- func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleGroupBy) BoolX(ctx context.Context) bool
- func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleGroupBy) Float64X(ctx context.Context) float64
- func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RoleGroupBy) IntX(ctx context.Context) int
- func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RoleGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error
- func (s *RoleGroupBy) ScanX(ctx context.Context, v any)
- func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RoleGroupBy) StringX(ctx context.Context) string
- func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RoleGroupBy) StringsX(ctx context.Context) []string
- type RoleMutation
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddResourceIDs(ids ...int)
- func (m *RoleMutation) AddUserIDs(ids ...int)
- 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) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearResource()
- func (m *RoleMutation) ClearUser()
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- 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 int, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleMutation) OldRoleName(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldRoleValue(ctx context.Context) (v string, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) RemoveResourceIDs(ids ...int)
- func (m *RoleMutation) RemoveUserIDs(ids ...int)
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) RemovedResourceIDs() (ids []int)
- func (m *RoleMutation) RemovedUserIDs() (ids []int)
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetResource()
- func (m *RoleMutation) ResetRoleName()
- func (m *RoleMutation) ResetRoleValue()
- func (m *RoleMutation) ResetUser()
- func (m *RoleMutation) ResourceCleared() bool
- func (m *RoleMutation) ResourceIDs() (ids []int)
- func (m *RoleMutation) RoleName() (r string, exists bool)
- func (m *RoleMutation) RoleValue() (r string, exists bool)
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetOp(op Op)
- func (m *RoleMutation) SetRoleName(s string)
- func (m *RoleMutation) SetRoleValue(s string)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) UserCleared() bool
- func (m *RoleMutation) UserIDs() (ids []int)
- func (m *RoleMutation) Where(ps ...predicate.Role)
- func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))
- type RoleQuery
- func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect
- 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 int, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) int
- func (rq *RoleQuery) FirstX(ctx context.Context) *Role
- func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
- func (rq *RoleQuery) IDs(ctx context.Context) (ids []int, err error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) int
- func (rq *RoleQuery) OnlyX(ctx context.Context) *Role
- func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery
- func (rq *RoleQuery) QueryResource() *ResourceQuery
- func (rq *RoleQuery) QueryUser() *UserQuery
- func (rq *RoleQuery) Select(fields ...string) *RoleSelect
- func (rq *RoleQuery) Unique(unique bool) *RoleQuery
- func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery
- func (rq *RoleQuery) WithResource(opts ...func(*ResourceQuery)) *RoleQuery
- func (rq *RoleQuery) WithUser(opts ...func(*UserQuery)) *RoleQuery
- type RoleSelect
- func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect
- func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleSelect) BoolX(ctx context.Context) bool
- func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleSelect) BoolsX(ctx context.Context) []bool
- func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleSelect) Float64X(ctx context.Context) float64
- func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleSelect) Float64sX(ctx context.Context) []float64
- func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RoleSelect) IntX(ctx context.Context) int
- func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RoleSelect) IntsX(ctx context.Context) []int
- func (rs *RoleSelect) Scan(ctx context.Context, v any) error
- func (s *RoleSelect) ScanX(ctx context.Context, v any)
- func (s *RoleSelect) String(ctx context.Context) (_ string, err error)
- func (s *RoleSelect) StringX(ctx context.Context) string
- func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RoleSelect) StringsX(ctx context.Context) []string
- type RoleUpdate
- func (ru *RoleUpdate) AddResource(r ...*Resource) *RoleUpdate
- func (ru *RoleUpdate) AddResourceIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) AddUser(u ...*User) *RoleUpdate
- func (ru *RoleUpdate) AddUserIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) ClearResource() *RoleUpdate
- func (ru *RoleUpdate) ClearUser() *RoleUpdate
- func (ru *RoleUpdate) Exec(ctx context.Context) error
- func (ru *RoleUpdate) ExecX(ctx context.Context)
- func (ru *RoleUpdate) Mutation() *RoleMutation
- func (ru *RoleUpdate) RemoveResource(r ...*Resource) *RoleUpdate
- func (ru *RoleUpdate) RemoveResourceIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) RemoveUser(u ...*User) *RoleUpdate
- func (ru *RoleUpdate) RemoveUserIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
- func (ru *RoleUpdate) SaveX(ctx context.Context) int
- func (ru *RoleUpdate) SetRoleName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetRoleValue(s string) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) AddResource(r ...*Resource) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddResourceIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddUser(u ...*User) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddUserIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearResource() *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearUser() *RoleUpdateOne
- func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
- func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
- func (ruo *RoleUpdateOne) Mutation() *RoleMutation
- func (ruo *RoleUpdateOne) RemoveResource(r ...*Resource) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveResourceIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveUser(u ...*User) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...int) *RoleUpdateOne
- 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) SetRoleName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetRoleValue(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Student
- func (s *Student) QueryCertificate() *CertificateQuery
- func (s *Student) QueryClass() *ClassQuery
- func (s *Student) QueryClassLeader() *ClassLeaderQuery
- func (s *Student) QueryDepartment() *DepartmentQuery
- func (s *Student) QueryEducationLevel() *EducationLevelQuery
- func (s *Student) QueryEnrollmentStatus() *EnrollmentStatusQuery
- func (s *Student) QueryFamilyInfo() *FamilyInfoQuery
- func (s *Student) QueryMajor() *MajorQuery
- func (s *Student) QueryPracticalExperience() *PracticalExperienceQuery
- func (s *Student) QueryTutor() *TutorQuery
- func (s *Student) QueryUser() *UserQuery
- func (s *Student) String() string
- func (s *Student) Unwrap() *Student
- func (s *Student) Update() *StudentUpdateOne
- type StudentClient
- func (c *StudentClient) Create() *StudentCreate
- func (c *StudentClient) CreateBulk(builders ...*StudentCreate) *StudentCreateBulk
- func (c *StudentClient) Delete() *StudentDelete
- func (c *StudentClient) DeleteOne(s *Student) *StudentDeleteOne
- func (c *StudentClient) DeleteOneID(id int) *StudentDeleteOne
- func (c *StudentClient) Get(ctx context.Context, id int) (*Student, error)
- func (c *StudentClient) GetX(ctx context.Context, id int) *Student
- func (c *StudentClient) Hooks() []Hook
- func (c *StudentClient) Intercept(interceptors ...Interceptor)
- func (c *StudentClient) Interceptors() []Interceptor
- func (c *StudentClient) Query() *StudentQuery
- func (c *StudentClient) QueryCertificate(s *Student) *CertificateQuery
- func (c *StudentClient) QueryClass(s *Student) *ClassQuery
- func (c *StudentClient) QueryClassLeader(s *Student) *ClassLeaderQuery
- func (c *StudentClient) QueryDepartment(s *Student) *DepartmentQuery
- func (c *StudentClient) QueryEducationLevel(s *Student) *EducationLevelQuery
- func (c *StudentClient) QueryEnrollmentStatus(s *Student) *EnrollmentStatusQuery
- func (c *StudentClient) QueryFamilyInfo(s *Student) *FamilyInfoQuery
- func (c *StudentClient) QueryMajor(s *Student) *MajorQuery
- func (c *StudentClient) QueryPracticalExperience(s *Student) *PracticalExperienceQuery
- func (c *StudentClient) QueryTutor(s *Student) *TutorQuery
- func (c *StudentClient) QueryUser(s *Student) *UserQuery
- func (c *StudentClient) Update() *StudentUpdate
- func (c *StudentClient) UpdateOne(s *Student) *StudentUpdateOne
- func (c *StudentClient) UpdateOneID(id int) *StudentUpdateOne
- func (c *StudentClient) Use(hooks ...Hook)
- type StudentCreate
- func (sc *StudentCreate) AddCertificate(c ...*Certificate) *StudentCreate
- func (sc *StudentCreate) AddCertificateIDs(ids ...int) *StudentCreate
- func (sc *StudentCreate) AddEducationLevel(e ...*EducationLevel) *StudentCreate
- func (sc *StudentCreate) AddEducationLevelIDs(ids ...int) *StudentCreate
- func (sc *StudentCreate) AddEnrollmentStatuIDs(ids ...int) *StudentCreate
- func (sc *StudentCreate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentCreate
- func (sc *StudentCreate) AddFamilyInfo(f ...*FamilyInfo) *StudentCreate
- func (sc *StudentCreate) AddFamilyInfoIDs(ids ...int) *StudentCreate
- func (sc *StudentCreate) AddPracticalExperience(p ...*PracticalExperience) *StudentCreate
- func (sc *StudentCreate) AddPracticalExperienceIDs(ids ...int) *StudentCreate
- func (sc *StudentCreate) Exec(ctx context.Context) error
- func (sc *StudentCreate) ExecX(ctx context.Context)
- func (sc *StudentCreate) Mutation() *StudentMutation
- func (sc *StudentCreate) Save(ctx context.Context) (*Student, error)
- func (sc *StudentCreate) SaveX(ctx context.Context) *Student
- func (sc *StudentCreate) SetAge(i int) *StudentCreate
- func (sc *StudentCreate) SetAvatar(b []byte) *StudentCreate
- func (sc *StudentCreate) SetClass(c *Class) *StudentCreate
- func (sc *StudentCreate) SetClassID(id int) *StudentCreate
- func (sc *StudentCreate) SetClassLeader(c *ClassLeader) *StudentCreate
- func (sc *StudentCreate) SetClassLeaderID(id int) *StudentCreate
- func (sc *StudentCreate) SetCode(s string) *StudentCreate
- func (sc *StudentCreate) SetDepartment(d *Department) *StudentCreate
- func (sc *StudentCreate) SetDepartmentID(id int) *StudentCreate
- func (sc *StudentCreate) SetMajor(m *Major) *StudentCreate
- func (sc *StudentCreate) SetMajorID(id int) *StudentCreate
- func (sc *StudentCreate) SetName(s string) *StudentCreate
- func (sc *StudentCreate) SetNillableClassID(id *int) *StudentCreate
- func (sc *StudentCreate) SetNillableClassLeaderID(id *int) *StudentCreate
- func (sc *StudentCreate) SetNillableDepartmentID(id *int) *StudentCreate
- func (sc *StudentCreate) SetNillableMajorID(id *int) *StudentCreate
- func (sc *StudentCreate) SetNillableTutorID(id *int) *StudentCreate
- func (sc *StudentCreate) SetNillableUserID(id *int) *StudentCreate
- func (sc *StudentCreate) SetSex(s string) *StudentCreate
- func (sc *StudentCreate) SetTutor(t *Tutor) *StudentCreate
- func (sc *StudentCreate) SetTutorID(id int) *StudentCreate
- func (sc *StudentCreate) SetUser(u *User) *StudentCreate
- func (sc *StudentCreate) SetUserID(id int) *StudentCreate
- type StudentCreateBulk
- type StudentDelete
- type StudentDeleteOne
- type StudentEdges
- func (e StudentEdges) CertificateOrErr() ([]*Certificate, error)
- func (e StudentEdges) ClassLeaderOrErr() (*ClassLeader, error)
- func (e StudentEdges) ClassOrErr() (*Class, error)
- func (e StudentEdges) DepartmentOrErr() (*Department, error)
- func (e StudentEdges) EducationLevelOrErr() ([]*EducationLevel, error)
- func (e StudentEdges) EnrollmentStatusOrErr() ([]*EnrollmentStatus, error)
- func (e StudentEdges) FamilyInfoOrErr() ([]*FamilyInfo, error)
- func (e StudentEdges) MajorOrErr() (*Major, error)
- func (e StudentEdges) PracticalExperienceOrErr() ([]*PracticalExperience, error)
- func (e StudentEdges) TutorOrErr() (*Tutor, error)
- func (e StudentEdges) UserOrErr() (*User, error)
- type StudentGroupBy
- func (sgb *StudentGroupBy) Aggregate(fns ...AggregateFunc) *StudentGroupBy
- func (s *StudentGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *StudentGroupBy) BoolX(ctx context.Context) bool
- func (s *StudentGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *StudentGroupBy) BoolsX(ctx context.Context) []bool
- func (s *StudentGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *StudentGroupBy) Float64X(ctx context.Context) float64
- func (s *StudentGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *StudentGroupBy) Float64sX(ctx context.Context) []float64
- func (s *StudentGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *StudentGroupBy) IntX(ctx context.Context) int
- func (s *StudentGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *StudentGroupBy) IntsX(ctx context.Context) []int
- func (sgb *StudentGroupBy) Scan(ctx context.Context, v any) error
- func (s *StudentGroupBy) ScanX(ctx context.Context, v any)
- func (s *StudentGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *StudentGroupBy) StringX(ctx context.Context) string
- func (s *StudentGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *StudentGroupBy) StringsX(ctx context.Context) []string
- type StudentMutation
- func (m *StudentMutation) AddAge(i int)
- func (m *StudentMutation) AddCertificateIDs(ids ...int)
- func (m *StudentMutation) AddEducationLevelIDs(ids ...int)
- func (m *StudentMutation) AddEnrollmentStatuIDs(ids ...int)
- func (m *StudentMutation) AddFamilyInfoIDs(ids ...int)
- func (m *StudentMutation) AddField(name string, value ent.Value) error
- func (m *StudentMutation) AddPracticalExperienceIDs(ids ...int)
- func (m *StudentMutation) AddedAge() (r int, exists bool)
- func (m *StudentMutation) AddedEdges() []string
- func (m *StudentMutation) AddedField(name string) (ent.Value, bool)
- func (m *StudentMutation) AddedFields() []string
- func (m *StudentMutation) AddedIDs(name string) []ent.Value
- func (m *StudentMutation) Age() (r int, exists bool)
- func (m *StudentMutation) Avatar() (r []byte, exists bool)
- func (m *StudentMutation) CertificateCleared() bool
- func (m *StudentMutation) CertificateIDs() (ids []int)
- func (m *StudentMutation) ClassCleared() bool
- func (m *StudentMutation) ClassID() (id int, exists bool)
- func (m *StudentMutation) ClassIDs() (ids []int)
- func (m *StudentMutation) ClassLeaderCleared() bool
- func (m *StudentMutation) ClassLeaderID() (id int, exists bool)
- func (m *StudentMutation) ClassLeaderIDs() (ids []int)
- func (m *StudentMutation) ClearCertificate()
- func (m *StudentMutation) ClearClass()
- func (m *StudentMutation) ClearClassLeader()
- func (m *StudentMutation) ClearDepartment()
- func (m *StudentMutation) ClearEdge(name string) error
- func (m *StudentMutation) ClearEducationLevel()
- func (m *StudentMutation) ClearEnrollmentStatus()
- func (m *StudentMutation) ClearFamilyInfo()
- func (m *StudentMutation) ClearField(name string) error
- func (m *StudentMutation) ClearMajor()
- func (m *StudentMutation) ClearPracticalExperience()
- func (m *StudentMutation) ClearTutor()
- func (m *StudentMutation) ClearUser()
- func (m *StudentMutation) ClearedEdges() []string
- func (m *StudentMutation) ClearedFields() []string
- func (m StudentMutation) Client() *Client
- func (m *StudentMutation) Code() (r string, exists bool)
- func (m *StudentMutation) DepartmentCleared() bool
- func (m *StudentMutation) DepartmentID() (id int, exists bool)
- func (m *StudentMutation) DepartmentIDs() (ids []int)
- func (m *StudentMutation) EdgeCleared(name string) bool
- func (m *StudentMutation) EducationLevelCleared() bool
- func (m *StudentMutation) EducationLevelIDs() (ids []int)
- func (m *StudentMutation) EnrollmentStatusCleared() bool
- func (m *StudentMutation) EnrollmentStatusIDs() (ids []int)
- func (m *StudentMutation) FamilyInfoCleared() bool
- func (m *StudentMutation) FamilyInfoIDs() (ids []int)
- func (m *StudentMutation) Field(name string) (ent.Value, bool)
- func (m *StudentMutation) FieldCleared(name string) bool
- func (m *StudentMutation) Fields() []string
- func (m *StudentMutation) ID() (id int, exists bool)
- func (m *StudentMutation) IDs(ctx context.Context) ([]int, error)
- func (m *StudentMutation) MajorCleared() bool
- func (m *StudentMutation) MajorID() (id int, exists bool)
- func (m *StudentMutation) MajorIDs() (ids []int)
- func (m *StudentMutation) Name() (r string, exists bool)
- func (m *StudentMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *StudentMutation) OldAvatar(ctx context.Context) (v []byte, err error)
- func (m *StudentMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *StudentMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *StudentMutation) OldName(ctx context.Context) (v string, err error)
- func (m *StudentMutation) OldSex(ctx context.Context) (v string, err error)
- func (m *StudentMutation) Op() Op
- func (m *StudentMutation) PracticalExperienceCleared() bool
- func (m *StudentMutation) PracticalExperienceIDs() (ids []int)
- func (m *StudentMutation) RemoveCertificateIDs(ids ...int)
- func (m *StudentMutation) RemoveEducationLevelIDs(ids ...int)
- func (m *StudentMutation) RemoveEnrollmentStatuIDs(ids ...int)
- func (m *StudentMutation) RemoveFamilyInfoIDs(ids ...int)
- func (m *StudentMutation) RemovePracticalExperienceIDs(ids ...int)
- func (m *StudentMutation) RemovedCertificateIDs() (ids []int)
- func (m *StudentMutation) RemovedEdges() []string
- func (m *StudentMutation) RemovedEducationLevelIDs() (ids []int)
- func (m *StudentMutation) RemovedEnrollmentStatusIDs() (ids []int)
- func (m *StudentMutation) RemovedFamilyInfoIDs() (ids []int)
- func (m *StudentMutation) RemovedIDs(name string) []ent.Value
- func (m *StudentMutation) RemovedPracticalExperienceIDs() (ids []int)
- func (m *StudentMutation) ResetAge()
- func (m *StudentMutation) ResetAvatar()
- func (m *StudentMutation) ResetCertificate()
- func (m *StudentMutation) ResetClass()
- func (m *StudentMutation) ResetClassLeader()
- func (m *StudentMutation) ResetCode()
- func (m *StudentMutation) ResetDepartment()
- func (m *StudentMutation) ResetEdge(name string) error
- func (m *StudentMutation) ResetEducationLevel()
- func (m *StudentMutation) ResetEnrollmentStatus()
- func (m *StudentMutation) ResetFamilyInfo()
- func (m *StudentMutation) ResetField(name string) error
- func (m *StudentMutation) ResetMajor()
- func (m *StudentMutation) ResetName()
- func (m *StudentMutation) ResetPracticalExperience()
- func (m *StudentMutation) ResetSex()
- func (m *StudentMutation) ResetTutor()
- func (m *StudentMutation) ResetUser()
- func (m *StudentMutation) SetAge(i int)
- func (m *StudentMutation) SetAvatar(b []byte)
- func (m *StudentMutation) SetClassID(id int)
- func (m *StudentMutation) SetClassLeaderID(id int)
- func (m *StudentMutation) SetCode(s string)
- func (m *StudentMutation) SetDepartmentID(id int)
- func (m *StudentMutation) SetField(name string, value ent.Value) error
- func (m *StudentMutation) SetMajorID(id int)
- func (m *StudentMutation) SetName(s string)
- func (m *StudentMutation) SetOp(op Op)
- func (m *StudentMutation) SetSex(s string)
- func (m *StudentMutation) SetTutorID(id int)
- func (m *StudentMutation) SetUserID(id int)
- func (m *StudentMutation) Sex() (r string, exists bool)
- func (m *StudentMutation) TutorCleared() bool
- func (m *StudentMutation) TutorID() (id int, exists bool)
- func (m *StudentMutation) TutorIDs() (ids []int)
- func (m StudentMutation) Tx() (*Tx, error)
- func (m *StudentMutation) Type() string
- func (m *StudentMutation) UserCleared() bool
- func (m *StudentMutation) UserID() (id int, exists bool)
- func (m *StudentMutation) UserIDs() (ids []int)
- func (m *StudentMutation) Where(ps ...predicate.Student)
- func (m *StudentMutation) WhereP(ps ...func(*sql.Selector))
- type StudentQuery
- func (sq *StudentQuery) Aggregate(fns ...AggregateFunc) *StudentSelect
- func (sq *StudentQuery) All(ctx context.Context) ([]*Student, error)
- func (sq *StudentQuery) AllX(ctx context.Context) []*Student
- func (sq *StudentQuery) Clone() *StudentQuery
- func (sq *StudentQuery) Count(ctx context.Context) (int, error)
- func (sq *StudentQuery) CountX(ctx context.Context) int
- func (sq *StudentQuery) Exist(ctx context.Context) (bool, error)
- func (sq *StudentQuery) ExistX(ctx context.Context) bool
- func (sq *StudentQuery) First(ctx context.Context) (*Student, error)
- func (sq *StudentQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *StudentQuery) FirstIDX(ctx context.Context) int
- func (sq *StudentQuery) FirstX(ctx context.Context) *Student
- func (sq *StudentQuery) GroupBy(field string, fields ...string) *StudentGroupBy
- func (sq *StudentQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *StudentQuery) IDsX(ctx context.Context) []int
- func (sq *StudentQuery) Limit(limit int) *StudentQuery
- func (sq *StudentQuery) Offset(offset int) *StudentQuery
- func (sq *StudentQuery) Only(ctx context.Context) (*Student, error)
- func (sq *StudentQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *StudentQuery) OnlyIDX(ctx context.Context) int
- func (sq *StudentQuery) OnlyX(ctx context.Context) *Student
- func (sq *StudentQuery) Order(o ...OrderFunc) *StudentQuery
- func (sq *StudentQuery) QueryCertificate() *CertificateQuery
- func (sq *StudentQuery) QueryClass() *ClassQuery
- func (sq *StudentQuery) QueryClassLeader() *ClassLeaderQuery
- func (sq *StudentQuery) QueryDepartment() *DepartmentQuery
- func (sq *StudentQuery) QueryEducationLevel() *EducationLevelQuery
- func (sq *StudentQuery) QueryEnrollmentStatus() *EnrollmentStatusQuery
- func (sq *StudentQuery) QueryFamilyInfo() *FamilyInfoQuery
- func (sq *StudentQuery) QueryMajor() *MajorQuery
- func (sq *StudentQuery) QueryPracticalExperience() *PracticalExperienceQuery
- func (sq *StudentQuery) QueryTutor() *TutorQuery
- func (sq *StudentQuery) QueryUser() *UserQuery
- func (sq *StudentQuery) Select(fields ...string) *StudentSelect
- func (sq *StudentQuery) Unique(unique bool) *StudentQuery
- func (sq *StudentQuery) Where(ps ...predicate.Student) *StudentQuery
- func (sq *StudentQuery) WithCertificate(opts ...func(*CertificateQuery)) *StudentQuery
- func (sq *StudentQuery) WithClass(opts ...func(*ClassQuery)) *StudentQuery
- func (sq *StudentQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *StudentQuery
- func (sq *StudentQuery) WithDepartment(opts ...func(*DepartmentQuery)) *StudentQuery
- func (sq *StudentQuery) WithEducationLevel(opts ...func(*EducationLevelQuery)) *StudentQuery
- func (sq *StudentQuery) WithEnrollmentStatus(opts ...func(*EnrollmentStatusQuery)) *StudentQuery
- func (sq *StudentQuery) WithFamilyInfo(opts ...func(*FamilyInfoQuery)) *StudentQuery
- func (sq *StudentQuery) WithMajor(opts ...func(*MajorQuery)) *StudentQuery
- func (sq *StudentQuery) WithPracticalExperience(opts ...func(*PracticalExperienceQuery)) *StudentQuery
- func (sq *StudentQuery) WithTutor(opts ...func(*TutorQuery)) *StudentQuery
- func (sq *StudentQuery) WithUser(opts ...func(*UserQuery)) *StudentQuery
- type StudentSelect
- func (ss *StudentSelect) Aggregate(fns ...AggregateFunc) *StudentSelect
- func (s *StudentSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *StudentSelect) BoolX(ctx context.Context) bool
- func (s *StudentSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *StudentSelect) BoolsX(ctx context.Context) []bool
- func (s *StudentSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *StudentSelect) Float64X(ctx context.Context) float64
- func (s *StudentSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *StudentSelect) Float64sX(ctx context.Context) []float64
- func (s *StudentSelect) Int(ctx context.Context) (_ int, err error)
- func (s *StudentSelect) IntX(ctx context.Context) int
- func (s *StudentSelect) Ints(ctx context.Context) ([]int, error)
- func (s *StudentSelect) IntsX(ctx context.Context) []int
- func (ss *StudentSelect) Scan(ctx context.Context, v any) error
- func (s *StudentSelect) ScanX(ctx context.Context, v any)
- func (s *StudentSelect) String(ctx context.Context) (_ string, err error)
- func (s *StudentSelect) StringX(ctx context.Context) string
- func (s *StudentSelect) Strings(ctx context.Context) ([]string, error)
- func (s *StudentSelect) StringsX(ctx context.Context) []string
- type StudentUpdate
- func (su *StudentUpdate) AddAge(i int) *StudentUpdate
- func (su *StudentUpdate) AddCertificate(c ...*Certificate) *StudentUpdate
- func (su *StudentUpdate) AddCertificateIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) AddEducationLevel(e ...*EducationLevel) *StudentUpdate
- func (su *StudentUpdate) AddEducationLevelIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) AddEnrollmentStatuIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate
- func (su *StudentUpdate) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdate
- func (su *StudentUpdate) AddFamilyInfoIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdate
- func (su *StudentUpdate) AddPracticalExperienceIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) ClearCertificate() *StudentUpdate
- func (su *StudentUpdate) ClearClass() *StudentUpdate
- func (su *StudentUpdate) ClearClassLeader() *StudentUpdate
- func (su *StudentUpdate) ClearDepartment() *StudentUpdate
- func (su *StudentUpdate) ClearEducationLevel() *StudentUpdate
- func (su *StudentUpdate) ClearEnrollmentStatus() *StudentUpdate
- func (su *StudentUpdate) ClearFamilyInfo() *StudentUpdate
- func (su *StudentUpdate) ClearMajor() *StudentUpdate
- func (su *StudentUpdate) ClearPracticalExperience() *StudentUpdate
- func (su *StudentUpdate) ClearTutor() *StudentUpdate
- func (su *StudentUpdate) ClearUser() *StudentUpdate
- func (su *StudentUpdate) Exec(ctx context.Context) error
- func (su *StudentUpdate) ExecX(ctx context.Context)
- func (su *StudentUpdate) Mutation() *StudentMutation
- func (su *StudentUpdate) RemoveCertificate(c ...*Certificate) *StudentUpdate
- func (su *StudentUpdate) RemoveCertificateIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdate
- func (su *StudentUpdate) RemoveEducationLevelIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate
- func (su *StudentUpdate) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdate
- func (su *StudentUpdate) RemoveFamilyInfoIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdate
- func (su *StudentUpdate) RemovePracticalExperienceIDs(ids ...int) *StudentUpdate
- func (su *StudentUpdate) Save(ctx context.Context) (int, error)
- func (su *StudentUpdate) SaveX(ctx context.Context) int
- func (su *StudentUpdate) SetAge(i int) *StudentUpdate
- func (su *StudentUpdate) SetAvatar(b []byte) *StudentUpdate
- func (su *StudentUpdate) SetClass(c *Class) *StudentUpdate
- func (su *StudentUpdate) SetClassID(id int) *StudentUpdate
- func (su *StudentUpdate) SetClassLeader(c *ClassLeader) *StudentUpdate
- func (su *StudentUpdate) SetClassLeaderID(id int) *StudentUpdate
- func (su *StudentUpdate) SetCode(s string) *StudentUpdate
- func (su *StudentUpdate) SetDepartment(d *Department) *StudentUpdate
- func (su *StudentUpdate) SetDepartmentID(id int) *StudentUpdate
- func (su *StudentUpdate) SetMajor(m *Major) *StudentUpdate
- func (su *StudentUpdate) SetMajorID(id int) *StudentUpdate
- func (su *StudentUpdate) SetName(s string) *StudentUpdate
- func (su *StudentUpdate) SetNillableClassID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetNillableClassLeaderID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetNillableDepartmentID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetNillableMajorID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetNillableTutorID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetNillableUserID(id *int) *StudentUpdate
- func (su *StudentUpdate) SetSex(s string) *StudentUpdate
- func (su *StudentUpdate) SetTutor(t *Tutor) *StudentUpdate
- func (su *StudentUpdate) SetTutorID(id int) *StudentUpdate
- func (su *StudentUpdate) SetUser(u *User) *StudentUpdate
- func (su *StudentUpdate) SetUserID(id int) *StudentUpdate
- func (su *StudentUpdate) Where(ps ...predicate.Student) *StudentUpdate
- type StudentUpdateOne
- func (suo *StudentUpdateOne) AddAge(i int) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddCertificate(c ...*Certificate) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddCertificateIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddEducationLevel(e ...*EducationLevel) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddEducationLevelIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddEnrollmentStatuIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddFamilyInfoIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdateOne
- func (suo *StudentUpdateOne) AddPracticalExperienceIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearCertificate() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearClass() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearClassLeader() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearDepartment() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearEducationLevel() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearEnrollmentStatus() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearFamilyInfo() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearMajor() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearPracticalExperience() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearTutor() *StudentUpdateOne
- func (suo *StudentUpdateOne) ClearUser() *StudentUpdateOne
- func (suo *StudentUpdateOne) Exec(ctx context.Context) error
- func (suo *StudentUpdateOne) ExecX(ctx context.Context)
- func (suo *StudentUpdateOne) Mutation() *StudentMutation
- func (suo *StudentUpdateOne) RemoveCertificate(c ...*Certificate) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveCertificateIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveEducationLevelIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemoveFamilyInfoIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdateOne
- func (suo *StudentUpdateOne) RemovePracticalExperienceIDs(ids ...int) *StudentUpdateOne
- func (suo *StudentUpdateOne) Save(ctx context.Context) (*Student, error)
- func (suo *StudentUpdateOne) SaveX(ctx context.Context) *Student
- func (suo *StudentUpdateOne) Select(field string, fields ...string) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetAge(i int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetAvatar(b []byte) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetClass(c *Class) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetClassID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetClassLeader(c *ClassLeader) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetClassLeaderID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetCode(s string) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetDepartment(d *Department) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetDepartmentID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetMajor(m *Major) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetMajorID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetName(s string) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableClassID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableClassLeaderID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableDepartmentID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableMajorID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableTutorID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetNillableUserID(id *int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetSex(s string) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetTutor(t *Tutor) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetTutorID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetUser(u *User) *StudentUpdateOne
- func (suo *StudentUpdateOne) SetUserID(id int) *StudentUpdateOne
- func (suo *StudentUpdateOne) Where(ps ...predicate.Student) *StudentUpdateOne
- type Students
- type TraverseFunc
- type Traverser
- type Tutor
- type TutorClient
- func (c *TutorClient) Create() *TutorCreate
- func (c *TutorClient) CreateBulk(builders ...*TutorCreate) *TutorCreateBulk
- func (c *TutorClient) Delete() *TutorDelete
- func (c *TutorClient) DeleteOne(t *Tutor) *TutorDeleteOne
- func (c *TutorClient) DeleteOneID(id int) *TutorDeleteOne
- func (c *TutorClient) Get(ctx context.Context, id int) (*Tutor, error)
- func (c *TutorClient) GetX(ctx context.Context, id int) *Tutor
- func (c *TutorClient) Hooks() []Hook
- func (c *TutorClient) Intercept(interceptors ...Interceptor)
- func (c *TutorClient) Interceptors() []Interceptor
- func (c *TutorClient) Query() *TutorQuery
- func (c *TutorClient) QueryClass(t *Tutor) *ClassQuery
- func (c *TutorClient) QueryStudent(t *Tutor) *StudentQuery
- func (c *TutorClient) Update() *TutorUpdate
- func (c *TutorClient) UpdateOne(t *Tutor) *TutorUpdateOne
- func (c *TutorClient) UpdateOneID(id int) *TutorUpdateOne
- func (c *TutorClient) Use(hooks ...Hook)
- type TutorCreate
- func (tc *TutorCreate) Exec(ctx context.Context) error
- func (tc *TutorCreate) ExecX(ctx context.Context)
- func (tc *TutorCreate) Mutation() *TutorMutation
- func (tc *TutorCreate) Save(ctx context.Context) (*Tutor, error)
- func (tc *TutorCreate) SaveX(ctx context.Context) *Tutor
- func (tc *TutorCreate) SetClass(c *Class) *TutorCreate
- func (tc *TutorCreate) SetClassID(id int) *TutorCreate
- func (tc *TutorCreate) SetNillableClassID(id *int) *TutorCreate
- func (tc *TutorCreate) SetNillableStudentID(id *int) *TutorCreate
- func (tc *TutorCreate) SetStudent(s *Student) *TutorCreate
- func (tc *TutorCreate) SetStudentID(id int) *TutorCreate
- type TutorCreateBulk
- type TutorDelete
- type TutorDeleteOne
- type TutorEdges
- type TutorGroupBy
- func (tgb *TutorGroupBy) Aggregate(fns ...AggregateFunc) *TutorGroupBy
- func (s *TutorGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TutorGroupBy) BoolX(ctx context.Context) bool
- func (s *TutorGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TutorGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TutorGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TutorGroupBy) Float64X(ctx context.Context) float64
- func (s *TutorGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TutorGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TutorGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TutorGroupBy) IntX(ctx context.Context) int
- func (s *TutorGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TutorGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TutorGroupBy) Scan(ctx context.Context, v any) error
- func (s *TutorGroupBy) ScanX(ctx context.Context, v any)
- func (s *TutorGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TutorGroupBy) StringX(ctx context.Context) string
- func (s *TutorGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TutorGroupBy) StringsX(ctx context.Context) []string
- type TutorMutation
- func (m *TutorMutation) AddField(name string, value ent.Value) error
- func (m *TutorMutation) AddedEdges() []string
- func (m *TutorMutation) AddedField(name string) (ent.Value, bool)
- func (m *TutorMutation) AddedFields() []string
- func (m *TutorMutation) AddedIDs(name string) []ent.Value
- func (m *TutorMutation) ClassCleared() bool
- func (m *TutorMutation) ClassID() (id int, exists bool)
- func (m *TutorMutation) ClassIDs() (ids []int)
- func (m *TutorMutation) ClearClass()
- func (m *TutorMutation) ClearEdge(name string) error
- func (m *TutorMutation) ClearField(name string) error
- func (m *TutorMutation) ClearStudent()
- func (m *TutorMutation) ClearedEdges() []string
- func (m *TutorMutation) ClearedFields() []string
- func (m TutorMutation) Client() *Client
- func (m *TutorMutation) EdgeCleared(name string) bool
- func (m *TutorMutation) Field(name string) (ent.Value, bool)
- func (m *TutorMutation) FieldCleared(name string) bool
- func (m *TutorMutation) Fields() []string
- func (m *TutorMutation) ID() (id int, exists bool)
- func (m *TutorMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TutorMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TutorMutation) Op() Op
- func (m *TutorMutation) RemovedEdges() []string
- func (m *TutorMutation) RemovedIDs(name string) []ent.Value
- func (m *TutorMutation) ResetClass()
- func (m *TutorMutation) ResetEdge(name string) error
- func (m *TutorMutation) ResetField(name string) error
- func (m *TutorMutation) ResetStudent()
- func (m *TutorMutation) SetClassID(id int)
- func (m *TutorMutation) SetField(name string, value ent.Value) error
- func (m *TutorMutation) SetOp(op Op)
- func (m *TutorMutation) SetStudentID(id int)
- func (m *TutorMutation) StudentCleared() bool
- func (m *TutorMutation) StudentID() (id int, exists bool)
- func (m *TutorMutation) StudentIDs() (ids []int)
- func (m TutorMutation) Tx() (*Tx, error)
- func (m *TutorMutation) Type() string
- func (m *TutorMutation) Where(ps ...predicate.Tutor)
- func (m *TutorMutation) WhereP(ps ...func(*sql.Selector))
- type TutorQuery
- func (tq *TutorQuery) Aggregate(fns ...AggregateFunc) *TutorSelect
- func (tq *TutorQuery) All(ctx context.Context) ([]*Tutor, error)
- func (tq *TutorQuery) AllX(ctx context.Context) []*Tutor
- func (tq *TutorQuery) Clone() *TutorQuery
- func (tq *TutorQuery) Count(ctx context.Context) (int, error)
- func (tq *TutorQuery) CountX(ctx context.Context) int
- func (tq *TutorQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TutorQuery) ExistX(ctx context.Context) bool
- func (tq *TutorQuery) First(ctx context.Context) (*Tutor, error)
- func (tq *TutorQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TutorQuery) FirstIDX(ctx context.Context) int
- func (tq *TutorQuery) FirstX(ctx context.Context) *Tutor
- func (tq *TutorQuery) GroupBy(field string, fields ...string) *TutorGroupBy
- func (tq *TutorQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TutorQuery) IDsX(ctx context.Context) []int
- func (tq *TutorQuery) Limit(limit int) *TutorQuery
- func (tq *TutorQuery) Offset(offset int) *TutorQuery
- func (tq *TutorQuery) Only(ctx context.Context) (*Tutor, error)
- func (tq *TutorQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TutorQuery) OnlyIDX(ctx context.Context) int
- func (tq *TutorQuery) OnlyX(ctx context.Context) *Tutor
- func (tq *TutorQuery) Order(o ...OrderFunc) *TutorQuery
- func (tq *TutorQuery) QueryClass() *ClassQuery
- func (tq *TutorQuery) QueryStudent() *StudentQuery
- func (tq *TutorQuery) Select(fields ...string) *TutorSelect
- func (tq *TutorQuery) Unique(unique bool) *TutorQuery
- func (tq *TutorQuery) Where(ps ...predicate.Tutor) *TutorQuery
- func (tq *TutorQuery) WithClass(opts ...func(*ClassQuery)) *TutorQuery
- func (tq *TutorQuery) WithStudent(opts ...func(*StudentQuery)) *TutorQuery
- type TutorSelect
- func (ts *TutorSelect) Aggregate(fns ...AggregateFunc) *TutorSelect
- func (s *TutorSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TutorSelect) BoolX(ctx context.Context) bool
- func (s *TutorSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TutorSelect) BoolsX(ctx context.Context) []bool
- func (s *TutorSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TutorSelect) Float64X(ctx context.Context) float64
- func (s *TutorSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TutorSelect) Float64sX(ctx context.Context) []float64
- func (s *TutorSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TutorSelect) IntX(ctx context.Context) int
- func (s *TutorSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TutorSelect) IntsX(ctx context.Context) []int
- func (ts *TutorSelect) Scan(ctx context.Context, v any) error
- func (s *TutorSelect) ScanX(ctx context.Context, v any)
- func (s *TutorSelect) String(ctx context.Context) (_ string, err error)
- func (s *TutorSelect) StringX(ctx context.Context) string
- func (s *TutorSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TutorSelect) StringsX(ctx context.Context) []string
- type TutorUpdate
- func (tu *TutorUpdate) ClearClass() *TutorUpdate
- func (tu *TutorUpdate) ClearStudent() *TutorUpdate
- func (tu *TutorUpdate) Exec(ctx context.Context) error
- func (tu *TutorUpdate) ExecX(ctx context.Context)
- func (tu *TutorUpdate) Mutation() *TutorMutation
- func (tu *TutorUpdate) Save(ctx context.Context) (int, error)
- func (tu *TutorUpdate) SaveX(ctx context.Context) int
- func (tu *TutorUpdate) SetClass(c *Class) *TutorUpdate
- func (tu *TutorUpdate) SetClassID(id int) *TutorUpdate
- func (tu *TutorUpdate) SetNillableClassID(id *int) *TutorUpdate
- func (tu *TutorUpdate) SetNillableStudentID(id *int) *TutorUpdate
- func (tu *TutorUpdate) SetStudent(s *Student) *TutorUpdate
- func (tu *TutorUpdate) SetStudentID(id int) *TutorUpdate
- func (tu *TutorUpdate) Where(ps ...predicate.Tutor) *TutorUpdate
- type TutorUpdateOne
- func (tuo *TutorUpdateOne) ClearClass() *TutorUpdateOne
- func (tuo *TutorUpdateOne) ClearStudent() *TutorUpdateOne
- func (tuo *TutorUpdateOne) Exec(ctx context.Context) error
- func (tuo *TutorUpdateOne) ExecX(ctx context.Context)
- func (tuo *TutorUpdateOne) Mutation() *TutorMutation
- func (tuo *TutorUpdateOne) Save(ctx context.Context) (*Tutor, error)
- func (tuo *TutorUpdateOne) SaveX(ctx context.Context) *Tutor
- func (tuo *TutorUpdateOne) Select(field string, fields ...string) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetClass(c *Class) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetClassID(id int) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetNillableClassID(id *int) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetNillableStudentID(id *int) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetStudent(s *Student) *TutorUpdateOne
- func (tuo *TutorUpdateOne) SetStudentID(id int) *TutorUpdateOne
- func (tuo *TutorUpdateOne) Where(ps ...predicate.Tutor) *TutorUpdateOne
- type Tutors
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryResource(u *User) *ResourceQuery
- func (c *UserClient) QueryRole(u *User) *RoleQuery
- func (c *UserClient) QueryStudent(u *User) *StudentQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddResource(r ...*Resource) *UserCreate
- func (uc *UserCreate) AddResourceIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddRole(r ...*Role) *UserCreate
- func (uc *UserCreate) AddRoleIDs(ids ...int) *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) SetAccount(s string) *UserCreate
- func (uc *UserCreate) SetAvatar(b []byte) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetNillableStudentID(id *int) *UserCreate
- func (uc *UserCreate) SetPasswd(s string) *UserCreate
- func (uc *UserCreate) SetStudent(s *Student) *UserCreate
- func (uc *UserCreate) SetStudentID(id int) *UserCreate
- func (uc *UserCreate) SetUsername(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) Account() (r string, exists bool)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddResourceIDs(ids ...int)
- func (m *UserMutation) AddRoleIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) Avatar() (r []byte, exists bool)
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearResource()
- func (m *UserMutation) ClearRole()
- func (m *UserMutation) ClearStudent()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) OldAccount(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldAvatar(ctx context.Context) (v *[]byte, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldPasswd(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Passwd() (r string, exists bool)
- func (m *UserMutation) RemoveResourceIDs(ids ...int)
- func (m *UserMutation) RemoveRoleIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedResourceIDs() (ids []int)
- func (m *UserMutation) RemovedRoleIDs() (ids []int)
- func (m *UserMutation) ResetAccount()
- func (m *UserMutation) ResetAvatar()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetPasswd()
- func (m *UserMutation) ResetResource()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetStudent()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) ResourceCleared() bool
- func (m *UserMutation) ResourceIDs() (ids []int)
- func (m *UserMutation) RoleCleared() bool
- func (m *UserMutation) RoleIDs() (ids []int)
- func (m *UserMutation) SetAccount(s string)
- func (m *UserMutation) SetAvatar(b []byte)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPasswd(s string)
- func (m *UserMutation) SetStudentID(id int)
- func (m *UserMutation) SetUsername(s string)
- func (m *UserMutation) StudentCleared() bool
- func (m *UserMutation) StudentID() (id int, exists bool)
- func (m *UserMutation) StudentIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Username() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryResource() *ResourceQuery
- func (uq *UserQuery) QueryRole() *RoleQuery
- func (uq *UserQuery) QueryStudent() *StudentQuery
- 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) WithResource(opts ...func(*ResourceQuery)) *UserQuery
- func (uq *UserQuery) WithRole(opts ...func(*RoleQuery)) *UserQuery
- func (uq *UserQuery) WithStudent(opts ...func(*StudentQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddResource(r ...*Resource) *UserUpdate
- func (uu *UserUpdate) AddResourceIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddRole(r ...*Role) *UserUpdate
- func (uu *UserUpdate) AddRoleIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) ClearResource() *UserUpdate
- func (uu *UserUpdate) ClearRole() *UserUpdate
- func (uu *UserUpdate) ClearStudent() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveResource(r ...*Resource) *UserUpdate
- func (uu *UserUpdate) RemoveResourceIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveRole(r ...*Role) *UserUpdate
- func (uu *UserUpdate) RemoveRoleIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAccount(s string) *UserUpdate
- func (uu *UserUpdate) SetAvatar(b []byte) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableStudentID(id *int) *UserUpdate
- func (uu *UserUpdate) SetPasswd(s string) *UserUpdate
- func (uu *UserUpdate) SetStudent(s *Student) *UserUpdate
- func (uu *UserUpdate) SetStudentID(id int) *UserUpdate
- func (uu *UserUpdate) SetUsername(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddResource(r ...*Resource) *UserUpdateOne
- func (uuo *UserUpdateOne) AddResourceIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRole(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRoleIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearResource() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearRole() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearStudent() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveResource(r ...*Resource) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveResourceIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRole(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int) *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) SetAccount(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAvatar(b []byte) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableStudentID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPasswd(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetStudent(s *Student) *UserUpdateOne
- func (uuo *UserUpdateOne) SetStudentID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAuthorization = "Authorization" TypeCampus = "Campus" TypeCertificate = "Certificate" TypeClass = "Class" TypeClassLeader = "ClassLeader" TypeDepartment = "Department" TypeEducationLevel = "EducationLevel" TypeEnrollmentStatus = "EnrollmentStatus" TypeFamilyInfo = "FamilyInfo" TypeMajor = "Major" TypeMajorDirection = "MajorDirection" TypePracticalExperience = "PracticalExperience" TypeResource = "Resource" TypeRole = "Role" TypeStudent = "Student" TypeTutor = "Tutor" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type 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(domain.As(domain.Sum(field1), "sum_field1"), (domain.As(domain.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 Authorization ¶
type Authorization struct { // ID of the ent. ID int `json:"id,omitempty"` // ClientID holds the value of the "client_id" field. ClientID string `json:"client_id,omitempty"` // ClientSecret holds the value of the "client_secret" field. ClientSecret string `json:"client_secret,omitempty"` // ClientName holds the value of the "client_name" field. ClientName string `json:"client_name,omitempty"` // GrantType holds the value of the "grant_type" field. GrantType []string `json:"grant_type,omitempty"` // Scope holds the value of the "scope" field. Scope []string `json:"scope,omitempty"` // RedirectURL holds the value of the "redirect_url" field. RedirectURL string `json:"redirect_url,omitempty"` // Domain holds the value of the "domain" field. Domain string `json:"domain,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AuthorizationQuery when eager-loading is set. Edges AuthorizationEdges `json:"edges"` // contains filtered or unexported fields }
Authorization is the model entity for the Authorization schema.
func (*Authorization) QueryResource ¶
func (a *Authorization) QueryResource() *ResourceQuery
QueryResource queries the "resource" edge of the Authorization entity.
func (*Authorization) String ¶
func (a *Authorization) String() string
String implements the fmt.Stringer.
func (*Authorization) Unwrap ¶
func (a *Authorization) Unwrap() *Authorization
Unwrap unwraps the Authorization 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 (*Authorization) Update ¶
func (a *Authorization) Update() *AuthorizationUpdateOne
Update returns a builder for updating this Authorization. Note that you need to call Authorization.Unwrap() before calling this method if this Authorization was returned from a transaction, and the transaction was committed or rolled back.
type AuthorizationClient ¶
type AuthorizationClient struct {
// contains filtered or unexported fields
}
AuthorizationClient is a client for the Authorization schema.
func NewAuthorizationClient ¶
func NewAuthorizationClient(c config) *AuthorizationClient
NewAuthorizationClient returns a client for the Authorization from the given config.
func (*AuthorizationClient) Create ¶
func (c *AuthorizationClient) Create() *AuthorizationCreate
Create returns a builder for creating a Authorization entity.
func (*AuthorizationClient) CreateBulk ¶
func (c *AuthorizationClient) CreateBulk(builders ...*AuthorizationCreate) *AuthorizationCreateBulk
CreateBulk returns a builder for creating a bulk of Authorization entities.
func (*AuthorizationClient) Delete ¶
func (c *AuthorizationClient) Delete() *AuthorizationDelete
Delete returns a delete builder for Authorization.
func (*AuthorizationClient) DeleteOne ¶
func (c *AuthorizationClient) DeleteOne(a *Authorization) *AuthorizationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AuthorizationClient) DeleteOneID ¶
func (c *AuthorizationClient) DeleteOneID(id int) *AuthorizationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AuthorizationClient) Get ¶
func (c *AuthorizationClient) Get(ctx context.Context, id int) (*Authorization, error)
Get returns a Authorization entity by its id.
func (*AuthorizationClient) GetX ¶
func (c *AuthorizationClient) GetX(ctx context.Context, id int) *Authorization
GetX is like Get, but panics if an error occurs.
func (*AuthorizationClient) Hooks ¶
func (c *AuthorizationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AuthorizationClient) Intercept ¶
func (c *AuthorizationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `authorization.Intercept(f(g(h())))`.
func (*AuthorizationClient) Interceptors ¶
func (c *AuthorizationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AuthorizationClient) Query ¶
func (c *AuthorizationClient) Query() *AuthorizationQuery
Query returns a query builder for Authorization.
func (*AuthorizationClient) QueryResource ¶
func (c *AuthorizationClient) QueryResource(a *Authorization) *ResourceQuery
QueryResource queries the resource edge of a Authorization.
func (*AuthorizationClient) Update ¶
func (c *AuthorizationClient) Update() *AuthorizationUpdate
Update returns an update builder for Authorization.
func (*AuthorizationClient) UpdateOne ¶
func (c *AuthorizationClient) UpdateOne(a *Authorization) *AuthorizationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AuthorizationClient) UpdateOneID ¶
func (c *AuthorizationClient) UpdateOneID(id int) *AuthorizationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AuthorizationClient) Use ¶
func (c *AuthorizationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `authorization.Hooks(f(g(h())))`.
type AuthorizationCreate ¶
type AuthorizationCreate struct {
// contains filtered or unexported fields
}
AuthorizationCreate is the builder for creating a Authorization entity.
func (*AuthorizationCreate) AddResource ¶
func (ac *AuthorizationCreate) AddResource(r ...*Resource) *AuthorizationCreate
AddResource adds the "resource" edges to the Resource entity.
func (*AuthorizationCreate) AddResourceIDs ¶
func (ac *AuthorizationCreate) AddResourceIDs(ids ...int) *AuthorizationCreate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*AuthorizationCreate) Exec ¶
func (ac *AuthorizationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AuthorizationCreate) ExecX ¶
func (ac *AuthorizationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationCreate) Mutation ¶
func (ac *AuthorizationCreate) Mutation() *AuthorizationMutation
Mutation returns the AuthorizationMutation object of the builder.
func (*AuthorizationCreate) Save ¶
func (ac *AuthorizationCreate) Save(ctx context.Context) (*Authorization, error)
Save creates the Authorization in the database.
func (*AuthorizationCreate) SaveX ¶
func (ac *AuthorizationCreate) SaveX(ctx context.Context) *Authorization
SaveX calls Save and panics if Save returns an error.
func (*AuthorizationCreate) SetClientID ¶
func (ac *AuthorizationCreate) SetClientID(s string) *AuthorizationCreate
SetClientID sets the "client_id" field.
func (*AuthorizationCreate) SetClientName ¶
func (ac *AuthorizationCreate) SetClientName(s string) *AuthorizationCreate
SetClientName sets the "client_name" field.
func (*AuthorizationCreate) SetClientSecret ¶
func (ac *AuthorizationCreate) SetClientSecret(s string) *AuthorizationCreate
SetClientSecret sets the "client_secret" field.
func (*AuthorizationCreate) SetDomain ¶
func (ac *AuthorizationCreate) SetDomain(s string) *AuthorizationCreate
SetDomain sets the "domain" field.
func (*AuthorizationCreate) SetGrantType ¶
func (ac *AuthorizationCreate) SetGrantType(s []string) *AuthorizationCreate
SetGrantType sets the "grant_type" field.
func (*AuthorizationCreate) SetRedirectURL ¶
func (ac *AuthorizationCreate) SetRedirectURL(s string) *AuthorizationCreate
SetRedirectURL sets the "redirect_url" field.
func (*AuthorizationCreate) SetScope ¶
func (ac *AuthorizationCreate) SetScope(s []string) *AuthorizationCreate
SetScope sets the "scope" field.
type AuthorizationCreateBulk ¶
type AuthorizationCreateBulk struct {
// contains filtered or unexported fields
}
AuthorizationCreateBulk is the builder for creating many Authorization entities in bulk.
func (*AuthorizationCreateBulk) Exec ¶
func (acb *AuthorizationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AuthorizationCreateBulk) ExecX ¶
func (acb *AuthorizationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationCreateBulk) Save ¶
func (acb *AuthorizationCreateBulk) Save(ctx context.Context) ([]*Authorization, error)
Save creates the Authorization entities in the database.
func (*AuthorizationCreateBulk) SaveX ¶
func (acb *AuthorizationCreateBulk) SaveX(ctx context.Context) []*Authorization
SaveX is like Save, but panics if an error occurs.
type AuthorizationDelete ¶
type AuthorizationDelete struct {
// contains filtered or unexported fields
}
AuthorizationDelete is the builder for deleting a Authorization entity.
func (*AuthorizationDelete) Exec ¶
func (ad *AuthorizationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AuthorizationDelete) ExecX ¶
func (ad *AuthorizationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationDelete) Where ¶
func (ad *AuthorizationDelete) Where(ps ...predicate.Authorization) *AuthorizationDelete
Where appends a list predicates to the AuthorizationDelete builder.
type AuthorizationDeleteOne ¶
type AuthorizationDeleteOne struct {
// contains filtered or unexported fields
}
AuthorizationDeleteOne is the builder for deleting a single Authorization entity.
func (*AuthorizationDeleteOne) Exec ¶
func (ado *AuthorizationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AuthorizationDeleteOne) ExecX ¶
func (ado *AuthorizationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationDeleteOne) Where ¶
func (ado *AuthorizationDeleteOne) Where(ps ...predicate.Authorization) *AuthorizationDeleteOne
Where appends a list predicates to the AuthorizationDelete builder.
type AuthorizationEdges ¶
type AuthorizationEdges struct { // Resource holds the value of the resource edge. Resource []*Resource `json:"resource,omitempty"` // contains filtered or unexported fields }
AuthorizationEdges holds the relations/edges for other nodes in the graph.
func (AuthorizationEdges) ResourceOrErr ¶
func (e AuthorizationEdges) ResourceOrErr() ([]*Resource, error)
ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading.
type AuthorizationGroupBy ¶
type AuthorizationGroupBy struct {
// contains filtered or unexported fields
}
AuthorizationGroupBy is the group-by builder for Authorization entities.
func (*AuthorizationGroupBy) Aggregate ¶
func (agb *AuthorizationGroupBy) Aggregate(fns ...AggregateFunc) *AuthorizationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AuthorizationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AuthorizationGroupBy) Scan ¶
func (agb *AuthorizationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AuthorizationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AuthorizationMutation ¶
type AuthorizationMutation struct {
// contains filtered or unexported fields
}
AuthorizationMutation represents an operation that mutates the Authorization nodes in the graph.
func (*AuthorizationMutation) AddField ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) AddResourceIDs ¶
func (m *AuthorizationMutation) AddResourceIDs(ids ...int)
AddResourceIDs adds the "resource" edge to the Resource entity by ids.
func (*AuthorizationMutation) AddedEdges ¶
func (m *AuthorizationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AuthorizationMutation) AddedField ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) AddedFields ¶
func (m *AuthorizationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AuthorizationMutation) AddedIDs ¶
func (m *AuthorizationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AuthorizationMutation) AppendGrantType ¶
func (m *AuthorizationMutation) AppendGrantType(s []string)
AppendGrantType adds s to the "grant_type" field.
func (*AuthorizationMutation) AppendScope ¶
func (m *AuthorizationMutation) AppendScope(s []string)
AppendScope adds s to the "scope" field.
func (*AuthorizationMutation) AppendedGrantType ¶
func (m *AuthorizationMutation) AppendedGrantType() ([]string, bool)
AppendedGrantType returns the list of values that were appended to the "grant_type" field in this mutation.
func (*AuthorizationMutation) AppendedScope ¶
func (m *AuthorizationMutation) AppendedScope() ([]string, bool)
AppendedScope returns the list of values that were appended to the "scope" field in this mutation.
func (*AuthorizationMutation) ClearEdge ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ClearField ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ClearResource ¶
func (m *AuthorizationMutation) ClearResource()
ClearResource clears the "resource" edge to the Resource entity.
func (*AuthorizationMutation) ClearedEdges ¶
func (m *AuthorizationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AuthorizationMutation) ClearedFields ¶
func (m *AuthorizationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AuthorizationMutation) Client ¶
func (m AuthorizationMutation) 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 (*AuthorizationMutation) ClientID ¶
func (m *AuthorizationMutation) ClientID() (r string, exists bool)
ClientID returns the value of the "client_id" field in the mutation.
func (*AuthorizationMutation) ClientName ¶
func (m *AuthorizationMutation) ClientName() (r string, exists bool)
ClientName returns the value of the "client_name" field in the mutation.
func (*AuthorizationMutation) ClientSecret ¶
func (m *AuthorizationMutation) ClientSecret() (r string, exists bool)
ClientSecret returns the value of the "client_secret" field in the mutation.
func (*AuthorizationMutation) Domain ¶
func (m *AuthorizationMutation) Domain() (r string, exists bool)
Domain returns the value of the "domain" field in the mutation.
func (*AuthorizationMutation) EdgeCleared ¶
func (m *AuthorizationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AuthorizationMutation) Field ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) FieldCleared ¶
func (m *AuthorizationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AuthorizationMutation) Fields ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) GrantType ¶
func (m *AuthorizationMutation) GrantType() (r []string, exists bool)
GrantType returns the value of the "grant_type" field in the mutation.
func (*AuthorizationMutation) ID ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) IDs ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) OldClientID ¶
func (m *AuthorizationMutation) OldClientID(ctx context.Context) (v string, err error)
OldClientID returns the old "client_id" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldClientName ¶
func (m *AuthorizationMutation) OldClientName(ctx context.Context) (v string, err error)
OldClientName returns the old "client_name" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldClientSecret ¶
func (m *AuthorizationMutation) OldClientSecret(ctx context.Context) (v string, err error)
OldClientSecret returns the old "client_secret" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldDomain ¶
func (m *AuthorizationMutation) OldDomain(ctx context.Context) (v string, err error)
OldDomain returns the old "domain" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) 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 (*AuthorizationMutation) OldGrantType ¶
func (m *AuthorizationMutation) OldGrantType(ctx context.Context) (v []string, err error)
OldGrantType returns the old "grant_type" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldRedirectURL ¶
func (m *AuthorizationMutation) OldRedirectURL(ctx context.Context) (v string, err error)
OldRedirectURL returns the old "redirect_url" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldScope ¶
func (m *AuthorizationMutation) OldScope(ctx context.Context) (v []string, err error)
OldScope returns the old "scope" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) Op ¶
func (m *AuthorizationMutation) Op() Op
Op returns the operation name.
func (*AuthorizationMutation) RedirectURL ¶
func (m *AuthorizationMutation) RedirectURL() (r string, exists bool)
RedirectURL returns the value of the "redirect_url" field in the mutation.
func (*AuthorizationMutation) RemoveResourceIDs ¶
func (m *AuthorizationMutation) RemoveResourceIDs(ids ...int)
RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.
func (*AuthorizationMutation) RemovedEdges ¶
func (m *AuthorizationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AuthorizationMutation) RemovedIDs ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) RemovedResourceIDs ¶
func (m *AuthorizationMutation) RemovedResourceIDs() (ids []int)
RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.
func (*AuthorizationMutation) ResetClientID ¶
func (m *AuthorizationMutation) ResetClientID()
ResetClientID resets all changes to the "client_id" field.
func (*AuthorizationMutation) ResetClientName ¶
func (m *AuthorizationMutation) ResetClientName()
ResetClientName resets all changes to the "client_name" field.
func (*AuthorizationMutation) ResetClientSecret ¶
func (m *AuthorizationMutation) ResetClientSecret()
ResetClientSecret resets all changes to the "client_secret" field.
func (*AuthorizationMutation) ResetDomain ¶
func (m *AuthorizationMutation) ResetDomain()
ResetDomain resets all changes to the "domain" field.
func (*AuthorizationMutation) ResetEdge ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ResetField ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ResetGrantType ¶
func (m *AuthorizationMutation) ResetGrantType()
ResetGrantType resets all changes to the "grant_type" field.
func (*AuthorizationMutation) ResetRedirectURL ¶
func (m *AuthorizationMutation) ResetRedirectURL()
ResetRedirectURL resets all changes to the "redirect_url" field.
func (*AuthorizationMutation) ResetResource ¶
func (m *AuthorizationMutation) ResetResource()
ResetResource resets all changes to the "resource" edge.
func (*AuthorizationMutation) ResetScope ¶
func (m *AuthorizationMutation) ResetScope()
ResetScope resets all changes to the "scope" field.
func (*AuthorizationMutation) ResourceCleared ¶
func (m *AuthorizationMutation) ResourceCleared() bool
ResourceCleared reports if the "resource" edge to the Resource entity was cleared.
func (*AuthorizationMutation) ResourceIDs ¶
func (m *AuthorizationMutation) ResourceIDs() (ids []int)
ResourceIDs returns the "resource" edge IDs in the mutation.
func (*AuthorizationMutation) Scope ¶
func (m *AuthorizationMutation) Scope() (r []string, exists bool)
Scope returns the value of the "scope" field in the mutation.
func (*AuthorizationMutation) SetClientID ¶
func (m *AuthorizationMutation) SetClientID(s string)
SetClientID sets the "client_id" field.
func (*AuthorizationMutation) SetClientName ¶
func (m *AuthorizationMutation) SetClientName(s string)
SetClientName sets the "client_name" field.
func (*AuthorizationMutation) SetClientSecret ¶
func (m *AuthorizationMutation) SetClientSecret(s string)
SetClientSecret sets the "client_secret" field.
func (*AuthorizationMutation) SetDomain ¶
func (m *AuthorizationMutation) SetDomain(s string)
SetDomain sets the "domain" field.
func (*AuthorizationMutation) SetField ¶
func (m *AuthorizationMutation) 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 (*AuthorizationMutation) SetGrantType ¶
func (m *AuthorizationMutation) SetGrantType(s []string)
SetGrantType sets the "grant_type" field.
func (*AuthorizationMutation) SetOp ¶
func (m *AuthorizationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AuthorizationMutation) SetRedirectURL ¶
func (m *AuthorizationMutation) SetRedirectURL(s string)
SetRedirectURL sets the "redirect_url" field.
func (*AuthorizationMutation) SetScope ¶
func (m *AuthorizationMutation) SetScope(s []string)
SetScope sets the "scope" field.
func (AuthorizationMutation) Tx ¶
func (m AuthorizationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AuthorizationMutation) Type ¶
func (m *AuthorizationMutation) Type() string
Type returns the node type of this mutation (Authorization).
func (*AuthorizationMutation) Where ¶
func (m *AuthorizationMutation) Where(ps ...predicate.Authorization)
Where appends a list predicates to the AuthorizationMutation builder.
func (*AuthorizationMutation) WhereP ¶
func (m *AuthorizationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AuthorizationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AuthorizationQuery ¶
type AuthorizationQuery struct {
// contains filtered or unexported fields
}
AuthorizationQuery is the builder for querying Authorization entities.
func (*AuthorizationQuery) Aggregate ¶
func (aq *AuthorizationQuery) Aggregate(fns ...AggregateFunc) *AuthorizationSelect
Aggregate returns a AuthorizationSelect configured with the given aggregations.
func (*AuthorizationQuery) All ¶
func (aq *AuthorizationQuery) All(ctx context.Context) ([]*Authorization, error)
All executes the query and returns a list of Authorizations.
func (*AuthorizationQuery) AllX ¶
func (aq *AuthorizationQuery) AllX(ctx context.Context) []*Authorization
AllX is like All, but panics if an error occurs.
func (*AuthorizationQuery) Clone ¶
func (aq *AuthorizationQuery) Clone() *AuthorizationQuery
Clone returns a duplicate of the AuthorizationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AuthorizationQuery) Count ¶
func (aq *AuthorizationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AuthorizationQuery) CountX ¶
func (aq *AuthorizationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AuthorizationQuery) Exist ¶
func (aq *AuthorizationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AuthorizationQuery) ExistX ¶
func (aq *AuthorizationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AuthorizationQuery) First ¶
func (aq *AuthorizationQuery) First(ctx context.Context) (*Authorization, error)
First returns the first Authorization entity from the query. Returns a *NotFoundError when no Authorization was found.
func (*AuthorizationQuery) FirstID ¶
func (aq *AuthorizationQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Authorization ID from the query. Returns a *NotFoundError when no Authorization ID was found.
func (*AuthorizationQuery) FirstIDX ¶
func (aq *AuthorizationQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AuthorizationQuery) FirstX ¶
func (aq *AuthorizationQuery) FirstX(ctx context.Context) *Authorization
FirstX is like First, but panics if an error occurs.
func (*AuthorizationQuery) GroupBy ¶
func (aq *AuthorizationQuery) GroupBy(field string, fields ...string) *AuthorizationGroupBy
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 { ClientID string `json:"client_id,omitempty"` Count int `json:"count,omitempty"` } client.Authorization.Query(). GroupBy(authorization.FieldClientID). Aggregate(domain.Count()). Scan(ctx, &v)
func (*AuthorizationQuery) IDs ¶
func (aq *AuthorizationQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Authorization IDs.
func (*AuthorizationQuery) IDsX ¶
func (aq *AuthorizationQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AuthorizationQuery) Limit ¶
func (aq *AuthorizationQuery) Limit(limit int) *AuthorizationQuery
Limit the number of records to be returned by this query.
func (*AuthorizationQuery) Offset ¶
func (aq *AuthorizationQuery) Offset(offset int) *AuthorizationQuery
Offset to start from.
func (*AuthorizationQuery) Only ¶
func (aq *AuthorizationQuery) Only(ctx context.Context) (*Authorization, error)
Only returns a single Authorization entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Authorization entity is found. Returns a *NotFoundError when no Authorization entities are found.
func (*AuthorizationQuery) OnlyID ¶
func (aq *AuthorizationQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Authorization ID in the query. Returns a *NotSingularError when more than one Authorization ID is found. Returns a *NotFoundError when no entities are found.
func (*AuthorizationQuery) OnlyIDX ¶
func (aq *AuthorizationQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AuthorizationQuery) OnlyX ¶
func (aq *AuthorizationQuery) OnlyX(ctx context.Context) *Authorization
OnlyX is like Only, but panics if an error occurs.
func (*AuthorizationQuery) Order ¶
func (aq *AuthorizationQuery) Order(o ...OrderFunc) *AuthorizationQuery
Order specifies how the records should be ordered.
func (*AuthorizationQuery) QueryResource ¶
func (aq *AuthorizationQuery) QueryResource() *ResourceQuery
QueryResource chains the current query on the "resource" edge.
func (*AuthorizationQuery) Select ¶
func (aq *AuthorizationQuery) Select(fields ...string) *AuthorizationSelect
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 { ClientID string `json:"client_id,omitempty"` } client.Authorization.Query(). Select(authorization.FieldClientID). Scan(ctx, &v)
func (*AuthorizationQuery) Unique ¶
func (aq *AuthorizationQuery) Unique(unique bool) *AuthorizationQuery
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 (*AuthorizationQuery) Where ¶
func (aq *AuthorizationQuery) Where(ps ...predicate.Authorization) *AuthorizationQuery
Where adds a new predicate for the AuthorizationQuery builder.
func (*AuthorizationQuery) WithResource ¶
func (aq *AuthorizationQuery) WithResource(opts ...func(*ResourceQuery)) *AuthorizationQuery
WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.
type AuthorizationSelect ¶
type AuthorizationSelect struct { *AuthorizationQuery // contains filtered or unexported fields }
AuthorizationSelect is the builder for selecting fields of Authorization entities.
func (*AuthorizationSelect) Aggregate ¶
func (as *AuthorizationSelect) Aggregate(fns ...AggregateFunc) *AuthorizationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AuthorizationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AuthorizationSelect) Scan ¶
func (as *AuthorizationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AuthorizationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AuthorizationUpdate ¶
type AuthorizationUpdate struct {
// contains filtered or unexported fields
}
AuthorizationUpdate is the builder for updating Authorization entities.
func (*AuthorizationUpdate) AddResource ¶
func (au *AuthorizationUpdate) AddResource(r ...*Resource) *AuthorizationUpdate
AddResource adds the "resource" edges to the Resource entity.
func (*AuthorizationUpdate) AddResourceIDs ¶
func (au *AuthorizationUpdate) AddResourceIDs(ids ...int) *AuthorizationUpdate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*AuthorizationUpdate) AppendGrantType ¶
func (au *AuthorizationUpdate) AppendGrantType(s []string) *AuthorizationUpdate
AppendGrantType appends s to the "grant_type" field.
func (*AuthorizationUpdate) AppendScope ¶
func (au *AuthorizationUpdate) AppendScope(s []string) *AuthorizationUpdate
AppendScope appends s to the "scope" field.
func (*AuthorizationUpdate) ClearResource ¶
func (au *AuthorizationUpdate) ClearResource() *AuthorizationUpdate
ClearResource clears all "resource" edges to the Resource entity.
func (*AuthorizationUpdate) Exec ¶
func (au *AuthorizationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AuthorizationUpdate) ExecX ¶
func (au *AuthorizationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationUpdate) Mutation ¶
func (au *AuthorizationUpdate) Mutation() *AuthorizationMutation
Mutation returns the AuthorizationMutation object of the builder.
func (*AuthorizationUpdate) RemoveResource ¶
func (au *AuthorizationUpdate) RemoveResource(r ...*Resource) *AuthorizationUpdate
RemoveResource removes "resource" edges to Resource entities.
func (*AuthorizationUpdate) RemoveResourceIDs ¶
func (au *AuthorizationUpdate) RemoveResourceIDs(ids ...int) *AuthorizationUpdate
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*AuthorizationUpdate) Save ¶
func (au *AuthorizationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AuthorizationUpdate) SaveX ¶
func (au *AuthorizationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AuthorizationUpdate) SetClientID ¶
func (au *AuthorizationUpdate) SetClientID(s string) *AuthorizationUpdate
SetClientID sets the "client_id" field.
func (*AuthorizationUpdate) SetClientName ¶
func (au *AuthorizationUpdate) SetClientName(s string) *AuthorizationUpdate
SetClientName sets the "client_name" field.
func (*AuthorizationUpdate) SetClientSecret ¶
func (au *AuthorizationUpdate) SetClientSecret(s string) *AuthorizationUpdate
SetClientSecret sets the "client_secret" field.
func (*AuthorizationUpdate) SetDomain ¶
func (au *AuthorizationUpdate) SetDomain(s string) *AuthorizationUpdate
SetDomain sets the "domain" field.
func (*AuthorizationUpdate) SetGrantType ¶
func (au *AuthorizationUpdate) SetGrantType(s []string) *AuthorizationUpdate
SetGrantType sets the "grant_type" field.
func (*AuthorizationUpdate) SetRedirectURL ¶
func (au *AuthorizationUpdate) SetRedirectURL(s string) *AuthorizationUpdate
SetRedirectURL sets the "redirect_url" field.
func (*AuthorizationUpdate) SetScope ¶
func (au *AuthorizationUpdate) SetScope(s []string) *AuthorizationUpdate
SetScope sets the "scope" field.
func (*AuthorizationUpdate) Where ¶
func (au *AuthorizationUpdate) Where(ps ...predicate.Authorization) *AuthorizationUpdate
Where appends a list predicates to the AuthorizationUpdate builder.
type AuthorizationUpdateOne ¶
type AuthorizationUpdateOne struct {
// contains filtered or unexported fields
}
AuthorizationUpdateOne is the builder for updating a single Authorization entity.
func (*AuthorizationUpdateOne) AddResource ¶
func (auo *AuthorizationUpdateOne) AddResource(r ...*Resource) *AuthorizationUpdateOne
AddResource adds the "resource" edges to the Resource entity.
func (*AuthorizationUpdateOne) AddResourceIDs ¶
func (auo *AuthorizationUpdateOne) AddResourceIDs(ids ...int) *AuthorizationUpdateOne
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*AuthorizationUpdateOne) AppendGrantType ¶
func (auo *AuthorizationUpdateOne) AppendGrantType(s []string) *AuthorizationUpdateOne
AppendGrantType appends s to the "grant_type" field.
func (*AuthorizationUpdateOne) AppendScope ¶
func (auo *AuthorizationUpdateOne) AppendScope(s []string) *AuthorizationUpdateOne
AppendScope appends s to the "scope" field.
func (*AuthorizationUpdateOne) ClearResource ¶
func (auo *AuthorizationUpdateOne) ClearResource() *AuthorizationUpdateOne
ClearResource clears all "resource" edges to the Resource entity.
func (*AuthorizationUpdateOne) Exec ¶
func (auo *AuthorizationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AuthorizationUpdateOne) ExecX ¶
func (auo *AuthorizationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuthorizationUpdateOne) Mutation ¶
func (auo *AuthorizationUpdateOne) Mutation() *AuthorizationMutation
Mutation returns the AuthorizationMutation object of the builder.
func (*AuthorizationUpdateOne) RemoveResource ¶
func (auo *AuthorizationUpdateOne) RemoveResource(r ...*Resource) *AuthorizationUpdateOne
RemoveResource removes "resource" edges to Resource entities.
func (*AuthorizationUpdateOne) RemoveResourceIDs ¶
func (auo *AuthorizationUpdateOne) RemoveResourceIDs(ids ...int) *AuthorizationUpdateOne
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*AuthorizationUpdateOne) Save ¶
func (auo *AuthorizationUpdateOne) Save(ctx context.Context) (*Authorization, error)
Save executes the query and returns the updated Authorization entity.
func (*AuthorizationUpdateOne) SaveX ¶
func (auo *AuthorizationUpdateOne) SaveX(ctx context.Context) *Authorization
SaveX is like Save, but panics if an error occurs.
func (*AuthorizationUpdateOne) Select ¶
func (auo *AuthorizationUpdateOne) Select(field string, fields ...string) *AuthorizationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AuthorizationUpdateOne) SetClientID ¶
func (auo *AuthorizationUpdateOne) SetClientID(s string) *AuthorizationUpdateOne
SetClientID sets the "client_id" field.
func (*AuthorizationUpdateOne) SetClientName ¶
func (auo *AuthorizationUpdateOne) SetClientName(s string) *AuthorizationUpdateOne
SetClientName sets the "client_name" field.
func (*AuthorizationUpdateOne) SetClientSecret ¶
func (auo *AuthorizationUpdateOne) SetClientSecret(s string) *AuthorizationUpdateOne
SetClientSecret sets the "client_secret" field.
func (*AuthorizationUpdateOne) SetDomain ¶
func (auo *AuthorizationUpdateOne) SetDomain(s string) *AuthorizationUpdateOne
SetDomain sets the "domain" field.
func (*AuthorizationUpdateOne) SetGrantType ¶
func (auo *AuthorizationUpdateOne) SetGrantType(s []string) *AuthorizationUpdateOne
SetGrantType sets the "grant_type" field.
func (*AuthorizationUpdateOne) SetRedirectURL ¶
func (auo *AuthorizationUpdateOne) SetRedirectURL(s string) *AuthorizationUpdateOne
SetRedirectURL sets the "redirect_url" field.
func (*AuthorizationUpdateOne) SetScope ¶
func (auo *AuthorizationUpdateOne) SetScope(s []string) *AuthorizationUpdateOne
SetScope sets the "scope" field.
func (*AuthorizationUpdateOne) Where ¶
func (auo *AuthorizationUpdateOne) Where(ps ...predicate.Authorization) *AuthorizationUpdateOne
Where appends a list predicates to the AuthorizationUpdate builder.
type Authorizations ¶
type Authorizations []*Authorization
Authorizations is a parsable slice of Authorization.
type Campus ¶
type Campus struct { // ID of the ent. ID int `json:"id,omitempty"` // 校区名称 Name string `json:"name,omitempty"` // 校区地址 Address string `json:"address,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CampusQuery when eager-loading is set. Edges CampusEdges `json:"edges"` // contains filtered or unexported fields }
Campus is the model entity for the Campus schema.
func (*Campus) QueryClass ¶
func (c *Campus) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the Campus entity.
func (*Campus) Unwrap ¶
Unwrap unwraps the Campus 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 (*Campus) Update ¶
func (c *Campus) Update() *CampusUpdateOne
Update returns a builder for updating this Campus. Note that you need to call Campus.Unwrap() before calling this method if this Campus was returned from a transaction, and the transaction was committed or rolled back.
type CampusClient ¶
type CampusClient struct {
// contains filtered or unexported fields
}
CampusClient is a client for the Campus schema.
func NewCampusClient ¶
func NewCampusClient(c config) *CampusClient
NewCampusClient returns a client for the Campus from the given config.
func (*CampusClient) Create ¶
func (c *CampusClient) Create() *CampusCreate
Create returns a builder for creating a Campus entity.
func (*CampusClient) CreateBulk ¶
func (c *CampusClient) CreateBulk(builders ...*CampusCreate) *CampusCreateBulk
CreateBulk returns a builder for creating a bulk of Campus entities.
func (*CampusClient) Delete ¶
func (c *CampusClient) Delete() *CampusDelete
Delete returns a delete builder for Campus.
func (*CampusClient) DeleteOne ¶
func (c *CampusClient) DeleteOne(ca *Campus) *CampusDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CampusClient) DeleteOneID ¶
func (c *CampusClient) DeleteOneID(id int) *CampusDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CampusClient) GetX ¶
func (c *CampusClient) GetX(ctx context.Context, id int) *Campus
GetX is like Get, but panics if an error occurs.
func (*CampusClient) Intercept ¶
func (c *CampusClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `campus.Intercept(f(g(h())))`.
func (*CampusClient) Interceptors ¶
func (c *CampusClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CampusClient) Query ¶
func (c *CampusClient) Query() *CampusQuery
Query returns a query builder for Campus.
func (*CampusClient) QueryClass ¶
func (c *CampusClient) QueryClass(ca *Campus) *ClassQuery
QueryClass queries the class edge of a Campus.
func (*CampusClient) Update ¶
func (c *CampusClient) Update() *CampusUpdate
Update returns an update builder for Campus.
func (*CampusClient) UpdateOne ¶
func (c *CampusClient) UpdateOne(ca *Campus) *CampusUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CampusClient) UpdateOneID ¶
func (c *CampusClient) UpdateOneID(id int) *CampusUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CampusClient) Use ¶
func (c *CampusClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `campus.Hooks(f(g(h())))`.
type CampusCreate ¶
type CampusCreate struct {
// contains filtered or unexported fields
}
CampusCreate is the builder for creating a Campus entity.
func (*CampusCreate) Exec ¶
func (cc *CampusCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CampusCreate) ExecX ¶
func (cc *CampusCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampusCreate) Mutation ¶
func (cc *CampusCreate) Mutation() *CampusMutation
Mutation returns the CampusMutation object of the builder.
func (*CampusCreate) Save ¶
func (cc *CampusCreate) Save(ctx context.Context) (*Campus, error)
Save creates the Campus in the database.
func (*CampusCreate) SaveX ¶
func (cc *CampusCreate) SaveX(ctx context.Context) *Campus
SaveX calls Save and panics if Save returns an error.
func (*CampusCreate) SetAddress ¶
func (cc *CampusCreate) SetAddress(s string) *CampusCreate
SetAddress sets the "address" field.
func (*CampusCreate) SetClass ¶
func (cc *CampusCreate) SetClass(c *Class) *CampusCreate
SetClass sets the "class" edge to the Class entity.
func (*CampusCreate) SetClassID ¶
func (cc *CampusCreate) SetClassID(id int) *CampusCreate
SetClassID sets the "class" edge to the Class entity by ID.
func (*CampusCreate) SetName ¶
func (cc *CampusCreate) SetName(s string) *CampusCreate
SetName sets the "name" field.
func (*CampusCreate) SetNillableClassID ¶
func (cc *CampusCreate) SetNillableClassID(id *int) *CampusCreate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
type CampusCreateBulk ¶
type CampusCreateBulk struct {
// contains filtered or unexported fields
}
CampusCreateBulk is the builder for creating many Campus entities in bulk.
func (*CampusCreateBulk) Exec ¶
func (ccb *CampusCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CampusCreateBulk) ExecX ¶
func (ccb *CampusCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CampusDelete ¶
type CampusDelete struct {
// contains filtered or unexported fields
}
CampusDelete is the builder for deleting a Campus entity.
func (*CampusDelete) Exec ¶
func (cd *CampusDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CampusDelete) ExecX ¶
func (cd *CampusDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CampusDelete) Where ¶
func (cd *CampusDelete) Where(ps ...predicate.Campus) *CampusDelete
Where appends a list predicates to the CampusDelete builder.
type CampusDeleteOne ¶
type CampusDeleteOne struct {
// contains filtered or unexported fields
}
CampusDeleteOne is the builder for deleting a single Campus entity.
func (*CampusDeleteOne) Exec ¶
func (cdo *CampusDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CampusDeleteOne) ExecX ¶
func (cdo *CampusDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampusDeleteOne) Where ¶
func (cdo *CampusDeleteOne) Where(ps ...predicate.Campus) *CampusDeleteOne
Where appends a list predicates to the CampusDelete builder.
type CampusEdges ¶
type CampusEdges struct { // Class holds the value of the class edge. Class *Class `json:"class,omitempty"` // contains filtered or unexported fields }
CampusEdges holds the relations/edges for other nodes in the graph.
func (CampusEdges) ClassOrErr ¶
func (e CampusEdges) ClassOrErr() (*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CampusGroupBy ¶
type CampusGroupBy struct {
// contains filtered or unexported fields
}
CampusGroupBy is the group-by builder for Campus entities.
func (*CampusGroupBy) Aggregate ¶
func (cgb *CampusGroupBy) Aggregate(fns ...AggregateFunc) *CampusGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CampusGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CampusGroupBy) Scan ¶
func (cgb *CampusGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CampusGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CampusMutation ¶
type CampusMutation struct {
// contains filtered or unexported fields
}
CampusMutation represents an operation that mutates the Campus nodes in the graph.
func (*CampusMutation) AddField ¶
func (m *CampusMutation) 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 (*CampusMutation) AddedEdges ¶
func (m *CampusMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CampusMutation) AddedField ¶
func (m *CampusMutation) 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 (*CampusMutation) AddedFields ¶
func (m *CampusMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CampusMutation) AddedIDs ¶
func (m *CampusMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CampusMutation) Address ¶
func (m *CampusMutation) Address() (r string, exists bool)
Address returns the value of the "address" field in the mutation.
func (*CampusMutation) ClassCleared ¶
func (m *CampusMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*CampusMutation) ClassID ¶
func (m *CampusMutation) ClassID() (id int, exists bool)
ClassID returns the "class" edge ID in the mutation.
func (*CampusMutation) ClassIDs ¶
func (m *CampusMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.
func (*CampusMutation) ClearClass ¶
func (m *CampusMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*CampusMutation) ClearEdge ¶
func (m *CampusMutation) 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 (*CampusMutation) ClearField ¶
func (m *CampusMutation) 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 (*CampusMutation) ClearedEdges ¶
func (m *CampusMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CampusMutation) ClearedFields ¶
func (m *CampusMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CampusMutation) Client ¶
func (m CampusMutation) 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 (*CampusMutation) EdgeCleared ¶
func (m *CampusMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CampusMutation) Field ¶
func (m *CampusMutation) 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 (*CampusMutation) FieldCleared ¶
func (m *CampusMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CampusMutation) Fields ¶
func (m *CampusMutation) 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 (*CampusMutation) ID ¶
func (m *CampusMutation) 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 (*CampusMutation) IDs ¶
func (m *CampusMutation) 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 (*CampusMutation) Name ¶
func (m *CampusMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CampusMutation) OldAddress ¶
func (m *CampusMutation) OldAddress(ctx context.Context) (v string, err error)
OldAddress returns the old "address" field's value of the Campus entity. If the Campus 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 (*CampusMutation) 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 (*CampusMutation) OldName ¶
func (m *CampusMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Campus entity. If the Campus 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 (*CampusMutation) RemovedEdges ¶
func (m *CampusMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CampusMutation) RemovedIDs ¶
func (m *CampusMutation) 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 (*CampusMutation) ResetAddress ¶
func (m *CampusMutation) ResetAddress()
ResetAddress resets all changes to the "address" field.
func (*CampusMutation) ResetClass ¶
func (m *CampusMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*CampusMutation) ResetEdge ¶
func (m *CampusMutation) 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 (*CampusMutation) ResetField ¶
func (m *CampusMutation) 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 (*CampusMutation) ResetName ¶
func (m *CampusMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CampusMutation) SetAddress ¶
func (m *CampusMutation) SetAddress(s string)
SetAddress sets the "address" field.
func (*CampusMutation) SetClassID ¶
func (m *CampusMutation) SetClassID(id int)
SetClassID sets the "class" edge to the Class entity by id.
func (*CampusMutation) SetField ¶
func (m *CampusMutation) 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 (*CampusMutation) SetName ¶
func (m *CampusMutation) SetName(s string)
SetName sets the "name" field.
func (*CampusMutation) SetOp ¶
func (m *CampusMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (CampusMutation) Tx ¶
func (m CampusMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CampusMutation) Type ¶
func (m *CampusMutation) Type() string
Type returns the node type of this mutation (Campus).
func (*CampusMutation) Where ¶
func (m *CampusMutation) Where(ps ...predicate.Campus)
Where appends a list predicates to the CampusMutation builder.
func (*CampusMutation) WhereP ¶
func (m *CampusMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CampusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CampusQuery ¶
type CampusQuery struct {
// contains filtered or unexported fields
}
CampusQuery is the builder for querying Campus entities.
func (*CampusQuery) Aggregate ¶
func (cq *CampusQuery) Aggregate(fns ...AggregateFunc) *CampusSelect
Aggregate returns a CampusSelect configured with the given aggregations.
func (*CampusQuery) All ¶
func (cq *CampusQuery) All(ctx context.Context) ([]*Campus, error)
All executes the query and returns a list of CampusSlice.
func (*CampusQuery) AllX ¶
func (cq *CampusQuery) AllX(ctx context.Context) []*Campus
AllX is like All, but panics if an error occurs.
func (*CampusQuery) Clone ¶
func (cq *CampusQuery) Clone() *CampusQuery
Clone returns a duplicate of the CampusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CampusQuery) Count ¶
func (cq *CampusQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CampusQuery) CountX ¶
func (cq *CampusQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CampusQuery) Exist ¶
func (cq *CampusQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CampusQuery) ExistX ¶
func (cq *CampusQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CampusQuery) First ¶
func (cq *CampusQuery) First(ctx context.Context) (*Campus, error)
First returns the first Campus entity from the query. Returns a *NotFoundError when no Campus was found.
func (*CampusQuery) FirstID ¶
func (cq *CampusQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Campus ID from the query. Returns a *NotFoundError when no Campus ID was found.
func (*CampusQuery) FirstIDX ¶
func (cq *CampusQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CampusQuery) FirstX ¶
func (cq *CampusQuery) FirstX(ctx context.Context) *Campus
FirstX is like First, but panics if an error occurs.
func (*CampusQuery) GroupBy ¶
func (cq *CampusQuery) GroupBy(field string, fields ...string) *CampusGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Campus.Query(). GroupBy(campus.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*CampusQuery) IDs ¶
func (cq *CampusQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Campus IDs.
func (*CampusQuery) IDsX ¶
func (cq *CampusQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CampusQuery) Limit ¶
func (cq *CampusQuery) Limit(limit int) *CampusQuery
Limit the number of records to be returned by this query.
func (*CampusQuery) Offset ¶
func (cq *CampusQuery) Offset(offset int) *CampusQuery
Offset to start from.
func (*CampusQuery) Only ¶
func (cq *CampusQuery) Only(ctx context.Context) (*Campus, error)
Only returns a single Campus entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Campus entity is found. Returns a *NotFoundError when no Campus entities are found.
func (*CampusQuery) OnlyID ¶
func (cq *CampusQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Campus ID in the query. Returns a *NotSingularError when more than one Campus ID is found. Returns a *NotFoundError when no entities are found.
func (*CampusQuery) OnlyIDX ¶
func (cq *CampusQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CampusQuery) OnlyX ¶
func (cq *CampusQuery) OnlyX(ctx context.Context) *Campus
OnlyX is like Only, but panics if an error occurs.
func (*CampusQuery) Order ¶
func (cq *CampusQuery) Order(o ...OrderFunc) *CampusQuery
Order specifies how the records should be ordered.
func (*CampusQuery) QueryClass ¶
func (cq *CampusQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*CampusQuery) Select ¶
func (cq *CampusQuery) Select(fields ...string) *CampusSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Campus.Query(). Select(campus.FieldName). Scan(ctx, &v)
func (*CampusQuery) Unique ¶
func (cq *CampusQuery) Unique(unique bool) *CampusQuery
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 (*CampusQuery) Where ¶
func (cq *CampusQuery) Where(ps ...predicate.Campus) *CampusQuery
Where adds a new predicate for the CampusQuery builder.
func (*CampusQuery) WithClass ¶
func (cq *CampusQuery) WithClass(opts ...func(*ClassQuery)) *CampusQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
type CampusSelect ¶
type CampusSelect struct { *CampusQuery // contains filtered or unexported fields }
CampusSelect is the builder for selecting fields of Campus entities.
func (*CampusSelect) Aggregate ¶
func (cs *CampusSelect) Aggregate(fns ...AggregateFunc) *CampusSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CampusSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CampusSelect) Scan ¶
func (cs *CampusSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CampusSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CampusUpdate ¶
type CampusUpdate struct {
// contains filtered or unexported fields
}
CampusUpdate is the builder for updating Campus entities.
func (*CampusUpdate) ClearClass ¶
func (cu *CampusUpdate) ClearClass() *CampusUpdate
ClearClass clears the "class" edge to the Class entity.
func (*CampusUpdate) Exec ¶
func (cu *CampusUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CampusUpdate) ExecX ¶
func (cu *CampusUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampusUpdate) Mutation ¶
func (cu *CampusUpdate) Mutation() *CampusMutation
Mutation returns the CampusMutation object of the builder.
func (*CampusUpdate) Save ¶
func (cu *CampusUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CampusUpdate) SaveX ¶
func (cu *CampusUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CampusUpdate) SetAddress ¶
func (cu *CampusUpdate) SetAddress(s string) *CampusUpdate
SetAddress sets the "address" field.
func (*CampusUpdate) SetClass ¶
func (cu *CampusUpdate) SetClass(c *Class) *CampusUpdate
SetClass sets the "class" edge to the Class entity.
func (*CampusUpdate) SetClassID ¶
func (cu *CampusUpdate) SetClassID(id int) *CampusUpdate
SetClassID sets the "class" edge to the Class entity by ID.
func (*CampusUpdate) SetName ¶
func (cu *CampusUpdate) SetName(s string) *CampusUpdate
SetName sets the "name" field.
func (*CampusUpdate) SetNillableClassID ¶
func (cu *CampusUpdate) SetNillableClassID(id *int) *CampusUpdate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*CampusUpdate) Where ¶
func (cu *CampusUpdate) Where(ps ...predicate.Campus) *CampusUpdate
Where appends a list predicates to the CampusUpdate builder.
type CampusUpdateOne ¶
type CampusUpdateOne struct {
// contains filtered or unexported fields
}
CampusUpdateOne is the builder for updating a single Campus entity.
func (*CampusUpdateOne) ClearClass ¶
func (cuo *CampusUpdateOne) ClearClass() *CampusUpdateOne
ClearClass clears the "class" edge to the Class entity.
func (*CampusUpdateOne) Exec ¶
func (cuo *CampusUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CampusUpdateOne) ExecX ¶
func (cuo *CampusUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampusUpdateOne) Mutation ¶
func (cuo *CampusUpdateOne) Mutation() *CampusMutation
Mutation returns the CampusMutation object of the builder.
func (*CampusUpdateOne) Save ¶
func (cuo *CampusUpdateOne) Save(ctx context.Context) (*Campus, error)
Save executes the query and returns the updated Campus entity.
func (*CampusUpdateOne) SaveX ¶
func (cuo *CampusUpdateOne) SaveX(ctx context.Context) *Campus
SaveX is like Save, but panics if an error occurs.
func (*CampusUpdateOne) Select ¶
func (cuo *CampusUpdateOne) Select(field string, fields ...string) *CampusUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CampusUpdateOne) SetAddress ¶
func (cuo *CampusUpdateOne) SetAddress(s string) *CampusUpdateOne
SetAddress sets the "address" field.
func (*CampusUpdateOne) SetClass ¶
func (cuo *CampusUpdateOne) SetClass(c *Class) *CampusUpdateOne
SetClass sets the "class" edge to the Class entity.
func (*CampusUpdateOne) SetClassID ¶
func (cuo *CampusUpdateOne) SetClassID(id int) *CampusUpdateOne
SetClassID sets the "class" edge to the Class entity by ID.
func (*CampusUpdateOne) SetName ¶
func (cuo *CampusUpdateOne) SetName(s string) *CampusUpdateOne
SetName sets the "name" field.
func (*CampusUpdateOne) SetNillableClassID ¶
func (cuo *CampusUpdateOne) SetNillableClassID(id *int) *CampusUpdateOne
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*CampusUpdateOne) Where ¶
func (cuo *CampusUpdateOne) Where(ps ...predicate.Campus) *CampusUpdateOne
Where appends a list predicates to the CampusUpdate builder.
type Certificate ¶
type Certificate struct { // ID of the ent. ID int `json:"id,omitempty"` // 证书名称 Name string `json:"name,omitempty"` // 证书代码 Code string `json:"code,omitempty"` // 证书描述 Description string `json:"description,omitempty"` // 颁发部门 Department string `json:"department,omitempty"` // 颁发日期 IssueDate string `json:"issue_date,omitempty"` // 证书类型 CertificateType string `json:"certificate_type,omitempty"` // 证书级别 CertificateLevel string `json:"certificate_level,omitempty"` // 证书类别 CertificateType2 string `json:"certificate_type2,omitempty"` // 获奖类别 AwardCategory string `json:"award_category,omitempty"` // 证书图片 CertificateImage []byte `json:"certificate_image,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CertificateQuery when eager-loading is set. Edges CertificateEdges `json:"edges"` // contains filtered or unexported fields }
Certificate is the model entity for the Certificate schema.
func (*Certificate) QueryStudent ¶
func (c *Certificate) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the Certificate entity.
func (*Certificate) String ¶
func (c *Certificate) String() string
String implements the fmt.Stringer.
func (*Certificate) Unwrap ¶
func (c *Certificate) Unwrap() *Certificate
Unwrap unwraps the Certificate 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 (*Certificate) Update ¶
func (c *Certificate) Update() *CertificateUpdateOne
Update returns a builder for updating this Certificate. Note that you need to call Certificate.Unwrap() before calling this method if this Certificate was returned from a transaction, and the transaction was committed or rolled back.
type CertificateClient ¶
type CertificateClient struct {
// contains filtered or unexported fields
}
CertificateClient is a client for the Certificate schema.
func NewCertificateClient ¶
func NewCertificateClient(c config) *CertificateClient
NewCertificateClient returns a client for the Certificate from the given config.
func (*CertificateClient) Create ¶
func (c *CertificateClient) Create() *CertificateCreate
Create returns a builder for creating a Certificate entity.
func (*CertificateClient) CreateBulk ¶
func (c *CertificateClient) CreateBulk(builders ...*CertificateCreate) *CertificateCreateBulk
CreateBulk returns a builder for creating a bulk of Certificate entities.
func (*CertificateClient) Delete ¶
func (c *CertificateClient) Delete() *CertificateDelete
Delete returns a delete builder for Certificate.
func (*CertificateClient) DeleteOne ¶
func (c *CertificateClient) DeleteOne(ce *Certificate) *CertificateDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CertificateClient) DeleteOneID ¶
func (c *CertificateClient) DeleteOneID(id int) *CertificateDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CertificateClient) Get ¶
func (c *CertificateClient) Get(ctx context.Context, id int) (*Certificate, error)
Get returns a Certificate entity by its id.
func (*CertificateClient) GetX ¶
func (c *CertificateClient) GetX(ctx context.Context, id int) *Certificate
GetX is like Get, but panics if an error occurs.
func (*CertificateClient) Hooks ¶
func (c *CertificateClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CertificateClient) Intercept ¶
func (c *CertificateClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `certificate.Intercept(f(g(h())))`.
func (*CertificateClient) Interceptors ¶
func (c *CertificateClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CertificateClient) Query ¶
func (c *CertificateClient) Query() *CertificateQuery
Query returns a query builder for Certificate.
func (*CertificateClient) QueryStudent ¶
func (c *CertificateClient) QueryStudent(ce *Certificate) *StudentQuery
QueryStudent queries the student edge of a Certificate.
func (*CertificateClient) Update ¶
func (c *CertificateClient) Update() *CertificateUpdate
Update returns an update builder for Certificate.
func (*CertificateClient) UpdateOne ¶
func (c *CertificateClient) UpdateOne(ce *Certificate) *CertificateUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CertificateClient) UpdateOneID ¶
func (c *CertificateClient) UpdateOneID(id int) *CertificateUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CertificateClient) Use ¶
func (c *CertificateClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `certificate.Hooks(f(g(h())))`.
type CertificateCreate ¶
type CertificateCreate struct {
// contains filtered or unexported fields
}
CertificateCreate is the builder for creating a Certificate entity.
func (*CertificateCreate) Exec ¶
func (cc *CertificateCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificateCreate) ExecX ¶
func (cc *CertificateCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificateCreate) Mutation ¶
func (cc *CertificateCreate) Mutation() *CertificateMutation
Mutation returns the CertificateMutation object of the builder.
func (*CertificateCreate) Save ¶
func (cc *CertificateCreate) Save(ctx context.Context) (*Certificate, error)
Save creates the Certificate in the database.
func (*CertificateCreate) SaveX ¶
func (cc *CertificateCreate) SaveX(ctx context.Context) *Certificate
SaveX calls Save and panics if Save returns an error.
func (*CertificateCreate) SetAwardCategory ¶
func (cc *CertificateCreate) SetAwardCategory(s string) *CertificateCreate
SetAwardCategory sets the "award_category" field.
func (*CertificateCreate) SetCertificateImage ¶
func (cc *CertificateCreate) SetCertificateImage(b []byte) *CertificateCreate
SetCertificateImage sets the "certificate_image" field.
func (*CertificateCreate) SetCertificateLevel ¶
func (cc *CertificateCreate) SetCertificateLevel(s string) *CertificateCreate
SetCertificateLevel sets the "certificate_level" field.
func (*CertificateCreate) SetCertificateType ¶
func (cc *CertificateCreate) SetCertificateType(s string) *CertificateCreate
SetCertificateType sets the "certificate_type" field.
func (*CertificateCreate) SetCertificateType2 ¶
func (cc *CertificateCreate) SetCertificateType2(s string) *CertificateCreate
SetCertificateType2 sets the "certificate_type2" field.
func (*CertificateCreate) SetCode ¶
func (cc *CertificateCreate) SetCode(s string) *CertificateCreate
SetCode sets the "code" field.
func (*CertificateCreate) SetDepartment ¶
func (cc *CertificateCreate) SetDepartment(s string) *CertificateCreate
SetDepartment sets the "department" field.
func (*CertificateCreate) SetDescription ¶
func (cc *CertificateCreate) SetDescription(s string) *CertificateCreate
SetDescription sets the "description" field.
func (*CertificateCreate) SetIssueDate ¶
func (cc *CertificateCreate) SetIssueDate(s string) *CertificateCreate
SetIssueDate sets the "issue_date" field.
func (*CertificateCreate) SetName ¶
func (cc *CertificateCreate) SetName(s string) *CertificateCreate
SetName sets the "name" field.
func (*CertificateCreate) SetNillableStudentID ¶
func (cc *CertificateCreate) SetNillableStudentID(id *int) *CertificateCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*CertificateCreate) SetStudent ¶
func (cc *CertificateCreate) SetStudent(s *Student) *CertificateCreate
SetStudent sets the "student" edge to the Student entity.
func (*CertificateCreate) SetStudentID ¶
func (cc *CertificateCreate) SetStudentID(id int) *CertificateCreate
SetStudentID sets the "student" edge to the Student entity by ID.
type CertificateCreateBulk ¶
type CertificateCreateBulk struct {
// contains filtered or unexported fields
}
CertificateCreateBulk is the builder for creating many Certificate entities in bulk.
func (*CertificateCreateBulk) Exec ¶
func (ccb *CertificateCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificateCreateBulk) ExecX ¶
func (ccb *CertificateCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificateCreateBulk) Save ¶
func (ccb *CertificateCreateBulk) Save(ctx context.Context) ([]*Certificate, error)
Save creates the Certificate entities in the database.
func (*CertificateCreateBulk) SaveX ¶
func (ccb *CertificateCreateBulk) SaveX(ctx context.Context) []*Certificate
SaveX is like Save, but panics if an error occurs.
type CertificateDelete ¶
type CertificateDelete struct {
// contains filtered or unexported fields
}
CertificateDelete is the builder for deleting a Certificate entity.
func (*CertificateDelete) Exec ¶
func (cd *CertificateDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CertificateDelete) ExecX ¶
func (cd *CertificateDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CertificateDelete) Where ¶
func (cd *CertificateDelete) Where(ps ...predicate.Certificate) *CertificateDelete
Where appends a list predicates to the CertificateDelete builder.
type CertificateDeleteOne ¶
type CertificateDeleteOne struct {
// contains filtered or unexported fields
}
CertificateDeleteOne is the builder for deleting a single Certificate entity.
func (*CertificateDeleteOne) Exec ¶
func (cdo *CertificateDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CertificateDeleteOne) ExecX ¶
func (cdo *CertificateDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificateDeleteOne) Where ¶
func (cdo *CertificateDeleteOne) Where(ps ...predicate.Certificate) *CertificateDeleteOne
Where appends a list predicates to the CertificateDelete builder.
type CertificateEdges ¶
type CertificateEdges struct { // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
CertificateEdges holds the relations/edges for other nodes in the graph.
func (CertificateEdges) StudentOrErr ¶
func (e CertificateEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CertificateGroupBy ¶
type CertificateGroupBy struct {
// contains filtered or unexported fields
}
CertificateGroupBy is the group-by builder for Certificate entities.
func (*CertificateGroupBy) Aggregate ¶
func (cgb *CertificateGroupBy) Aggregate(fns ...AggregateFunc) *CertificateGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CertificateGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CertificateGroupBy) Scan ¶
func (cgb *CertificateGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CertificateGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CertificateMutation ¶
type CertificateMutation struct {
// contains filtered or unexported fields
}
CertificateMutation represents an operation that mutates the Certificate nodes in the graph.
func (*CertificateMutation) AddField ¶
func (m *CertificateMutation) 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 (*CertificateMutation) AddedEdges ¶
func (m *CertificateMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CertificateMutation) AddedField ¶
func (m *CertificateMutation) 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 (*CertificateMutation) AddedFields ¶
func (m *CertificateMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CertificateMutation) AddedIDs ¶
func (m *CertificateMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CertificateMutation) AwardCategory ¶
func (m *CertificateMutation) AwardCategory() (r string, exists bool)
AwardCategory returns the value of the "award_category" field in the mutation.
func (*CertificateMutation) CertificateImage ¶
func (m *CertificateMutation) CertificateImage() (r []byte, exists bool)
CertificateImage returns the value of the "certificate_image" field in the mutation.
func (*CertificateMutation) CertificateLevel ¶
func (m *CertificateMutation) CertificateLevel() (r string, exists bool)
CertificateLevel returns the value of the "certificate_level" field in the mutation.
func (*CertificateMutation) CertificateType ¶
func (m *CertificateMutation) CertificateType() (r string, exists bool)
CertificateType returns the value of the "certificate_type" field in the mutation.
func (*CertificateMutation) CertificateType2 ¶
func (m *CertificateMutation) CertificateType2() (r string, exists bool)
CertificateType2 returns the value of the "certificate_type2" field in the mutation.
func (*CertificateMutation) ClearEdge ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ClearField ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ClearStudent ¶
func (m *CertificateMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*CertificateMutation) ClearedEdges ¶
func (m *CertificateMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CertificateMutation) ClearedFields ¶
func (m *CertificateMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CertificateMutation) Client ¶
func (m CertificateMutation) 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 (*CertificateMutation) Code ¶
func (m *CertificateMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*CertificateMutation) Department ¶
func (m *CertificateMutation) Department() (r string, exists bool)
Department returns the value of the "department" field in the mutation.
func (*CertificateMutation) Description ¶
func (m *CertificateMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*CertificateMutation) EdgeCleared ¶
func (m *CertificateMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CertificateMutation) Field ¶
func (m *CertificateMutation) 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 (*CertificateMutation) FieldCleared ¶
func (m *CertificateMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CertificateMutation) Fields ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ID ¶
func (m *CertificateMutation) 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 (*CertificateMutation) IDs ¶
func (m *CertificateMutation) 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 (*CertificateMutation) IssueDate ¶
func (m *CertificateMutation) IssueDate() (r string, exists bool)
IssueDate returns the value of the "issue_date" field in the mutation.
func (*CertificateMutation) Name ¶
func (m *CertificateMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CertificateMutation) OldAwardCategory ¶
func (m *CertificateMutation) OldAwardCategory(ctx context.Context) (v string, err error)
OldAwardCategory returns the old "award_category" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateImage ¶
func (m *CertificateMutation) OldCertificateImage(ctx context.Context) (v []byte, err error)
OldCertificateImage returns the old "certificate_image" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateLevel ¶
func (m *CertificateMutation) OldCertificateLevel(ctx context.Context) (v string, err error)
OldCertificateLevel returns the old "certificate_level" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateType ¶
func (m *CertificateMutation) OldCertificateType(ctx context.Context) (v string, err error)
OldCertificateType returns the old "certificate_type" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateType2 ¶
func (m *CertificateMutation) OldCertificateType2(ctx context.Context) (v string, err error)
OldCertificateType2 returns the old "certificate_type2" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCode ¶
func (m *CertificateMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldDepartment ¶
func (m *CertificateMutation) OldDepartment(ctx context.Context) (v string, err error)
OldDepartment returns the old "department" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldDescription ¶
func (m *CertificateMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) 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 (*CertificateMutation) OldIssueDate ¶
func (m *CertificateMutation) OldIssueDate(ctx context.Context) (v string, err error)
OldIssueDate returns the old "issue_date" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldName ¶
func (m *CertificateMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) Op ¶
func (m *CertificateMutation) Op() Op
Op returns the operation name.
func (*CertificateMutation) RemovedEdges ¶
func (m *CertificateMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CertificateMutation) RemovedIDs ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ResetAwardCategory ¶
func (m *CertificateMutation) ResetAwardCategory()
ResetAwardCategory resets all changes to the "award_category" field.
func (*CertificateMutation) ResetCertificateImage ¶
func (m *CertificateMutation) ResetCertificateImage()
ResetCertificateImage resets all changes to the "certificate_image" field.
func (*CertificateMutation) ResetCertificateLevel ¶
func (m *CertificateMutation) ResetCertificateLevel()
ResetCertificateLevel resets all changes to the "certificate_level" field.
func (*CertificateMutation) ResetCertificateType ¶
func (m *CertificateMutation) ResetCertificateType()
ResetCertificateType resets all changes to the "certificate_type" field.
func (*CertificateMutation) ResetCertificateType2 ¶
func (m *CertificateMutation) ResetCertificateType2()
ResetCertificateType2 resets all changes to the "certificate_type2" field.
func (*CertificateMutation) ResetCode ¶
func (m *CertificateMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*CertificateMutation) ResetDepartment ¶
func (m *CertificateMutation) ResetDepartment()
ResetDepartment resets all changes to the "department" field.
func (*CertificateMutation) ResetDescription ¶
func (m *CertificateMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*CertificateMutation) ResetEdge ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ResetField ¶
func (m *CertificateMutation) 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 (*CertificateMutation) ResetIssueDate ¶
func (m *CertificateMutation) ResetIssueDate()
ResetIssueDate resets all changes to the "issue_date" field.
func (*CertificateMutation) ResetName ¶
func (m *CertificateMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CertificateMutation) ResetStudent ¶
func (m *CertificateMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*CertificateMutation) SetAwardCategory ¶
func (m *CertificateMutation) SetAwardCategory(s string)
SetAwardCategory sets the "award_category" field.
func (*CertificateMutation) SetCertificateImage ¶
func (m *CertificateMutation) SetCertificateImage(b []byte)
SetCertificateImage sets the "certificate_image" field.
func (*CertificateMutation) SetCertificateLevel ¶
func (m *CertificateMutation) SetCertificateLevel(s string)
SetCertificateLevel sets the "certificate_level" field.
func (*CertificateMutation) SetCertificateType ¶
func (m *CertificateMutation) SetCertificateType(s string)
SetCertificateType sets the "certificate_type" field.
func (*CertificateMutation) SetCertificateType2 ¶
func (m *CertificateMutation) SetCertificateType2(s string)
SetCertificateType2 sets the "certificate_type2" field.
func (*CertificateMutation) SetCode ¶
func (m *CertificateMutation) SetCode(s string)
SetCode sets the "code" field.
func (*CertificateMutation) SetDepartment ¶
func (m *CertificateMutation) SetDepartment(s string)
SetDepartment sets the "department" field.
func (*CertificateMutation) SetDescription ¶
func (m *CertificateMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*CertificateMutation) SetField ¶
func (m *CertificateMutation) 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 (*CertificateMutation) SetIssueDate ¶
func (m *CertificateMutation) SetIssueDate(s string)
SetIssueDate sets the "issue_date" field.
func (*CertificateMutation) SetName ¶
func (m *CertificateMutation) SetName(s string)
SetName sets the "name" field.
func (*CertificateMutation) SetOp ¶
func (m *CertificateMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CertificateMutation) SetStudentID ¶
func (m *CertificateMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*CertificateMutation) StudentCleared ¶
func (m *CertificateMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*CertificateMutation) StudentID ¶
func (m *CertificateMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*CertificateMutation) StudentIDs ¶
func (m *CertificateMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (CertificateMutation) Tx ¶
func (m CertificateMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CertificateMutation) Type ¶
func (m *CertificateMutation) Type() string
Type returns the node type of this mutation (Certificate).
func (*CertificateMutation) Where ¶
func (m *CertificateMutation) Where(ps ...predicate.Certificate)
Where appends a list predicates to the CertificateMutation builder.
func (*CertificateMutation) WhereP ¶
func (m *CertificateMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CertificateMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CertificateQuery ¶
type CertificateQuery struct {
// contains filtered or unexported fields
}
CertificateQuery is the builder for querying Certificate entities.
func (*CertificateQuery) Aggregate ¶
func (cq *CertificateQuery) Aggregate(fns ...AggregateFunc) *CertificateSelect
Aggregate returns a CertificateSelect configured with the given aggregations.
func (*CertificateQuery) All ¶
func (cq *CertificateQuery) All(ctx context.Context) ([]*Certificate, error)
All executes the query and returns a list of Certificates.
func (*CertificateQuery) AllX ¶
func (cq *CertificateQuery) AllX(ctx context.Context) []*Certificate
AllX is like All, but panics if an error occurs.
func (*CertificateQuery) Clone ¶
func (cq *CertificateQuery) Clone() *CertificateQuery
Clone returns a duplicate of the CertificateQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CertificateQuery) Count ¶
func (cq *CertificateQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CertificateQuery) CountX ¶
func (cq *CertificateQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CertificateQuery) Exist ¶
func (cq *CertificateQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CertificateQuery) ExistX ¶
func (cq *CertificateQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CertificateQuery) First ¶
func (cq *CertificateQuery) First(ctx context.Context) (*Certificate, error)
First returns the first Certificate entity from the query. Returns a *NotFoundError when no Certificate was found.
func (*CertificateQuery) FirstID ¶
func (cq *CertificateQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Certificate ID from the query. Returns a *NotFoundError when no Certificate ID was found.
func (*CertificateQuery) FirstIDX ¶
func (cq *CertificateQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CertificateQuery) FirstX ¶
func (cq *CertificateQuery) FirstX(ctx context.Context) *Certificate
FirstX is like First, but panics if an error occurs.
func (*CertificateQuery) GroupBy ¶
func (cq *CertificateQuery) GroupBy(field string, fields ...string) *CertificateGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Certificate.Query(). GroupBy(certificate.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*CertificateQuery) IDs ¶
func (cq *CertificateQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Certificate IDs.
func (*CertificateQuery) IDsX ¶
func (cq *CertificateQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CertificateQuery) Limit ¶
func (cq *CertificateQuery) Limit(limit int) *CertificateQuery
Limit the number of records to be returned by this query.
func (*CertificateQuery) Offset ¶
func (cq *CertificateQuery) Offset(offset int) *CertificateQuery
Offset to start from.
func (*CertificateQuery) Only ¶
func (cq *CertificateQuery) Only(ctx context.Context) (*Certificate, error)
Only returns a single Certificate entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Certificate entity is found. Returns a *NotFoundError when no Certificate entities are found.
func (*CertificateQuery) OnlyID ¶
func (cq *CertificateQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Certificate ID in the query. Returns a *NotSingularError when more than one Certificate ID is found. Returns a *NotFoundError when no entities are found.
func (*CertificateQuery) OnlyIDX ¶
func (cq *CertificateQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CertificateQuery) OnlyX ¶
func (cq *CertificateQuery) OnlyX(ctx context.Context) *Certificate
OnlyX is like Only, but panics if an error occurs.
func (*CertificateQuery) Order ¶
func (cq *CertificateQuery) Order(o ...OrderFunc) *CertificateQuery
Order specifies how the records should be ordered.
func (*CertificateQuery) QueryStudent ¶
func (cq *CertificateQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*CertificateQuery) Select ¶
func (cq *CertificateQuery) Select(fields ...string) *CertificateSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Certificate.Query(). Select(certificate.FieldName). Scan(ctx, &v)
func (*CertificateQuery) Unique ¶
func (cq *CertificateQuery) Unique(unique bool) *CertificateQuery
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 (*CertificateQuery) Where ¶
func (cq *CertificateQuery) Where(ps ...predicate.Certificate) *CertificateQuery
Where adds a new predicate for the CertificateQuery builder.
func (*CertificateQuery) WithStudent ¶
func (cq *CertificateQuery) WithStudent(opts ...func(*StudentQuery)) *CertificateQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type CertificateSelect ¶
type CertificateSelect struct { *CertificateQuery // contains filtered or unexported fields }
CertificateSelect is the builder for selecting fields of Certificate entities.
func (*CertificateSelect) Aggregate ¶
func (cs *CertificateSelect) Aggregate(fns ...AggregateFunc) *CertificateSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CertificateSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CertificateSelect) Scan ¶
func (cs *CertificateSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CertificateSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CertificateUpdate ¶
type CertificateUpdate struct {
// contains filtered or unexported fields
}
CertificateUpdate is the builder for updating Certificate entities.
func (*CertificateUpdate) ClearStudent ¶
func (cu *CertificateUpdate) ClearStudent() *CertificateUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*CertificateUpdate) Exec ¶
func (cu *CertificateUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificateUpdate) ExecX ¶
func (cu *CertificateUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificateUpdate) Mutation ¶
func (cu *CertificateUpdate) Mutation() *CertificateMutation
Mutation returns the CertificateMutation object of the builder.
func (*CertificateUpdate) Save ¶
func (cu *CertificateUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CertificateUpdate) SaveX ¶
func (cu *CertificateUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CertificateUpdate) SetAwardCategory ¶
func (cu *CertificateUpdate) SetAwardCategory(s string) *CertificateUpdate
SetAwardCategory sets the "award_category" field.
func (*CertificateUpdate) SetCertificateImage ¶
func (cu *CertificateUpdate) SetCertificateImage(b []byte) *CertificateUpdate
SetCertificateImage sets the "certificate_image" field.
func (*CertificateUpdate) SetCertificateLevel ¶
func (cu *CertificateUpdate) SetCertificateLevel(s string) *CertificateUpdate
SetCertificateLevel sets the "certificate_level" field.
func (*CertificateUpdate) SetCertificateType ¶
func (cu *CertificateUpdate) SetCertificateType(s string) *CertificateUpdate
SetCertificateType sets the "certificate_type" field.
func (*CertificateUpdate) SetCertificateType2 ¶
func (cu *CertificateUpdate) SetCertificateType2(s string) *CertificateUpdate
SetCertificateType2 sets the "certificate_type2" field.
func (*CertificateUpdate) SetCode ¶
func (cu *CertificateUpdate) SetCode(s string) *CertificateUpdate
SetCode sets the "code" field.
func (*CertificateUpdate) SetDepartment ¶
func (cu *CertificateUpdate) SetDepartment(s string) *CertificateUpdate
SetDepartment sets the "department" field.
func (*CertificateUpdate) SetDescription ¶
func (cu *CertificateUpdate) SetDescription(s string) *CertificateUpdate
SetDescription sets the "description" field.
func (*CertificateUpdate) SetIssueDate ¶
func (cu *CertificateUpdate) SetIssueDate(s string) *CertificateUpdate
SetIssueDate sets the "issue_date" field.
func (*CertificateUpdate) SetName ¶
func (cu *CertificateUpdate) SetName(s string) *CertificateUpdate
SetName sets the "name" field.
func (*CertificateUpdate) SetNillableStudentID ¶
func (cu *CertificateUpdate) SetNillableStudentID(id *int) *CertificateUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*CertificateUpdate) SetStudent ¶
func (cu *CertificateUpdate) SetStudent(s *Student) *CertificateUpdate
SetStudent sets the "student" edge to the Student entity.
func (*CertificateUpdate) SetStudentID ¶
func (cu *CertificateUpdate) SetStudentID(id int) *CertificateUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*CertificateUpdate) Where ¶
func (cu *CertificateUpdate) Where(ps ...predicate.Certificate) *CertificateUpdate
Where appends a list predicates to the CertificateUpdate builder.
type CertificateUpdateOne ¶
type CertificateUpdateOne struct {
// contains filtered or unexported fields
}
CertificateUpdateOne is the builder for updating a single Certificate entity.
func (*CertificateUpdateOne) ClearStudent ¶
func (cuo *CertificateUpdateOne) ClearStudent() *CertificateUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*CertificateUpdateOne) Exec ¶
func (cuo *CertificateUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CertificateUpdateOne) ExecX ¶
func (cuo *CertificateUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificateUpdateOne) Mutation ¶
func (cuo *CertificateUpdateOne) Mutation() *CertificateMutation
Mutation returns the CertificateMutation object of the builder.
func (*CertificateUpdateOne) Save ¶
func (cuo *CertificateUpdateOne) Save(ctx context.Context) (*Certificate, error)
Save executes the query and returns the updated Certificate entity.
func (*CertificateUpdateOne) SaveX ¶
func (cuo *CertificateUpdateOne) SaveX(ctx context.Context) *Certificate
SaveX is like Save, but panics if an error occurs.
func (*CertificateUpdateOne) Select ¶
func (cuo *CertificateUpdateOne) Select(field string, fields ...string) *CertificateUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CertificateUpdateOne) SetAwardCategory ¶
func (cuo *CertificateUpdateOne) SetAwardCategory(s string) *CertificateUpdateOne
SetAwardCategory sets the "award_category" field.
func (*CertificateUpdateOne) SetCertificateImage ¶
func (cuo *CertificateUpdateOne) SetCertificateImage(b []byte) *CertificateUpdateOne
SetCertificateImage sets the "certificate_image" field.
func (*CertificateUpdateOne) SetCertificateLevel ¶
func (cuo *CertificateUpdateOne) SetCertificateLevel(s string) *CertificateUpdateOne
SetCertificateLevel sets the "certificate_level" field.
func (*CertificateUpdateOne) SetCertificateType ¶
func (cuo *CertificateUpdateOne) SetCertificateType(s string) *CertificateUpdateOne
SetCertificateType sets the "certificate_type" field.
func (*CertificateUpdateOne) SetCertificateType2 ¶
func (cuo *CertificateUpdateOne) SetCertificateType2(s string) *CertificateUpdateOne
SetCertificateType2 sets the "certificate_type2" field.
func (*CertificateUpdateOne) SetCode ¶
func (cuo *CertificateUpdateOne) SetCode(s string) *CertificateUpdateOne
SetCode sets the "code" field.
func (*CertificateUpdateOne) SetDepartment ¶
func (cuo *CertificateUpdateOne) SetDepartment(s string) *CertificateUpdateOne
SetDepartment sets the "department" field.
func (*CertificateUpdateOne) SetDescription ¶
func (cuo *CertificateUpdateOne) SetDescription(s string) *CertificateUpdateOne
SetDescription sets the "description" field.
func (*CertificateUpdateOne) SetIssueDate ¶
func (cuo *CertificateUpdateOne) SetIssueDate(s string) *CertificateUpdateOne
SetIssueDate sets the "issue_date" field.
func (*CertificateUpdateOne) SetName ¶
func (cuo *CertificateUpdateOne) SetName(s string) *CertificateUpdateOne
SetName sets the "name" field.
func (*CertificateUpdateOne) SetNillableStudentID ¶
func (cuo *CertificateUpdateOne) SetNillableStudentID(id *int) *CertificateUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*CertificateUpdateOne) SetStudent ¶
func (cuo *CertificateUpdateOne) SetStudent(s *Student) *CertificateUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*CertificateUpdateOne) SetStudentID ¶
func (cuo *CertificateUpdateOne) SetStudentID(id int) *CertificateUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*CertificateUpdateOne) Where ¶
func (cuo *CertificateUpdateOne) Where(ps ...predicate.Certificate) *CertificateUpdateOne
Where appends a list predicates to the CertificateUpdate builder.
type Certificates ¶
type Certificates []*Certificate
Certificates is a parsable slice of Certificate.
type Class ¶
type Class struct { // ID of the ent. ID int `json:"id,omitempty"` // 班级名称 Name string `json:"name,omitempty"` // 班级编号 Code string `json:"code,omitempty"` // 班级描述 Description string `json:"description,omitempty"` // 班级类型 Type string `json:"type,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ClassQuery when eager-loading is set. Edges ClassEdges `json:"edges"` // contains filtered or unexported fields }
Class is the model entity for the Class schema.
func (*Class) QueryCampus ¶
func (c *Class) QueryCampus() *CampusQuery
QueryCampus queries the "campus" edge of the Class entity.
func (*Class) QueryClassLeader ¶
func (c *Class) QueryClassLeader() *ClassLeaderQuery
QueryClassLeader queries the "class_leader" edge of the Class entity.
func (*Class) QueryDepartment ¶
func (c *Class) QueryDepartment() *DepartmentQuery
QueryDepartment queries the "department" edge of the Class entity.
func (*Class) QueryMajor ¶
func (c *Class) QueryMajor() *MajorQuery
QueryMajor queries the "major" edge of the Class entity.
func (*Class) QueryMajorDirection ¶
func (c *Class) QueryMajorDirection() *MajorDirectionQuery
QueryMajorDirection queries the "major_direction" edge of the Class entity.
func (*Class) QueryStudent ¶
func (c *Class) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the Class entity.
func (*Class) QueryTutor ¶
func (c *Class) QueryTutor() *TutorQuery
QueryTutor queries the "tutor" edge of the Class entity.
func (*Class) Unwrap ¶
Unwrap unwraps the Class 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 (*Class) Update ¶
func (c *Class) Update() *ClassUpdateOne
Update returns a builder for updating this Class. Note that you need to call Class.Unwrap() before calling this method if this Class was returned from a transaction, and the transaction was committed or rolled back.
type ClassClient ¶
type ClassClient struct {
// contains filtered or unexported fields
}
ClassClient is a client for the Class schema.
func NewClassClient ¶
func NewClassClient(c config) *ClassClient
NewClassClient returns a client for the Class from the given config.
func (*ClassClient) Create ¶
func (c *ClassClient) Create() *ClassCreate
Create returns a builder for creating a Class entity.
func (*ClassClient) CreateBulk ¶
func (c *ClassClient) CreateBulk(builders ...*ClassCreate) *ClassCreateBulk
CreateBulk returns a builder for creating a bulk of Class entities.
func (*ClassClient) Delete ¶
func (c *ClassClient) Delete() *ClassDelete
Delete returns a delete builder for Class.
func (*ClassClient) DeleteOne ¶
func (c *ClassClient) DeleteOne(cl *Class) *ClassDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ClassClient) DeleteOneID ¶
func (c *ClassClient) DeleteOneID(id int) *ClassDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ClassClient) GetX ¶
func (c *ClassClient) GetX(ctx context.Context, id int) *Class
GetX is like Get, but panics if an error occurs.
func (*ClassClient) Intercept ¶
func (c *ClassClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `class.Intercept(f(g(h())))`.
func (*ClassClient) Interceptors ¶
func (c *ClassClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ClassClient) Query ¶
func (c *ClassClient) Query() *ClassQuery
Query returns a query builder for Class.
func (*ClassClient) QueryCampus ¶
func (c *ClassClient) QueryCampus(cl *Class) *CampusQuery
QueryCampus queries the campus edge of a Class.
func (*ClassClient) QueryClassLeader ¶
func (c *ClassClient) QueryClassLeader(cl *Class) *ClassLeaderQuery
QueryClassLeader queries the class_leader edge of a Class.
func (*ClassClient) QueryDepartment ¶
func (c *ClassClient) QueryDepartment(cl *Class) *DepartmentQuery
QueryDepartment queries the department edge of a Class.
func (*ClassClient) QueryMajor ¶
func (c *ClassClient) QueryMajor(cl *Class) *MajorQuery
QueryMajor queries the major edge of a Class.
func (*ClassClient) QueryMajorDirection ¶
func (c *ClassClient) QueryMajorDirection(cl *Class) *MajorDirectionQuery
QueryMajorDirection queries the major_direction edge of a Class.
func (*ClassClient) QueryStudent ¶
func (c *ClassClient) QueryStudent(cl *Class) *StudentQuery
QueryStudent queries the student edge of a Class.
func (*ClassClient) QueryTutor ¶
func (c *ClassClient) QueryTutor(cl *Class) *TutorQuery
QueryTutor queries the tutor edge of a Class.
func (*ClassClient) Update ¶
func (c *ClassClient) Update() *ClassUpdate
Update returns an update builder for Class.
func (*ClassClient) UpdateOne ¶
func (c *ClassClient) UpdateOne(cl *Class) *ClassUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ClassClient) UpdateOneID ¶
func (c *ClassClient) UpdateOneID(id int) *ClassUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ClassClient) Use ¶
func (c *ClassClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `class.Hooks(f(g(h())))`.
type ClassCreate ¶
type ClassCreate struct {
// contains filtered or unexported fields
}
ClassCreate is the builder for creating a Class entity.
func (*ClassCreate) AddStudent ¶
func (cc *ClassCreate) AddStudent(s ...*Student) *ClassCreate
AddStudent adds the "student" edges to the Student entity.
func (*ClassCreate) AddStudentIDs ¶
func (cc *ClassCreate) AddStudentIDs(ids ...int) *ClassCreate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*ClassCreate) Exec ¶
func (cc *ClassCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassCreate) ExecX ¶
func (cc *ClassCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassCreate) Mutation ¶
func (cc *ClassCreate) Mutation() *ClassMutation
Mutation returns the ClassMutation object of the builder.
func (*ClassCreate) Save ¶
func (cc *ClassCreate) Save(ctx context.Context) (*Class, error)
Save creates the Class in the database.
func (*ClassCreate) SaveX ¶
func (cc *ClassCreate) SaveX(ctx context.Context) *Class
SaveX calls Save and panics if Save returns an error.
func (*ClassCreate) SetCampus ¶
func (cc *ClassCreate) SetCampus(c *Campus) *ClassCreate
SetCampus sets the "campus" edge to the Campus entity.
func (*ClassCreate) SetCampusID ¶
func (cc *ClassCreate) SetCampusID(id int) *ClassCreate
SetCampusID sets the "campus" edge to the Campus entity by ID.
func (*ClassCreate) SetClassLeader ¶
func (cc *ClassCreate) SetClassLeader(c *ClassLeader) *ClassCreate
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*ClassCreate) SetClassLeaderID ¶
func (cc *ClassCreate) SetClassLeaderID(id int) *ClassCreate
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*ClassCreate) SetCode ¶
func (cc *ClassCreate) SetCode(s string) *ClassCreate
SetCode sets the "code" field.
func (*ClassCreate) SetDepartment ¶
func (cc *ClassCreate) SetDepartment(d *Department) *ClassCreate
SetDepartment sets the "department" edge to the Department entity.
func (*ClassCreate) SetDepartmentID ¶
func (cc *ClassCreate) SetDepartmentID(id int) *ClassCreate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*ClassCreate) SetDescription ¶
func (cc *ClassCreate) SetDescription(s string) *ClassCreate
SetDescription sets the "description" field.
func (*ClassCreate) SetMajor ¶
func (cc *ClassCreate) SetMajor(m *Major) *ClassCreate
SetMajor sets the "major" edge to the Major entity.
func (*ClassCreate) SetMajorDirection ¶
func (cc *ClassCreate) SetMajorDirection(m *MajorDirection) *ClassCreate
SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.
func (*ClassCreate) SetMajorDirectionID ¶
func (cc *ClassCreate) SetMajorDirectionID(id int) *ClassCreate
SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.
func (*ClassCreate) SetMajorID ¶
func (cc *ClassCreate) SetMajorID(id int) *ClassCreate
SetMajorID sets the "major" edge to the Major entity by ID.
func (*ClassCreate) SetName ¶
func (cc *ClassCreate) SetName(s string) *ClassCreate
SetName sets the "name" field.
func (*ClassCreate) SetNillableCampusID ¶
func (cc *ClassCreate) SetNillableCampusID(id *int) *ClassCreate
SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.
func (*ClassCreate) SetNillableClassLeaderID ¶
func (cc *ClassCreate) SetNillableClassLeaderID(id *int) *ClassCreate
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*ClassCreate) SetNillableDepartmentID ¶
func (cc *ClassCreate) SetNillableDepartmentID(id *int) *ClassCreate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*ClassCreate) SetNillableMajorDirectionID ¶
func (cc *ClassCreate) SetNillableMajorDirectionID(id *int) *ClassCreate
SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.
func (*ClassCreate) SetNillableMajorID ¶
func (cc *ClassCreate) SetNillableMajorID(id *int) *ClassCreate
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*ClassCreate) SetNillableTutorID ¶
func (cc *ClassCreate) SetNillableTutorID(id *int) *ClassCreate
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*ClassCreate) SetTutor ¶
func (cc *ClassCreate) SetTutor(t *Tutor) *ClassCreate
SetTutor sets the "tutor" edge to the Tutor entity.
func (*ClassCreate) SetTutorID ¶
func (cc *ClassCreate) SetTutorID(id int) *ClassCreate
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*ClassCreate) SetType ¶
func (cc *ClassCreate) SetType(s string) *ClassCreate
SetType sets the "type" field.
type ClassCreateBulk ¶
type ClassCreateBulk struct {
// contains filtered or unexported fields
}
ClassCreateBulk is the builder for creating many Class entities in bulk.
func (*ClassCreateBulk) Exec ¶
func (ccb *ClassCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassCreateBulk) ExecX ¶
func (ccb *ClassCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ClassDelete ¶
type ClassDelete struct {
// contains filtered or unexported fields
}
ClassDelete is the builder for deleting a Class entity.
func (*ClassDelete) Exec ¶
func (cd *ClassDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ClassDelete) ExecX ¶
func (cd *ClassDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ClassDelete) Where ¶
func (cd *ClassDelete) Where(ps ...predicate.Class) *ClassDelete
Where appends a list predicates to the ClassDelete builder.
type ClassDeleteOne ¶
type ClassDeleteOne struct {
// contains filtered or unexported fields
}
ClassDeleteOne is the builder for deleting a single Class entity.
func (*ClassDeleteOne) Exec ¶
func (cdo *ClassDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ClassDeleteOne) ExecX ¶
func (cdo *ClassDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassDeleteOne) Where ¶
func (cdo *ClassDeleteOne) Where(ps ...predicate.Class) *ClassDeleteOne
Where appends a list predicates to the ClassDelete builder.
type ClassEdges ¶
type ClassEdges struct { // Major holds the value of the major edge. Major *Major `json:"major,omitempty"` // Department holds the value of the department edge. Department *Department `json:"department,omitempty"` // Campus holds the value of the campus edge. Campus *Campus `json:"campus,omitempty"` // Student holds the value of the student edge. Student []*Student `json:"student,omitempty"` // ClassLeader holds the value of the class_leader edge. ClassLeader *ClassLeader `json:"class_leader,omitempty"` // Tutor holds the value of the tutor edge. Tutor *Tutor `json:"tutor,omitempty"` // MajorDirection holds the value of the major_direction edge. MajorDirection *MajorDirection `json:"major_direction,omitempty"` // contains filtered or unexported fields }
ClassEdges holds the relations/edges for other nodes in the graph.
func (ClassEdges) CampusOrErr ¶
func (e ClassEdges) CampusOrErr() (*Campus, error)
CampusOrErr returns the Campus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassEdges) ClassLeaderOrErr ¶
func (e ClassEdges) ClassLeaderOrErr() (*ClassLeader, error)
ClassLeaderOrErr returns the ClassLeader value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassEdges) DepartmentOrErr ¶
func (e ClassEdges) DepartmentOrErr() (*Department, error)
DepartmentOrErr returns the Department value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassEdges) MajorDirectionOrErr ¶
func (e ClassEdges) MajorDirectionOrErr() (*MajorDirection, error)
MajorDirectionOrErr returns the MajorDirection value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassEdges) MajorOrErr ¶
func (e ClassEdges) MajorOrErr() (*Major, error)
MajorOrErr returns the Major value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassEdges) StudentOrErr ¶
func (e ClassEdges) StudentOrErr() ([]*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading.
func (ClassEdges) TutorOrErr ¶
func (e ClassEdges) TutorOrErr() (*Tutor, error)
TutorOrErr returns the Tutor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ClassGroupBy ¶
type ClassGroupBy struct {
// contains filtered or unexported fields
}
ClassGroupBy is the group-by builder for Class entities.
func (*ClassGroupBy) Aggregate ¶
func (cgb *ClassGroupBy) Aggregate(fns ...AggregateFunc) *ClassGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ClassGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ClassGroupBy) Scan ¶
func (cgb *ClassGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ClassGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ClassLeader ¶
type ClassLeader struct { // ID of the ent. ID int `json:"id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ClassLeaderQuery when eager-loading is set. Edges ClassLeaderEdges `json:"edges"` // contains filtered or unexported fields }
ClassLeader is the model entity for the ClassLeader schema.
func (*ClassLeader) QueryClass ¶
func (cl *ClassLeader) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the ClassLeader entity.
func (*ClassLeader) QueryStudent ¶
func (cl *ClassLeader) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the ClassLeader entity.
func (*ClassLeader) String ¶
func (cl *ClassLeader) String() string
String implements the fmt.Stringer.
func (*ClassLeader) Unwrap ¶
func (cl *ClassLeader) Unwrap() *ClassLeader
Unwrap unwraps the ClassLeader 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 (*ClassLeader) Update ¶
func (cl *ClassLeader) Update() *ClassLeaderUpdateOne
Update returns a builder for updating this ClassLeader. Note that you need to call ClassLeader.Unwrap() before calling this method if this ClassLeader was returned from a transaction, and the transaction was committed or rolled back.
type ClassLeaderClient ¶
type ClassLeaderClient struct {
// contains filtered or unexported fields
}
ClassLeaderClient is a client for the ClassLeader schema.
func NewClassLeaderClient ¶
func NewClassLeaderClient(c config) *ClassLeaderClient
NewClassLeaderClient returns a client for the ClassLeader from the given config.
func (*ClassLeaderClient) Create ¶
func (c *ClassLeaderClient) Create() *ClassLeaderCreate
Create returns a builder for creating a ClassLeader entity.
func (*ClassLeaderClient) CreateBulk ¶
func (c *ClassLeaderClient) CreateBulk(builders ...*ClassLeaderCreate) *ClassLeaderCreateBulk
CreateBulk returns a builder for creating a bulk of ClassLeader entities.
func (*ClassLeaderClient) Delete ¶
func (c *ClassLeaderClient) Delete() *ClassLeaderDelete
Delete returns a delete builder for ClassLeader.
func (*ClassLeaderClient) DeleteOne ¶
func (c *ClassLeaderClient) DeleteOne(cl *ClassLeader) *ClassLeaderDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ClassLeaderClient) DeleteOneID ¶
func (c *ClassLeaderClient) DeleteOneID(id int) *ClassLeaderDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ClassLeaderClient) Get ¶
func (c *ClassLeaderClient) Get(ctx context.Context, id int) (*ClassLeader, error)
Get returns a ClassLeader entity by its id.
func (*ClassLeaderClient) GetX ¶
func (c *ClassLeaderClient) GetX(ctx context.Context, id int) *ClassLeader
GetX is like Get, but panics if an error occurs.
func (*ClassLeaderClient) Hooks ¶
func (c *ClassLeaderClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ClassLeaderClient) Intercept ¶
func (c *ClassLeaderClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `classleader.Intercept(f(g(h())))`.
func (*ClassLeaderClient) Interceptors ¶
func (c *ClassLeaderClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ClassLeaderClient) Query ¶
func (c *ClassLeaderClient) Query() *ClassLeaderQuery
Query returns a query builder for ClassLeader.
func (*ClassLeaderClient) QueryClass ¶
func (c *ClassLeaderClient) QueryClass(cl *ClassLeader) *ClassQuery
QueryClass queries the class edge of a ClassLeader.
func (*ClassLeaderClient) QueryStudent ¶
func (c *ClassLeaderClient) QueryStudent(cl *ClassLeader) *StudentQuery
QueryStudent queries the student edge of a ClassLeader.
func (*ClassLeaderClient) Update ¶
func (c *ClassLeaderClient) Update() *ClassLeaderUpdate
Update returns an update builder for ClassLeader.
func (*ClassLeaderClient) UpdateOne ¶
func (c *ClassLeaderClient) UpdateOne(cl *ClassLeader) *ClassLeaderUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ClassLeaderClient) UpdateOneID ¶
func (c *ClassLeaderClient) UpdateOneID(id int) *ClassLeaderUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ClassLeaderClient) Use ¶
func (c *ClassLeaderClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `classleader.Hooks(f(g(h())))`.
type ClassLeaderCreate ¶
type ClassLeaderCreate struct {
// contains filtered or unexported fields
}
ClassLeaderCreate is the builder for creating a ClassLeader entity.
func (*ClassLeaderCreate) Exec ¶
func (clc *ClassLeaderCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassLeaderCreate) ExecX ¶
func (clc *ClassLeaderCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderCreate) Mutation ¶
func (clc *ClassLeaderCreate) Mutation() *ClassLeaderMutation
Mutation returns the ClassLeaderMutation object of the builder.
func (*ClassLeaderCreate) Save ¶
func (clc *ClassLeaderCreate) Save(ctx context.Context) (*ClassLeader, error)
Save creates the ClassLeader in the database.
func (*ClassLeaderCreate) SaveX ¶
func (clc *ClassLeaderCreate) SaveX(ctx context.Context) *ClassLeader
SaveX calls Save and panics if Save returns an error.
func (*ClassLeaderCreate) SetClass ¶
func (clc *ClassLeaderCreate) SetClass(c *Class) *ClassLeaderCreate
SetClass sets the "class" edge to the Class entity.
func (*ClassLeaderCreate) SetClassID ¶
func (clc *ClassLeaderCreate) SetClassID(id int) *ClassLeaderCreate
SetClassID sets the "class" edge to the Class entity by ID.
func (*ClassLeaderCreate) SetNillableClassID ¶
func (clc *ClassLeaderCreate) SetNillableClassID(id *int) *ClassLeaderCreate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*ClassLeaderCreate) SetNillableStudentID ¶
func (clc *ClassLeaderCreate) SetNillableStudentID(id *int) *ClassLeaderCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*ClassLeaderCreate) SetStudent ¶
func (clc *ClassLeaderCreate) SetStudent(s *Student) *ClassLeaderCreate
SetStudent sets the "student" edge to the Student entity.
func (*ClassLeaderCreate) SetStudentID ¶
func (clc *ClassLeaderCreate) SetStudentID(id int) *ClassLeaderCreate
SetStudentID sets the "student" edge to the Student entity by ID.
type ClassLeaderCreateBulk ¶
type ClassLeaderCreateBulk struct {
// contains filtered or unexported fields
}
ClassLeaderCreateBulk is the builder for creating many ClassLeader entities in bulk.
func (*ClassLeaderCreateBulk) Exec ¶
func (clcb *ClassLeaderCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassLeaderCreateBulk) ExecX ¶
func (clcb *ClassLeaderCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderCreateBulk) Save ¶
func (clcb *ClassLeaderCreateBulk) Save(ctx context.Context) ([]*ClassLeader, error)
Save creates the ClassLeader entities in the database.
func (*ClassLeaderCreateBulk) SaveX ¶
func (clcb *ClassLeaderCreateBulk) SaveX(ctx context.Context) []*ClassLeader
SaveX is like Save, but panics if an error occurs.
type ClassLeaderDelete ¶
type ClassLeaderDelete struct {
// contains filtered or unexported fields
}
ClassLeaderDelete is the builder for deleting a ClassLeader entity.
func (*ClassLeaderDelete) Exec ¶
func (cld *ClassLeaderDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ClassLeaderDelete) ExecX ¶
func (cld *ClassLeaderDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderDelete) Where ¶
func (cld *ClassLeaderDelete) Where(ps ...predicate.ClassLeader) *ClassLeaderDelete
Where appends a list predicates to the ClassLeaderDelete builder.
type ClassLeaderDeleteOne ¶
type ClassLeaderDeleteOne struct {
// contains filtered or unexported fields
}
ClassLeaderDeleteOne is the builder for deleting a single ClassLeader entity.
func (*ClassLeaderDeleteOne) Exec ¶
func (cldo *ClassLeaderDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ClassLeaderDeleteOne) ExecX ¶
func (cldo *ClassLeaderDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderDeleteOne) Where ¶
func (cldo *ClassLeaderDeleteOne) Where(ps ...predicate.ClassLeader) *ClassLeaderDeleteOne
Where appends a list predicates to the ClassLeaderDelete builder.
type ClassLeaderEdges ¶
type ClassLeaderEdges struct { // Class holds the value of the class edge. Class *Class `json:"class,omitempty"` // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
ClassLeaderEdges holds the relations/edges for other nodes in the graph.
func (ClassLeaderEdges) ClassOrErr ¶
func (e ClassLeaderEdges) ClassOrErr() (*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ClassLeaderEdges) StudentOrErr ¶
func (e ClassLeaderEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ClassLeaderGroupBy ¶
type ClassLeaderGroupBy struct {
// contains filtered or unexported fields
}
ClassLeaderGroupBy is the group-by builder for ClassLeader entities.
func (*ClassLeaderGroupBy) Aggregate ¶
func (clgb *ClassLeaderGroupBy) Aggregate(fns ...AggregateFunc) *ClassLeaderGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ClassLeaderGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ClassLeaderGroupBy) Scan ¶
func (clgb *ClassLeaderGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ClassLeaderGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ClassLeaderMutation ¶
type ClassLeaderMutation struct {
// contains filtered or unexported fields
}
ClassLeaderMutation represents an operation that mutates the ClassLeader nodes in the graph.
func (*ClassLeaderMutation) AddField ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) AddedEdges ¶
func (m *ClassLeaderMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ClassLeaderMutation) AddedField ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) AddedFields ¶
func (m *ClassLeaderMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ClassLeaderMutation) AddedIDs ¶
func (m *ClassLeaderMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ClassLeaderMutation) ClassCleared ¶
func (m *ClassLeaderMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*ClassLeaderMutation) ClassID ¶
func (m *ClassLeaderMutation) ClassID() (id int, exists bool)
ClassID returns the "class" edge ID in the mutation.
func (*ClassLeaderMutation) ClassIDs ¶
func (m *ClassLeaderMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.
func (*ClassLeaderMutation) ClearClass ¶
func (m *ClassLeaderMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*ClassLeaderMutation) ClearEdge ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ClearField ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ClearStudent ¶
func (m *ClassLeaderMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*ClassLeaderMutation) ClearedEdges ¶
func (m *ClassLeaderMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ClassLeaderMutation) ClearedFields ¶
func (m *ClassLeaderMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ClassLeaderMutation) Client ¶
func (m ClassLeaderMutation) 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 (*ClassLeaderMutation) EdgeCleared ¶
func (m *ClassLeaderMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ClassLeaderMutation) Field ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) FieldCleared ¶
func (m *ClassLeaderMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ClassLeaderMutation) Fields ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ID ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) IDs ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) 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 (*ClassLeaderMutation) Op ¶
func (m *ClassLeaderMutation) Op() Op
Op returns the operation name.
func (*ClassLeaderMutation) RemovedEdges ¶
func (m *ClassLeaderMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ClassLeaderMutation) RemovedIDs ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ResetClass ¶
func (m *ClassLeaderMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*ClassLeaderMutation) ResetEdge ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ResetField ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ResetStudent ¶
func (m *ClassLeaderMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*ClassLeaderMutation) SetClassID ¶
func (m *ClassLeaderMutation) SetClassID(id int)
SetClassID sets the "class" edge to the Class entity by id.
func (*ClassLeaderMutation) SetField ¶
func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) SetOp ¶
func (m *ClassLeaderMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ClassLeaderMutation) SetStudentID ¶
func (m *ClassLeaderMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*ClassLeaderMutation) StudentCleared ¶
func (m *ClassLeaderMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*ClassLeaderMutation) StudentID ¶
func (m *ClassLeaderMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*ClassLeaderMutation) StudentIDs ¶
func (m *ClassLeaderMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (ClassLeaderMutation) Tx ¶
func (m ClassLeaderMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ClassLeaderMutation) Type ¶
func (m *ClassLeaderMutation) Type() string
Type returns the node type of this mutation (ClassLeader).
func (*ClassLeaderMutation) Where ¶
func (m *ClassLeaderMutation) Where(ps ...predicate.ClassLeader)
Where appends a list predicates to the ClassLeaderMutation builder.
func (*ClassLeaderMutation) WhereP ¶
func (m *ClassLeaderMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ClassLeaderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ClassLeaderQuery ¶
type ClassLeaderQuery struct {
// contains filtered or unexported fields
}
ClassLeaderQuery is the builder for querying ClassLeader entities.
func (*ClassLeaderQuery) Aggregate ¶
func (clq *ClassLeaderQuery) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect
Aggregate returns a ClassLeaderSelect configured with the given aggregations.
func (*ClassLeaderQuery) All ¶
func (clq *ClassLeaderQuery) All(ctx context.Context) ([]*ClassLeader, error)
All executes the query and returns a list of ClassLeaders.
func (*ClassLeaderQuery) AllX ¶
func (clq *ClassLeaderQuery) AllX(ctx context.Context) []*ClassLeader
AllX is like All, but panics if an error occurs.
func (*ClassLeaderQuery) Clone ¶
func (clq *ClassLeaderQuery) Clone() *ClassLeaderQuery
Clone returns a duplicate of the ClassLeaderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ClassLeaderQuery) Count ¶
func (clq *ClassLeaderQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ClassLeaderQuery) CountX ¶
func (clq *ClassLeaderQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ClassLeaderQuery) Exist ¶
func (clq *ClassLeaderQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ClassLeaderQuery) ExistX ¶
func (clq *ClassLeaderQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ClassLeaderQuery) First ¶
func (clq *ClassLeaderQuery) First(ctx context.Context) (*ClassLeader, error)
First returns the first ClassLeader entity from the query. Returns a *NotFoundError when no ClassLeader was found.
func (*ClassLeaderQuery) FirstID ¶
func (clq *ClassLeaderQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ClassLeader ID from the query. Returns a *NotFoundError when no ClassLeader ID was found.
func (*ClassLeaderQuery) FirstIDX ¶
func (clq *ClassLeaderQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ClassLeaderQuery) FirstX ¶
func (clq *ClassLeaderQuery) FirstX(ctx context.Context) *ClassLeader
FirstX is like First, but panics if an error occurs.
func (*ClassLeaderQuery) GroupBy ¶
func (clq *ClassLeaderQuery) GroupBy(field string, fields ...string) *ClassLeaderGroupBy
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.
func (*ClassLeaderQuery) IDs ¶
func (clq *ClassLeaderQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ClassLeader IDs.
func (*ClassLeaderQuery) IDsX ¶
func (clq *ClassLeaderQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ClassLeaderQuery) Limit ¶
func (clq *ClassLeaderQuery) Limit(limit int) *ClassLeaderQuery
Limit the number of records to be returned by this query.
func (*ClassLeaderQuery) Offset ¶
func (clq *ClassLeaderQuery) Offset(offset int) *ClassLeaderQuery
Offset to start from.
func (*ClassLeaderQuery) Only ¶
func (clq *ClassLeaderQuery) Only(ctx context.Context) (*ClassLeader, error)
Only returns a single ClassLeader entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ClassLeader entity is found. Returns a *NotFoundError when no ClassLeader entities are found.
func (*ClassLeaderQuery) OnlyID ¶
func (clq *ClassLeaderQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ClassLeader ID in the query. Returns a *NotSingularError when more than one ClassLeader ID is found. Returns a *NotFoundError when no entities are found.
func (*ClassLeaderQuery) OnlyIDX ¶
func (clq *ClassLeaderQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ClassLeaderQuery) OnlyX ¶
func (clq *ClassLeaderQuery) OnlyX(ctx context.Context) *ClassLeader
OnlyX is like Only, but panics if an error occurs.
func (*ClassLeaderQuery) Order ¶
func (clq *ClassLeaderQuery) Order(o ...OrderFunc) *ClassLeaderQuery
Order specifies how the records should be ordered.
func (*ClassLeaderQuery) QueryClass ¶
func (clq *ClassLeaderQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*ClassLeaderQuery) QueryStudent ¶
func (clq *ClassLeaderQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*ClassLeaderQuery) Select ¶
func (clq *ClassLeaderQuery) Select(fields ...string) *ClassLeaderSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
func (*ClassLeaderQuery) Unique ¶
func (clq *ClassLeaderQuery) Unique(unique bool) *ClassLeaderQuery
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 (*ClassLeaderQuery) Where ¶
func (clq *ClassLeaderQuery) Where(ps ...predicate.ClassLeader) *ClassLeaderQuery
Where adds a new predicate for the ClassLeaderQuery builder.
func (*ClassLeaderQuery) WithClass ¶
func (clq *ClassLeaderQuery) WithClass(opts ...func(*ClassQuery)) *ClassLeaderQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassLeaderQuery) WithStudent ¶
func (clq *ClassLeaderQuery) WithStudent(opts ...func(*StudentQuery)) *ClassLeaderQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type ClassLeaderSelect ¶
type ClassLeaderSelect struct { *ClassLeaderQuery // contains filtered or unexported fields }
ClassLeaderSelect is the builder for selecting fields of ClassLeader entities.
func (*ClassLeaderSelect) Aggregate ¶
func (cls *ClassLeaderSelect) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ClassLeaderSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ClassLeaderSelect) Scan ¶
func (cls *ClassLeaderSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ClassLeaderSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ClassLeaderUpdate ¶
type ClassLeaderUpdate struct {
// contains filtered or unexported fields
}
ClassLeaderUpdate is the builder for updating ClassLeader entities.
func (*ClassLeaderUpdate) ClearClass ¶
func (clu *ClassLeaderUpdate) ClearClass() *ClassLeaderUpdate
ClearClass clears the "class" edge to the Class entity.
func (*ClassLeaderUpdate) ClearStudent ¶
func (clu *ClassLeaderUpdate) ClearStudent() *ClassLeaderUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*ClassLeaderUpdate) Exec ¶
func (clu *ClassLeaderUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassLeaderUpdate) ExecX ¶
func (clu *ClassLeaderUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderUpdate) Mutation ¶
func (clu *ClassLeaderUpdate) Mutation() *ClassLeaderMutation
Mutation returns the ClassLeaderMutation object of the builder.
func (*ClassLeaderUpdate) Save ¶
func (clu *ClassLeaderUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ClassLeaderUpdate) SaveX ¶
func (clu *ClassLeaderUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ClassLeaderUpdate) SetClass ¶
func (clu *ClassLeaderUpdate) SetClass(c *Class) *ClassLeaderUpdate
SetClass sets the "class" edge to the Class entity.
func (*ClassLeaderUpdate) SetClassID ¶
func (clu *ClassLeaderUpdate) SetClassID(id int) *ClassLeaderUpdate
SetClassID sets the "class" edge to the Class entity by ID.
func (*ClassLeaderUpdate) SetNillableClassID ¶
func (clu *ClassLeaderUpdate) SetNillableClassID(id *int) *ClassLeaderUpdate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*ClassLeaderUpdate) SetNillableStudentID ¶
func (clu *ClassLeaderUpdate) SetNillableStudentID(id *int) *ClassLeaderUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*ClassLeaderUpdate) SetStudent ¶
func (clu *ClassLeaderUpdate) SetStudent(s *Student) *ClassLeaderUpdate
SetStudent sets the "student" edge to the Student entity.
func (*ClassLeaderUpdate) SetStudentID ¶
func (clu *ClassLeaderUpdate) SetStudentID(id int) *ClassLeaderUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*ClassLeaderUpdate) Where ¶
func (clu *ClassLeaderUpdate) Where(ps ...predicate.ClassLeader) *ClassLeaderUpdate
Where appends a list predicates to the ClassLeaderUpdate builder.
type ClassLeaderUpdateOne ¶
type ClassLeaderUpdateOne struct {
// contains filtered or unexported fields
}
ClassLeaderUpdateOne is the builder for updating a single ClassLeader entity.
func (*ClassLeaderUpdateOne) ClearClass ¶
func (cluo *ClassLeaderUpdateOne) ClearClass() *ClassLeaderUpdateOne
ClearClass clears the "class" edge to the Class entity.
func (*ClassLeaderUpdateOne) ClearStudent ¶
func (cluo *ClassLeaderUpdateOne) ClearStudent() *ClassLeaderUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*ClassLeaderUpdateOne) Exec ¶
func (cluo *ClassLeaderUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ClassLeaderUpdateOne) ExecX ¶
func (cluo *ClassLeaderUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassLeaderUpdateOne) Mutation ¶
func (cluo *ClassLeaderUpdateOne) Mutation() *ClassLeaderMutation
Mutation returns the ClassLeaderMutation object of the builder.
func (*ClassLeaderUpdateOne) Save ¶
func (cluo *ClassLeaderUpdateOne) Save(ctx context.Context) (*ClassLeader, error)
Save executes the query and returns the updated ClassLeader entity.
func (*ClassLeaderUpdateOne) SaveX ¶
func (cluo *ClassLeaderUpdateOne) SaveX(ctx context.Context) *ClassLeader
SaveX is like Save, but panics if an error occurs.
func (*ClassLeaderUpdateOne) Select ¶
func (cluo *ClassLeaderUpdateOne) Select(field string, fields ...string) *ClassLeaderUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ClassLeaderUpdateOne) SetClass ¶
func (cluo *ClassLeaderUpdateOne) SetClass(c *Class) *ClassLeaderUpdateOne
SetClass sets the "class" edge to the Class entity.
func (*ClassLeaderUpdateOne) SetClassID ¶
func (cluo *ClassLeaderUpdateOne) SetClassID(id int) *ClassLeaderUpdateOne
SetClassID sets the "class" edge to the Class entity by ID.
func (*ClassLeaderUpdateOne) SetNillableClassID ¶
func (cluo *ClassLeaderUpdateOne) SetNillableClassID(id *int) *ClassLeaderUpdateOne
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*ClassLeaderUpdateOne) SetNillableStudentID ¶
func (cluo *ClassLeaderUpdateOne) SetNillableStudentID(id *int) *ClassLeaderUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*ClassLeaderUpdateOne) SetStudent ¶
func (cluo *ClassLeaderUpdateOne) SetStudent(s *Student) *ClassLeaderUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*ClassLeaderUpdateOne) SetStudentID ¶
func (cluo *ClassLeaderUpdateOne) SetStudentID(id int) *ClassLeaderUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*ClassLeaderUpdateOne) Where ¶
func (cluo *ClassLeaderUpdateOne) Where(ps ...predicate.ClassLeader) *ClassLeaderUpdateOne
Where appends a list predicates to the ClassLeaderUpdate builder.
type ClassLeaders ¶
type ClassLeaders []*ClassLeader
ClassLeaders is a parsable slice of ClassLeader.
type ClassMutation ¶
type ClassMutation struct {
// contains filtered or unexported fields
}
ClassMutation represents an operation that mutates the Class nodes in the graph.
func (*ClassMutation) AddField ¶
func (m *ClassMutation) 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 (*ClassMutation) AddStudentIDs ¶
func (m *ClassMutation) AddStudentIDs(ids ...int)
AddStudentIDs adds the "student" edge to the Student entity by ids.
func (*ClassMutation) AddedEdges ¶
func (m *ClassMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ClassMutation) AddedField ¶
func (m *ClassMutation) 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 (*ClassMutation) AddedFields ¶
func (m *ClassMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ClassMutation) AddedIDs ¶
func (m *ClassMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ClassMutation) CampusCleared ¶
func (m *ClassMutation) CampusCleared() bool
CampusCleared reports if the "campus" edge to the Campus entity was cleared.
func (*ClassMutation) CampusID ¶
func (m *ClassMutation) CampusID() (id int, exists bool)
CampusID returns the "campus" edge ID in the mutation.
func (*ClassMutation) CampusIDs ¶
func (m *ClassMutation) CampusIDs() (ids []int)
CampusIDs returns the "campus" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CampusID instead. It exists only for internal usage by the builders.
func (*ClassMutation) ClassLeaderCleared ¶
func (m *ClassMutation) ClassLeaderCleared() bool
ClassLeaderCleared reports if the "class_leader" edge to the ClassLeader entity was cleared.
func (*ClassMutation) ClassLeaderID ¶
func (m *ClassMutation) ClassLeaderID() (id int, exists bool)
ClassLeaderID returns the "class_leader" edge ID in the mutation.
func (*ClassMutation) ClassLeaderIDs ¶
func (m *ClassMutation) ClassLeaderIDs() (ids []int)
ClassLeaderIDs returns the "class_leader" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassLeaderID instead. It exists only for internal usage by the builders.
func (*ClassMutation) ClearCampus ¶
func (m *ClassMutation) ClearCampus()
ClearCampus clears the "campus" edge to the Campus entity.
func (*ClassMutation) ClearClassLeader ¶
func (m *ClassMutation) ClearClassLeader()
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*ClassMutation) ClearDepartment ¶
func (m *ClassMutation) ClearDepartment()
ClearDepartment clears the "department" edge to the Department entity.
func (*ClassMutation) ClearEdge ¶
func (m *ClassMutation) 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 (*ClassMutation) ClearField ¶
func (m *ClassMutation) 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 (*ClassMutation) ClearMajor ¶
func (m *ClassMutation) ClearMajor()
ClearMajor clears the "major" edge to the Major entity.
func (*ClassMutation) ClearMajorDirection ¶
func (m *ClassMutation) ClearMajorDirection()
ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.
func (*ClassMutation) ClearStudent ¶
func (m *ClassMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*ClassMutation) ClearTutor ¶
func (m *ClassMutation) ClearTutor()
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*ClassMutation) ClearedEdges ¶
func (m *ClassMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ClassMutation) ClearedFields ¶
func (m *ClassMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ClassMutation) Client ¶
func (m ClassMutation) 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 (*ClassMutation) Code ¶
func (m *ClassMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*ClassMutation) DepartmentCleared ¶
func (m *ClassMutation) DepartmentCleared() bool
DepartmentCleared reports if the "department" edge to the Department entity was cleared.
func (*ClassMutation) DepartmentID ¶
func (m *ClassMutation) DepartmentID() (id int, exists bool)
DepartmentID returns the "department" edge ID in the mutation.
func (*ClassMutation) DepartmentIDs ¶
func (m *ClassMutation) DepartmentIDs() (ids []int)
DepartmentIDs returns the "department" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentID instead. It exists only for internal usage by the builders.
func (*ClassMutation) Description ¶
func (m *ClassMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ClassMutation) EdgeCleared ¶
func (m *ClassMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ClassMutation) Field ¶
func (m *ClassMutation) 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 (*ClassMutation) FieldCleared ¶
func (m *ClassMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ClassMutation) Fields ¶
func (m *ClassMutation) 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 (*ClassMutation) GetType ¶
func (m *ClassMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*ClassMutation) ID ¶
func (m *ClassMutation) 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 (*ClassMutation) IDs ¶
func (m *ClassMutation) 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 (*ClassMutation) MajorCleared ¶
func (m *ClassMutation) MajorCleared() bool
MajorCleared reports if the "major" edge to the Major entity was cleared.
func (*ClassMutation) MajorDirectionCleared ¶
func (m *ClassMutation) MajorDirectionCleared() bool
MajorDirectionCleared reports if the "major_direction" edge to the MajorDirection entity was cleared.
func (*ClassMutation) MajorDirectionID ¶
func (m *ClassMutation) MajorDirectionID() (id int, exists bool)
MajorDirectionID returns the "major_direction" edge ID in the mutation.
func (*ClassMutation) MajorDirectionIDs ¶
func (m *ClassMutation) MajorDirectionIDs() (ids []int)
MajorDirectionIDs returns the "major_direction" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MajorDirectionID instead. It exists only for internal usage by the builders.
func (*ClassMutation) MajorID ¶
func (m *ClassMutation) MajorID() (id int, exists bool)
MajorID returns the "major" edge ID in the mutation.
func (*ClassMutation) MajorIDs ¶
func (m *ClassMutation) MajorIDs() (ids []int)
MajorIDs returns the "major" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MajorID instead. It exists only for internal usage by the builders.
func (*ClassMutation) Name ¶
func (m *ClassMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ClassMutation) OldCode ¶
func (m *ClassMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Class entity. If the Class 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 (*ClassMutation) OldDescription ¶
func (m *ClassMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Class entity. If the Class 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 (*ClassMutation) 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 (*ClassMutation) OldName ¶
func (m *ClassMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Class entity. If the Class 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 (*ClassMutation) OldType ¶
func (m *ClassMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Class entity. If the Class 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 (*ClassMutation) RemoveStudentIDs ¶
func (m *ClassMutation) RemoveStudentIDs(ids ...int)
RemoveStudentIDs removes the "student" edge to the Student entity by IDs.
func (*ClassMutation) RemovedEdges ¶
func (m *ClassMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ClassMutation) RemovedIDs ¶
func (m *ClassMutation) 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 (*ClassMutation) RemovedStudentIDs ¶
func (m *ClassMutation) RemovedStudentIDs() (ids []int)
RemovedStudent returns the removed IDs of the "student" edge to the Student entity.
func (*ClassMutation) ResetCampus ¶
func (m *ClassMutation) ResetCampus()
ResetCampus resets all changes to the "campus" edge.
func (*ClassMutation) ResetClassLeader ¶
func (m *ClassMutation) ResetClassLeader()
ResetClassLeader resets all changes to the "class_leader" edge.
func (*ClassMutation) ResetCode ¶
func (m *ClassMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*ClassMutation) ResetDepartment ¶
func (m *ClassMutation) ResetDepartment()
ResetDepartment resets all changes to the "department" edge.
func (*ClassMutation) ResetDescription ¶
func (m *ClassMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ClassMutation) ResetEdge ¶
func (m *ClassMutation) 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 (*ClassMutation) ResetField ¶
func (m *ClassMutation) 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 (*ClassMutation) ResetMajor ¶
func (m *ClassMutation) ResetMajor()
ResetMajor resets all changes to the "major" edge.
func (*ClassMutation) ResetMajorDirection ¶
func (m *ClassMutation) ResetMajorDirection()
ResetMajorDirection resets all changes to the "major_direction" edge.
func (*ClassMutation) ResetName ¶
func (m *ClassMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ClassMutation) ResetStudent ¶
func (m *ClassMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*ClassMutation) ResetTutor ¶
func (m *ClassMutation) ResetTutor()
ResetTutor resets all changes to the "tutor" edge.
func (*ClassMutation) ResetType ¶
func (m *ClassMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*ClassMutation) SetCampusID ¶
func (m *ClassMutation) SetCampusID(id int)
SetCampusID sets the "campus" edge to the Campus entity by id.
func (*ClassMutation) SetClassLeaderID ¶
func (m *ClassMutation) SetClassLeaderID(id int)
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by id.
func (*ClassMutation) SetCode ¶
func (m *ClassMutation) SetCode(s string)
SetCode sets the "code" field.
func (*ClassMutation) SetDepartmentID ¶
func (m *ClassMutation) SetDepartmentID(id int)
SetDepartmentID sets the "department" edge to the Department entity by id.
func (*ClassMutation) SetDescription ¶
func (m *ClassMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ClassMutation) SetField ¶
func (m *ClassMutation) 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 (*ClassMutation) SetMajorDirectionID ¶
func (m *ClassMutation) SetMajorDirectionID(id int)
SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by id.
func (*ClassMutation) SetMajorID ¶
func (m *ClassMutation) SetMajorID(id int)
SetMajorID sets the "major" edge to the Major entity by id.
func (*ClassMutation) SetName ¶
func (m *ClassMutation) SetName(s string)
SetName sets the "name" field.
func (*ClassMutation) SetOp ¶
func (m *ClassMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ClassMutation) SetTutorID ¶
func (m *ClassMutation) SetTutorID(id int)
SetTutorID sets the "tutor" edge to the Tutor entity by id.
func (*ClassMutation) SetType ¶
func (m *ClassMutation) SetType(s string)
SetType sets the "type" field.
func (*ClassMutation) StudentCleared ¶
func (m *ClassMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*ClassMutation) StudentIDs ¶
func (m *ClassMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation.
func (*ClassMutation) TutorCleared ¶
func (m *ClassMutation) TutorCleared() bool
TutorCleared reports if the "tutor" edge to the Tutor entity was cleared.
func (*ClassMutation) TutorID ¶
func (m *ClassMutation) TutorID() (id int, exists bool)
TutorID returns the "tutor" edge ID in the mutation.
func (*ClassMutation) TutorIDs ¶
func (m *ClassMutation) TutorIDs() (ids []int)
TutorIDs returns the "tutor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TutorID instead. It exists only for internal usage by the builders.
func (ClassMutation) Tx ¶
func (m ClassMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ClassMutation) Type ¶
func (m *ClassMutation) Type() string
Type returns the node type of this mutation (Class).
func (*ClassMutation) Where ¶
func (m *ClassMutation) Where(ps ...predicate.Class)
Where appends a list predicates to the ClassMutation builder.
func (*ClassMutation) WhereP ¶
func (m *ClassMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ClassMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ClassQuery ¶
type ClassQuery struct {
// contains filtered or unexported fields
}
ClassQuery is the builder for querying Class entities.
func (*ClassQuery) Aggregate ¶
func (cq *ClassQuery) Aggregate(fns ...AggregateFunc) *ClassSelect
Aggregate returns a ClassSelect configured with the given aggregations.
func (*ClassQuery) All ¶
func (cq *ClassQuery) All(ctx context.Context) ([]*Class, error)
All executes the query and returns a list of Classes.
func (*ClassQuery) AllX ¶
func (cq *ClassQuery) AllX(ctx context.Context) []*Class
AllX is like All, but panics if an error occurs.
func (*ClassQuery) Clone ¶
func (cq *ClassQuery) Clone() *ClassQuery
Clone returns a duplicate of the ClassQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ClassQuery) Count ¶
func (cq *ClassQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ClassQuery) CountX ¶
func (cq *ClassQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ClassQuery) Exist ¶
func (cq *ClassQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ClassQuery) ExistX ¶
func (cq *ClassQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ClassQuery) First ¶
func (cq *ClassQuery) First(ctx context.Context) (*Class, error)
First returns the first Class entity from the query. Returns a *NotFoundError when no Class was found.
func (*ClassQuery) FirstID ¶
func (cq *ClassQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Class ID from the query. Returns a *NotFoundError when no Class ID was found.
func (*ClassQuery) FirstIDX ¶
func (cq *ClassQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ClassQuery) FirstX ¶
func (cq *ClassQuery) FirstX(ctx context.Context) *Class
FirstX is like First, but panics if an error occurs.
func (*ClassQuery) GroupBy ¶
func (cq *ClassQuery) GroupBy(field string, fields ...string) *ClassGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Class.Query(). GroupBy(class.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*ClassQuery) IDs ¶
func (cq *ClassQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Class IDs.
func (*ClassQuery) IDsX ¶
func (cq *ClassQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ClassQuery) Limit ¶
func (cq *ClassQuery) Limit(limit int) *ClassQuery
Limit the number of records to be returned by this query.
func (*ClassQuery) Offset ¶
func (cq *ClassQuery) Offset(offset int) *ClassQuery
Offset to start from.
func (*ClassQuery) Only ¶
func (cq *ClassQuery) Only(ctx context.Context) (*Class, error)
Only returns a single Class entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Class entity is found. Returns a *NotFoundError when no Class entities are found.
func (*ClassQuery) OnlyID ¶
func (cq *ClassQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Class ID in the query. Returns a *NotSingularError when more than one Class ID is found. Returns a *NotFoundError when no entities are found.
func (*ClassQuery) OnlyIDX ¶
func (cq *ClassQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ClassQuery) OnlyX ¶
func (cq *ClassQuery) OnlyX(ctx context.Context) *Class
OnlyX is like Only, but panics if an error occurs.
func (*ClassQuery) Order ¶
func (cq *ClassQuery) Order(o ...OrderFunc) *ClassQuery
Order specifies how the records should be ordered.
func (*ClassQuery) QueryCampus ¶
func (cq *ClassQuery) QueryCampus() *CampusQuery
QueryCampus chains the current query on the "campus" edge.
func (*ClassQuery) QueryClassLeader ¶
func (cq *ClassQuery) QueryClassLeader() *ClassLeaderQuery
QueryClassLeader chains the current query on the "class_leader" edge.
func (*ClassQuery) QueryDepartment ¶
func (cq *ClassQuery) QueryDepartment() *DepartmentQuery
QueryDepartment chains the current query on the "department" edge.
func (*ClassQuery) QueryMajor ¶
func (cq *ClassQuery) QueryMajor() *MajorQuery
QueryMajor chains the current query on the "major" edge.
func (*ClassQuery) QueryMajorDirection ¶
func (cq *ClassQuery) QueryMajorDirection() *MajorDirectionQuery
QueryMajorDirection chains the current query on the "major_direction" edge.
func (*ClassQuery) QueryStudent ¶
func (cq *ClassQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*ClassQuery) QueryTutor ¶
func (cq *ClassQuery) QueryTutor() *TutorQuery
QueryTutor chains the current query on the "tutor" edge.
func (*ClassQuery) Select ¶
func (cq *ClassQuery) Select(fields ...string) *ClassSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Class.Query(). Select(class.FieldName). Scan(ctx, &v)
func (*ClassQuery) Unique ¶
func (cq *ClassQuery) Unique(unique bool) *ClassQuery
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 (*ClassQuery) Where ¶
func (cq *ClassQuery) Where(ps ...predicate.Class) *ClassQuery
Where adds a new predicate for the ClassQuery builder.
func (*ClassQuery) WithCampus ¶
func (cq *ClassQuery) WithCampus(opts ...func(*CampusQuery)) *ClassQuery
WithCampus tells the query-builder to eager-load the nodes that are connected to the "campus" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithClassLeader ¶
func (cq *ClassQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *ClassQuery
WithClassLeader tells the query-builder to eager-load the nodes that are connected to the "class_leader" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithDepartment ¶
func (cq *ClassQuery) WithDepartment(opts ...func(*DepartmentQuery)) *ClassQuery
WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithMajor ¶
func (cq *ClassQuery) WithMajor(opts ...func(*MajorQuery)) *ClassQuery
WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithMajorDirection ¶
func (cq *ClassQuery) WithMajorDirection(opts ...func(*MajorDirectionQuery)) *ClassQuery
WithMajorDirection tells the query-builder to eager-load the nodes that are connected to the "major_direction" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithStudent ¶
func (cq *ClassQuery) WithStudent(opts ...func(*StudentQuery)) *ClassQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
func (*ClassQuery) WithTutor ¶
func (cq *ClassQuery) WithTutor(opts ...func(*TutorQuery)) *ClassQuery
WithTutor tells the query-builder to eager-load the nodes that are connected to the "tutor" edge. The optional arguments are used to configure the query builder of the edge.
type ClassSelect ¶
type ClassSelect struct { *ClassQuery // contains filtered or unexported fields }
ClassSelect is the builder for selecting fields of Class entities.
func (*ClassSelect) Aggregate ¶
func (cs *ClassSelect) Aggregate(fns ...AggregateFunc) *ClassSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ClassSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ClassSelect) Scan ¶
func (cs *ClassSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ClassSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ClassUpdate ¶
type ClassUpdate struct {
// contains filtered or unexported fields
}
ClassUpdate is the builder for updating Class entities.
func (*ClassUpdate) AddStudent ¶
func (cu *ClassUpdate) AddStudent(s ...*Student) *ClassUpdate
AddStudent adds the "student" edges to the Student entity.
func (*ClassUpdate) AddStudentIDs ¶
func (cu *ClassUpdate) AddStudentIDs(ids ...int) *ClassUpdate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*ClassUpdate) ClearCampus ¶
func (cu *ClassUpdate) ClearCampus() *ClassUpdate
ClearCampus clears the "campus" edge to the Campus entity.
func (*ClassUpdate) ClearClassLeader ¶
func (cu *ClassUpdate) ClearClassLeader() *ClassUpdate
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*ClassUpdate) ClearDepartment ¶
func (cu *ClassUpdate) ClearDepartment() *ClassUpdate
ClearDepartment clears the "department" edge to the Department entity.
func (*ClassUpdate) ClearMajor ¶
func (cu *ClassUpdate) ClearMajor() *ClassUpdate
ClearMajor clears the "major" edge to the Major entity.
func (*ClassUpdate) ClearMajorDirection ¶
func (cu *ClassUpdate) ClearMajorDirection() *ClassUpdate
ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.
func (*ClassUpdate) ClearStudent ¶
func (cu *ClassUpdate) ClearStudent() *ClassUpdate
ClearStudent clears all "student" edges to the Student entity.
func (*ClassUpdate) ClearTutor ¶
func (cu *ClassUpdate) ClearTutor() *ClassUpdate
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*ClassUpdate) Exec ¶
func (cu *ClassUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ClassUpdate) ExecX ¶
func (cu *ClassUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassUpdate) Mutation ¶
func (cu *ClassUpdate) Mutation() *ClassMutation
Mutation returns the ClassMutation object of the builder.
func (*ClassUpdate) RemoveStudent ¶
func (cu *ClassUpdate) RemoveStudent(s ...*Student) *ClassUpdate
RemoveStudent removes "student" edges to Student entities.
func (*ClassUpdate) RemoveStudentIDs ¶
func (cu *ClassUpdate) RemoveStudentIDs(ids ...int) *ClassUpdate
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*ClassUpdate) Save ¶
func (cu *ClassUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ClassUpdate) SaveX ¶
func (cu *ClassUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ClassUpdate) SetCampus ¶
func (cu *ClassUpdate) SetCampus(c *Campus) *ClassUpdate
SetCampus sets the "campus" edge to the Campus entity.
func (*ClassUpdate) SetCampusID ¶
func (cu *ClassUpdate) SetCampusID(id int) *ClassUpdate
SetCampusID sets the "campus" edge to the Campus entity by ID.
func (*ClassUpdate) SetClassLeader ¶
func (cu *ClassUpdate) SetClassLeader(c *ClassLeader) *ClassUpdate
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*ClassUpdate) SetClassLeaderID ¶
func (cu *ClassUpdate) SetClassLeaderID(id int) *ClassUpdate
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*ClassUpdate) SetCode ¶
func (cu *ClassUpdate) SetCode(s string) *ClassUpdate
SetCode sets the "code" field.
func (*ClassUpdate) SetDepartment ¶
func (cu *ClassUpdate) SetDepartment(d *Department) *ClassUpdate
SetDepartment sets the "department" edge to the Department entity.
func (*ClassUpdate) SetDepartmentID ¶
func (cu *ClassUpdate) SetDepartmentID(id int) *ClassUpdate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*ClassUpdate) SetDescription ¶
func (cu *ClassUpdate) SetDescription(s string) *ClassUpdate
SetDescription sets the "description" field.
func (*ClassUpdate) SetMajor ¶
func (cu *ClassUpdate) SetMajor(m *Major) *ClassUpdate
SetMajor sets the "major" edge to the Major entity.
func (*ClassUpdate) SetMajorDirection ¶
func (cu *ClassUpdate) SetMajorDirection(m *MajorDirection) *ClassUpdate
SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.
func (*ClassUpdate) SetMajorDirectionID ¶
func (cu *ClassUpdate) SetMajorDirectionID(id int) *ClassUpdate
SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.
func (*ClassUpdate) SetMajorID ¶
func (cu *ClassUpdate) SetMajorID(id int) *ClassUpdate
SetMajorID sets the "major" edge to the Major entity by ID.
func (*ClassUpdate) SetName ¶
func (cu *ClassUpdate) SetName(s string) *ClassUpdate
SetName sets the "name" field.
func (*ClassUpdate) SetNillableCampusID ¶
func (cu *ClassUpdate) SetNillableCampusID(id *int) *ClassUpdate
SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.
func (*ClassUpdate) SetNillableClassLeaderID ¶
func (cu *ClassUpdate) SetNillableClassLeaderID(id *int) *ClassUpdate
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*ClassUpdate) SetNillableDepartmentID ¶
func (cu *ClassUpdate) SetNillableDepartmentID(id *int) *ClassUpdate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*ClassUpdate) SetNillableMajorDirectionID ¶
func (cu *ClassUpdate) SetNillableMajorDirectionID(id *int) *ClassUpdate
SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.
func (*ClassUpdate) SetNillableMajorID ¶
func (cu *ClassUpdate) SetNillableMajorID(id *int) *ClassUpdate
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*ClassUpdate) SetNillableTutorID ¶
func (cu *ClassUpdate) SetNillableTutorID(id *int) *ClassUpdate
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*ClassUpdate) SetTutor ¶
func (cu *ClassUpdate) SetTutor(t *Tutor) *ClassUpdate
SetTutor sets the "tutor" edge to the Tutor entity.
func (*ClassUpdate) SetTutorID ¶
func (cu *ClassUpdate) SetTutorID(id int) *ClassUpdate
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*ClassUpdate) SetType ¶
func (cu *ClassUpdate) SetType(s string) *ClassUpdate
SetType sets the "type" field.
func (*ClassUpdate) Where ¶
func (cu *ClassUpdate) Where(ps ...predicate.Class) *ClassUpdate
Where appends a list predicates to the ClassUpdate builder.
type ClassUpdateOne ¶
type ClassUpdateOne struct {
// contains filtered or unexported fields
}
ClassUpdateOne is the builder for updating a single Class entity.
func (*ClassUpdateOne) AddStudent ¶
func (cuo *ClassUpdateOne) AddStudent(s ...*Student) *ClassUpdateOne
AddStudent adds the "student" edges to the Student entity.
func (*ClassUpdateOne) AddStudentIDs ¶
func (cuo *ClassUpdateOne) AddStudentIDs(ids ...int) *ClassUpdateOne
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*ClassUpdateOne) ClearCampus ¶
func (cuo *ClassUpdateOne) ClearCampus() *ClassUpdateOne
ClearCampus clears the "campus" edge to the Campus entity.
func (*ClassUpdateOne) ClearClassLeader ¶
func (cuo *ClassUpdateOne) ClearClassLeader() *ClassUpdateOne
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*ClassUpdateOne) ClearDepartment ¶
func (cuo *ClassUpdateOne) ClearDepartment() *ClassUpdateOne
ClearDepartment clears the "department" edge to the Department entity.
func (*ClassUpdateOne) ClearMajor ¶
func (cuo *ClassUpdateOne) ClearMajor() *ClassUpdateOne
ClearMajor clears the "major" edge to the Major entity.
func (*ClassUpdateOne) ClearMajorDirection ¶
func (cuo *ClassUpdateOne) ClearMajorDirection() *ClassUpdateOne
ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.
func (*ClassUpdateOne) ClearStudent ¶
func (cuo *ClassUpdateOne) ClearStudent() *ClassUpdateOne
ClearStudent clears all "student" edges to the Student entity.
func (*ClassUpdateOne) ClearTutor ¶
func (cuo *ClassUpdateOne) ClearTutor() *ClassUpdateOne
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*ClassUpdateOne) Exec ¶
func (cuo *ClassUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ClassUpdateOne) ExecX ¶
func (cuo *ClassUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ClassUpdateOne) Mutation ¶
func (cuo *ClassUpdateOne) Mutation() *ClassMutation
Mutation returns the ClassMutation object of the builder.
func (*ClassUpdateOne) RemoveStudent ¶
func (cuo *ClassUpdateOne) RemoveStudent(s ...*Student) *ClassUpdateOne
RemoveStudent removes "student" edges to Student entities.
func (*ClassUpdateOne) RemoveStudentIDs ¶
func (cuo *ClassUpdateOne) RemoveStudentIDs(ids ...int) *ClassUpdateOne
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*ClassUpdateOne) Save ¶
func (cuo *ClassUpdateOne) Save(ctx context.Context) (*Class, error)
Save executes the query and returns the updated Class entity.
func (*ClassUpdateOne) SaveX ¶
func (cuo *ClassUpdateOne) SaveX(ctx context.Context) *Class
SaveX is like Save, but panics if an error occurs.
func (*ClassUpdateOne) Select ¶
func (cuo *ClassUpdateOne) Select(field string, fields ...string) *ClassUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ClassUpdateOne) SetCampus ¶
func (cuo *ClassUpdateOne) SetCampus(c *Campus) *ClassUpdateOne
SetCampus sets the "campus" edge to the Campus entity.
func (*ClassUpdateOne) SetCampusID ¶
func (cuo *ClassUpdateOne) SetCampusID(id int) *ClassUpdateOne
SetCampusID sets the "campus" edge to the Campus entity by ID.
func (*ClassUpdateOne) SetClassLeader ¶
func (cuo *ClassUpdateOne) SetClassLeader(c *ClassLeader) *ClassUpdateOne
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*ClassUpdateOne) SetClassLeaderID ¶
func (cuo *ClassUpdateOne) SetClassLeaderID(id int) *ClassUpdateOne
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*ClassUpdateOne) SetCode ¶
func (cuo *ClassUpdateOne) SetCode(s string) *ClassUpdateOne
SetCode sets the "code" field.
func (*ClassUpdateOne) SetDepartment ¶
func (cuo *ClassUpdateOne) SetDepartment(d *Department) *ClassUpdateOne
SetDepartment sets the "department" edge to the Department entity.
func (*ClassUpdateOne) SetDepartmentID ¶
func (cuo *ClassUpdateOne) SetDepartmentID(id int) *ClassUpdateOne
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*ClassUpdateOne) SetDescription ¶
func (cuo *ClassUpdateOne) SetDescription(s string) *ClassUpdateOne
SetDescription sets the "description" field.
func (*ClassUpdateOne) SetMajor ¶
func (cuo *ClassUpdateOne) SetMajor(m *Major) *ClassUpdateOne
SetMajor sets the "major" edge to the Major entity.
func (*ClassUpdateOne) SetMajorDirection ¶
func (cuo *ClassUpdateOne) SetMajorDirection(m *MajorDirection) *ClassUpdateOne
SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.
func (*ClassUpdateOne) SetMajorDirectionID ¶
func (cuo *ClassUpdateOne) SetMajorDirectionID(id int) *ClassUpdateOne
SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.
func (*ClassUpdateOne) SetMajorID ¶
func (cuo *ClassUpdateOne) SetMajorID(id int) *ClassUpdateOne
SetMajorID sets the "major" edge to the Major entity by ID.
func (*ClassUpdateOne) SetName ¶
func (cuo *ClassUpdateOne) SetName(s string) *ClassUpdateOne
SetName sets the "name" field.
func (*ClassUpdateOne) SetNillableCampusID ¶
func (cuo *ClassUpdateOne) SetNillableCampusID(id *int) *ClassUpdateOne
SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetNillableClassLeaderID ¶
func (cuo *ClassUpdateOne) SetNillableClassLeaderID(id *int) *ClassUpdateOne
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetNillableDepartmentID ¶
func (cuo *ClassUpdateOne) SetNillableDepartmentID(id *int) *ClassUpdateOne
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetNillableMajorDirectionID ¶
func (cuo *ClassUpdateOne) SetNillableMajorDirectionID(id *int) *ClassUpdateOne
SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetNillableMajorID ¶
func (cuo *ClassUpdateOne) SetNillableMajorID(id *int) *ClassUpdateOne
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetNillableTutorID ¶
func (cuo *ClassUpdateOne) SetNillableTutorID(id *int) *ClassUpdateOne
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*ClassUpdateOne) SetTutor ¶
func (cuo *ClassUpdateOne) SetTutor(t *Tutor) *ClassUpdateOne
SetTutor sets the "tutor" edge to the Tutor entity.
func (*ClassUpdateOne) SetTutorID ¶
func (cuo *ClassUpdateOne) SetTutorID(id int) *ClassUpdateOne
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*ClassUpdateOne) SetType ¶
func (cuo *ClassUpdateOne) SetType(s string) *ClassUpdateOne
SetType sets the "type" field.
func (*ClassUpdateOne) Where ¶
func (cuo *ClassUpdateOne) Where(ps ...predicate.Class) *ClassUpdateOne
Where appends a list predicates to the ClassUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Authorization is the client for interacting with the Authorization builders. Authorization *AuthorizationClient // Campus is the client for interacting with the Campus builders. Campus *CampusClient // Certificate is the client for interacting with the Certificate builders. Certificate *CertificateClient // Class is the client for interacting with the Class builders. Class *ClassClient // ClassLeader is the client for interacting with the ClassLeader builders. ClassLeader *ClassLeaderClient // Department is the client for interacting with the Department builders. Department *DepartmentClient // EducationLevel is the client for interacting with the EducationLevel builders. EducationLevel *EducationLevelClient // EnrollmentStatus is the client for interacting with the EnrollmentStatus builders. EnrollmentStatus *EnrollmentStatusClient // FamilyInfo is the client for interacting with the FamilyInfo builders. FamilyInfo *FamilyInfoClient // Major is the client for interacting with the Major builders. Major *MajorClient // MajorDirection is the client for interacting with the MajorDirection builders. MajorDirection *MajorDirectionClient // PracticalExperience is the client for interacting with the PracticalExperience builders. PracticalExperience *PracticalExperienceClient // Resource is the client for interacting with the Resource builders. Resource *ResourceClient // Role is the client for interacting with the Role builders. Role *RoleClient // Student is the client for interacting with the Student builders. Student *StudentClient // Tutor is the client for interacting with the Tutor builders. Tutor *TutorClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Authorization. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Department ¶
type Department struct { // ID of the ent. ID int `json:"id,omitempty"` // 系部名称 Name string `json:"name,omitempty"` // 系部代码 Code string `json:"code,omitempty"` // 系部描述 Description string `json:"description,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the DepartmentQuery when eager-loading is set. Edges DepartmentEdges `json:"edges"` // contains filtered or unexported fields }
Department is the model entity for the Department schema.
func (*Department) QueryClass ¶
func (d *Department) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the Department entity.
func (*Department) QueryMajor ¶
func (d *Department) QueryMajor() *MajorQuery
QueryMajor queries the "major" edge of the Department entity.
func (*Department) QueryStudent ¶
func (d *Department) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the Department entity.
func (*Department) String ¶
func (d *Department) String() string
String implements the fmt.Stringer.
func (*Department) Unwrap ¶
func (d *Department) Unwrap() *Department
Unwrap unwraps the Department 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 (*Department) Update ¶
func (d *Department) Update() *DepartmentUpdateOne
Update returns a builder for updating this Department. Note that you need to call Department.Unwrap() before calling this method if this Department was returned from a transaction, and the transaction was committed or rolled back.
type DepartmentClient ¶
type DepartmentClient struct {
// contains filtered or unexported fields
}
DepartmentClient is a client for the Department schema.
func NewDepartmentClient ¶
func NewDepartmentClient(c config) *DepartmentClient
NewDepartmentClient returns a client for the Department from the given config.
func (*DepartmentClient) Create ¶
func (c *DepartmentClient) Create() *DepartmentCreate
Create returns a builder for creating a Department entity.
func (*DepartmentClient) CreateBulk ¶
func (c *DepartmentClient) CreateBulk(builders ...*DepartmentCreate) *DepartmentCreateBulk
CreateBulk returns a builder for creating a bulk of Department entities.
func (*DepartmentClient) Delete ¶
func (c *DepartmentClient) Delete() *DepartmentDelete
Delete returns a delete builder for Department.
func (*DepartmentClient) DeleteOne ¶
func (c *DepartmentClient) DeleteOne(d *Department) *DepartmentDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DepartmentClient) DeleteOneID ¶
func (c *DepartmentClient) DeleteOneID(id int) *DepartmentDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DepartmentClient) Get ¶
func (c *DepartmentClient) Get(ctx context.Context, id int) (*Department, error)
Get returns a Department entity by its id.
func (*DepartmentClient) GetX ¶
func (c *DepartmentClient) GetX(ctx context.Context, id int) *Department
GetX is like Get, but panics if an error occurs.
func (*DepartmentClient) Hooks ¶
func (c *DepartmentClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DepartmentClient) Intercept ¶
func (c *DepartmentClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `department.Intercept(f(g(h())))`.
func (*DepartmentClient) Interceptors ¶
func (c *DepartmentClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DepartmentClient) Query ¶
func (c *DepartmentClient) Query() *DepartmentQuery
Query returns a query builder for Department.
func (*DepartmentClient) QueryClass ¶
func (c *DepartmentClient) QueryClass(d *Department) *ClassQuery
QueryClass queries the class edge of a Department.
func (*DepartmentClient) QueryMajor ¶
func (c *DepartmentClient) QueryMajor(d *Department) *MajorQuery
QueryMajor queries the major edge of a Department.
func (*DepartmentClient) QueryStudent ¶
func (c *DepartmentClient) QueryStudent(d *Department) *StudentQuery
QueryStudent queries the student edge of a Department.
func (*DepartmentClient) Update ¶
func (c *DepartmentClient) Update() *DepartmentUpdate
Update returns an update builder for Department.
func (*DepartmentClient) UpdateOne ¶
func (c *DepartmentClient) UpdateOne(d *Department) *DepartmentUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DepartmentClient) UpdateOneID ¶
func (c *DepartmentClient) UpdateOneID(id int) *DepartmentUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DepartmentClient) Use ¶
func (c *DepartmentClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `department.Hooks(f(g(h())))`.
type DepartmentCreate ¶
type DepartmentCreate struct {
// contains filtered or unexported fields
}
DepartmentCreate is the builder for creating a Department entity.
func (*DepartmentCreate) AddClasIDs ¶
func (dc *DepartmentCreate) AddClasIDs(ids ...int) *DepartmentCreate
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*DepartmentCreate) AddClass ¶
func (dc *DepartmentCreate) AddClass(c ...*Class) *DepartmentCreate
AddClass adds the "class" edges to the Class entity.
func (*DepartmentCreate) AddMajor ¶
func (dc *DepartmentCreate) AddMajor(m ...*Major) *DepartmentCreate
AddMajor adds the "major" edges to the Major entity.
func (*DepartmentCreate) AddMajorIDs ¶
func (dc *DepartmentCreate) AddMajorIDs(ids ...int) *DepartmentCreate
AddMajorIDs adds the "major" edge to the Major entity by IDs.
func (*DepartmentCreate) AddStudent ¶
func (dc *DepartmentCreate) AddStudent(s ...*Student) *DepartmentCreate
AddStudent adds the "student" edges to the Student entity.
func (*DepartmentCreate) AddStudentIDs ¶
func (dc *DepartmentCreate) AddStudentIDs(ids ...int) *DepartmentCreate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*DepartmentCreate) Exec ¶
func (dc *DepartmentCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DepartmentCreate) ExecX ¶
func (dc *DepartmentCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentCreate) Mutation ¶
func (dc *DepartmentCreate) Mutation() *DepartmentMutation
Mutation returns the DepartmentMutation object of the builder.
func (*DepartmentCreate) Save ¶
func (dc *DepartmentCreate) Save(ctx context.Context) (*Department, error)
Save creates the Department in the database.
func (*DepartmentCreate) SaveX ¶
func (dc *DepartmentCreate) SaveX(ctx context.Context) *Department
SaveX calls Save and panics if Save returns an error.
func (*DepartmentCreate) SetCode ¶
func (dc *DepartmentCreate) SetCode(s string) *DepartmentCreate
SetCode sets the "code" field.
func (*DepartmentCreate) SetDescription ¶
func (dc *DepartmentCreate) SetDescription(s string) *DepartmentCreate
SetDescription sets the "description" field.
func (*DepartmentCreate) SetName ¶
func (dc *DepartmentCreate) SetName(s string) *DepartmentCreate
SetName sets the "name" field.
type DepartmentCreateBulk ¶
type DepartmentCreateBulk struct {
// contains filtered or unexported fields
}
DepartmentCreateBulk is the builder for creating many Department entities in bulk.
func (*DepartmentCreateBulk) Exec ¶
func (dcb *DepartmentCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DepartmentCreateBulk) ExecX ¶
func (dcb *DepartmentCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentCreateBulk) Save ¶
func (dcb *DepartmentCreateBulk) Save(ctx context.Context) ([]*Department, error)
Save creates the Department entities in the database.
func (*DepartmentCreateBulk) SaveX ¶
func (dcb *DepartmentCreateBulk) SaveX(ctx context.Context) []*Department
SaveX is like Save, but panics if an error occurs.
type DepartmentDelete ¶
type DepartmentDelete struct {
// contains filtered or unexported fields
}
DepartmentDelete is the builder for deleting a Department entity.
func (*DepartmentDelete) Exec ¶
func (dd *DepartmentDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DepartmentDelete) ExecX ¶
func (dd *DepartmentDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentDelete) Where ¶
func (dd *DepartmentDelete) Where(ps ...predicate.Department) *DepartmentDelete
Where appends a list predicates to the DepartmentDelete builder.
type DepartmentDeleteOne ¶
type DepartmentDeleteOne struct {
// contains filtered or unexported fields
}
DepartmentDeleteOne is the builder for deleting a single Department entity.
func (*DepartmentDeleteOne) Exec ¶
func (ddo *DepartmentDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DepartmentDeleteOne) ExecX ¶
func (ddo *DepartmentDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentDeleteOne) Where ¶
func (ddo *DepartmentDeleteOne) Where(ps ...predicate.Department) *DepartmentDeleteOne
Where appends a list predicates to the DepartmentDelete builder.
type DepartmentEdges ¶
type DepartmentEdges struct { // Major holds the value of the major edge. Major []*Major `json:"major,omitempty"` // Class holds the value of the class edge. Class []*Class `json:"class,omitempty"` // Student holds the value of the student edge. Student []*Student `json:"student,omitempty"` // contains filtered or unexported fields }
DepartmentEdges holds the relations/edges for other nodes in the graph.
func (DepartmentEdges) ClassOrErr ¶
func (e DepartmentEdges) ClassOrErr() ([]*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading.
func (DepartmentEdges) MajorOrErr ¶
func (e DepartmentEdges) MajorOrErr() ([]*Major, error)
MajorOrErr returns the Major value or an error if the edge was not loaded in eager-loading.
func (DepartmentEdges) StudentOrErr ¶
func (e DepartmentEdges) StudentOrErr() ([]*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading.
type DepartmentGroupBy ¶
type DepartmentGroupBy struct {
// contains filtered or unexported fields
}
DepartmentGroupBy is the group-by builder for Department entities.
func (*DepartmentGroupBy) Aggregate ¶
func (dgb *DepartmentGroupBy) Aggregate(fns ...AggregateFunc) *DepartmentGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DepartmentGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DepartmentGroupBy) Scan ¶
func (dgb *DepartmentGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DepartmentGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DepartmentMutation ¶
type DepartmentMutation struct {
// contains filtered or unexported fields
}
DepartmentMutation represents an operation that mutates the Department nodes in the graph.
func (*DepartmentMutation) AddClasIDs ¶
func (m *DepartmentMutation) AddClasIDs(ids ...int)
AddClasIDs adds the "class" edge to the Class entity by ids.
func (*DepartmentMutation) AddField ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) AddMajorIDs ¶
func (m *DepartmentMutation) AddMajorIDs(ids ...int)
AddMajorIDs adds the "major" edge to the Major entity by ids.
func (*DepartmentMutation) AddStudentIDs ¶
func (m *DepartmentMutation) AddStudentIDs(ids ...int)
AddStudentIDs adds the "student" edge to the Student entity by ids.
func (*DepartmentMutation) AddedEdges ¶
func (m *DepartmentMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DepartmentMutation) AddedField ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) AddedFields ¶
func (m *DepartmentMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DepartmentMutation) AddedIDs ¶
func (m *DepartmentMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DepartmentMutation) ClassCleared ¶
func (m *DepartmentMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*DepartmentMutation) ClassIDs ¶
func (m *DepartmentMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation.
func (*DepartmentMutation) ClearClass ¶
func (m *DepartmentMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*DepartmentMutation) ClearEdge ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) ClearField ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) ClearMajor ¶
func (m *DepartmentMutation) ClearMajor()
ClearMajor clears the "major" edge to the Major entity.
func (*DepartmentMutation) ClearStudent ¶
func (m *DepartmentMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*DepartmentMutation) ClearedEdges ¶
func (m *DepartmentMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DepartmentMutation) ClearedFields ¶
func (m *DepartmentMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DepartmentMutation) Client ¶
func (m DepartmentMutation) 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 (*DepartmentMutation) Code ¶
func (m *DepartmentMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*DepartmentMutation) Description ¶
func (m *DepartmentMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*DepartmentMutation) EdgeCleared ¶
func (m *DepartmentMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DepartmentMutation) Field ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) FieldCleared ¶
func (m *DepartmentMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DepartmentMutation) Fields ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) ID ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) IDs ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) MajorCleared ¶
func (m *DepartmentMutation) MajorCleared() bool
MajorCleared reports if the "major" edge to the Major entity was cleared.
func (*DepartmentMutation) MajorIDs ¶
func (m *DepartmentMutation) MajorIDs() (ids []int)
MajorIDs returns the "major" edge IDs in the mutation.
func (*DepartmentMutation) Name ¶
func (m *DepartmentMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*DepartmentMutation) OldCode ¶
func (m *DepartmentMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Department entity. If the Department 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 (*DepartmentMutation) OldDescription ¶
func (m *DepartmentMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Department entity. If the Department 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 (*DepartmentMutation) 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 (*DepartmentMutation) OldName ¶
func (m *DepartmentMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Department entity. If the Department 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 (*DepartmentMutation) RemoveClasIDs ¶
func (m *DepartmentMutation) RemoveClasIDs(ids ...int)
RemoveClasIDs removes the "class" edge to the Class entity by IDs.
func (*DepartmentMutation) RemoveMajorIDs ¶
func (m *DepartmentMutation) RemoveMajorIDs(ids ...int)
RemoveMajorIDs removes the "major" edge to the Major entity by IDs.
func (*DepartmentMutation) RemoveStudentIDs ¶
func (m *DepartmentMutation) RemoveStudentIDs(ids ...int)
RemoveStudentIDs removes the "student" edge to the Student entity by IDs.
func (*DepartmentMutation) RemovedClassIDs ¶
func (m *DepartmentMutation) RemovedClassIDs() (ids []int)
RemovedClass returns the removed IDs of the "class" edge to the Class entity.
func (*DepartmentMutation) RemovedEdges ¶
func (m *DepartmentMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DepartmentMutation) RemovedIDs ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) RemovedMajorIDs ¶
func (m *DepartmentMutation) RemovedMajorIDs() (ids []int)
RemovedMajor returns the removed IDs of the "major" edge to the Major entity.
func (*DepartmentMutation) RemovedStudentIDs ¶
func (m *DepartmentMutation) RemovedStudentIDs() (ids []int)
RemovedStudent returns the removed IDs of the "student" edge to the Student entity.
func (*DepartmentMutation) ResetClass ¶
func (m *DepartmentMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*DepartmentMutation) ResetCode ¶
func (m *DepartmentMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*DepartmentMutation) ResetDescription ¶
func (m *DepartmentMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*DepartmentMutation) ResetEdge ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) ResetField ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) ResetMajor ¶
func (m *DepartmentMutation) ResetMajor()
ResetMajor resets all changes to the "major" edge.
func (*DepartmentMutation) ResetName ¶
func (m *DepartmentMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*DepartmentMutation) ResetStudent ¶
func (m *DepartmentMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*DepartmentMutation) SetCode ¶
func (m *DepartmentMutation) SetCode(s string)
SetCode sets the "code" field.
func (*DepartmentMutation) SetDescription ¶
func (m *DepartmentMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*DepartmentMutation) SetField ¶
func (m *DepartmentMutation) 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 (*DepartmentMutation) SetName ¶
func (m *DepartmentMutation) SetName(s string)
SetName sets the "name" field.
func (*DepartmentMutation) SetOp ¶
func (m *DepartmentMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DepartmentMutation) StudentCleared ¶
func (m *DepartmentMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*DepartmentMutation) StudentIDs ¶
func (m *DepartmentMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation.
func (DepartmentMutation) Tx ¶
func (m DepartmentMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DepartmentMutation) Type ¶
func (m *DepartmentMutation) Type() string
Type returns the node type of this mutation (Department).
func (*DepartmentMutation) Where ¶
func (m *DepartmentMutation) Where(ps ...predicate.Department)
Where appends a list predicates to the DepartmentMutation builder.
func (*DepartmentMutation) WhereP ¶
func (m *DepartmentMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DepartmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DepartmentQuery ¶
type DepartmentQuery struct {
// contains filtered or unexported fields
}
DepartmentQuery is the builder for querying Department entities.
func (*DepartmentQuery) Aggregate ¶
func (dq *DepartmentQuery) Aggregate(fns ...AggregateFunc) *DepartmentSelect
Aggregate returns a DepartmentSelect configured with the given aggregations.
func (*DepartmentQuery) All ¶
func (dq *DepartmentQuery) All(ctx context.Context) ([]*Department, error)
All executes the query and returns a list of Departments.
func (*DepartmentQuery) AllX ¶
func (dq *DepartmentQuery) AllX(ctx context.Context) []*Department
AllX is like All, but panics if an error occurs.
func (*DepartmentQuery) Clone ¶
func (dq *DepartmentQuery) Clone() *DepartmentQuery
Clone returns a duplicate of the DepartmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DepartmentQuery) Count ¶
func (dq *DepartmentQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DepartmentQuery) CountX ¶
func (dq *DepartmentQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DepartmentQuery) Exist ¶
func (dq *DepartmentQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DepartmentQuery) ExistX ¶
func (dq *DepartmentQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DepartmentQuery) First ¶
func (dq *DepartmentQuery) First(ctx context.Context) (*Department, error)
First returns the first Department entity from the query. Returns a *NotFoundError when no Department was found.
func (*DepartmentQuery) FirstID ¶
func (dq *DepartmentQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Department ID from the query. Returns a *NotFoundError when no Department ID was found.
func (*DepartmentQuery) FirstIDX ¶
func (dq *DepartmentQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*DepartmentQuery) FirstX ¶
func (dq *DepartmentQuery) FirstX(ctx context.Context) *Department
FirstX is like First, but panics if an error occurs.
func (*DepartmentQuery) GroupBy ¶
func (dq *DepartmentQuery) GroupBy(field string, fields ...string) *DepartmentGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Department.Query(). GroupBy(department.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*DepartmentQuery) IDs ¶
func (dq *DepartmentQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Department IDs.
func (*DepartmentQuery) IDsX ¶
func (dq *DepartmentQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*DepartmentQuery) Limit ¶
func (dq *DepartmentQuery) Limit(limit int) *DepartmentQuery
Limit the number of records to be returned by this query.
func (*DepartmentQuery) Offset ¶
func (dq *DepartmentQuery) Offset(offset int) *DepartmentQuery
Offset to start from.
func (*DepartmentQuery) Only ¶
func (dq *DepartmentQuery) Only(ctx context.Context) (*Department, error)
Only returns a single Department entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Department entity is found. Returns a *NotFoundError when no Department entities are found.
func (*DepartmentQuery) OnlyID ¶
func (dq *DepartmentQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Department ID in the query. Returns a *NotSingularError when more than one Department ID is found. Returns a *NotFoundError when no entities are found.
func (*DepartmentQuery) OnlyIDX ¶
func (dq *DepartmentQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DepartmentQuery) OnlyX ¶
func (dq *DepartmentQuery) OnlyX(ctx context.Context) *Department
OnlyX is like Only, but panics if an error occurs.
func (*DepartmentQuery) Order ¶
func (dq *DepartmentQuery) Order(o ...OrderFunc) *DepartmentQuery
Order specifies how the records should be ordered.
func (*DepartmentQuery) QueryClass ¶
func (dq *DepartmentQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*DepartmentQuery) QueryMajor ¶
func (dq *DepartmentQuery) QueryMajor() *MajorQuery
QueryMajor chains the current query on the "major" edge.
func (*DepartmentQuery) QueryStudent ¶
func (dq *DepartmentQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*DepartmentQuery) Select ¶
func (dq *DepartmentQuery) Select(fields ...string) *DepartmentSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Department.Query(). Select(department.FieldName). Scan(ctx, &v)
func (*DepartmentQuery) Unique ¶
func (dq *DepartmentQuery) Unique(unique bool) *DepartmentQuery
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 (*DepartmentQuery) Where ¶
func (dq *DepartmentQuery) Where(ps ...predicate.Department) *DepartmentQuery
Where adds a new predicate for the DepartmentQuery builder.
func (*DepartmentQuery) WithClass ¶
func (dq *DepartmentQuery) WithClass(opts ...func(*ClassQuery)) *DepartmentQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
func (*DepartmentQuery) WithMajor ¶
func (dq *DepartmentQuery) WithMajor(opts ...func(*MajorQuery)) *DepartmentQuery
WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.
func (*DepartmentQuery) WithStudent ¶
func (dq *DepartmentQuery) WithStudent(opts ...func(*StudentQuery)) *DepartmentQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type DepartmentSelect ¶
type DepartmentSelect struct { *DepartmentQuery // contains filtered or unexported fields }
DepartmentSelect is the builder for selecting fields of Department entities.
func (*DepartmentSelect) Aggregate ¶
func (ds *DepartmentSelect) Aggregate(fns ...AggregateFunc) *DepartmentSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DepartmentSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DepartmentSelect) Scan ¶
func (ds *DepartmentSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DepartmentSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DepartmentUpdate ¶
type DepartmentUpdate struct {
// contains filtered or unexported fields
}
DepartmentUpdate is the builder for updating Department entities.
func (*DepartmentUpdate) AddClasIDs ¶
func (du *DepartmentUpdate) AddClasIDs(ids ...int) *DepartmentUpdate
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*DepartmentUpdate) AddClass ¶
func (du *DepartmentUpdate) AddClass(c ...*Class) *DepartmentUpdate
AddClass adds the "class" edges to the Class entity.
func (*DepartmentUpdate) AddMajor ¶
func (du *DepartmentUpdate) AddMajor(m ...*Major) *DepartmentUpdate
AddMajor adds the "major" edges to the Major entity.
func (*DepartmentUpdate) AddMajorIDs ¶
func (du *DepartmentUpdate) AddMajorIDs(ids ...int) *DepartmentUpdate
AddMajorIDs adds the "major" edge to the Major entity by IDs.
func (*DepartmentUpdate) AddStudent ¶
func (du *DepartmentUpdate) AddStudent(s ...*Student) *DepartmentUpdate
AddStudent adds the "student" edges to the Student entity.
func (*DepartmentUpdate) AddStudentIDs ¶
func (du *DepartmentUpdate) AddStudentIDs(ids ...int) *DepartmentUpdate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*DepartmentUpdate) ClearClass ¶
func (du *DepartmentUpdate) ClearClass() *DepartmentUpdate
ClearClass clears all "class" edges to the Class entity.
func (*DepartmentUpdate) ClearMajor ¶
func (du *DepartmentUpdate) ClearMajor() *DepartmentUpdate
ClearMajor clears all "major" edges to the Major entity.
func (*DepartmentUpdate) ClearStudent ¶
func (du *DepartmentUpdate) ClearStudent() *DepartmentUpdate
ClearStudent clears all "student" edges to the Student entity.
func (*DepartmentUpdate) Exec ¶
func (du *DepartmentUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DepartmentUpdate) ExecX ¶
func (du *DepartmentUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentUpdate) Mutation ¶
func (du *DepartmentUpdate) Mutation() *DepartmentMutation
Mutation returns the DepartmentMutation object of the builder.
func (*DepartmentUpdate) RemoveClasIDs ¶
func (du *DepartmentUpdate) RemoveClasIDs(ids ...int) *DepartmentUpdate
RemoveClasIDs removes the "class" edge to Class entities by IDs.
func (*DepartmentUpdate) RemoveClass ¶
func (du *DepartmentUpdate) RemoveClass(c ...*Class) *DepartmentUpdate
RemoveClass removes "class" edges to Class entities.
func (*DepartmentUpdate) RemoveMajor ¶
func (du *DepartmentUpdate) RemoveMajor(m ...*Major) *DepartmentUpdate
RemoveMajor removes "major" edges to Major entities.
func (*DepartmentUpdate) RemoveMajorIDs ¶
func (du *DepartmentUpdate) RemoveMajorIDs(ids ...int) *DepartmentUpdate
RemoveMajorIDs removes the "major" edge to Major entities by IDs.
func (*DepartmentUpdate) RemoveStudent ¶
func (du *DepartmentUpdate) RemoveStudent(s ...*Student) *DepartmentUpdate
RemoveStudent removes "student" edges to Student entities.
func (*DepartmentUpdate) RemoveStudentIDs ¶
func (du *DepartmentUpdate) RemoveStudentIDs(ids ...int) *DepartmentUpdate
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*DepartmentUpdate) Save ¶
func (du *DepartmentUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DepartmentUpdate) SaveX ¶
func (du *DepartmentUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DepartmentUpdate) SetCode ¶
func (du *DepartmentUpdate) SetCode(s string) *DepartmentUpdate
SetCode sets the "code" field.
func (*DepartmentUpdate) SetDescription ¶
func (du *DepartmentUpdate) SetDescription(s string) *DepartmentUpdate
SetDescription sets the "description" field.
func (*DepartmentUpdate) SetName ¶
func (du *DepartmentUpdate) SetName(s string) *DepartmentUpdate
SetName sets the "name" field.
func (*DepartmentUpdate) Where ¶
func (du *DepartmentUpdate) Where(ps ...predicate.Department) *DepartmentUpdate
Where appends a list predicates to the DepartmentUpdate builder.
type DepartmentUpdateOne ¶
type DepartmentUpdateOne struct {
// contains filtered or unexported fields
}
DepartmentUpdateOne is the builder for updating a single Department entity.
func (*DepartmentUpdateOne) AddClasIDs ¶
func (duo *DepartmentUpdateOne) AddClasIDs(ids ...int) *DepartmentUpdateOne
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*DepartmentUpdateOne) AddClass ¶
func (duo *DepartmentUpdateOne) AddClass(c ...*Class) *DepartmentUpdateOne
AddClass adds the "class" edges to the Class entity.
func (*DepartmentUpdateOne) AddMajor ¶
func (duo *DepartmentUpdateOne) AddMajor(m ...*Major) *DepartmentUpdateOne
AddMajor adds the "major" edges to the Major entity.
func (*DepartmentUpdateOne) AddMajorIDs ¶
func (duo *DepartmentUpdateOne) AddMajorIDs(ids ...int) *DepartmentUpdateOne
AddMajorIDs adds the "major" edge to the Major entity by IDs.
func (*DepartmentUpdateOne) AddStudent ¶
func (duo *DepartmentUpdateOne) AddStudent(s ...*Student) *DepartmentUpdateOne
AddStudent adds the "student" edges to the Student entity.
func (*DepartmentUpdateOne) AddStudentIDs ¶
func (duo *DepartmentUpdateOne) AddStudentIDs(ids ...int) *DepartmentUpdateOne
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*DepartmentUpdateOne) ClearClass ¶
func (duo *DepartmentUpdateOne) ClearClass() *DepartmentUpdateOne
ClearClass clears all "class" edges to the Class entity.
func (*DepartmentUpdateOne) ClearMajor ¶
func (duo *DepartmentUpdateOne) ClearMajor() *DepartmentUpdateOne
ClearMajor clears all "major" edges to the Major entity.
func (*DepartmentUpdateOne) ClearStudent ¶
func (duo *DepartmentUpdateOne) ClearStudent() *DepartmentUpdateOne
ClearStudent clears all "student" edges to the Student entity.
func (*DepartmentUpdateOne) Exec ¶
func (duo *DepartmentUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DepartmentUpdateOne) ExecX ¶
func (duo *DepartmentUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentUpdateOne) Mutation ¶
func (duo *DepartmentUpdateOne) Mutation() *DepartmentMutation
Mutation returns the DepartmentMutation object of the builder.
func (*DepartmentUpdateOne) RemoveClasIDs ¶
func (duo *DepartmentUpdateOne) RemoveClasIDs(ids ...int) *DepartmentUpdateOne
RemoveClasIDs removes the "class" edge to Class entities by IDs.
func (*DepartmentUpdateOne) RemoveClass ¶
func (duo *DepartmentUpdateOne) RemoveClass(c ...*Class) *DepartmentUpdateOne
RemoveClass removes "class" edges to Class entities.
func (*DepartmentUpdateOne) RemoveMajor ¶
func (duo *DepartmentUpdateOne) RemoveMajor(m ...*Major) *DepartmentUpdateOne
RemoveMajor removes "major" edges to Major entities.
func (*DepartmentUpdateOne) RemoveMajorIDs ¶
func (duo *DepartmentUpdateOne) RemoveMajorIDs(ids ...int) *DepartmentUpdateOne
RemoveMajorIDs removes the "major" edge to Major entities by IDs.
func (*DepartmentUpdateOne) RemoveStudent ¶
func (duo *DepartmentUpdateOne) RemoveStudent(s ...*Student) *DepartmentUpdateOne
RemoveStudent removes "student" edges to Student entities.
func (*DepartmentUpdateOne) RemoveStudentIDs ¶
func (duo *DepartmentUpdateOne) RemoveStudentIDs(ids ...int) *DepartmentUpdateOne
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*DepartmentUpdateOne) Save ¶
func (duo *DepartmentUpdateOne) Save(ctx context.Context) (*Department, error)
Save executes the query and returns the updated Department entity.
func (*DepartmentUpdateOne) SaveX ¶
func (duo *DepartmentUpdateOne) SaveX(ctx context.Context) *Department
SaveX is like Save, but panics if an error occurs.
func (*DepartmentUpdateOne) Select ¶
func (duo *DepartmentUpdateOne) Select(field string, fields ...string) *DepartmentUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DepartmentUpdateOne) SetCode ¶
func (duo *DepartmentUpdateOne) SetCode(s string) *DepartmentUpdateOne
SetCode sets the "code" field.
func (*DepartmentUpdateOne) SetDescription ¶
func (duo *DepartmentUpdateOne) SetDescription(s string) *DepartmentUpdateOne
SetDescription sets the "description" field.
func (*DepartmentUpdateOne) SetName ¶
func (duo *DepartmentUpdateOne) SetName(s string) *DepartmentUpdateOne
SetName sets the "name" field.
func (*DepartmentUpdateOne) Where ¶
func (duo *DepartmentUpdateOne) Where(ps ...predicate.Department) *DepartmentUpdateOne
Where appends a list predicates to the DepartmentUpdate builder.
type EducationLevel ¶
type EducationLevel struct { // ID of the ent. ID int `json:"id,omitempty"` // 培养层次名称 Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EducationLevelQuery when eager-loading is set. Edges EducationLevelEdges `json:"edges"` // contains filtered or unexported fields }
EducationLevel is the model entity for the EducationLevel schema.
func (*EducationLevel) QueryStudent ¶
func (el *EducationLevel) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the EducationLevel entity.
func (*EducationLevel) String ¶
func (el *EducationLevel) String() string
String implements the fmt.Stringer.
func (*EducationLevel) Unwrap ¶
func (el *EducationLevel) Unwrap() *EducationLevel
Unwrap unwraps the EducationLevel 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 (*EducationLevel) Update ¶
func (el *EducationLevel) Update() *EducationLevelUpdateOne
Update returns a builder for updating this EducationLevel. Note that you need to call EducationLevel.Unwrap() before calling this method if this EducationLevel was returned from a transaction, and the transaction was committed or rolled back.
type EducationLevelClient ¶
type EducationLevelClient struct {
// contains filtered or unexported fields
}
EducationLevelClient is a client for the EducationLevel schema.
func NewEducationLevelClient ¶
func NewEducationLevelClient(c config) *EducationLevelClient
NewEducationLevelClient returns a client for the EducationLevel from the given config.
func (*EducationLevelClient) Create ¶
func (c *EducationLevelClient) Create() *EducationLevelCreate
Create returns a builder for creating a EducationLevel entity.
func (*EducationLevelClient) CreateBulk ¶
func (c *EducationLevelClient) CreateBulk(builders ...*EducationLevelCreate) *EducationLevelCreateBulk
CreateBulk returns a builder for creating a bulk of EducationLevel entities.
func (*EducationLevelClient) Delete ¶
func (c *EducationLevelClient) Delete() *EducationLevelDelete
Delete returns a delete builder for EducationLevel.
func (*EducationLevelClient) DeleteOne ¶
func (c *EducationLevelClient) DeleteOne(el *EducationLevel) *EducationLevelDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*EducationLevelClient) DeleteOneID ¶
func (c *EducationLevelClient) DeleteOneID(id int) *EducationLevelDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*EducationLevelClient) Get ¶
func (c *EducationLevelClient) Get(ctx context.Context, id int) (*EducationLevel, error)
Get returns a EducationLevel entity by its id.
func (*EducationLevelClient) GetX ¶
func (c *EducationLevelClient) GetX(ctx context.Context, id int) *EducationLevel
GetX is like Get, but panics if an error occurs.
func (*EducationLevelClient) Hooks ¶
func (c *EducationLevelClient) Hooks() []Hook
Hooks returns the client hooks.
func (*EducationLevelClient) Intercept ¶
func (c *EducationLevelClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `educationlevel.Intercept(f(g(h())))`.
func (*EducationLevelClient) Interceptors ¶
func (c *EducationLevelClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*EducationLevelClient) Query ¶
func (c *EducationLevelClient) Query() *EducationLevelQuery
Query returns a query builder for EducationLevel.
func (*EducationLevelClient) QueryStudent ¶
func (c *EducationLevelClient) QueryStudent(el *EducationLevel) *StudentQuery
QueryStudent queries the student edge of a EducationLevel.
func (*EducationLevelClient) Update ¶
func (c *EducationLevelClient) Update() *EducationLevelUpdate
Update returns an update builder for EducationLevel.
func (*EducationLevelClient) UpdateOne ¶
func (c *EducationLevelClient) UpdateOne(el *EducationLevel) *EducationLevelUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EducationLevelClient) UpdateOneID ¶
func (c *EducationLevelClient) UpdateOneID(id int) *EducationLevelUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EducationLevelClient) Use ¶
func (c *EducationLevelClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `educationlevel.Hooks(f(g(h())))`.
type EducationLevelCreate ¶
type EducationLevelCreate struct {
// contains filtered or unexported fields
}
EducationLevelCreate is the builder for creating a EducationLevel entity.
func (*EducationLevelCreate) Exec ¶
func (elc *EducationLevelCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*EducationLevelCreate) ExecX ¶
func (elc *EducationLevelCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelCreate) Mutation ¶
func (elc *EducationLevelCreate) Mutation() *EducationLevelMutation
Mutation returns the EducationLevelMutation object of the builder.
func (*EducationLevelCreate) Save ¶
func (elc *EducationLevelCreate) Save(ctx context.Context) (*EducationLevel, error)
Save creates the EducationLevel in the database.
func (*EducationLevelCreate) SaveX ¶
func (elc *EducationLevelCreate) SaveX(ctx context.Context) *EducationLevel
SaveX calls Save and panics if Save returns an error.
func (*EducationLevelCreate) SetName ¶
func (elc *EducationLevelCreate) SetName(s string) *EducationLevelCreate
SetName sets the "name" field.
func (*EducationLevelCreate) SetNillableStudentID ¶
func (elc *EducationLevelCreate) SetNillableStudentID(id *int) *EducationLevelCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EducationLevelCreate) SetStudent ¶
func (elc *EducationLevelCreate) SetStudent(s *Student) *EducationLevelCreate
SetStudent sets the "student" edge to the Student entity.
func (*EducationLevelCreate) SetStudentID ¶
func (elc *EducationLevelCreate) SetStudentID(id int) *EducationLevelCreate
SetStudentID sets the "student" edge to the Student entity by ID.
type EducationLevelCreateBulk ¶
type EducationLevelCreateBulk struct {
// contains filtered or unexported fields
}
EducationLevelCreateBulk is the builder for creating many EducationLevel entities in bulk.
func (*EducationLevelCreateBulk) Exec ¶
func (elcb *EducationLevelCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EducationLevelCreateBulk) ExecX ¶
func (elcb *EducationLevelCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelCreateBulk) Save ¶
func (elcb *EducationLevelCreateBulk) Save(ctx context.Context) ([]*EducationLevel, error)
Save creates the EducationLevel entities in the database.
func (*EducationLevelCreateBulk) SaveX ¶
func (elcb *EducationLevelCreateBulk) SaveX(ctx context.Context) []*EducationLevel
SaveX is like Save, but panics if an error occurs.
type EducationLevelDelete ¶
type EducationLevelDelete struct {
// contains filtered or unexported fields
}
EducationLevelDelete is the builder for deleting a EducationLevel entity.
func (*EducationLevelDelete) Exec ¶
func (eld *EducationLevelDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EducationLevelDelete) ExecX ¶
func (eld *EducationLevelDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelDelete) Where ¶
func (eld *EducationLevelDelete) Where(ps ...predicate.EducationLevel) *EducationLevelDelete
Where appends a list predicates to the EducationLevelDelete builder.
type EducationLevelDeleteOne ¶
type EducationLevelDeleteOne struct {
// contains filtered or unexported fields
}
EducationLevelDeleteOne is the builder for deleting a single EducationLevel entity.
func (*EducationLevelDeleteOne) Exec ¶
func (eldo *EducationLevelDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EducationLevelDeleteOne) ExecX ¶
func (eldo *EducationLevelDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelDeleteOne) Where ¶
func (eldo *EducationLevelDeleteOne) Where(ps ...predicate.EducationLevel) *EducationLevelDeleteOne
Where appends a list predicates to the EducationLevelDelete builder.
type EducationLevelEdges ¶
type EducationLevelEdges struct { // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
EducationLevelEdges holds the relations/edges for other nodes in the graph.
func (EducationLevelEdges) StudentOrErr ¶
func (e EducationLevelEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type EducationLevelGroupBy ¶
type EducationLevelGroupBy struct {
// contains filtered or unexported fields
}
EducationLevelGroupBy is the group-by builder for EducationLevel entities.
func (*EducationLevelGroupBy) Aggregate ¶
func (elgb *EducationLevelGroupBy) Aggregate(fns ...AggregateFunc) *EducationLevelGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EducationLevelGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*EducationLevelGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EducationLevelGroupBy) Scan ¶
func (elgb *EducationLevelGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EducationLevelGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EducationLevelMutation ¶
type EducationLevelMutation struct {
// contains filtered or unexported fields
}
EducationLevelMutation represents an operation that mutates the EducationLevel nodes in the graph.
func (*EducationLevelMutation) AddField ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) AddedEdges ¶
func (m *EducationLevelMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EducationLevelMutation) AddedField ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) AddedFields ¶
func (m *EducationLevelMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*EducationLevelMutation) AddedIDs ¶
func (m *EducationLevelMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*EducationLevelMutation) ClearEdge ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ClearField ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ClearStudent ¶
func (m *EducationLevelMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*EducationLevelMutation) ClearedEdges ¶
func (m *EducationLevelMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EducationLevelMutation) ClearedFields ¶
func (m *EducationLevelMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EducationLevelMutation) Client ¶
func (m EducationLevelMutation) 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 (*EducationLevelMutation) EdgeCleared ¶
func (m *EducationLevelMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*EducationLevelMutation) Field ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) FieldCleared ¶
func (m *EducationLevelMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*EducationLevelMutation) Fields ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ID ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) IDs ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) Name ¶
func (m *EducationLevelMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*EducationLevelMutation) 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 (*EducationLevelMutation) OldName ¶
func (m *EducationLevelMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the EducationLevel entity. If the EducationLevel 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 (*EducationLevelMutation) Op ¶
func (m *EducationLevelMutation) Op() Op
Op returns the operation name.
func (*EducationLevelMutation) RemovedEdges ¶
func (m *EducationLevelMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EducationLevelMutation) RemovedIDs ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetEdge ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetField ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetName ¶
func (m *EducationLevelMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*EducationLevelMutation) ResetStudent ¶
func (m *EducationLevelMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*EducationLevelMutation) SetField ¶
func (m *EducationLevelMutation) 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 (*EducationLevelMutation) SetName ¶
func (m *EducationLevelMutation) SetName(s string)
SetName sets the "name" field.
func (*EducationLevelMutation) SetOp ¶
func (m *EducationLevelMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*EducationLevelMutation) SetStudentID ¶
func (m *EducationLevelMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*EducationLevelMutation) StudentCleared ¶
func (m *EducationLevelMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*EducationLevelMutation) StudentID ¶
func (m *EducationLevelMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*EducationLevelMutation) StudentIDs ¶
func (m *EducationLevelMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (EducationLevelMutation) Tx ¶
func (m EducationLevelMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EducationLevelMutation) Type ¶
func (m *EducationLevelMutation) Type() string
Type returns the node type of this mutation (EducationLevel).
func (*EducationLevelMutation) Where ¶
func (m *EducationLevelMutation) Where(ps ...predicate.EducationLevel)
Where appends a list predicates to the EducationLevelMutation builder.
func (*EducationLevelMutation) WhereP ¶
func (m *EducationLevelMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the EducationLevelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type EducationLevelQuery ¶
type EducationLevelQuery struct {
// contains filtered or unexported fields
}
EducationLevelQuery is the builder for querying EducationLevel entities.
func (*EducationLevelQuery) Aggregate ¶
func (elq *EducationLevelQuery) Aggregate(fns ...AggregateFunc) *EducationLevelSelect
Aggregate returns a EducationLevelSelect configured with the given aggregations.
func (*EducationLevelQuery) All ¶
func (elq *EducationLevelQuery) All(ctx context.Context) ([]*EducationLevel, error)
All executes the query and returns a list of EducationLevels.
func (*EducationLevelQuery) AllX ¶
func (elq *EducationLevelQuery) AllX(ctx context.Context) []*EducationLevel
AllX is like All, but panics if an error occurs.
func (*EducationLevelQuery) Clone ¶
func (elq *EducationLevelQuery) Clone() *EducationLevelQuery
Clone returns a duplicate of the EducationLevelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EducationLevelQuery) Count ¶
func (elq *EducationLevelQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EducationLevelQuery) CountX ¶
func (elq *EducationLevelQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EducationLevelQuery) Exist ¶
func (elq *EducationLevelQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EducationLevelQuery) ExistX ¶
func (elq *EducationLevelQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EducationLevelQuery) First ¶
func (elq *EducationLevelQuery) First(ctx context.Context) (*EducationLevel, error)
First returns the first EducationLevel entity from the query. Returns a *NotFoundError when no EducationLevel was found.
func (*EducationLevelQuery) FirstID ¶
func (elq *EducationLevelQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first EducationLevel ID from the query. Returns a *NotFoundError when no EducationLevel ID was found.
func (*EducationLevelQuery) FirstIDX ¶
func (elq *EducationLevelQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*EducationLevelQuery) FirstX ¶
func (elq *EducationLevelQuery) FirstX(ctx context.Context) *EducationLevel
FirstX is like First, but panics if an error occurs.
func (*EducationLevelQuery) GroupBy ¶
func (elq *EducationLevelQuery) GroupBy(field string, fields ...string) *EducationLevelGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.EducationLevel.Query(). GroupBy(educationlevel.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*EducationLevelQuery) IDs ¶
func (elq *EducationLevelQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of EducationLevel IDs.
func (*EducationLevelQuery) IDsX ¶
func (elq *EducationLevelQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*EducationLevelQuery) Limit ¶
func (elq *EducationLevelQuery) Limit(limit int) *EducationLevelQuery
Limit the number of records to be returned by this query.
func (*EducationLevelQuery) Offset ¶
func (elq *EducationLevelQuery) Offset(offset int) *EducationLevelQuery
Offset to start from.
func (*EducationLevelQuery) Only ¶
func (elq *EducationLevelQuery) Only(ctx context.Context) (*EducationLevel, error)
Only returns a single EducationLevel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EducationLevel entity is found. Returns a *NotFoundError when no EducationLevel entities are found.
func (*EducationLevelQuery) OnlyID ¶
func (elq *EducationLevelQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only EducationLevel ID in the query. Returns a *NotSingularError when more than one EducationLevel ID is found. Returns a *NotFoundError when no entities are found.
func (*EducationLevelQuery) OnlyIDX ¶
func (elq *EducationLevelQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EducationLevelQuery) OnlyX ¶
func (elq *EducationLevelQuery) OnlyX(ctx context.Context) *EducationLevel
OnlyX is like Only, but panics if an error occurs.
func (*EducationLevelQuery) Order ¶
func (elq *EducationLevelQuery) Order(o ...OrderFunc) *EducationLevelQuery
Order specifies how the records should be ordered.
func (*EducationLevelQuery) QueryStudent ¶
func (elq *EducationLevelQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*EducationLevelQuery) Select ¶
func (elq *EducationLevelQuery) Select(fields ...string) *EducationLevelSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.EducationLevel.Query(). Select(educationlevel.FieldName). Scan(ctx, &v)
func (*EducationLevelQuery) Unique ¶
func (elq *EducationLevelQuery) Unique(unique bool) *EducationLevelQuery
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 (*EducationLevelQuery) Where ¶
func (elq *EducationLevelQuery) Where(ps ...predicate.EducationLevel) *EducationLevelQuery
Where adds a new predicate for the EducationLevelQuery builder.
func (*EducationLevelQuery) WithStudent ¶
func (elq *EducationLevelQuery) WithStudent(opts ...func(*StudentQuery)) *EducationLevelQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type EducationLevelSelect ¶
type EducationLevelSelect struct { *EducationLevelQuery // contains filtered or unexported fields }
EducationLevelSelect is the builder for selecting fields of EducationLevel entities.
func (*EducationLevelSelect) Aggregate ¶
func (els *EducationLevelSelect) Aggregate(fns ...AggregateFunc) *EducationLevelSelect
Aggregate adds the given aggregation functions to the selector query.
func (*EducationLevelSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EducationLevelSelect) Scan ¶
func (els *EducationLevelSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EducationLevelSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EducationLevelUpdate ¶
type EducationLevelUpdate struct {
// contains filtered or unexported fields
}
EducationLevelUpdate is the builder for updating EducationLevel entities.
func (*EducationLevelUpdate) ClearStudent ¶
func (elu *EducationLevelUpdate) ClearStudent() *EducationLevelUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*EducationLevelUpdate) Exec ¶
func (elu *EducationLevelUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EducationLevelUpdate) ExecX ¶
func (elu *EducationLevelUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelUpdate) Mutation ¶
func (elu *EducationLevelUpdate) Mutation() *EducationLevelMutation
Mutation returns the EducationLevelMutation object of the builder.
func (*EducationLevelUpdate) Save ¶
func (elu *EducationLevelUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EducationLevelUpdate) SaveX ¶
func (elu *EducationLevelUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EducationLevelUpdate) SetName ¶
func (elu *EducationLevelUpdate) SetName(s string) *EducationLevelUpdate
SetName sets the "name" field.
func (*EducationLevelUpdate) SetNillableStudentID ¶
func (elu *EducationLevelUpdate) SetNillableStudentID(id *int) *EducationLevelUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EducationLevelUpdate) SetStudent ¶
func (elu *EducationLevelUpdate) SetStudent(s *Student) *EducationLevelUpdate
SetStudent sets the "student" edge to the Student entity.
func (*EducationLevelUpdate) SetStudentID ¶
func (elu *EducationLevelUpdate) SetStudentID(id int) *EducationLevelUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*EducationLevelUpdate) Where ¶
func (elu *EducationLevelUpdate) Where(ps ...predicate.EducationLevel) *EducationLevelUpdate
Where appends a list predicates to the EducationLevelUpdate builder.
type EducationLevelUpdateOne ¶
type EducationLevelUpdateOne struct {
// contains filtered or unexported fields
}
EducationLevelUpdateOne is the builder for updating a single EducationLevel entity.
func (*EducationLevelUpdateOne) ClearStudent ¶
func (eluo *EducationLevelUpdateOne) ClearStudent() *EducationLevelUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*EducationLevelUpdateOne) Exec ¶
func (eluo *EducationLevelUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EducationLevelUpdateOne) ExecX ¶
func (eluo *EducationLevelUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EducationLevelUpdateOne) Mutation ¶
func (eluo *EducationLevelUpdateOne) Mutation() *EducationLevelMutation
Mutation returns the EducationLevelMutation object of the builder.
func (*EducationLevelUpdateOne) Save ¶
func (eluo *EducationLevelUpdateOne) Save(ctx context.Context) (*EducationLevel, error)
Save executes the query and returns the updated EducationLevel entity.
func (*EducationLevelUpdateOne) SaveX ¶
func (eluo *EducationLevelUpdateOne) SaveX(ctx context.Context) *EducationLevel
SaveX is like Save, but panics if an error occurs.
func (*EducationLevelUpdateOne) Select ¶
func (eluo *EducationLevelUpdateOne) Select(field string, fields ...string) *EducationLevelUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*EducationLevelUpdateOne) SetName ¶
func (eluo *EducationLevelUpdateOne) SetName(s string) *EducationLevelUpdateOne
SetName sets the "name" field.
func (*EducationLevelUpdateOne) SetNillableStudentID ¶
func (eluo *EducationLevelUpdateOne) SetNillableStudentID(id *int) *EducationLevelUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EducationLevelUpdateOne) SetStudent ¶
func (eluo *EducationLevelUpdateOne) SetStudent(s *Student) *EducationLevelUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*EducationLevelUpdateOne) SetStudentID ¶
func (eluo *EducationLevelUpdateOne) SetStudentID(id int) *EducationLevelUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*EducationLevelUpdateOne) Where ¶
func (eluo *EducationLevelUpdateOne) Where(ps ...predicate.EducationLevel) *EducationLevelUpdateOne
Where appends a list predicates to the EducationLevelUpdate builder.
type EducationLevels ¶
type EducationLevels []*EducationLevel
EducationLevels is a parsable slice of EducationLevel.
type EnrollmentStatus ¶
type EnrollmentStatus struct { // ID of the ent. ID int `json:"id,omitempty"` // 学籍状态名称 Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EnrollmentStatusQuery when eager-loading is set. Edges EnrollmentStatusEdges `json:"edges"` // contains filtered or unexported fields }
EnrollmentStatus is the model entity for the EnrollmentStatus schema.
func (*EnrollmentStatus) QueryStudent ¶
func (es *EnrollmentStatus) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the EnrollmentStatus entity.
func (*EnrollmentStatus) String ¶
func (es *EnrollmentStatus) String() string
String implements the fmt.Stringer.
func (*EnrollmentStatus) Unwrap ¶
func (es *EnrollmentStatus) Unwrap() *EnrollmentStatus
Unwrap unwraps the EnrollmentStatus 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 (*EnrollmentStatus) Update ¶
func (es *EnrollmentStatus) Update() *EnrollmentStatusUpdateOne
Update returns a builder for updating this EnrollmentStatus. Note that you need to call EnrollmentStatus.Unwrap() before calling this method if this EnrollmentStatus was returned from a transaction, and the transaction was committed or rolled back.
type EnrollmentStatusClient ¶
type EnrollmentStatusClient struct {
// contains filtered or unexported fields
}
EnrollmentStatusClient is a client for the EnrollmentStatus schema.
func NewEnrollmentStatusClient ¶
func NewEnrollmentStatusClient(c config) *EnrollmentStatusClient
NewEnrollmentStatusClient returns a client for the EnrollmentStatus from the given config.
func (*EnrollmentStatusClient) Create ¶
func (c *EnrollmentStatusClient) Create() *EnrollmentStatusCreate
Create returns a builder for creating a EnrollmentStatus entity.
func (*EnrollmentStatusClient) CreateBulk ¶
func (c *EnrollmentStatusClient) CreateBulk(builders ...*EnrollmentStatusCreate) *EnrollmentStatusCreateBulk
CreateBulk returns a builder for creating a bulk of EnrollmentStatus entities.
func (*EnrollmentStatusClient) Delete ¶
func (c *EnrollmentStatusClient) Delete() *EnrollmentStatusDelete
Delete returns a delete builder for EnrollmentStatus.
func (*EnrollmentStatusClient) DeleteOne ¶
func (c *EnrollmentStatusClient) DeleteOne(es *EnrollmentStatus) *EnrollmentStatusDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*EnrollmentStatusClient) DeleteOneID ¶
func (c *EnrollmentStatusClient) DeleteOneID(id int) *EnrollmentStatusDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*EnrollmentStatusClient) Get ¶
func (c *EnrollmentStatusClient) Get(ctx context.Context, id int) (*EnrollmentStatus, error)
Get returns a EnrollmentStatus entity by its id.
func (*EnrollmentStatusClient) GetX ¶
func (c *EnrollmentStatusClient) GetX(ctx context.Context, id int) *EnrollmentStatus
GetX is like Get, but panics if an error occurs.
func (*EnrollmentStatusClient) Hooks ¶
func (c *EnrollmentStatusClient) Hooks() []Hook
Hooks returns the client hooks.
func (*EnrollmentStatusClient) Intercept ¶
func (c *EnrollmentStatusClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `enrollmentstatus.Intercept(f(g(h())))`.
func (*EnrollmentStatusClient) Interceptors ¶
func (c *EnrollmentStatusClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*EnrollmentStatusClient) Query ¶
func (c *EnrollmentStatusClient) Query() *EnrollmentStatusQuery
Query returns a query builder for EnrollmentStatus.
func (*EnrollmentStatusClient) QueryStudent ¶
func (c *EnrollmentStatusClient) QueryStudent(es *EnrollmentStatus) *StudentQuery
QueryStudent queries the student edge of a EnrollmentStatus.
func (*EnrollmentStatusClient) Update ¶
func (c *EnrollmentStatusClient) Update() *EnrollmentStatusUpdate
Update returns an update builder for EnrollmentStatus.
func (*EnrollmentStatusClient) UpdateOne ¶
func (c *EnrollmentStatusClient) UpdateOne(es *EnrollmentStatus) *EnrollmentStatusUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EnrollmentStatusClient) UpdateOneID ¶
func (c *EnrollmentStatusClient) UpdateOneID(id int) *EnrollmentStatusUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EnrollmentStatusClient) Use ¶
func (c *EnrollmentStatusClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `enrollmentstatus.Hooks(f(g(h())))`.
type EnrollmentStatusCreate ¶
type EnrollmentStatusCreate struct {
// contains filtered or unexported fields
}
EnrollmentStatusCreate is the builder for creating a EnrollmentStatus entity.
func (*EnrollmentStatusCreate) Exec ¶
func (esc *EnrollmentStatusCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*EnrollmentStatusCreate) ExecX ¶
func (esc *EnrollmentStatusCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusCreate) Mutation ¶
func (esc *EnrollmentStatusCreate) Mutation() *EnrollmentStatusMutation
Mutation returns the EnrollmentStatusMutation object of the builder.
func (*EnrollmentStatusCreate) Save ¶
func (esc *EnrollmentStatusCreate) Save(ctx context.Context) (*EnrollmentStatus, error)
Save creates the EnrollmentStatus in the database.
func (*EnrollmentStatusCreate) SaveX ¶
func (esc *EnrollmentStatusCreate) SaveX(ctx context.Context) *EnrollmentStatus
SaveX calls Save and panics if Save returns an error.
func (*EnrollmentStatusCreate) SetName ¶
func (esc *EnrollmentStatusCreate) SetName(s string) *EnrollmentStatusCreate
SetName sets the "name" field.
func (*EnrollmentStatusCreate) SetNillableStudentID ¶
func (esc *EnrollmentStatusCreate) SetNillableStudentID(id *int) *EnrollmentStatusCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EnrollmentStatusCreate) SetStudent ¶
func (esc *EnrollmentStatusCreate) SetStudent(s *Student) *EnrollmentStatusCreate
SetStudent sets the "student" edge to the Student entity.
func (*EnrollmentStatusCreate) SetStudentID ¶
func (esc *EnrollmentStatusCreate) SetStudentID(id int) *EnrollmentStatusCreate
SetStudentID sets the "student" edge to the Student entity by ID.
type EnrollmentStatusCreateBulk ¶
type EnrollmentStatusCreateBulk struct {
// contains filtered or unexported fields
}
EnrollmentStatusCreateBulk is the builder for creating many EnrollmentStatus entities in bulk.
func (*EnrollmentStatusCreateBulk) Exec ¶
func (escb *EnrollmentStatusCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EnrollmentStatusCreateBulk) ExecX ¶
func (escb *EnrollmentStatusCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusCreateBulk) Save ¶
func (escb *EnrollmentStatusCreateBulk) Save(ctx context.Context) ([]*EnrollmentStatus, error)
Save creates the EnrollmentStatus entities in the database.
func (*EnrollmentStatusCreateBulk) SaveX ¶
func (escb *EnrollmentStatusCreateBulk) SaveX(ctx context.Context) []*EnrollmentStatus
SaveX is like Save, but panics if an error occurs.
type EnrollmentStatusDelete ¶
type EnrollmentStatusDelete struct {
// contains filtered or unexported fields
}
EnrollmentStatusDelete is the builder for deleting a EnrollmentStatus entity.
func (*EnrollmentStatusDelete) Exec ¶
func (esd *EnrollmentStatusDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EnrollmentStatusDelete) ExecX ¶
func (esd *EnrollmentStatusDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusDelete) Where ¶
func (esd *EnrollmentStatusDelete) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusDelete
Where appends a list predicates to the EnrollmentStatusDelete builder.
type EnrollmentStatusDeleteOne ¶
type EnrollmentStatusDeleteOne struct {
// contains filtered or unexported fields
}
EnrollmentStatusDeleteOne is the builder for deleting a single EnrollmentStatus entity.
func (*EnrollmentStatusDeleteOne) Exec ¶
func (esdo *EnrollmentStatusDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EnrollmentStatusDeleteOne) ExecX ¶
func (esdo *EnrollmentStatusDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusDeleteOne) Where ¶
func (esdo *EnrollmentStatusDeleteOne) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusDeleteOne
Where appends a list predicates to the EnrollmentStatusDelete builder.
type EnrollmentStatusEdges ¶
type EnrollmentStatusEdges struct { // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
EnrollmentStatusEdges holds the relations/edges for other nodes in the graph.
func (EnrollmentStatusEdges) StudentOrErr ¶
func (e EnrollmentStatusEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type EnrollmentStatusGroupBy ¶
type EnrollmentStatusGroupBy struct {
// contains filtered or unexported fields
}
EnrollmentStatusGroupBy is the group-by builder for EnrollmentStatus entities.
func (*EnrollmentStatusGroupBy) Aggregate ¶
func (esgb *EnrollmentStatusGroupBy) Aggregate(fns ...AggregateFunc) *EnrollmentStatusGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EnrollmentStatusGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*EnrollmentStatusGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusGroupBy) Scan ¶
func (esgb *EnrollmentStatusGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EnrollmentStatusGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EnrollmentStatusMutation ¶
type EnrollmentStatusMutation struct {
// contains filtered or unexported fields
}
EnrollmentStatusMutation represents an operation that mutates the EnrollmentStatus nodes in the graph.
func (*EnrollmentStatusMutation) AddField ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) AddedEdges ¶
func (m *EnrollmentStatusMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EnrollmentStatusMutation) AddedField ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) AddedFields ¶
func (m *EnrollmentStatusMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*EnrollmentStatusMutation) AddedIDs ¶
func (m *EnrollmentStatusMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*EnrollmentStatusMutation) ClearEdge ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ClearField ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ClearStudent ¶
func (m *EnrollmentStatusMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*EnrollmentStatusMutation) ClearedEdges ¶
func (m *EnrollmentStatusMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EnrollmentStatusMutation) ClearedFields ¶
func (m *EnrollmentStatusMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EnrollmentStatusMutation) Client ¶
func (m EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) EdgeCleared ¶
func (m *EnrollmentStatusMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*EnrollmentStatusMutation) Field ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) FieldCleared ¶
func (m *EnrollmentStatusMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*EnrollmentStatusMutation) Fields ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ID ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) IDs ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) Name ¶
func (m *EnrollmentStatusMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) OldName ¶
func (m *EnrollmentStatusMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the EnrollmentStatus entity. If the EnrollmentStatus 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 (*EnrollmentStatusMutation) Op ¶
func (m *EnrollmentStatusMutation) Op() Op
Op returns the operation name.
func (*EnrollmentStatusMutation) RemovedEdges ¶
func (m *EnrollmentStatusMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EnrollmentStatusMutation) RemovedIDs ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetEdge ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetField ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetName ¶
func (m *EnrollmentStatusMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*EnrollmentStatusMutation) ResetStudent ¶
func (m *EnrollmentStatusMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*EnrollmentStatusMutation) SetField ¶
func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) SetName ¶
func (m *EnrollmentStatusMutation) SetName(s string)
SetName sets the "name" field.
func (*EnrollmentStatusMutation) SetOp ¶
func (m *EnrollmentStatusMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*EnrollmentStatusMutation) SetStudentID ¶
func (m *EnrollmentStatusMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*EnrollmentStatusMutation) StudentCleared ¶
func (m *EnrollmentStatusMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*EnrollmentStatusMutation) StudentID ¶
func (m *EnrollmentStatusMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*EnrollmentStatusMutation) StudentIDs ¶
func (m *EnrollmentStatusMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (EnrollmentStatusMutation) Tx ¶
func (m EnrollmentStatusMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EnrollmentStatusMutation) Type ¶
func (m *EnrollmentStatusMutation) Type() string
Type returns the node type of this mutation (EnrollmentStatus).
func (*EnrollmentStatusMutation) Where ¶
func (m *EnrollmentStatusMutation) Where(ps ...predicate.EnrollmentStatus)
Where appends a list predicates to the EnrollmentStatusMutation builder.
func (*EnrollmentStatusMutation) WhereP ¶
func (m *EnrollmentStatusMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the EnrollmentStatusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type EnrollmentStatusQuery ¶
type EnrollmentStatusQuery struct {
// contains filtered or unexported fields
}
EnrollmentStatusQuery is the builder for querying EnrollmentStatus entities.
func (*EnrollmentStatusQuery) Aggregate ¶
func (esq *EnrollmentStatusQuery) Aggregate(fns ...AggregateFunc) *EnrollmentStatusSelect
Aggregate returns a EnrollmentStatusSelect configured with the given aggregations.
func (*EnrollmentStatusQuery) All ¶
func (esq *EnrollmentStatusQuery) All(ctx context.Context) ([]*EnrollmentStatus, error)
All executes the query and returns a list of EnrollmentStatusSlice.
func (*EnrollmentStatusQuery) AllX ¶
func (esq *EnrollmentStatusQuery) AllX(ctx context.Context) []*EnrollmentStatus
AllX is like All, but panics if an error occurs.
func (*EnrollmentStatusQuery) Clone ¶
func (esq *EnrollmentStatusQuery) Clone() *EnrollmentStatusQuery
Clone returns a duplicate of the EnrollmentStatusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EnrollmentStatusQuery) Count ¶
func (esq *EnrollmentStatusQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EnrollmentStatusQuery) CountX ¶
func (esq *EnrollmentStatusQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EnrollmentStatusQuery) Exist ¶
func (esq *EnrollmentStatusQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EnrollmentStatusQuery) ExistX ¶
func (esq *EnrollmentStatusQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EnrollmentStatusQuery) First ¶
func (esq *EnrollmentStatusQuery) First(ctx context.Context) (*EnrollmentStatus, error)
First returns the first EnrollmentStatus entity from the query. Returns a *NotFoundError when no EnrollmentStatus was found.
func (*EnrollmentStatusQuery) FirstID ¶
func (esq *EnrollmentStatusQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first EnrollmentStatus ID from the query. Returns a *NotFoundError when no EnrollmentStatus ID was found.
func (*EnrollmentStatusQuery) FirstIDX ¶
func (esq *EnrollmentStatusQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*EnrollmentStatusQuery) FirstX ¶
func (esq *EnrollmentStatusQuery) FirstX(ctx context.Context) *EnrollmentStatus
FirstX is like First, but panics if an error occurs.
func (*EnrollmentStatusQuery) GroupBy ¶
func (esq *EnrollmentStatusQuery) GroupBy(field string, fields ...string) *EnrollmentStatusGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.EnrollmentStatus.Query(). GroupBy(enrollmentstatus.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*EnrollmentStatusQuery) IDs ¶
func (esq *EnrollmentStatusQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of EnrollmentStatus IDs.
func (*EnrollmentStatusQuery) IDsX ¶
func (esq *EnrollmentStatusQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*EnrollmentStatusQuery) Limit ¶
func (esq *EnrollmentStatusQuery) Limit(limit int) *EnrollmentStatusQuery
Limit the number of records to be returned by this query.
func (*EnrollmentStatusQuery) Offset ¶
func (esq *EnrollmentStatusQuery) Offset(offset int) *EnrollmentStatusQuery
Offset to start from.
func (*EnrollmentStatusQuery) Only ¶
func (esq *EnrollmentStatusQuery) Only(ctx context.Context) (*EnrollmentStatus, error)
Only returns a single EnrollmentStatus entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EnrollmentStatus entity is found. Returns a *NotFoundError when no EnrollmentStatus entities are found.
func (*EnrollmentStatusQuery) OnlyID ¶
func (esq *EnrollmentStatusQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only EnrollmentStatus ID in the query. Returns a *NotSingularError when more than one EnrollmentStatus ID is found. Returns a *NotFoundError when no entities are found.
func (*EnrollmentStatusQuery) OnlyIDX ¶
func (esq *EnrollmentStatusQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EnrollmentStatusQuery) OnlyX ¶
func (esq *EnrollmentStatusQuery) OnlyX(ctx context.Context) *EnrollmentStatus
OnlyX is like Only, but panics if an error occurs.
func (*EnrollmentStatusQuery) Order ¶
func (esq *EnrollmentStatusQuery) Order(o ...OrderFunc) *EnrollmentStatusQuery
Order specifies how the records should be ordered.
func (*EnrollmentStatusQuery) QueryStudent ¶
func (esq *EnrollmentStatusQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*EnrollmentStatusQuery) Select ¶
func (esq *EnrollmentStatusQuery) Select(fields ...string) *EnrollmentStatusSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.EnrollmentStatus.Query(). Select(enrollmentstatus.FieldName). Scan(ctx, &v)
func (*EnrollmentStatusQuery) Unique ¶
func (esq *EnrollmentStatusQuery) Unique(unique bool) *EnrollmentStatusQuery
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 (*EnrollmentStatusQuery) Where ¶
func (esq *EnrollmentStatusQuery) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusQuery
Where adds a new predicate for the EnrollmentStatusQuery builder.
func (*EnrollmentStatusQuery) WithStudent ¶
func (esq *EnrollmentStatusQuery) WithStudent(opts ...func(*StudentQuery)) *EnrollmentStatusQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type EnrollmentStatusSelect ¶
type EnrollmentStatusSelect struct { *EnrollmentStatusQuery // contains filtered or unexported fields }
EnrollmentStatusSelect is the builder for selecting fields of EnrollmentStatus entities.
func (*EnrollmentStatusSelect) Aggregate ¶
func (ess *EnrollmentStatusSelect) Aggregate(fns ...AggregateFunc) *EnrollmentStatusSelect
Aggregate adds the given aggregation functions to the selector query.
func (*EnrollmentStatusSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*EnrollmentStatusSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EnrollmentStatusSelect) Scan ¶
func (ess *EnrollmentStatusSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EnrollmentStatusSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EnrollmentStatusSlice ¶
type EnrollmentStatusSlice []*EnrollmentStatus
EnrollmentStatusSlice is a parsable slice of EnrollmentStatus.
type EnrollmentStatusUpdate ¶
type EnrollmentStatusUpdate struct {
// contains filtered or unexported fields
}
EnrollmentStatusUpdate is the builder for updating EnrollmentStatus entities.
func (*EnrollmentStatusUpdate) ClearStudent ¶
func (esu *EnrollmentStatusUpdate) ClearStudent() *EnrollmentStatusUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*EnrollmentStatusUpdate) Exec ¶
func (esu *EnrollmentStatusUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EnrollmentStatusUpdate) ExecX ¶
func (esu *EnrollmentStatusUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusUpdate) Mutation ¶
func (esu *EnrollmentStatusUpdate) Mutation() *EnrollmentStatusMutation
Mutation returns the EnrollmentStatusMutation object of the builder.
func (*EnrollmentStatusUpdate) Save ¶
func (esu *EnrollmentStatusUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EnrollmentStatusUpdate) SaveX ¶
func (esu *EnrollmentStatusUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EnrollmentStatusUpdate) SetName ¶
func (esu *EnrollmentStatusUpdate) SetName(s string) *EnrollmentStatusUpdate
SetName sets the "name" field.
func (*EnrollmentStatusUpdate) SetNillableStudentID ¶
func (esu *EnrollmentStatusUpdate) SetNillableStudentID(id *int) *EnrollmentStatusUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EnrollmentStatusUpdate) SetStudent ¶
func (esu *EnrollmentStatusUpdate) SetStudent(s *Student) *EnrollmentStatusUpdate
SetStudent sets the "student" edge to the Student entity.
func (*EnrollmentStatusUpdate) SetStudentID ¶
func (esu *EnrollmentStatusUpdate) SetStudentID(id int) *EnrollmentStatusUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*EnrollmentStatusUpdate) Where ¶
func (esu *EnrollmentStatusUpdate) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusUpdate
Where appends a list predicates to the EnrollmentStatusUpdate builder.
type EnrollmentStatusUpdateOne ¶
type EnrollmentStatusUpdateOne struct {
// contains filtered or unexported fields
}
EnrollmentStatusUpdateOne is the builder for updating a single EnrollmentStatus entity.
func (*EnrollmentStatusUpdateOne) ClearStudent ¶
func (esuo *EnrollmentStatusUpdateOne) ClearStudent() *EnrollmentStatusUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*EnrollmentStatusUpdateOne) Exec ¶
func (esuo *EnrollmentStatusUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EnrollmentStatusUpdateOne) ExecX ¶
func (esuo *EnrollmentStatusUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EnrollmentStatusUpdateOne) Mutation ¶
func (esuo *EnrollmentStatusUpdateOne) Mutation() *EnrollmentStatusMutation
Mutation returns the EnrollmentStatusMutation object of the builder.
func (*EnrollmentStatusUpdateOne) Save ¶
func (esuo *EnrollmentStatusUpdateOne) Save(ctx context.Context) (*EnrollmentStatus, error)
Save executes the query and returns the updated EnrollmentStatus entity.
func (*EnrollmentStatusUpdateOne) SaveX ¶
func (esuo *EnrollmentStatusUpdateOne) SaveX(ctx context.Context) *EnrollmentStatus
SaveX is like Save, but panics if an error occurs.
func (*EnrollmentStatusUpdateOne) Select ¶
func (esuo *EnrollmentStatusUpdateOne) Select(field string, fields ...string) *EnrollmentStatusUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*EnrollmentStatusUpdateOne) SetName ¶
func (esuo *EnrollmentStatusUpdateOne) SetName(s string) *EnrollmentStatusUpdateOne
SetName sets the "name" field.
func (*EnrollmentStatusUpdateOne) SetNillableStudentID ¶
func (esuo *EnrollmentStatusUpdateOne) SetNillableStudentID(id *int) *EnrollmentStatusUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*EnrollmentStatusUpdateOne) SetStudent ¶
func (esuo *EnrollmentStatusUpdateOne) SetStudent(s *Student) *EnrollmentStatusUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*EnrollmentStatusUpdateOne) SetStudentID ¶
func (esuo *EnrollmentStatusUpdateOne) SetStudentID(id int) *EnrollmentStatusUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*EnrollmentStatusUpdateOne) Where ¶
func (esuo *EnrollmentStatusUpdateOne) Where(ps ...predicate.EnrollmentStatus) *EnrollmentStatusUpdateOne
Where appends a list predicates to the EnrollmentStatusUpdate builder.
type FamilyInfo ¶
type FamilyInfo struct { // ID of the ent. ID int `json:"id,omitempty"` // 家庭成员姓名 Name string `json:"name,omitempty"` // 与学生关系 Relationship string `json:"relationship,omitempty"` // 身份证号 IDCard string `json:"id_card,omitempty"` // 年龄 Age string `json:"age,omitempty"` // 职业 Occupation string `json:"occupation,omitempty"` // 职务 Post string `json:"post,omitempty"` // 工作单位 WorkUnit string `json:"work_unit,omitempty"` // 联系电话 ContactNumber string `json:"contact_number,omitempty"` // 健康状况 Health string `json:"health,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FamilyInfoQuery when eager-loading is set. Edges FamilyInfoEdges `json:"edges"` // contains filtered or unexported fields }
FamilyInfo is the model entity for the FamilyInfo schema.
func (*FamilyInfo) QueryStudent ¶
func (fi *FamilyInfo) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the FamilyInfo entity.
func (*FamilyInfo) String ¶
func (fi *FamilyInfo) String() string
String implements the fmt.Stringer.
func (*FamilyInfo) Unwrap ¶
func (fi *FamilyInfo) Unwrap() *FamilyInfo
Unwrap unwraps the FamilyInfo 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 (*FamilyInfo) Update ¶
func (fi *FamilyInfo) Update() *FamilyInfoUpdateOne
Update returns a builder for updating this FamilyInfo. Note that you need to call FamilyInfo.Unwrap() before calling this method if this FamilyInfo was returned from a transaction, and the transaction was committed or rolled back.
type FamilyInfoClient ¶
type FamilyInfoClient struct {
// contains filtered or unexported fields
}
FamilyInfoClient is a client for the FamilyInfo schema.
func NewFamilyInfoClient ¶
func NewFamilyInfoClient(c config) *FamilyInfoClient
NewFamilyInfoClient returns a client for the FamilyInfo from the given config.
func (*FamilyInfoClient) Create ¶
func (c *FamilyInfoClient) Create() *FamilyInfoCreate
Create returns a builder for creating a FamilyInfo entity.
func (*FamilyInfoClient) CreateBulk ¶
func (c *FamilyInfoClient) CreateBulk(builders ...*FamilyInfoCreate) *FamilyInfoCreateBulk
CreateBulk returns a builder for creating a bulk of FamilyInfo entities.
func (*FamilyInfoClient) Delete ¶
func (c *FamilyInfoClient) Delete() *FamilyInfoDelete
Delete returns a delete builder for FamilyInfo.
func (*FamilyInfoClient) DeleteOne ¶
func (c *FamilyInfoClient) DeleteOne(fi *FamilyInfo) *FamilyInfoDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FamilyInfoClient) DeleteOneID ¶
func (c *FamilyInfoClient) DeleteOneID(id int) *FamilyInfoDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FamilyInfoClient) Get ¶
func (c *FamilyInfoClient) Get(ctx context.Context, id int) (*FamilyInfo, error)
Get returns a FamilyInfo entity by its id.
func (*FamilyInfoClient) GetX ¶
func (c *FamilyInfoClient) GetX(ctx context.Context, id int) *FamilyInfo
GetX is like Get, but panics if an error occurs.
func (*FamilyInfoClient) Hooks ¶
func (c *FamilyInfoClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FamilyInfoClient) Intercept ¶
func (c *FamilyInfoClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `familyinfo.Intercept(f(g(h())))`.
func (*FamilyInfoClient) Interceptors ¶
func (c *FamilyInfoClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FamilyInfoClient) Query ¶
func (c *FamilyInfoClient) Query() *FamilyInfoQuery
Query returns a query builder for FamilyInfo.
func (*FamilyInfoClient) QueryStudent ¶
func (c *FamilyInfoClient) QueryStudent(fi *FamilyInfo) *StudentQuery
QueryStudent queries the student edge of a FamilyInfo.
func (*FamilyInfoClient) Update ¶
func (c *FamilyInfoClient) Update() *FamilyInfoUpdate
Update returns an update builder for FamilyInfo.
func (*FamilyInfoClient) UpdateOne ¶
func (c *FamilyInfoClient) UpdateOne(fi *FamilyInfo) *FamilyInfoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FamilyInfoClient) UpdateOneID ¶
func (c *FamilyInfoClient) UpdateOneID(id int) *FamilyInfoUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FamilyInfoClient) Use ¶
func (c *FamilyInfoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `familyinfo.Hooks(f(g(h())))`.
type FamilyInfoCreate ¶
type FamilyInfoCreate struct {
// contains filtered or unexported fields
}
FamilyInfoCreate is the builder for creating a FamilyInfo entity.
func (*FamilyInfoCreate) Exec ¶
func (fic *FamilyInfoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FamilyInfoCreate) ExecX ¶
func (fic *FamilyInfoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoCreate) Mutation ¶
func (fic *FamilyInfoCreate) Mutation() *FamilyInfoMutation
Mutation returns the FamilyInfoMutation object of the builder.
func (*FamilyInfoCreate) Save ¶
func (fic *FamilyInfoCreate) Save(ctx context.Context) (*FamilyInfo, error)
Save creates the FamilyInfo in the database.
func (*FamilyInfoCreate) SaveX ¶
func (fic *FamilyInfoCreate) SaveX(ctx context.Context) *FamilyInfo
SaveX calls Save and panics if Save returns an error.
func (*FamilyInfoCreate) SetAge ¶
func (fic *FamilyInfoCreate) SetAge(s string) *FamilyInfoCreate
SetAge sets the "age" field.
func (*FamilyInfoCreate) SetContactNumber ¶
func (fic *FamilyInfoCreate) SetContactNumber(s string) *FamilyInfoCreate
SetContactNumber sets the "contact_number" field.
func (*FamilyInfoCreate) SetHealth ¶
func (fic *FamilyInfoCreate) SetHealth(s string) *FamilyInfoCreate
SetHealth sets the "health" field.
func (*FamilyInfoCreate) SetIDCard ¶
func (fic *FamilyInfoCreate) SetIDCard(s string) *FamilyInfoCreate
SetIDCard sets the "id_card" field.
func (*FamilyInfoCreate) SetName ¶
func (fic *FamilyInfoCreate) SetName(s string) *FamilyInfoCreate
SetName sets the "name" field.
func (*FamilyInfoCreate) SetNillableStudentID ¶
func (fic *FamilyInfoCreate) SetNillableStudentID(id *int) *FamilyInfoCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*FamilyInfoCreate) SetOccupation ¶
func (fic *FamilyInfoCreate) SetOccupation(s string) *FamilyInfoCreate
SetOccupation sets the "occupation" field.
func (*FamilyInfoCreate) SetPost ¶
func (fic *FamilyInfoCreate) SetPost(s string) *FamilyInfoCreate
SetPost sets the "post" field.
func (*FamilyInfoCreate) SetRelationship ¶
func (fic *FamilyInfoCreate) SetRelationship(s string) *FamilyInfoCreate
SetRelationship sets the "relationship" field.
func (*FamilyInfoCreate) SetStudent ¶
func (fic *FamilyInfoCreate) SetStudent(s *Student) *FamilyInfoCreate
SetStudent sets the "student" edge to the Student entity.
func (*FamilyInfoCreate) SetStudentID ¶
func (fic *FamilyInfoCreate) SetStudentID(id int) *FamilyInfoCreate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*FamilyInfoCreate) SetWorkUnit ¶
func (fic *FamilyInfoCreate) SetWorkUnit(s string) *FamilyInfoCreate
SetWorkUnit sets the "work_unit" field.
type FamilyInfoCreateBulk ¶
type FamilyInfoCreateBulk struct {
// contains filtered or unexported fields
}
FamilyInfoCreateBulk is the builder for creating many FamilyInfo entities in bulk.
func (*FamilyInfoCreateBulk) Exec ¶
func (ficb *FamilyInfoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FamilyInfoCreateBulk) ExecX ¶
func (ficb *FamilyInfoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoCreateBulk) Save ¶
func (ficb *FamilyInfoCreateBulk) Save(ctx context.Context) ([]*FamilyInfo, error)
Save creates the FamilyInfo entities in the database.
func (*FamilyInfoCreateBulk) SaveX ¶
func (ficb *FamilyInfoCreateBulk) SaveX(ctx context.Context) []*FamilyInfo
SaveX is like Save, but panics if an error occurs.
type FamilyInfoDelete ¶
type FamilyInfoDelete struct {
// contains filtered or unexported fields
}
FamilyInfoDelete is the builder for deleting a FamilyInfo entity.
func (*FamilyInfoDelete) Exec ¶
func (fid *FamilyInfoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FamilyInfoDelete) ExecX ¶
func (fid *FamilyInfoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoDelete) Where ¶
func (fid *FamilyInfoDelete) Where(ps ...predicate.FamilyInfo) *FamilyInfoDelete
Where appends a list predicates to the FamilyInfoDelete builder.
type FamilyInfoDeleteOne ¶
type FamilyInfoDeleteOne struct {
// contains filtered or unexported fields
}
FamilyInfoDeleteOne is the builder for deleting a single FamilyInfo entity.
func (*FamilyInfoDeleteOne) Exec ¶
func (fido *FamilyInfoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FamilyInfoDeleteOne) ExecX ¶
func (fido *FamilyInfoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoDeleteOne) Where ¶
func (fido *FamilyInfoDeleteOne) Where(ps ...predicate.FamilyInfo) *FamilyInfoDeleteOne
Where appends a list predicates to the FamilyInfoDelete builder.
type FamilyInfoEdges ¶
type FamilyInfoEdges struct { // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
FamilyInfoEdges holds the relations/edges for other nodes in the graph.
func (FamilyInfoEdges) StudentOrErr ¶
func (e FamilyInfoEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type FamilyInfoGroupBy ¶
type FamilyInfoGroupBy struct {
// contains filtered or unexported fields
}
FamilyInfoGroupBy is the group-by builder for FamilyInfo entities.
func (*FamilyInfoGroupBy) Aggregate ¶
func (figb *FamilyInfoGroupBy) Aggregate(fns ...AggregateFunc) *FamilyInfoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FamilyInfoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FamilyInfoGroupBy) Scan ¶
func (figb *FamilyInfoGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FamilyInfoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FamilyInfoMutation ¶
type FamilyInfoMutation struct {
// contains filtered or unexported fields
}
FamilyInfoMutation represents an operation that mutates the FamilyInfo nodes in the graph.
func (*FamilyInfoMutation) AddField ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) AddedEdges ¶
func (m *FamilyInfoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FamilyInfoMutation) AddedField ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) AddedFields ¶
func (m *FamilyInfoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FamilyInfoMutation) AddedIDs ¶
func (m *FamilyInfoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FamilyInfoMutation) Age ¶
func (m *FamilyInfoMutation) Age() (r string, exists bool)
Age returns the value of the "age" field in the mutation.
func (*FamilyInfoMutation) ClearEdge ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ClearField ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ClearStudent ¶
func (m *FamilyInfoMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*FamilyInfoMutation) ClearedEdges ¶
func (m *FamilyInfoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FamilyInfoMutation) ClearedFields ¶
func (m *FamilyInfoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FamilyInfoMutation) Client ¶
func (m FamilyInfoMutation) 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 (*FamilyInfoMutation) ContactNumber ¶
func (m *FamilyInfoMutation) ContactNumber() (r string, exists bool)
ContactNumber returns the value of the "contact_number" field in the mutation.
func (*FamilyInfoMutation) EdgeCleared ¶
func (m *FamilyInfoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FamilyInfoMutation) Field ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) FieldCleared ¶
func (m *FamilyInfoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FamilyInfoMutation) Fields ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) Health ¶
func (m *FamilyInfoMutation) Health() (r string, exists bool)
Health returns the value of the "health" field in the mutation.
func (*FamilyInfoMutation) ID ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) IDCard ¶
func (m *FamilyInfoMutation) IDCard() (r string, exists bool)
IDCard returns the value of the "id_card" field in the mutation.
func (*FamilyInfoMutation) IDs ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) Name ¶
func (m *FamilyInfoMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FamilyInfoMutation) Occupation ¶
func (m *FamilyInfoMutation) Occupation() (r string, exists bool)
Occupation returns the value of the "occupation" field in the mutation.
func (*FamilyInfoMutation) OldAge ¶
func (m *FamilyInfoMutation) OldAge(ctx context.Context) (v string, err error)
OldAge returns the old "age" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldContactNumber ¶
func (m *FamilyInfoMutation) OldContactNumber(ctx context.Context) (v string, err error)
OldContactNumber returns the old "contact_number" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) 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 (*FamilyInfoMutation) OldHealth ¶
func (m *FamilyInfoMutation) OldHealth(ctx context.Context) (v string, err error)
OldHealth returns the old "health" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldIDCard ¶
func (m *FamilyInfoMutation) OldIDCard(ctx context.Context) (v string, err error)
OldIDCard returns the old "id_card" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldName ¶
func (m *FamilyInfoMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldOccupation ¶
func (m *FamilyInfoMutation) OldOccupation(ctx context.Context) (v string, err error)
OldOccupation returns the old "occupation" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldPost ¶
func (m *FamilyInfoMutation) OldPost(ctx context.Context) (v string, err error)
OldPost returns the old "post" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldRelationship ¶
func (m *FamilyInfoMutation) OldRelationship(ctx context.Context) (v string, err error)
OldRelationship returns the old "relationship" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldWorkUnit ¶
func (m *FamilyInfoMutation) OldWorkUnit(ctx context.Context) (v string, err error)
OldWorkUnit returns the old "work_unit" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) Post ¶
func (m *FamilyInfoMutation) Post() (r string, exists bool)
Post returns the value of the "post" field in the mutation.
func (*FamilyInfoMutation) Relationship ¶
func (m *FamilyInfoMutation) Relationship() (r string, exists bool)
Relationship returns the value of the "relationship" field in the mutation.
func (*FamilyInfoMutation) RemovedEdges ¶
func (m *FamilyInfoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FamilyInfoMutation) RemovedIDs ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetAge ¶
func (m *FamilyInfoMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*FamilyInfoMutation) ResetContactNumber ¶
func (m *FamilyInfoMutation) ResetContactNumber()
ResetContactNumber resets all changes to the "contact_number" field.
func (*FamilyInfoMutation) ResetEdge ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetField ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetHealth ¶
func (m *FamilyInfoMutation) ResetHealth()
ResetHealth resets all changes to the "health" field.
func (*FamilyInfoMutation) ResetIDCard ¶
func (m *FamilyInfoMutation) ResetIDCard()
ResetIDCard resets all changes to the "id_card" field.
func (*FamilyInfoMutation) ResetName ¶
func (m *FamilyInfoMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FamilyInfoMutation) ResetOccupation ¶
func (m *FamilyInfoMutation) ResetOccupation()
ResetOccupation resets all changes to the "occupation" field.
func (*FamilyInfoMutation) ResetPost ¶
func (m *FamilyInfoMutation) ResetPost()
ResetPost resets all changes to the "post" field.
func (*FamilyInfoMutation) ResetRelationship ¶
func (m *FamilyInfoMutation) ResetRelationship()
ResetRelationship resets all changes to the "relationship" field.
func (*FamilyInfoMutation) ResetStudent ¶
func (m *FamilyInfoMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*FamilyInfoMutation) ResetWorkUnit ¶
func (m *FamilyInfoMutation) ResetWorkUnit()
ResetWorkUnit resets all changes to the "work_unit" field.
func (*FamilyInfoMutation) SetAge ¶
func (m *FamilyInfoMutation) SetAge(s string)
SetAge sets the "age" field.
func (*FamilyInfoMutation) SetContactNumber ¶
func (m *FamilyInfoMutation) SetContactNumber(s string)
SetContactNumber sets the "contact_number" field.
func (*FamilyInfoMutation) SetField ¶
func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) SetHealth ¶
func (m *FamilyInfoMutation) SetHealth(s string)
SetHealth sets the "health" field.
func (*FamilyInfoMutation) SetIDCard ¶
func (m *FamilyInfoMutation) SetIDCard(s string)
SetIDCard sets the "id_card" field.
func (*FamilyInfoMutation) SetName ¶
func (m *FamilyInfoMutation) SetName(s string)
SetName sets the "name" field.
func (*FamilyInfoMutation) SetOccupation ¶
func (m *FamilyInfoMutation) SetOccupation(s string)
SetOccupation sets the "occupation" field.
func (*FamilyInfoMutation) SetOp ¶
func (m *FamilyInfoMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FamilyInfoMutation) SetPost ¶
func (m *FamilyInfoMutation) SetPost(s string)
SetPost sets the "post" field.
func (*FamilyInfoMutation) SetRelationship ¶
func (m *FamilyInfoMutation) SetRelationship(s string)
SetRelationship sets the "relationship" field.
func (*FamilyInfoMutation) SetStudentID ¶
func (m *FamilyInfoMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*FamilyInfoMutation) SetWorkUnit ¶
func (m *FamilyInfoMutation) SetWorkUnit(s string)
SetWorkUnit sets the "work_unit" field.
func (*FamilyInfoMutation) StudentCleared ¶
func (m *FamilyInfoMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*FamilyInfoMutation) StudentID ¶
func (m *FamilyInfoMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*FamilyInfoMutation) StudentIDs ¶
func (m *FamilyInfoMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (FamilyInfoMutation) Tx ¶
func (m FamilyInfoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FamilyInfoMutation) Type ¶
func (m *FamilyInfoMutation) Type() string
Type returns the node type of this mutation (FamilyInfo).
func (*FamilyInfoMutation) Where ¶
func (m *FamilyInfoMutation) Where(ps ...predicate.FamilyInfo)
Where appends a list predicates to the FamilyInfoMutation builder.
func (*FamilyInfoMutation) WhereP ¶
func (m *FamilyInfoMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FamilyInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
func (*FamilyInfoMutation) WorkUnit ¶
func (m *FamilyInfoMutation) WorkUnit() (r string, exists bool)
WorkUnit returns the value of the "work_unit" field in the mutation.
type FamilyInfoQuery ¶
type FamilyInfoQuery struct {
// contains filtered or unexported fields
}
FamilyInfoQuery is the builder for querying FamilyInfo entities.
func (*FamilyInfoQuery) Aggregate ¶
func (fiq *FamilyInfoQuery) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect
Aggregate returns a FamilyInfoSelect configured with the given aggregations.
func (*FamilyInfoQuery) All ¶
func (fiq *FamilyInfoQuery) All(ctx context.Context) ([]*FamilyInfo, error)
All executes the query and returns a list of FamilyInfos.
func (*FamilyInfoQuery) AllX ¶
func (fiq *FamilyInfoQuery) AllX(ctx context.Context) []*FamilyInfo
AllX is like All, but panics if an error occurs.
func (*FamilyInfoQuery) Clone ¶
func (fiq *FamilyInfoQuery) Clone() *FamilyInfoQuery
Clone returns a duplicate of the FamilyInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FamilyInfoQuery) Count ¶
func (fiq *FamilyInfoQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FamilyInfoQuery) CountX ¶
func (fiq *FamilyInfoQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FamilyInfoQuery) Exist ¶
func (fiq *FamilyInfoQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FamilyInfoQuery) ExistX ¶
func (fiq *FamilyInfoQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FamilyInfoQuery) First ¶
func (fiq *FamilyInfoQuery) First(ctx context.Context) (*FamilyInfo, error)
First returns the first FamilyInfo entity from the query. Returns a *NotFoundError when no FamilyInfo was found.
func (*FamilyInfoQuery) FirstID ¶
func (fiq *FamilyInfoQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first FamilyInfo ID from the query. Returns a *NotFoundError when no FamilyInfo ID was found.
func (*FamilyInfoQuery) FirstIDX ¶
func (fiq *FamilyInfoQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*FamilyInfoQuery) FirstX ¶
func (fiq *FamilyInfoQuery) FirstX(ctx context.Context) *FamilyInfo
FirstX is like First, but panics if an error occurs.
func (*FamilyInfoQuery) GroupBy ¶
func (fiq *FamilyInfoQuery) GroupBy(field string, fields ...string) *FamilyInfoGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.FamilyInfo.Query(). GroupBy(familyinfo.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*FamilyInfoQuery) IDs ¶
func (fiq *FamilyInfoQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of FamilyInfo IDs.
func (*FamilyInfoQuery) IDsX ¶
func (fiq *FamilyInfoQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*FamilyInfoQuery) Limit ¶
func (fiq *FamilyInfoQuery) Limit(limit int) *FamilyInfoQuery
Limit the number of records to be returned by this query.
func (*FamilyInfoQuery) Offset ¶
func (fiq *FamilyInfoQuery) Offset(offset int) *FamilyInfoQuery
Offset to start from.
func (*FamilyInfoQuery) Only ¶
func (fiq *FamilyInfoQuery) Only(ctx context.Context) (*FamilyInfo, error)
Only returns a single FamilyInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FamilyInfo entity is found. Returns a *NotFoundError when no FamilyInfo entities are found.
func (*FamilyInfoQuery) OnlyID ¶
func (fiq *FamilyInfoQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only FamilyInfo ID in the query. Returns a *NotSingularError when more than one FamilyInfo ID is found. Returns a *NotFoundError when no entities are found.
func (*FamilyInfoQuery) OnlyIDX ¶
func (fiq *FamilyInfoQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FamilyInfoQuery) OnlyX ¶
func (fiq *FamilyInfoQuery) OnlyX(ctx context.Context) *FamilyInfo
OnlyX is like Only, but panics if an error occurs.
func (*FamilyInfoQuery) Order ¶
func (fiq *FamilyInfoQuery) Order(o ...OrderFunc) *FamilyInfoQuery
Order specifies how the records should be ordered.
func (*FamilyInfoQuery) QueryStudent ¶
func (fiq *FamilyInfoQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*FamilyInfoQuery) Select ¶
func (fiq *FamilyInfoQuery) Select(fields ...string) *FamilyInfoSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.FamilyInfo.Query(). Select(familyinfo.FieldName). Scan(ctx, &v)
func (*FamilyInfoQuery) Unique ¶
func (fiq *FamilyInfoQuery) Unique(unique bool) *FamilyInfoQuery
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 (*FamilyInfoQuery) Where ¶
func (fiq *FamilyInfoQuery) Where(ps ...predicate.FamilyInfo) *FamilyInfoQuery
Where adds a new predicate for the FamilyInfoQuery builder.
func (*FamilyInfoQuery) WithStudent ¶
func (fiq *FamilyInfoQuery) WithStudent(opts ...func(*StudentQuery)) *FamilyInfoQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type FamilyInfoSelect ¶
type FamilyInfoSelect struct { *FamilyInfoQuery // contains filtered or unexported fields }
FamilyInfoSelect is the builder for selecting fields of FamilyInfo entities.
func (*FamilyInfoSelect) Aggregate ¶
func (fis *FamilyInfoSelect) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FamilyInfoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FamilyInfoSelect) Scan ¶
func (fis *FamilyInfoSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FamilyInfoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FamilyInfoUpdate ¶
type FamilyInfoUpdate struct {
// contains filtered or unexported fields
}
FamilyInfoUpdate is the builder for updating FamilyInfo entities.
func (*FamilyInfoUpdate) ClearStudent ¶
func (fiu *FamilyInfoUpdate) ClearStudent() *FamilyInfoUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*FamilyInfoUpdate) Exec ¶
func (fiu *FamilyInfoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FamilyInfoUpdate) ExecX ¶
func (fiu *FamilyInfoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoUpdate) Mutation ¶
func (fiu *FamilyInfoUpdate) Mutation() *FamilyInfoMutation
Mutation returns the FamilyInfoMutation object of the builder.
func (*FamilyInfoUpdate) Save ¶
func (fiu *FamilyInfoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FamilyInfoUpdate) SaveX ¶
func (fiu *FamilyInfoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FamilyInfoUpdate) SetAge ¶
func (fiu *FamilyInfoUpdate) SetAge(s string) *FamilyInfoUpdate
SetAge sets the "age" field.
func (*FamilyInfoUpdate) SetContactNumber ¶
func (fiu *FamilyInfoUpdate) SetContactNumber(s string) *FamilyInfoUpdate
SetContactNumber sets the "contact_number" field.
func (*FamilyInfoUpdate) SetHealth ¶
func (fiu *FamilyInfoUpdate) SetHealth(s string) *FamilyInfoUpdate
SetHealth sets the "health" field.
func (*FamilyInfoUpdate) SetIDCard ¶
func (fiu *FamilyInfoUpdate) SetIDCard(s string) *FamilyInfoUpdate
SetIDCard sets the "id_card" field.
func (*FamilyInfoUpdate) SetName ¶
func (fiu *FamilyInfoUpdate) SetName(s string) *FamilyInfoUpdate
SetName sets the "name" field.
func (*FamilyInfoUpdate) SetNillableStudentID ¶
func (fiu *FamilyInfoUpdate) SetNillableStudentID(id *int) *FamilyInfoUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*FamilyInfoUpdate) SetOccupation ¶
func (fiu *FamilyInfoUpdate) SetOccupation(s string) *FamilyInfoUpdate
SetOccupation sets the "occupation" field.
func (*FamilyInfoUpdate) SetPost ¶
func (fiu *FamilyInfoUpdate) SetPost(s string) *FamilyInfoUpdate
SetPost sets the "post" field.
func (*FamilyInfoUpdate) SetRelationship ¶
func (fiu *FamilyInfoUpdate) SetRelationship(s string) *FamilyInfoUpdate
SetRelationship sets the "relationship" field.
func (*FamilyInfoUpdate) SetStudent ¶
func (fiu *FamilyInfoUpdate) SetStudent(s *Student) *FamilyInfoUpdate
SetStudent sets the "student" edge to the Student entity.
func (*FamilyInfoUpdate) SetStudentID ¶
func (fiu *FamilyInfoUpdate) SetStudentID(id int) *FamilyInfoUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*FamilyInfoUpdate) SetWorkUnit ¶
func (fiu *FamilyInfoUpdate) SetWorkUnit(s string) *FamilyInfoUpdate
SetWorkUnit sets the "work_unit" field.
func (*FamilyInfoUpdate) Where ¶
func (fiu *FamilyInfoUpdate) Where(ps ...predicate.FamilyInfo) *FamilyInfoUpdate
Where appends a list predicates to the FamilyInfoUpdate builder.
type FamilyInfoUpdateOne ¶
type FamilyInfoUpdateOne struct {
// contains filtered or unexported fields
}
FamilyInfoUpdateOne is the builder for updating a single FamilyInfo entity.
func (*FamilyInfoUpdateOne) ClearStudent ¶
func (fiuo *FamilyInfoUpdateOne) ClearStudent() *FamilyInfoUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*FamilyInfoUpdateOne) Exec ¶
func (fiuo *FamilyInfoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FamilyInfoUpdateOne) ExecX ¶
func (fiuo *FamilyInfoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FamilyInfoUpdateOne) Mutation ¶
func (fiuo *FamilyInfoUpdateOne) Mutation() *FamilyInfoMutation
Mutation returns the FamilyInfoMutation object of the builder.
func (*FamilyInfoUpdateOne) Save ¶
func (fiuo *FamilyInfoUpdateOne) Save(ctx context.Context) (*FamilyInfo, error)
Save executes the query and returns the updated FamilyInfo entity.
func (*FamilyInfoUpdateOne) SaveX ¶
func (fiuo *FamilyInfoUpdateOne) SaveX(ctx context.Context) *FamilyInfo
SaveX is like Save, but panics if an error occurs.
func (*FamilyInfoUpdateOne) Select ¶
func (fiuo *FamilyInfoUpdateOne) Select(field string, fields ...string) *FamilyInfoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FamilyInfoUpdateOne) SetAge ¶
func (fiuo *FamilyInfoUpdateOne) SetAge(s string) *FamilyInfoUpdateOne
SetAge sets the "age" field.
func (*FamilyInfoUpdateOne) SetContactNumber ¶
func (fiuo *FamilyInfoUpdateOne) SetContactNumber(s string) *FamilyInfoUpdateOne
SetContactNumber sets the "contact_number" field.
func (*FamilyInfoUpdateOne) SetHealth ¶
func (fiuo *FamilyInfoUpdateOne) SetHealth(s string) *FamilyInfoUpdateOne
SetHealth sets the "health" field.
func (*FamilyInfoUpdateOne) SetIDCard ¶
func (fiuo *FamilyInfoUpdateOne) SetIDCard(s string) *FamilyInfoUpdateOne
SetIDCard sets the "id_card" field.
func (*FamilyInfoUpdateOne) SetName ¶
func (fiuo *FamilyInfoUpdateOne) SetName(s string) *FamilyInfoUpdateOne
SetName sets the "name" field.
func (*FamilyInfoUpdateOne) SetNillableStudentID ¶
func (fiuo *FamilyInfoUpdateOne) SetNillableStudentID(id *int) *FamilyInfoUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*FamilyInfoUpdateOne) SetOccupation ¶
func (fiuo *FamilyInfoUpdateOne) SetOccupation(s string) *FamilyInfoUpdateOne
SetOccupation sets the "occupation" field.
func (*FamilyInfoUpdateOne) SetPost ¶
func (fiuo *FamilyInfoUpdateOne) SetPost(s string) *FamilyInfoUpdateOne
SetPost sets the "post" field.
func (*FamilyInfoUpdateOne) SetRelationship ¶
func (fiuo *FamilyInfoUpdateOne) SetRelationship(s string) *FamilyInfoUpdateOne
SetRelationship sets the "relationship" field.
func (*FamilyInfoUpdateOne) SetStudent ¶
func (fiuo *FamilyInfoUpdateOne) SetStudent(s *Student) *FamilyInfoUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*FamilyInfoUpdateOne) SetStudentID ¶
func (fiuo *FamilyInfoUpdateOne) SetStudentID(id int) *FamilyInfoUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*FamilyInfoUpdateOne) SetWorkUnit ¶
func (fiuo *FamilyInfoUpdateOne) SetWorkUnit(s string) *FamilyInfoUpdateOne
SetWorkUnit sets the "work_unit" field.
func (*FamilyInfoUpdateOne) Where ¶
func (fiuo *FamilyInfoUpdateOne) Where(ps ...predicate.FamilyInfo) *FamilyInfoUpdateOne
Where appends a list predicates to the FamilyInfoUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type Major ¶
type Major struct { // ID of the ent. ID int `json:"id,omitempty"` // 专业名称 Name string `json:"name,omitempty"` // 专业代码 Code string `json:"code,omitempty"` // 专业描述 Description string `json:"description,omitempty"` // 特殊类型 SpecialType string `json:"special_type,omitempty"` // 招生类型 EnrollmentType string `json:"enrollment_type,omitempty"` // 是否专业大类 IsMajorCategory bool `json:"is_major_category,omitempty"` // 专业大类 MajorCategory string `json:"major_category,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MajorQuery when eager-loading is set. Edges MajorEdges `json:"edges"` // contains filtered or unexported fields }
Major is the model entity for the Major schema.
func (*Major) QueryClass ¶
func (m *Major) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the Major entity.
func (*Major) QueryDepartment ¶
func (m *Major) QueryDepartment() *DepartmentQuery
QueryDepartment queries the "department" edge of the Major entity.
func (*Major) QueryStudent ¶
func (m *Major) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the Major entity.
func (*Major) Unwrap ¶
Unwrap unwraps the Major 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 (*Major) Update ¶
func (m *Major) Update() *MajorUpdateOne
Update returns a builder for updating this Major. Note that you need to call Major.Unwrap() before calling this method if this Major was returned from a transaction, and the transaction was committed or rolled back.
type MajorClient ¶
type MajorClient struct {
// contains filtered or unexported fields
}
MajorClient is a client for the Major schema.
func NewMajorClient ¶
func NewMajorClient(c config) *MajorClient
NewMajorClient returns a client for the Major from the given config.
func (*MajorClient) Create ¶
func (c *MajorClient) Create() *MajorCreate
Create returns a builder for creating a Major entity.
func (*MajorClient) CreateBulk ¶
func (c *MajorClient) CreateBulk(builders ...*MajorCreate) *MajorCreateBulk
CreateBulk returns a builder for creating a bulk of Major entities.
func (*MajorClient) Delete ¶
func (c *MajorClient) Delete() *MajorDelete
Delete returns a delete builder for Major.
func (*MajorClient) DeleteOne ¶
func (c *MajorClient) DeleteOne(m *Major) *MajorDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MajorClient) DeleteOneID ¶
func (c *MajorClient) DeleteOneID(id int) *MajorDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MajorClient) GetX ¶
func (c *MajorClient) GetX(ctx context.Context, id int) *Major
GetX is like Get, but panics if an error occurs.
func (*MajorClient) Intercept ¶
func (c *MajorClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `major.Intercept(f(g(h())))`.
func (*MajorClient) Interceptors ¶
func (c *MajorClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MajorClient) Query ¶
func (c *MajorClient) Query() *MajorQuery
Query returns a query builder for Major.
func (*MajorClient) QueryClass ¶
func (c *MajorClient) QueryClass(m *Major) *ClassQuery
QueryClass queries the class edge of a Major.
func (*MajorClient) QueryDepartment ¶
func (c *MajorClient) QueryDepartment(m *Major) *DepartmentQuery
QueryDepartment queries the department edge of a Major.
func (*MajorClient) QueryStudent ¶
func (c *MajorClient) QueryStudent(m *Major) *StudentQuery
QueryStudent queries the student edge of a Major.
func (*MajorClient) Update ¶
func (c *MajorClient) Update() *MajorUpdate
Update returns an update builder for Major.
func (*MajorClient) UpdateOne ¶
func (c *MajorClient) UpdateOne(m *Major) *MajorUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MajorClient) UpdateOneID ¶
func (c *MajorClient) UpdateOneID(id int) *MajorUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MajorClient) Use ¶
func (c *MajorClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `major.Hooks(f(g(h())))`.
type MajorCreate ¶
type MajorCreate struct {
// contains filtered or unexported fields
}
MajorCreate is the builder for creating a Major entity.
func (*MajorCreate) AddClasIDs ¶
func (mc *MajorCreate) AddClasIDs(ids ...int) *MajorCreate
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*MajorCreate) AddClass ¶
func (mc *MajorCreate) AddClass(c ...*Class) *MajorCreate
AddClass adds the "class" edges to the Class entity.
func (*MajorCreate) AddStudent ¶
func (mc *MajorCreate) AddStudent(s ...*Student) *MajorCreate
AddStudent adds the "student" edges to the Student entity.
func (*MajorCreate) AddStudentIDs ¶
func (mc *MajorCreate) AddStudentIDs(ids ...int) *MajorCreate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*MajorCreate) Exec ¶
func (mc *MajorCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorCreate) ExecX ¶
func (mc *MajorCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorCreate) Mutation ¶
func (mc *MajorCreate) Mutation() *MajorMutation
Mutation returns the MajorMutation object of the builder.
func (*MajorCreate) Save ¶
func (mc *MajorCreate) Save(ctx context.Context) (*Major, error)
Save creates the Major in the database.
func (*MajorCreate) SaveX ¶
func (mc *MajorCreate) SaveX(ctx context.Context) *Major
SaveX calls Save and panics if Save returns an error.
func (*MajorCreate) SetCode ¶
func (mc *MajorCreate) SetCode(s string) *MajorCreate
SetCode sets the "code" field.
func (*MajorCreate) SetDepartment ¶
func (mc *MajorCreate) SetDepartment(d *Department) *MajorCreate
SetDepartment sets the "department" edge to the Department entity.
func (*MajorCreate) SetDepartmentID ¶
func (mc *MajorCreate) SetDepartmentID(id int) *MajorCreate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*MajorCreate) SetDescription ¶
func (mc *MajorCreate) SetDescription(s string) *MajorCreate
SetDescription sets the "description" field.
func (*MajorCreate) SetEnrollmentType ¶
func (mc *MajorCreate) SetEnrollmentType(s string) *MajorCreate
SetEnrollmentType sets the "enrollment_type" field.
func (*MajorCreate) SetIsMajorCategory ¶
func (mc *MajorCreate) SetIsMajorCategory(b bool) *MajorCreate
SetIsMajorCategory sets the "is_major_category" field.
func (*MajorCreate) SetMajorCategory ¶
func (mc *MajorCreate) SetMajorCategory(s string) *MajorCreate
SetMajorCategory sets the "major_category" field.
func (*MajorCreate) SetName ¶
func (mc *MajorCreate) SetName(s string) *MajorCreate
SetName sets the "name" field.
func (*MajorCreate) SetNillableDepartmentID ¶
func (mc *MajorCreate) SetNillableDepartmentID(id *int) *MajorCreate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*MajorCreate) SetSpecialType ¶
func (mc *MajorCreate) SetSpecialType(s string) *MajorCreate
SetSpecialType sets the "special_type" field.
type MajorCreateBulk ¶
type MajorCreateBulk struct {
// contains filtered or unexported fields
}
MajorCreateBulk is the builder for creating many Major entities in bulk.
func (*MajorCreateBulk) Exec ¶
func (mcb *MajorCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorCreateBulk) ExecX ¶
func (mcb *MajorCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MajorDelete ¶
type MajorDelete struct {
// contains filtered or unexported fields
}
MajorDelete is the builder for deleting a Major entity.
func (*MajorDelete) Exec ¶
func (md *MajorDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MajorDelete) ExecX ¶
func (md *MajorDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MajorDelete) Where ¶
func (md *MajorDelete) Where(ps ...predicate.Major) *MajorDelete
Where appends a list predicates to the MajorDelete builder.
type MajorDeleteOne ¶
type MajorDeleteOne struct {
// contains filtered or unexported fields
}
MajorDeleteOne is the builder for deleting a single Major entity.
func (*MajorDeleteOne) Exec ¶
func (mdo *MajorDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MajorDeleteOne) ExecX ¶
func (mdo *MajorDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDeleteOne) Where ¶
func (mdo *MajorDeleteOne) Where(ps ...predicate.Major) *MajorDeleteOne
Where appends a list predicates to the MajorDelete builder.
type MajorDirection ¶
type MajorDirection struct { // ID of the ent. ID int `json:"id,omitempty"` // 专业方向名称 Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MajorDirectionQuery when eager-loading is set. Edges MajorDirectionEdges `json:"edges"` // contains filtered or unexported fields }
MajorDirection is the model entity for the MajorDirection schema.
func (*MajorDirection) QueryClass ¶
func (md *MajorDirection) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the MajorDirection entity.
func (*MajorDirection) String ¶
func (md *MajorDirection) String() string
String implements the fmt.Stringer.
func (*MajorDirection) Unwrap ¶
func (md *MajorDirection) Unwrap() *MajorDirection
Unwrap unwraps the MajorDirection 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 (*MajorDirection) Update ¶
func (md *MajorDirection) Update() *MajorDirectionUpdateOne
Update returns a builder for updating this MajorDirection. Note that you need to call MajorDirection.Unwrap() before calling this method if this MajorDirection was returned from a transaction, and the transaction was committed or rolled back.
type MajorDirectionClient ¶
type MajorDirectionClient struct {
// contains filtered or unexported fields
}
MajorDirectionClient is a client for the MajorDirection schema.
func NewMajorDirectionClient ¶
func NewMajorDirectionClient(c config) *MajorDirectionClient
NewMajorDirectionClient returns a client for the MajorDirection from the given config.
func (*MajorDirectionClient) Create ¶
func (c *MajorDirectionClient) Create() *MajorDirectionCreate
Create returns a builder for creating a MajorDirection entity.
func (*MajorDirectionClient) CreateBulk ¶
func (c *MajorDirectionClient) CreateBulk(builders ...*MajorDirectionCreate) *MajorDirectionCreateBulk
CreateBulk returns a builder for creating a bulk of MajorDirection entities.
func (*MajorDirectionClient) Delete ¶
func (c *MajorDirectionClient) Delete() *MajorDirectionDelete
Delete returns a delete builder for MajorDirection.
func (*MajorDirectionClient) DeleteOne ¶
func (c *MajorDirectionClient) DeleteOne(md *MajorDirection) *MajorDirectionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MajorDirectionClient) DeleteOneID ¶
func (c *MajorDirectionClient) DeleteOneID(id int) *MajorDirectionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MajorDirectionClient) Get ¶
func (c *MajorDirectionClient) Get(ctx context.Context, id int) (*MajorDirection, error)
Get returns a MajorDirection entity by its id.
func (*MajorDirectionClient) GetX ¶
func (c *MajorDirectionClient) GetX(ctx context.Context, id int) *MajorDirection
GetX is like Get, but panics if an error occurs.
func (*MajorDirectionClient) Hooks ¶
func (c *MajorDirectionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MajorDirectionClient) Intercept ¶
func (c *MajorDirectionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `majordirection.Intercept(f(g(h())))`.
func (*MajorDirectionClient) Interceptors ¶
func (c *MajorDirectionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MajorDirectionClient) Query ¶
func (c *MajorDirectionClient) Query() *MajorDirectionQuery
Query returns a query builder for MajorDirection.
func (*MajorDirectionClient) QueryClass ¶
func (c *MajorDirectionClient) QueryClass(md *MajorDirection) *ClassQuery
QueryClass queries the class edge of a MajorDirection.
func (*MajorDirectionClient) Update ¶
func (c *MajorDirectionClient) Update() *MajorDirectionUpdate
Update returns an update builder for MajorDirection.
func (*MajorDirectionClient) UpdateOne ¶
func (c *MajorDirectionClient) UpdateOne(md *MajorDirection) *MajorDirectionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MajorDirectionClient) UpdateOneID ¶
func (c *MajorDirectionClient) UpdateOneID(id int) *MajorDirectionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MajorDirectionClient) Use ¶
func (c *MajorDirectionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `majordirection.Hooks(f(g(h())))`.
type MajorDirectionCreate ¶
type MajorDirectionCreate struct {
// contains filtered or unexported fields
}
MajorDirectionCreate is the builder for creating a MajorDirection entity.
func (*MajorDirectionCreate) Exec ¶
func (mdc *MajorDirectionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorDirectionCreate) ExecX ¶
func (mdc *MajorDirectionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionCreate) Mutation ¶
func (mdc *MajorDirectionCreate) Mutation() *MajorDirectionMutation
Mutation returns the MajorDirectionMutation object of the builder.
func (*MajorDirectionCreate) Save ¶
func (mdc *MajorDirectionCreate) Save(ctx context.Context) (*MajorDirection, error)
Save creates the MajorDirection in the database.
func (*MajorDirectionCreate) SaveX ¶
func (mdc *MajorDirectionCreate) SaveX(ctx context.Context) *MajorDirection
SaveX calls Save and panics if Save returns an error.
func (*MajorDirectionCreate) SetClass ¶
func (mdc *MajorDirectionCreate) SetClass(c *Class) *MajorDirectionCreate
SetClass sets the "class" edge to the Class entity.
func (*MajorDirectionCreate) SetClassID ¶
func (mdc *MajorDirectionCreate) SetClassID(id int) *MajorDirectionCreate
SetClassID sets the "class" edge to the Class entity by ID.
func (*MajorDirectionCreate) SetName ¶
func (mdc *MajorDirectionCreate) SetName(s string) *MajorDirectionCreate
SetName sets the "name" field.
func (*MajorDirectionCreate) SetNillableClassID ¶
func (mdc *MajorDirectionCreate) SetNillableClassID(id *int) *MajorDirectionCreate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
type MajorDirectionCreateBulk ¶
type MajorDirectionCreateBulk struct {
// contains filtered or unexported fields
}
MajorDirectionCreateBulk is the builder for creating many MajorDirection entities in bulk.
func (*MajorDirectionCreateBulk) Exec ¶
func (mdcb *MajorDirectionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorDirectionCreateBulk) ExecX ¶
func (mdcb *MajorDirectionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionCreateBulk) Save ¶
func (mdcb *MajorDirectionCreateBulk) Save(ctx context.Context) ([]*MajorDirection, error)
Save creates the MajorDirection entities in the database.
func (*MajorDirectionCreateBulk) SaveX ¶
func (mdcb *MajorDirectionCreateBulk) SaveX(ctx context.Context) []*MajorDirection
SaveX is like Save, but panics if an error occurs.
type MajorDirectionDelete ¶
type MajorDirectionDelete struct {
// contains filtered or unexported fields
}
MajorDirectionDelete is the builder for deleting a MajorDirection entity.
func (*MajorDirectionDelete) Exec ¶
func (mdd *MajorDirectionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MajorDirectionDelete) ExecX ¶
func (mdd *MajorDirectionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionDelete) Where ¶
func (mdd *MajorDirectionDelete) Where(ps ...predicate.MajorDirection) *MajorDirectionDelete
Where appends a list predicates to the MajorDirectionDelete builder.
type MajorDirectionDeleteOne ¶
type MajorDirectionDeleteOne struct {
// contains filtered or unexported fields
}
MajorDirectionDeleteOne is the builder for deleting a single MajorDirection entity.
func (*MajorDirectionDeleteOne) Exec ¶
func (mddo *MajorDirectionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MajorDirectionDeleteOne) ExecX ¶
func (mddo *MajorDirectionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionDeleteOne) Where ¶
func (mddo *MajorDirectionDeleteOne) Where(ps ...predicate.MajorDirection) *MajorDirectionDeleteOne
Where appends a list predicates to the MajorDirectionDelete builder.
type MajorDirectionEdges ¶
type MajorDirectionEdges struct { // Class holds the value of the class edge. Class *Class `json:"class,omitempty"` // contains filtered or unexported fields }
MajorDirectionEdges holds the relations/edges for other nodes in the graph.
func (MajorDirectionEdges) ClassOrErr ¶
func (e MajorDirectionEdges) ClassOrErr() (*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type MajorDirectionGroupBy ¶
type MajorDirectionGroupBy struct {
// contains filtered or unexported fields
}
MajorDirectionGroupBy is the group-by builder for MajorDirection entities.
func (*MajorDirectionGroupBy) Aggregate ¶
func (mdgb *MajorDirectionGroupBy) Aggregate(fns ...AggregateFunc) *MajorDirectionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MajorDirectionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*MajorDirectionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MajorDirectionGroupBy) Scan ¶
func (mdgb *MajorDirectionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MajorDirectionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MajorDirectionMutation ¶
type MajorDirectionMutation struct {
// contains filtered or unexported fields
}
MajorDirectionMutation represents an operation that mutates the MajorDirection nodes in the graph.
func (*MajorDirectionMutation) AddField ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) AddedEdges ¶
func (m *MajorDirectionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MajorDirectionMutation) AddedField ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) AddedFields ¶
func (m *MajorDirectionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MajorDirectionMutation) AddedIDs ¶
func (m *MajorDirectionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MajorDirectionMutation) ClassCleared ¶
func (m *MajorDirectionMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*MajorDirectionMutation) ClassID ¶
func (m *MajorDirectionMutation) ClassID() (id int, exists bool)
ClassID returns the "class" edge ID in the mutation.
func (*MajorDirectionMutation) ClassIDs ¶
func (m *MajorDirectionMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.
func (*MajorDirectionMutation) ClearClass ¶
func (m *MajorDirectionMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*MajorDirectionMutation) ClearEdge ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ClearField ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ClearedEdges ¶
func (m *MajorDirectionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MajorDirectionMutation) ClearedFields ¶
func (m *MajorDirectionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MajorDirectionMutation) Client ¶
func (m MajorDirectionMutation) 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 (*MajorDirectionMutation) EdgeCleared ¶
func (m *MajorDirectionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MajorDirectionMutation) Field ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) FieldCleared ¶
func (m *MajorDirectionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MajorDirectionMutation) Fields ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ID ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) IDs ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) Name ¶
func (m *MajorDirectionMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*MajorDirectionMutation) 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 (*MajorDirectionMutation) OldName ¶
func (m *MajorDirectionMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the MajorDirection entity. If the MajorDirection 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 (*MajorDirectionMutation) Op ¶
func (m *MajorDirectionMutation) Op() Op
Op returns the operation name.
func (*MajorDirectionMutation) RemovedEdges ¶
func (m *MajorDirectionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MajorDirectionMutation) RemovedIDs ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetClass ¶
func (m *MajorDirectionMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*MajorDirectionMutation) ResetEdge ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetField ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetName ¶
func (m *MajorDirectionMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*MajorDirectionMutation) SetClassID ¶
func (m *MajorDirectionMutation) SetClassID(id int)
SetClassID sets the "class" edge to the Class entity by id.
func (*MajorDirectionMutation) SetField ¶
func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) SetName ¶
func (m *MajorDirectionMutation) SetName(s string)
SetName sets the "name" field.
func (*MajorDirectionMutation) SetOp ¶
func (m *MajorDirectionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (MajorDirectionMutation) Tx ¶
func (m MajorDirectionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MajorDirectionMutation) Type ¶
func (m *MajorDirectionMutation) Type() string
Type returns the node type of this mutation (MajorDirection).
func (*MajorDirectionMutation) Where ¶
func (m *MajorDirectionMutation) Where(ps ...predicate.MajorDirection)
Where appends a list predicates to the MajorDirectionMutation builder.
func (*MajorDirectionMutation) WhereP ¶
func (m *MajorDirectionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MajorDirectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MajorDirectionQuery ¶
type MajorDirectionQuery struct {
// contains filtered or unexported fields
}
MajorDirectionQuery is the builder for querying MajorDirection entities.
func (*MajorDirectionQuery) Aggregate ¶
func (mdq *MajorDirectionQuery) Aggregate(fns ...AggregateFunc) *MajorDirectionSelect
Aggregate returns a MajorDirectionSelect configured with the given aggregations.
func (*MajorDirectionQuery) All ¶
func (mdq *MajorDirectionQuery) All(ctx context.Context) ([]*MajorDirection, error)
All executes the query and returns a list of MajorDirections.
func (*MajorDirectionQuery) AllX ¶
func (mdq *MajorDirectionQuery) AllX(ctx context.Context) []*MajorDirection
AllX is like All, but panics if an error occurs.
func (*MajorDirectionQuery) Clone ¶
func (mdq *MajorDirectionQuery) Clone() *MajorDirectionQuery
Clone returns a duplicate of the MajorDirectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MajorDirectionQuery) Count ¶
func (mdq *MajorDirectionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MajorDirectionQuery) CountX ¶
func (mdq *MajorDirectionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MajorDirectionQuery) Exist ¶
func (mdq *MajorDirectionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MajorDirectionQuery) ExistX ¶
func (mdq *MajorDirectionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MajorDirectionQuery) First ¶
func (mdq *MajorDirectionQuery) First(ctx context.Context) (*MajorDirection, error)
First returns the first MajorDirection entity from the query. Returns a *NotFoundError when no MajorDirection was found.
func (*MajorDirectionQuery) FirstID ¶
func (mdq *MajorDirectionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first MajorDirection ID from the query. Returns a *NotFoundError when no MajorDirection ID was found.
func (*MajorDirectionQuery) FirstIDX ¶
func (mdq *MajorDirectionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MajorDirectionQuery) FirstX ¶
func (mdq *MajorDirectionQuery) FirstX(ctx context.Context) *MajorDirection
FirstX is like First, but panics if an error occurs.
func (*MajorDirectionQuery) GroupBy ¶
func (mdq *MajorDirectionQuery) GroupBy(field string, fields ...string) *MajorDirectionGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.MajorDirection.Query(). GroupBy(majordirection.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*MajorDirectionQuery) IDs ¶
func (mdq *MajorDirectionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of MajorDirection IDs.
func (*MajorDirectionQuery) IDsX ¶
func (mdq *MajorDirectionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MajorDirectionQuery) Limit ¶
func (mdq *MajorDirectionQuery) Limit(limit int) *MajorDirectionQuery
Limit the number of records to be returned by this query.
func (*MajorDirectionQuery) Offset ¶
func (mdq *MajorDirectionQuery) Offset(offset int) *MajorDirectionQuery
Offset to start from.
func (*MajorDirectionQuery) Only ¶
func (mdq *MajorDirectionQuery) Only(ctx context.Context) (*MajorDirection, error)
Only returns a single MajorDirection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MajorDirection entity is found. Returns a *NotFoundError when no MajorDirection entities are found.
func (*MajorDirectionQuery) OnlyID ¶
func (mdq *MajorDirectionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only MajorDirection ID in the query. Returns a *NotSingularError when more than one MajorDirection ID is found. Returns a *NotFoundError when no entities are found.
func (*MajorDirectionQuery) OnlyIDX ¶
func (mdq *MajorDirectionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MajorDirectionQuery) OnlyX ¶
func (mdq *MajorDirectionQuery) OnlyX(ctx context.Context) *MajorDirection
OnlyX is like Only, but panics if an error occurs.
func (*MajorDirectionQuery) Order ¶
func (mdq *MajorDirectionQuery) Order(o ...OrderFunc) *MajorDirectionQuery
Order specifies how the records should be ordered.
func (*MajorDirectionQuery) QueryClass ¶
func (mdq *MajorDirectionQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*MajorDirectionQuery) Select ¶
func (mdq *MajorDirectionQuery) Select(fields ...string) *MajorDirectionSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.MajorDirection.Query(). Select(majordirection.FieldName). Scan(ctx, &v)
func (*MajorDirectionQuery) Unique ¶
func (mdq *MajorDirectionQuery) Unique(unique bool) *MajorDirectionQuery
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 (*MajorDirectionQuery) Where ¶
func (mdq *MajorDirectionQuery) Where(ps ...predicate.MajorDirection) *MajorDirectionQuery
Where adds a new predicate for the MajorDirectionQuery builder.
func (*MajorDirectionQuery) WithClass ¶
func (mdq *MajorDirectionQuery) WithClass(opts ...func(*ClassQuery)) *MajorDirectionQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
type MajorDirectionSelect ¶
type MajorDirectionSelect struct { *MajorDirectionQuery // contains filtered or unexported fields }
MajorDirectionSelect is the builder for selecting fields of MajorDirection entities.
func (*MajorDirectionSelect) Aggregate ¶
func (mds *MajorDirectionSelect) Aggregate(fns ...AggregateFunc) *MajorDirectionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MajorDirectionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MajorDirectionSelect) Scan ¶
func (mds *MajorDirectionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MajorDirectionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MajorDirectionUpdate ¶
type MajorDirectionUpdate struct {
// contains filtered or unexported fields
}
MajorDirectionUpdate is the builder for updating MajorDirection entities.
func (*MajorDirectionUpdate) ClearClass ¶
func (mdu *MajorDirectionUpdate) ClearClass() *MajorDirectionUpdate
ClearClass clears the "class" edge to the Class entity.
func (*MajorDirectionUpdate) Exec ¶
func (mdu *MajorDirectionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorDirectionUpdate) ExecX ¶
func (mdu *MajorDirectionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionUpdate) Mutation ¶
func (mdu *MajorDirectionUpdate) Mutation() *MajorDirectionMutation
Mutation returns the MajorDirectionMutation object of the builder.
func (*MajorDirectionUpdate) Save ¶
func (mdu *MajorDirectionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MajorDirectionUpdate) SaveX ¶
func (mdu *MajorDirectionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MajorDirectionUpdate) SetClass ¶
func (mdu *MajorDirectionUpdate) SetClass(c *Class) *MajorDirectionUpdate
SetClass sets the "class" edge to the Class entity.
func (*MajorDirectionUpdate) SetClassID ¶
func (mdu *MajorDirectionUpdate) SetClassID(id int) *MajorDirectionUpdate
SetClassID sets the "class" edge to the Class entity by ID.
func (*MajorDirectionUpdate) SetName ¶
func (mdu *MajorDirectionUpdate) SetName(s string) *MajorDirectionUpdate
SetName sets the "name" field.
func (*MajorDirectionUpdate) SetNillableClassID ¶
func (mdu *MajorDirectionUpdate) SetNillableClassID(id *int) *MajorDirectionUpdate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*MajorDirectionUpdate) Where ¶
func (mdu *MajorDirectionUpdate) Where(ps ...predicate.MajorDirection) *MajorDirectionUpdate
Where appends a list predicates to the MajorDirectionUpdate builder.
type MajorDirectionUpdateOne ¶
type MajorDirectionUpdateOne struct {
// contains filtered or unexported fields
}
MajorDirectionUpdateOne is the builder for updating a single MajorDirection entity.
func (*MajorDirectionUpdateOne) ClearClass ¶
func (mduo *MajorDirectionUpdateOne) ClearClass() *MajorDirectionUpdateOne
ClearClass clears the "class" edge to the Class entity.
func (*MajorDirectionUpdateOne) Exec ¶
func (mduo *MajorDirectionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MajorDirectionUpdateOne) ExecX ¶
func (mduo *MajorDirectionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorDirectionUpdateOne) Mutation ¶
func (mduo *MajorDirectionUpdateOne) Mutation() *MajorDirectionMutation
Mutation returns the MajorDirectionMutation object of the builder.
func (*MajorDirectionUpdateOne) Save ¶
func (mduo *MajorDirectionUpdateOne) Save(ctx context.Context) (*MajorDirection, error)
Save executes the query and returns the updated MajorDirection entity.
func (*MajorDirectionUpdateOne) SaveX ¶
func (mduo *MajorDirectionUpdateOne) SaveX(ctx context.Context) *MajorDirection
SaveX is like Save, but panics if an error occurs.
func (*MajorDirectionUpdateOne) Select ¶
func (mduo *MajorDirectionUpdateOne) Select(field string, fields ...string) *MajorDirectionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MajorDirectionUpdateOne) SetClass ¶
func (mduo *MajorDirectionUpdateOne) SetClass(c *Class) *MajorDirectionUpdateOne
SetClass sets the "class" edge to the Class entity.
func (*MajorDirectionUpdateOne) SetClassID ¶
func (mduo *MajorDirectionUpdateOne) SetClassID(id int) *MajorDirectionUpdateOne
SetClassID sets the "class" edge to the Class entity by ID.
func (*MajorDirectionUpdateOne) SetName ¶
func (mduo *MajorDirectionUpdateOne) SetName(s string) *MajorDirectionUpdateOne
SetName sets the "name" field.
func (*MajorDirectionUpdateOne) SetNillableClassID ¶
func (mduo *MajorDirectionUpdateOne) SetNillableClassID(id *int) *MajorDirectionUpdateOne
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*MajorDirectionUpdateOne) Where ¶
func (mduo *MajorDirectionUpdateOne) Where(ps ...predicate.MajorDirection) *MajorDirectionUpdateOne
Where appends a list predicates to the MajorDirectionUpdate builder.
type MajorDirections ¶
type MajorDirections []*MajorDirection
MajorDirections is a parsable slice of MajorDirection.
type MajorEdges ¶
type MajorEdges struct { // Department holds the value of the department edge. Department *Department `json:"department,omitempty"` // Student holds the value of the student edge. Student []*Student `json:"student,omitempty"` // Class holds the value of the class edge. Class []*Class `json:"class,omitempty"` // contains filtered or unexported fields }
MajorEdges holds the relations/edges for other nodes in the graph.
func (MajorEdges) ClassOrErr ¶
func (e MajorEdges) ClassOrErr() ([]*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading.
func (MajorEdges) DepartmentOrErr ¶
func (e MajorEdges) DepartmentOrErr() (*Department, error)
DepartmentOrErr returns the Department value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (MajorEdges) StudentOrErr ¶
func (e MajorEdges) StudentOrErr() ([]*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading.
type MajorGroupBy ¶
type MajorGroupBy struct {
// contains filtered or unexported fields
}
MajorGroupBy is the group-by builder for Major entities.
func (*MajorGroupBy) Aggregate ¶
func (mgb *MajorGroupBy) Aggregate(fns ...AggregateFunc) *MajorGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MajorGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MajorGroupBy) Scan ¶
func (mgb *MajorGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MajorGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MajorMutation ¶
type MajorMutation struct {
// contains filtered or unexported fields
}
MajorMutation represents an operation that mutates the Major nodes in the graph.
func (*MajorMutation) AddClasIDs ¶
func (m *MajorMutation) AddClasIDs(ids ...int)
AddClasIDs adds the "class" edge to the Class entity by ids.
func (*MajorMutation) AddField ¶
func (m *MajorMutation) 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 (*MajorMutation) AddStudentIDs ¶
func (m *MajorMutation) AddStudentIDs(ids ...int)
AddStudentIDs adds the "student" edge to the Student entity by ids.
func (*MajorMutation) AddedEdges ¶
func (m *MajorMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MajorMutation) AddedField ¶
func (m *MajorMutation) 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 (*MajorMutation) AddedFields ¶
func (m *MajorMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MajorMutation) AddedIDs ¶
func (m *MajorMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MajorMutation) ClassCleared ¶
func (m *MajorMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*MajorMutation) ClassIDs ¶
func (m *MajorMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation.
func (*MajorMutation) ClearClass ¶
func (m *MajorMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*MajorMutation) ClearDepartment ¶
func (m *MajorMutation) ClearDepartment()
ClearDepartment clears the "department" edge to the Department entity.
func (*MajorMutation) ClearEdge ¶
func (m *MajorMutation) 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 (*MajorMutation) ClearField ¶
func (m *MajorMutation) 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 (*MajorMutation) ClearStudent ¶
func (m *MajorMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*MajorMutation) ClearedEdges ¶
func (m *MajorMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MajorMutation) ClearedFields ¶
func (m *MajorMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MajorMutation) Client ¶
func (m MajorMutation) 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 (*MajorMutation) Code ¶
func (m *MajorMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*MajorMutation) DepartmentCleared ¶
func (m *MajorMutation) DepartmentCleared() bool
DepartmentCleared reports if the "department" edge to the Department entity was cleared.
func (*MajorMutation) DepartmentID ¶
func (m *MajorMutation) DepartmentID() (id int, exists bool)
DepartmentID returns the "department" edge ID in the mutation.
func (*MajorMutation) DepartmentIDs ¶
func (m *MajorMutation) DepartmentIDs() (ids []int)
DepartmentIDs returns the "department" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentID instead. It exists only for internal usage by the builders.
func (*MajorMutation) Description ¶
func (m *MajorMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*MajorMutation) EdgeCleared ¶
func (m *MajorMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MajorMutation) EnrollmentType ¶
func (m *MajorMutation) EnrollmentType() (r string, exists bool)
EnrollmentType returns the value of the "enrollment_type" field in the mutation.
func (*MajorMutation) Field ¶
func (m *MajorMutation) 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 (*MajorMutation) FieldCleared ¶
func (m *MajorMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MajorMutation) Fields ¶
func (m *MajorMutation) 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 (*MajorMutation) ID ¶
func (m *MajorMutation) 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 (*MajorMutation) IDs ¶
func (m *MajorMutation) 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 (*MajorMutation) IsMajorCategory ¶
func (m *MajorMutation) IsMajorCategory() (r bool, exists bool)
IsMajorCategory returns the value of the "is_major_category" field in the mutation.
func (*MajorMutation) MajorCategory ¶
func (m *MajorMutation) MajorCategory() (r string, exists bool)
MajorCategory returns the value of the "major_category" field in the mutation.
func (*MajorMutation) Name ¶
func (m *MajorMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*MajorMutation) OldCode ¶
func (m *MajorMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Major entity. If the Major 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 (*MajorMutation) OldDescription ¶
func (m *MajorMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Major entity. If the Major 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 (*MajorMutation) OldEnrollmentType ¶
func (m *MajorMutation) OldEnrollmentType(ctx context.Context) (v string, err error)
OldEnrollmentType returns the old "enrollment_type" field's value of the Major entity. If the Major 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 (*MajorMutation) 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 (*MajorMutation) OldIsMajorCategory ¶
func (m *MajorMutation) OldIsMajorCategory(ctx context.Context) (v bool, err error)
OldIsMajorCategory returns the old "is_major_category" field's value of the Major entity. If the Major 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 (*MajorMutation) OldMajorCategory ¶
func (m *MajorMutation) OldMajorCategory(ctx context.Context) (v string, err error)
OldMajorCategory returns the old "major_category" field's value of the Major entity. If the Major 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 (*MajorMutation) OldName ¶
func (m *MajorMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Major entity. If the Major 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 (*MajorMutation) OldSpecialType ¶
func (m *MajorMutation) OldSpecialType(ctx context.Context) (v string, err error)
OldSpecialType returns the old "special_type" field's value of the Major entity. If the Major 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 (*MajorMutation) RemoveClasIDs ¶
func (m *MajorMutation) RemoveClasIDs(ids ...int)
RemoveClasIDs removes the "class" edge to the Class entity by IDs.
func (*MajorMutation) RemoveStudentIDs ¶
func (m *MajorMutation) RemoveStudentIDs(ids ...int)
RemoveStudentIDs removes the "student" edge to the Student entity by IDs.
func (*MajorMutation) RemovedClassIDs ¶
func (m *MajorMutation) RemovedClassIDs() (ids []int)
RemovedClass returns the removed IDs of the "class" edge to the Class entity.
func (*MajorMutation) RemovedEdges ¶
func (m *MajorMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MajorMutation) RemovedIDs ¶
func (m *MajorMutation) 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 (*MajorMutation) RemovedStudentIDs ¶
func (m *MajorMutation) RemovedStudentIDs() (ids []int)
RemovedStudent returns the removed IDs of the "student" edge to the Student entity.
func (*MajorMutation) ResetClass ¶
func (m *MajorMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*MajorMutation) ResetCode ¶
func (m *MajorMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*MajorMutation) ResetDepartment ¶
func (m *MajorMutation) ResetDepartment()
ResetDepartment resets all changes to the "department" edge.
func (*MajorMutation) ResetDescription ¶
func (m *MajorMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*MajorMutation) ResetEdge ¶
func (m *MajorMutation) 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 (*MajorMutation) ResetEnrollmentType ¶
func (m *MajorMutation) ResetEnrollmentType()
ResetEnrollmentType resets all changes to the "enrollment_type" field.
func (*MajorMutation) ResetField ¶
func (m *MajorMutation) 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 (*MajorMutation) ResetIsMajorCategory ¶
func (m *MajorMutation) ResetIsMajorCategory()
ResetIsMajorCategory resets all changes to the "is_major_category" field.
func (*MajorMutation) ResetMajorCategory ¶
func (m *MajorMutation) ResetMajorCategory()
ResetMajorCategory resets all changes to the "major_category" field.
func (*MajorMutation) ResetName ¶
func (m *MajorMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*MajorMutation) ResetSpecialType ¶
func (m *MajorMutation) ResetSpecialType()
ResetSpecialType resets all changes to the "special_type" field.
func (*MajorMutation) ResetStudent ¶
func (m *MajorMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*MajorMutation) SetCode ¶
func (m *MajorMutation) SetCode(s string)
SetCode sets the "code" field.
func (*MajorMutation) SetDepartmentID ¶
func (m *MajorMutation) SetDepartmentID(id int)
SetDepartmentID sets the "department" edge to the Department entity by id.
func (*MajorMutation) SetDescription ¶
func (m *MajorMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*MajorMutation) SetEnrollmentType ¶
func (m *MajorMutation) SetEnrollmentType(s string)
SetEnrollmentType sets the "enrollment_type" field.
func (*MajorMutation) SetField ¶
func (m *MajorMutation) 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 (*MajorMutation) SetIsMajorCategory ¶
func (m *MajorMutation) SetIsMajorCategory(b bool)
SetIsMajorCategory sets the "is_major_category" field.
func (*MajorMutation) SetMajorCategory ¶
func (m *MajorMutation) SetMajorCategory(s string)
SetMajorCategory sets the "major_category" field.
func (*MajorMutation) SetName ¶
func (m *MajorMutation) SetName(s string)
SetName sets the "name" field.
func (*MajorMutation) SetOp ¶
func (m *MajorMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*MajorMutation) SetSpecialType ¶
func (m *MajorMutation) SetSpecialType(s string)
SetSpecialType sets the "special_type" field.
func (*MajorMutation) SpecialType ¶
func (m *MajorMutation) SpecialType() (r string, exists bool)
SpecialType returns the value of the "special_type" field in the mutation.
func (*MajorMutation) StudentCleared ¶
func (m *MajorMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*MajorMutation) StudentIDs ¶
func (m *MajorMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation.
func (MajorMutation) Tx ¶
func (m MajorMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MajorMutation) Type ¶
func (m *MajorMutation) Type() string
Type returns the node type of this mutation (Major).
func (*MajorMutation) Where ¶
func (m *MajorMutation) Where(ps ...predicate.Major)
Where appends a list predicates to the MajorMutation builder.
func (*MajorMutation) WhereP ¶
func (m *MajorMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MajorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MajorQuery ¶
type MajorQuery struct {
// contains filtered or unexported fields
}
MajorQuery is the builder for querying Major entities.
func (*MajorQuery) Aggregate ¶
func (mq *MajorQuery) Aggregate(fns ...AggregateFunc) *MajorSelect
Aggregate returns a MajorSelect configured with the given aggregations.
func (*MajorQuery) All ¶
func (mq *MajorQuery) All(ctx context.Context) ([]*Major, error)
All executes the query and returns a list of Majors.
func (*MajorQuery) AllX ¶
func (mq *MajorQuery) AllX(ctx context.Context) []*Major
AllX is like All, but panics if an error occurs.
func (*MajorQuery) Clone ¶
func (mq *MajorQuery) Clone() *MajorQuery
Clone returns a duplicate of the MajorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MajorQuery) Count ¶
func (mq *MajorQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MajorQuery) CountX ¶
func (mq *MajorQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MajorQuery) Exist ¶
func (mq *MajorQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MajorQuery) ExistX ¶
func (mq *MajorQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MajorQuery) First ¶
func (mq *MajorQuery) First(ctx context.Context) (*Major, error)
First returns the first Major entity from the query. Returns a *NotFoundError when no Major was found.
func (*MajorQuery) FirstID ¶
func (mq *MajorQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Major ID from the query. Returns a *NotFoundError when no Major ID was found.
func (*MajorQuery) FirstIDX ¶
func (mq *MajorQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MajorQuery) FirstX ¶
func (mq *MajorQuery) FirstX(ctx context.Context) *Major
FirstX is like First, but panics if an error occurs.
func (*MajorQuery) GroupBy ¶
func (mq *MajorQuery) GroupBy(field string, fields ...string) *MajorGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Major.Query(). GroupBy(major.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*MajorQuery) IDs ¶
func (mq *MajorQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Major IDs.
func (*MajorQuery) IDsX ¶
func (mq *MajorQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MajorQuery) Limit ¶
func (mq *MajorQuery) Limit(limit int) *MajorQuery
Limit the number of records to be returned by this query.
func (*MajorQuery) Offset ¶
func (mq *MajorQuery) Offset(offset int) *MajorQuery
Offset to start from.
func (*MajorQuery) Only ¶
func (mq *MajorQuery) Only(ctx context.Context) (*Major, error)
Only returns a single Major entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Major entity is found. Returns a *NotFoundError when no Major entities are found.
func (*MajorQuery) OnlyID ¶
func (mq *MajorQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Major ID in the query. Returns a *NotSingularError when more than one Major ID is found. Returns a *NotFoundError when no entities are found.
func (*MajorQuery) OnlyIDX ¶
func (mq *MajorQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MajorQuery) OnlyX ¶
func (mq *MajorQuery) OnlyX(ctx context.Context) *Major
OnlyX is like Only, but panics if an error occurs.
func (*MajorQuery) Order ¶
func (mq *MajorQuery) Order(o ...OrderFunc) *MajorQuery
Order specifies how the records should be ordered.
func (*MajorQuery) QueryClass ¶
func (mq *MajorQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*MajorQuery) QueryDepartment ¶
func (mq *MajorQuery) QueryDepartment() *DepartmentQuery
QueryDepartment chains the current query on the "department" edge.
func (*MajorQuery) QueryStudent ¶
func (mq *MajorQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*MajorQuery) Select ¶
func (mq *MajorQuery) Select(fields ...string) *MajorSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Major.Query(). Select(major.FieldName). Scan(ctx, &v)
func (*MajorQuery) Unique ¶
func (mq *MajorQuery) Unique(unique bool) *MajorQuery
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 (*MajorQuery) Where ¶
func (mq *MajorQuery) Where(ps ...predicate.Major) *MajorQuery
Where adds a new predicate for the MajorQuery builder.
func (*MajorQuery) WithClass ¶
func (mq *MajorQuery) WithClass(opts ...func(*ClassQuery)) *MajorQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
func (*MajorQuery) WithDepartment ¶
func (mq *MajorQuery) WithDepartment(opts ...func(*DepartmentQuery)) *MajorQuery
WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.
func (*MajorQuery) WithStudent ¶
func (mq *MajorQuery) WithStudent(opts ...func(*StudentQuery)) *MajorQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type MajorSelect ¶
type MajorSelect struct { *MajorQuery // contains filtered or unexported fields }
MajorSelect is the builder for selecting fields of Major entities.
func (*MajorSelect) Aggregate ¶
func (ms *MajorSelect) Aggregate(fns ...AggregateFunc) *MajorSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MajorSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MajorSelect) Scan ¶
func (ms *MajorSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MajorSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MajorUpdate ¶
type MajorUpdate struct {
// contains filtered or unexported fields
}
MajorUpdate is the builder for updating Major entities.
func (*MajorUpdate) AddClasIDs ¶
func (mu *MajorUpdate) AddClasIDs(ids ...int) *MajorUpdate
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*MajorUpdate) AddClass ¶
func (mu *MajorUpdate) AddClass(c ...*Class) *MajorUpdate
AddClass adds the "class" edges to the Class entity.
func (*MajorUpdate) AddStudent ¶
func (mu *MajorUpdate) AddStudent(s ...*Student) *MajorUpdate
AddStudent adds the "student" edges to the Student entity.
func (*MajorUpdate) AddStudentIDs ¶
func (mu *MajorUpdate) AddStudentIDs(ids ...int) *MajorUpdate
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*MajorUpdate) ClearClass ¶
func (mu *MajorUpdate) ClearClass() *MajorUpdate
ClearClass clears all "class" edges to the Class entity.
func (*MajorUpdate) ClearDepartment ¶
func (mu *MajorUpdate) ClearDepartment() *MajorUpdate
ClearDepartment clears the "department" edge to the Department entity.
func (*MajorUpdate) ClearStudent ¶
func (mu *MajorUpdate) ClearStudent() *MajorUpdate
ClearStudent clears all "student" edges to the Student entity.
func (*MajorUpdate) Exec ¶
func (mu *MajorUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MajorUpdate) ExecX ¶
func (mu *MajorUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorUpdate) Mutation ¶
func (mu *MajorUpdate) Mutation() *MajorMutation
Mutation returns the MajorMutation object of the builder.
func (*MajorUpdate) RemoveClasIDs ¶
func (mu *MajorUpdate) RemoveClasIDs(ids ...int) *MajorUpdate
RemoveClasIDs removes the "class" edge to Class entities by IDs.
func (*MajorUpdate) RemoveClass ¶
func (mu *MajorUpdate) RemoveClass(c ...*Class) *MajorUpdate
RemoveClass removes "class" edges to Class entities.
func (*MajorUpdate) RemoveStudent ¶
func (mu *MajorUpdate) RemoveStudent(s ...*Student) *MajorUpdate
RemoveStudent removes "student" edges to Student entities.
func (*MajorUpdate) RemoveStudentIDs ¶
func (mu *MajorUpdate) RemoveStudentIDs(ids ...int) *MajorUpdate
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*MajorUpdate) Save ¶
func (mu *MajorUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MajorUpdate) SaveX ¶
func (mu *MajorUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MajorUpdate) SetCode ¶
func (mu *MajorUpdate) SetCode(s string) *MajorUpdate
SetCode sets the "code" field.
func (*MajorUpdate) SetDepartment ¶
func (mu *MajorUpdate) SetDepartment(d *Department) *MajorUpdate
SetDepartment sets the "department" edge to the Department entity.
func (*MajorUpdate) SetDepartmentID ¶
func (mu *MajorUpdate) SetDepartmentID(id int) *MajorUpdate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*MajorUpdate) SetDescription ¶
func (mu *MajorUpdate) SetDescription(s string) *MajorUpdate
SetDescription sets the "description" field.
func (*MajorUpdate) SetEnrollmentType ¶
func (mu *MajorUpdate) SetEnrollmentType(s string) *MajorUpdate
SetEnrollmentType sets the "enrollment_type" field.
func (*MajorUpdate) SetIsMajorCategory ¶
func (mu *MajorUpdate) SetIsMajorCategory(b bool) *MajorUpdate
SetIsMajorCategory sets the "is_major_category" field.
func (*MajorUpdate) SetMajorCategory ¶
func (mu *MajorUpdate) SetMajorCategory(s string) *MajorUpdate
SetMajorCategory sets the "major_category" field.
func (*MajorUpdate) SetName ¶
func (mu *MajorUpdate) SetName(s string) *MajorUpdate
SetName sets the "name" field.
func (*MajorUpdate) SetNillableDepartmentID ¶
func (mu *MajorUpdate) SetNillableDepartmentID(id *int) *MajorUpdate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*MajorUpdate) SetSpecialType ¶
func (mu *MajorUpdate) SetSpecialType(s string) *MajorUpdate
SetSpecialType sets the "special_type" field.
func (*MajorUpdate) Where ¶
func (mu *MajorUpdate) Where(ps ...predicate.Major) *MajorUpdate
Where appends a list predicates to the MajorUpdate builder.
type MajorUpdateOne ¶
type MajorUpdateOne struct {
// contains filtered or unexported fields
}
MajorUpdateOne is the builder for updating a single Major entity.
func (*MajorUpdateOne) AddClasIDs ¶
func (muo *MajorUpdateOne) AddClasIDs(ids ...int) *MajorUpdateOne
AddClasIDs adds the "class" edge to the Class entity by IDs.
func (*MajorUpdateOne) AddClass ¶
func (muo *MajorUpdateOne) AddClass(c ...*Class) *MajorUpdateOne
AddClass adds the "class" edges to the Class entity.
func (*MajorUpdateOne) AddStudent ¶
func (muo *MajorUpdateOne) AddStudent(s ...*Student) *MajorUpdateOne
AddStudent adds the "student" edges to the Student entity.
func (*MajorUpdateOne) AddStudentIDs ¶
func (muo *MajorUpdateOne) AddStudentIDs(ids ...int) *MajorUpdateOne
AddStudentIDs adds the "student" edge to the Student entity by IDs.
func (*MajorUpdateOne) ClearClass ¶
func (muo *MajorUpdateOne) ClearClass() *MajorUpdateOne
ClearClass clears all "class" edges to the Class entity.
func (*MajorUpdateOne) ClearDepartment ¶
func (muo *MajorUpdateOne) ClearDepartment() *MajorUpdateOne
ClearDepartment clears the "department" edge to the Department entity.
func (*MajorUpdateOne) ClearStudent ¶
func (muo *MajorUpdateOne) ClearStudent() *MajorUpdateOne
ClearStudent clears all "student" edges to the Student entity.
func (*MajorUpdateOne) Exec ¶
func (muo *MajorUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MajorUpdateOne) ExecX ¶
func (muo *MajorUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MajorUpdateOne) Mutation ¶
func (muo *MajorUpdateOne) Mutation() *MajorMutation
Mutation returns the MajorMutation object of the builder.
func (*MajorUpdateOne) RemoveClasIDs ¶
func (muo *MajorUpdateOne) RemoveClasIDs(ids ...int) *MajorUpdateOne
RemoveClasIDs removes the "class" edge to Class entities by IDs.
func (*MajorUpdateOne) RemoveClass ¶
func (muo *MajorUpdateOne) RemoveClass(c ...*Class) *MajorUpdateOne
RemoveClass removes "class" edges to Class entities.
func (*MajorUpdateOne) RemoveStudent ¶
func (muo *MajorUpdateOne) RemoveStudent(s ...*Student) *MajorUpdateOne
RemoveStudent removes "student" edges to Student entities.
func (*MajorUpdateOne) RemoveStudentIDs ¶
func (muo *MajorUpdateOne) RemoveStudentIDs(ids ...int) *MajorUpdateOne
RemoveStudentIDs removes the "student" edge to Student entities by IDs.
func (*MajorUpdateOne) Save ¶
func (muo *MajorUpdateOne) Save(ctx context.Context) (*Major, error)
Save executes the query and returns the updated Major entity.
func (*MajorUpdateOne) SaveX ¶
func (muo *MajorUpdateOne) SaveX(ctx context.Context) *Major
SaveX is like Save, but panics if an error occurs.
func (*MajorUpdateOne) Select ¶
func (muo *MajorUpdateOne) Select(field string, fields ...string) *MajorUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MajorUpdateOne) SetCode ¶
func (muo *MajorUpdateOne) SetCode(s string) *MajorUpdateOne
SetCode sets the "code" field.
func (*MajorUpdateOne) SetDepartment ¶
func (muo *MajorUpdateOne) SetDepartment(d *Department) *MajorUpdateOne
SetDepartment sets the "department" edge to the Department entity.
func (*MajorUpdateOne) SetDepartmentID ¶
func (muo *MajorUpdateOne) SetDepartmentID(id int) *MajorUpdateOne
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*MajorUpdateOne) SetDescription ¶
func (muo *MajorUpdateOne) SetDescription(s string) *MajorUpdateOne
SetDescription sets the "description" field.
func (*MajorUpdateOne) SetEnrollmentType ¶
func (muo *MajorUpdateOne) SetEnrollmentType(s string) *MajorUpdateOne
SetEnrollmentType sets the "enrollment_type" field.
func (*MajorUpdateOne) SetIsMajorCategory ¶
func (muo *MajorUpdateOne) SetIsMajorCategory(b bool) *MajorUpdateOne
SetIsMajorCategory sets the "is_major_category" field.
func (*MajorUpdateOne) SetMajorCategory ¶
func (muo *MajorUpdateOne) SetMajorCategory(s string) *MajorUpdateOne
SetMajorCategory sets the "major_category" field.
func (*MajorUpdateOne) SetName ¶
func (muo *MajorUpdateOne) SetName(s string) *MajorUpdateOne
SetName sets the "name" field.
func (*MajorUpdateOne) SetNillableDepartmentID ¶
func (muo *MajorUpdateOne) SetNillableDepartmentID(id *int) *MajorUpdateOne
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*MajorUpdateOne) SetSpecialType ¶
func (muo *MajorUpdateOne) SetSpecialType(s string) *MajorUpdateOne
SetSpecialType sets the "special_type" field.
func (*MajorUpdateOne) Where ¶
func (muo *MajorUpdateOne) Where(ps ...predicate.Major) *MajorUpdateOne
Where appends a list predicates to the MajorUpdate builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type PracticalExperience ¶
type PracticalExperience struct { // ID of the ent. ID int `json:"id,omitempty"` // 实践名称 Name string `json:"name,omitempty"` // 实践单位 Unit string `json:"unit,omitempty"` // 开始时间 StartTime string `json:"start_time,omitempty"` // 结束时间 EndTime string `json:"end_time,omitempty"` // 实践描述 Describe string `json:"describe,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PracticalExperienceQuery when eager-loading is set. Edges PracticalExperienceEdges `json:"edges"` // contains filtered or unexported fields }
PracticalExperience is the model entity for the PracticalExperience schema.
func (*PracticalExperience) QueryStudent ¶
func (pe *PracticalExperience) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the PracticalExperience entity.
func (*PracticalExperience) String ¶
func (pe *PracticalExperience) String() string
String implements the fmt.Stringer.
func (*PracticalExperience) Unwrap ¶
func (pe *PracticalExperience) Unwrap() *PracticalExperience
Unwrap unwraps the PracticalExperience 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 (*PracticalExperience) Update ¶
func (pe *PracticalExperience) Update() *PracticalExperienceUpdateOne
Update returns a builder for updating this PracticalExperience. Note that you need to call PracticalExperience.Unwrap() before calling this method if this PracticalExperience was returned from a transaction, and the transaction was committed or rolled back.
type PracticalExperienceClient ¶
type PracticalExperienceClient struct {
// contains filtered or unexported fields
}
PracticalExperienceClient is a client for the PracticalExperience schema.
func NewPracticalExperienceClient ¶
func NewPracticalExperienceClient(c config) *PracticalExperienceClient
NewPracticalExperienceClient returns a client for the PracticalExperience from the given config.
func (*PracticalExperienceClient) Create ¶
func (c *PracticalExperienceClient) Create() *PracticalExperienceCreate
Create returns a builder for creating a PracticalExperience entity.
func (*PracticalExperienceClient) CreateBulk ¶
func (c *PracticalExperienceClient) CreateBulk(builders ...*PracticalExperienceCreate) *PracticalExperienceCreateBulk
CreateBulk returns a builder for creating a bulk of PracticalExperience entities.
func (*PracticalExperienceClient) Delete ¶
func (c *PracticalExperienceClient) Delete() *PracticalExperienceDelete
Delete returns a delete builder for PracticalExperience.
func (*PracticalExperienceClient) DeleteOne ¶
func (c *PracticalExperienceClient) DeleteOne(pe *PracticalExperience) *PracticalExperienceDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PracticalExperienceClient) DeleteOneID ¶
func (c *PracticalExperienceClient) DeleteOneID(id int) *PracticalExperienceDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PracticalExperienceClient) Get ¶
func (c *PracticalExperienceClient) Get(ctx context.Context, id int) (*PracticalExperience, error)
Get returns a PracticalExperience entity by its id.
func (*PracticalExperienceClient) GetX ¶
func (c *PracticalExperienceClient) GetX(ctx context.Context, id int) *PracticalExperience
GetX is like Get, but panics if an error occurs.
func (*PracticalExperienceClient) Hooks ¶
func (c *PracticalExperienceClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PracticalExperienceClient) Intercept ¶
func (c *PracticalExperienceClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `practicalexperience.Intercept(f(g(h())))`.
func (*PracticalExperienceClient) Interceptors ¶
func (c *PracticalExperienceClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PracticalExperienceClient) Query ¶
func (c *PracticalExperienceClient) Query() *PracticalExperienceQuery
Query returns a query builder for PracticalExperience.
func (*PracticalExperienceClient) QueryStudent ¶
func (c *PracticalExperienceClient) QueryStudent(pe *PracticalExperience) *StudentQuery
QueryStudent queries the student edge of a PracticalExperience.
func (*PracticalExperienceClient) Update ¶
func (c *PracticalExperienceClient) Update() *PracticalExperienceUpdate
Update returns an update builder for PracticalExperience.
func (*PracticalExperienceClient) UpdateOne ¶
func (c *PracticalExperienceClient) UpdateOne(pe *PracticalExperience) *PracticalExperienceUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PracticalExperienceClient) UpdateOneID ¶
func (c *PracticalExperienceClient) UpdateOneID(id int) *PracticalExperienceUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PracticalExperienceClient) Use ¶
func (c *PracticalExperienceClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `practicalexperience.Hooks(f(g(h())))`.
type PracticalExperienceCreate ¶
type PracticalExperienceCreate struct {
// contains filtered or unexported fields
}
PracticalExperienceCreate is the builder for creating a PracticalExperience entity.
func (*PracticalExperienceCreate) Exec ¶
func (pec *PracticalExperienceCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PracticalExperienceCreate) ExecX ¶
func (pec *PracticalExperienceCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceCreate) Mutation ¶
func (pec *PracticalExperienceCreate) Mutation() *PracticalExperienceMutation
Mutation returns the PracticalExperienceMutation object of the builder.
func (*PracticalExperienceCreate) Save ¶
func (pec *PracticalExperienceCreate) Save(ctx context.Context) (*PracticalExperience, error)
Save creates the PracticalExperience in the database.
func (*PracticalExperienceCreate) SaveX ¶
func (pec *PracticalExperienceCreate) SaveX(ctx context.Context) *PracticalExperience
SaveX calls Save and panics if Save returns an error.
func (*PracticalExperienceCreate) SetDescribe ¶
func (pec *PracticalExperienceCreate) SetDescribe(s string) *PracticalExperienceCreate
SetDescribe sets the "describe" field.
func (*PracticalExperienceCreate) SetEndTime ¶
func (pec *PracticalExperienceCreate) SetEndTime(s string) *PracticalExperienceCreate
SetEndTime sets the "end_time" field.
func (*PracticalExperienceCreate) SetName ¶
func (pec *PracticalExperienceCreate) SetName(s string) *PracticalExperienceCreate
SetName sets the "name" field.
func (*PracticalExperienceCreate) SetNillableStudentID ¶
func (pec *PracticalExperienceCreate) SetNillableStudentID(id *int) *PracticalExperienceCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*PracticalExperienceCreate) SetStartTime ¶
func (pec *PracticalExperienceCreate) SetStartTime(s string) *PracticalExperienceCreate
SetStartTime sets the "start_time" field.
func (*PracticalExperienceCreate) SetStudent ¶
func (pec *PracticalExperienceCreate) SetStudent(s *Student) *PracticalExperienceCreate
SetStudent sets the "student" edge to the Student entity.
func (*PracticalExperienceCreate) SetStudentID ¶
func (pec *PracticalExperienceCreate) SetStudentID(id int) *PracticalExperienceCreate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*PracticalExperienceCreate) SetUnit ¶
func (pec *PracticalExperienceCreate) SetUnit(s string) *PracticalExperienceCreate
SetUnit sets the "unit" field.
type PracticalExperienceCreateBulk ¶
type PracticalExperienceCreateBulk struct {
// contains filtered or unexported fields
}
PracticalExperienceCreateBulk is the builder for creating many PracticalExperience entities in bulk.
func (*PracticalExperienceCreateBulk) Exec ¶
func (pecb *PracticalExperienceCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PracticalExperienceCreateBulk) ExecX ¶
func (pecb *PracticalExperienceCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceCreateBulk) Save ¶
func (pecb *PracticalExperienceCreateBulk) Save(ctx context.Context) ([]*PracticalExperience, error)
Save creates the PracticalExperience entities in the database.
func (*PracticalExperienceCreateBulk) SaveX ¶
func (pecb *PracticalExperienceCreateBulk) SaveX(ctx context.Context) []*PracticalExperience
SaveX is like Save, but panics if an error occurs.
type PracticalExperienceDelete ¶
type PracticalExperienceDelete struct {
// contains filtered or unexported fields
}
PracticalExperienceDelete is the builder for deleting a PracticalExperience entity.
func (*PracticalExperienceDelete) Exec ¶
func (ped *PracticalExperienceDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PracticalExperienceDelete) ExecX ¶
func (ped *PracticalExperienceDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceDelete) Where ¶
func (ped *PracticalExperienceDelete) Where(ps ...predicate.PracticalExperience) *PracticalExperienceDelete
Where appends a list predicates to the PracticalExperienceDelete builder.
type PracticalExperienceDeleteOne ¶
type PracticalExperienceDeleteOne struct {
// contains filtered or unexported fields
}
PracticalExperienceDeleteOne is the builder for deleting a single PracticalExperience entity.
func (*PracticalExperienceDeleteOne) Exec ¶
func (pedo *PracticalExperienceDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PracticalExperienceDeleteOne) ExecX ¶
func (pedo *PracticalExperienceDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceDeleteOne) Where ¶
func (pedo *PracticalExperienceDeleteOne) Where(ps ...predicate.PracticalExperience) *PracticalExperienceDeleteOne
Where appends a list predicates to the PracticalExperienceDelete builder.
type PracticalExperienceEdges ¶
type PracticalExperienceEdges struct { // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
PracticalExperienceEdges holds the relations/edges for other nodes in the graph.
func (PracticalExperienceEdges) StudentOrErr ¶
func (e PracticalExperienceEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PracticalExperienceGroupBy ¶
type PracticalExperienceGroupBy struct {
// contains filtered or unexported fields
}
PracticalExperienceGroupBy is the group-by builder for PracticalExperience entities.
func (*PracticalExperienceGroupBy) Aggregate ¶
func (pegb *PracticalExperienceGroupBy) Aggregate(fns ...AggregateFunc) *PracticalExperienceGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PracticalExperienceGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Float64X ¶
Float64X is like Float64, but panics if an error occurs.
func (*PracticalExperienceGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*PracticalExperienceGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceGroupBy) Scan ¶
func (pegb *PracticalExperienceGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PracticalExperienceGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PracticalExperienceMutation ¶
type PracticalExperienceMutation struct {
// contains filtered or unexported fields
}
PracticalExperienceMutation represents an operation that mutates the PracticalExperience nodes in the graph.
func (*PracticalExperienceMutation) AddField ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) AddedEdges ¶
func (m *PracticalExperienceMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PracticalExperienceMutation) AddedField ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) AddedFields ¶
func (m *PracticalExperienceMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PracticalExperienceMutation) AddedIDs ¶
func (m *PracticalExperienceMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PracticalExperienceMutation) ClearEdge ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ClearField ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ClearStudent ¶
func (m *PracticalExperienceMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*PracticalExperienceMutation) ClearedEdges ¶
func (m *PracticalExperienceMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PracticalExperienceMutation) ClearedFields ¶
func (m *PracticalExperienceMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PracticalExperienceMutation) Client ¶
func (m PracticalExperienceMutation) 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 (*PracticalExperienceMutation) Describe ¶
func (m *PracticalExperienceMutation) Describe() (r string, exists bool)
Describe returns the value of the "describe" field in the mutation.
func (*PracticalExperienceMutation) EdgeCleared ¶
func (m *PracticalExperienceMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PracticalExperienceMutation) EndTime ¶
func (m *PracticalExperienceMutation) EndTime() (r string, exists bool)
EndTime returns the value of the "end_time" field in the mutation.
func (*PracticalExperienceMutation) Field ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) FieldCleared ¶
func (m *PracticalExperienceMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PracticalExperienceMutation) Fields ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ID ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) IDs ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) Name ¶
func (m *PracticalExperienceMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PracticalExperienceMutation) OldDescribe ¶
func (m *PracticalExperienceMutation) OldDescribe(ctx context.Context) (v string, err error)
OldDescribe returns the old "describe" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldEndTime ¶
func (m *PracticalExperienceMutation) OldEndTime(ctx context.Context) (v string, err error)
OldEndTime returns the old "end_time" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) 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 (*PracticalExperienceMutation) OldName ¶
func (m *PracticalExperienceMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldStartTime ¶
func (m *PracticalExperienceMutation) OldStartTime(ctx context.Context) (v string, err error)
OldStartTime returns the old "start_time" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldUnit ¶
func (m *PracticalExperienceMutation) OldUnit(ctx context.Context) (v string, err error)
OldUnit returns the old "unit" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) Op ¶
func (m *PracticalExperienceMutation) Op() Op
Op returns the operation name.
func (*PracticalExperienceMutation) RemovedEdges ¶
func (m *PracticalExperienceMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PracticalExperienceMutation) RemovedIDs ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetDescribe ¶
func (m *PracticalExperienceMutation) ResetDescribe()
ResetDescribe resets all changes to the "describe" field.
func (*PracticalExperienceMutation) ResetEdge ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetEndTime ¶
func (m *PracticalExperienceMutation) ResetEndTime()
ResetEndTime resets all changes to the "end_time" field.
func (*PracticalExperienceMutation) ResetField ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetName ¶
func (m *PracticalExperienceMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PracticalExperienceMutation) ResetStartTime ¶
func (m *PracticalExperienceMutation) ResetStartTime()
ResetStartTime resets all changes to the "start_time" field.
func (*PracticalExperienceMutation) ResetStudent ¶
func (m *PracticalExperienceMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*PracticalExperienceMutation) ResetUnit ¶
func (m *PracticalExperienceMutation) ResetUnit()
ResetUnit resets all changes to the "unit" field.
func (*PracticalExperienceMutation) SetDescribe ¶
func (m *PracticalExperienceMutation) SetDescribe(s string)
SetDescribe sets the "describe" field.
func (*PracticalExperienceMutation) SetEndTime ¶
func (m *PracticalExperienceMutation) SetEndTime(s string)
SetEndTime sets the "end_time" field.
func (*PracticalExperienceMutation) SetField ¶
func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) SetName ¶
func (m *PracticalExperienceMutation) SetName(s string)
SetName sets the "name" field.
func (*PracticalExperienceMutation) SetOp ¶
func (m *PracticalExperienceMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PracticalExperienceMutation) SetStartTime ¶
func (m *PracticalExperienceMutation) SetStartTime(s string)
SetStartTime sets the "start_time" field.
func (*PracticalExperienceMutation) SetStudentID ¶
func (m *PracticalExperienceMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*PracticalExperienceMutation) SetUnit ¶
func (m *PracticalExperienceMutation) SetUnit(s string)
SetUnit sets the "unit" field.
func (*PracticalExperienceMutation) StartTime ¶
func (m *PracticalExperienceMutation) StartTime() (r string, exists bool)
StartTime returns the value of the "start_time" field in the mutation.
func (*PracticalExperienceMutation) StudentCleared ¶
func (m *PracticalExperienceMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*PracticalExperienceMutation) StudentID ¶
func (m *PracticalExperienceMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*PracticalExperienceMutation) StudentIDs ¶
func (m *PracticalExperienceMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (PracticalExperienceMutation) Tx ¶
func (m PracticalExperienceMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PracticalExperienceMutation) Type ¶
func (m *PracticalExperienceMutation) Type() string
Type returns the node type of this mutation (PracticalExperience).
func (*PracticalExperienceMutation) Unit ¶
func (m *PracticalExperienceMutation) Unit() (r string, exists bool)
Unit returns the value of the "unit" field in the mutation.
func (*PracticalExperienceMutation) Where ¶
func (m *PracticalExperienceMutation) Where(ps ...predicate.PracticalExperience)
Where appends a list predicates to the PracticalExperienceMutation builder.
func (*PracticalExperienceMutation) WhereP ¶
func (m *PracticalExperienceMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PracticalExperienceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PracticalExperienceQuery ¶
type PracticalExperienceQuery struct {
// contains filtered or unexported fields
}
PracticalExperienceQuery is the builder for querying PracticalExperience entities.
func (*PracticalExperienceQuery) Aggregate ¶
func (peq *PracticalExperienceQuery) Aggregate(fns ...AggregateFunc) *PracticalExperienceSelect
Aggregate returns a PracticalExperienceSelect configured with the given aggregations.
func (*PracticalExperienceQuery) All ¶
func (peq *PracticalExperienceQuery) All(ctx context.Context) ([]*PracticalExperience, error)
All executes the query and returns a list of PracticalExperiences.
func (*PracticalExperienceQuery) AllX ¶
func (peq *PracticalExperienceQuery) AllX(ctx context.Context) []*PracticalExperience
AllX is like All, but panics if an error occurs.
func (*PracticalExperienceQuery) Clone ¶
func (peq *PracticalExperienceQuery) Clone() *PracticalExperienceQuery
Clone returns a duplicate of the PracticalExperienceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PracticalExperienceQuery) Count ¶
func (peq *PracticalExperienceQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PracticalExperienceQuery) CountX ¶
func (peq *PracticalExperienceQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PracticalExperienceQuery) Exist ¶
func (peq *PracticalExperienceQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PracticalExperienceQuery) ExistX ¶
func (peq *PracticalExperienceQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PracticalExperienceQuery) First ¶
func (peq *PracticalExperienceQuery) First(ctx context.Context) (*PracticalExperience, error)
First returns the first PracticalExperience entity from the query. Returns a *NotFoundError when no PracticalExperience was found.
func (*PracticalExperienceQuery) FirstID ¶
func (peq *PracticalExperienceQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PracticalExperience ID from the query. Returns a *NotFoundError when no PracticalExperience ID was found.
func (*PracticalExperienceQuery) FirstIDX ¶
func (peq *PracticalExperienceQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PracticalExperienceQuery) FirstX ¶
func (peq *PracticalExperienceQuery) FirstX(ctx context.Context) *PracticalExperience
FirstX is like First, but panics if an error occurs.
func (*PracticalExperienceQuery) GroupBy ¶
func (peq *PracticalExperienceQuery) GroupBy(field string, fields ...string) *PracticalExperienceGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.PracticalExperience.Query(). GroupBy(practicalexperience.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*PracticalExperienceQuery) IDs ¶
func (peq *PracticalExperienceQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of PracticalExperience IDs.
func (*PracticalExperienceQuery) IDsX ¶
func (peq *PracticalExperienceQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PracticalExperienceQuery) Limit ¶
func (peq *PracticalExperienceQuery) Limit(limit int) *PracticalExperienceQuery
Limit the number of records to be returned by this query.
func (*PracticalExperienceQuery) Offset ¶
func (peq *PracticalExperienceQuery) Offset(offset int) *PracticalExperienceQuery
Offset to start from.
func (*PracticalExperienceQuery) Only ¶
func (peq *PracticalExperienceQuery) Only(ctx context.Context) (*PracticalExperience, error)
Only returns a single PracticalExperience entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PracticalExperience entity is found. Returns a *NotFoundError when no PracticalExperience entities are found.
func (*PracticalExperienceQuery) OnlyID ¶
func (peq *PracticalExperienceQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PracticalExperience ID in the query. Returns a *NotSingularError when more than one PracticalExperience ID is found. Returns a *NotFoundError when no entities are found.
func (*PracticalExperienceQuery) OnlyIDX ¶
func (peq *PracticalExperienceQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PracticalExperienceQuery) OnlyX ¶
func (peq *PracticalExperienceQuery) OnlyX(ctx context.Context) *PracticalExperience
OnlyX is like Only, but panics if an error occurs.
func (*PracticalExperienceQuery) Order ¶
func (peq *PracticalExperienceQuery) Order(o ...OrderFunc) *PracticalExperienceQuery
Order specifies how the records should be ordered.
func (*PracticalExperienceQuery) QueryStudent ¶
func (peq *PracticalExperienceQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*PracticalExperienceQuery) Select ¶
func (peq *PracticalExperienceQuery) Select(fields ...string) *PracticalExperienceSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.PracticalExperience.Query(). Select(practicalexperience.FieldName). Scan(ctx, &v)
func (*PracticalExperienceQuery) Unique ¶
func (peq *PracticalExperienceQuery) Unique(unique bool) *PracticalExperienceQuery
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 (*PracticalExperienceQuery) Where ¶
func (peq *PracticalExperienceQuery) Where(ps ...predicate.PracticalExperience) *PracticalExperienceQuery
Where adds a new predicate for the PracticalExperienceQuery builder.
func (*PracticalExperienceQuery) WithStudent ¶
func (peq *PracticalExperienceQuery) WithStudent(opts ...func(*StudentQuery)) *PracticalExperienceQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type PracticalExperienceSelect ¶
type PracticalExperienceSelect struct { *PracticalExperienceQuery // contains filtered or unexported fields }
PracticalExperienceSelect is the builder for selecting fields of PracticalExperience entities.
func (*PracticalExperienceSelect) Aggregate ¶
func (pes *PracticalExperienceSelect) Aggregate(fns ...AggregateFunc) *PracticalExperienceSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PracticalExperienceSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Float64X ¶
Float64X is like Float64, but panics if an error occurs.
func (*PracticalExperienceSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*PracticalExperienceSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PracticalExperienceSelect) Scan ¶
func (pes *PracticalExperienceSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PracticalExperienceSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PracticalExperienceUpdate ¶
type PracticalExperienceUpdate struct {
// contains filtered or unexported fields
}
PracticalExperienceUpdate is the builder for updating PracticalExperience entities.
func (*PracticalExperienceUpdate) ClearStudent ¶
func (peu *PracticalExperienceUpdate) ClearStudent() *PracticalExperienceUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*PracticalExperienceUpdate) Exec ¶
func (peu *PracticalExperienceUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PracticalExperienceUpdate) ExecX ¶
func (peu *PracticalExperienceUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceUpdate) Mutation ¶
func (peu *PracticalExperienceUpdate) Mutation() *PracticalExperienceMutation
Mutation returns the PracticalExperienceMutation object of the builder.
func (*PracticalExperienceUpdate) Save ¶
func (peu *PracticalExperienceUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PracticalExperienceUpdate) SaveX ¶
func (peu *PracticalExperienceUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PracticalExperienceUpdate) SetDescribe ¶
func (peu *PracticalExperienceUpdate) SetDescribe(s string) *PracticalExperienceUpdate
SetDescribe sets the "describe" field.
func (*PracticalExperienceUpdate) SetEndTime ¶
func (peu *PracticalExperienceUpdate) SetEndTime(s string) *PracticalExperienceUpdate
SetEndTime sets the "end_time" field.
func (*PracticalExperienceUpdate) SetName ¶
func (peu *PracticalExperienceUpdate) SetName(s string) *PracticalExperienceUpdate
SetName sets the "name" field.
func (*PracticalExperienceUpdate) SetNillableStudentID ¶
func (peu *PracticalExperienceUpdate) SetNillableStudentID(id *int) *PracticalExperienceUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*PracticalExperienceUpdate) SetStartTime ¶
func (peu *PracticalExperienceUpdate) SetStartTime(s string) *PracticalExperienceUpdate
SetStartTime sets the "start_time" field.
func (*PracticalExperienceUpdate) SetStudent ¶
func (peu *PracticalExperienceUpdate) SetStudent(s *Student) *PracticalExperienceUpdate
SetStudent sets the "student" edge to the Student entity.
func (*PracticalExperienceUpdate) SetStudentID ¶
func (peu *PracticalExperienceUpdate) SetStudentID(id int) *PracticalExperienceUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*PracticalExperienceUpdate) SetUnit ¶
func (peu *PracticalExperienceUpdate) SetUnit(s string) *PracticalExperienceUpdate
SetUnit sets the "unit" field.
func (*PracticalExperienceUpdate) Where ¶
func (peu *PracticalExperienceUpdate) Where(ps ...predicate.PracticalExperience) *PracticalExperienceUpdate
Where appends a list predicates to the PracticalExperienceUpdate builder.
type PracticalExperienceUpdateOne ¶
type PracticalExperienceUpdateOne struct {
// contains filtered or unexported fields
}
PracticalExperienceUpdateOne is the builder for updating a single PracticalExperience entity.
func (*PracticalExperienceUpdateOne) ClearStudent ¶
func (peuo *PracticalExperienceUpdateOne) ClearStudent() *PracticalExperienceUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*PracticalExperienceUpdateOne) Exec ¶
func (peuo *PracticalExperienceUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PracticalExperienceUpdateOne) ExecX ¶
func (peuo *PracticalExperienceUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PracticalExperienceUpdateOne) Mutation ¶
func (peuo *PracticalExperienceUpdateOne) Mutation() *PracticalExperienceMutation
Mutation returns the PracticalExperienceMutation object of the builder.
func (*PracticalExperienceUpdateOne) Save ¶
func (peuo *PracticalExperienceUpdateOne) Save(ctx context.Context) (*PracticalExperience, error)
Save executes the query and returns the updated PracticalExperience entity.
func (*PracticalExperienceUpdateOne) SaveX ¶
func (peuo *PracticalExperienceUpdateOne) SaveX(ctx context.Context) *PracticalExperience
SaveX is like Save, but panics if an error occurs.
func (*PracticalExperienceUpdateOne) Select ¶
func (peuo *PracticalExperienceUpdateOne) Select(field string, fields ...string) *PracticalExperienceUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PracticalExperienceUpdateOne) SetDescribe ¶
func (peuo *PracticalExperienceUpdateOne) SetDescribe(s string) *PracticalExperienceUpdateOne
SetDescribe sets the "describe" field.
func (*PracticalExperienceUpdateOne) SetEndTime ¶
func (peuo *PracticalExperienceUpdateOne) SetEndTime(s string) *PracticalExperienceUpdateOne
SetEndTime sets the "end_time" field.
func (*PracticalExperienceUpdateOne) SetName ¶
func (peuo *PracticalExperienceUpdateOne) SetName(s string) *PracticalExperienceUpdateOne
SetName sets the "name" field.
func (*PracticalExperienceUpdateOne) SetNillableStudentID ¶
func (peuo *PracticalExperienceUpdateOne) SetNillableStudentID(id *int) *PracticalExperienceUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*PracticalExperienceUpdateOne) SetStartTime ¶
func (peuo *PracticalExperienceUpdateOne) SetStartTime(s string) *PracticalExperienceUpdateOne
SetStartTime sets the "start_time" field.
func (*PracticalExperienceUpdateOne) SetStudent ¶
func (peuo *PracticalExperienceUpdateOne) SetStudent(s *Student) *PracticalExperienceUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*PracticalExperienceUpdateOne) SetStudentID ¶
func (peuo *PracticalExperienceUpdateOne) SetStudentID(id int) *PracticalExperienceUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*PracticalExperienceUpdateOne) SetUnit ¶
func (peuo *PracticalExperienceUpdateOne) SetUnit(s string) *PracticalExperienceUpdateOne
SetUnit sets the "unit" field.
func (*PracticalExperienceUpdateOne) Where ¶
func (peuo *PracticalExperienceUpdateOne) Where(ps ...predicate.PracticalExperience) *PracticalExperienceUpdateOne
Where appends a list predicates to the PracticalExperienceUpdate builder.
type PracticalExperiences ¶
type PracticalExperiences []*PracticalExperience
PracticalExperiences is a parsable slice of PracticalExperience.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type Resource ¶
type Resource struct { // ID of the ent. ID int `json:"id,omitempty"` // ResourceName holds the value of the "resource_name" field. ResourceName string `json:"resource_name,omitempty"` // ResourceValue holds the value of the "resource_value" field. ResourceValue string `json:"resource_value,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ResourceQuery when eager-loading is set. Edges ResourceEdges `json:"edges"` // contains filtered or unexported fields }
Resource is the model entity for the Resource schema.
func (*Resource) QueryAuthorization ¶
func (r *Resource) QueryAuthorization() *AuthorizationQuery
QueryAuthorization queries the "authorization" edge of the Resource entity.
func (*Resource) Unwrap ¶
Unwrap unwraps the Resource 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 (*Resource) Update ¶
func (r *Resource) Update() *ResourceUpdateOne
Update returns a builder for updating this Resource. Note that you need to call Resource.Unwrap() before calling this method if this Resource was returned from a transaction, and the transaction was committed or rolled back.
type ResourceClient ¶
type ResourceClient struct {
// contains filtered or unexported fields
}
ResourceClient is a client for the Resource schema.
func NewResourceClient ¶
func NewResourceClient(c config) *ResourceClient
NewResourceClient returns a client for the Resource from the given config.
func (*ResourceClient) Create ¶
func (c *ResourceClient) Create() *ResourceCreate
Create returns a builder for creating a Resource entity.
func (*ResourceClient) CreateBulk ¶
func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk
CreateBulk returns a builder for creating a bulk of Resource entities.
func (*ResourceClient) Delete ¶
func (c *ResourceClient) Delete() *ResourceDelete
Delete returns a delete builder for Resource.
func (*ResourceClient) DeleteOne ¶
func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ResourceClient) DeleteOneID ¶
func (c *ResourceClient) DeleteOneID(id int) *ResourceDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ResourceClient) GetX ¶
func (c *ResourceClient) GetX(ctx context.Context, id int) *Resource
GetX is like Get, but panics if an error occurs.
func (*ResourceClient) Hooks ¶
func (c *ResourceClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ResourceClient) Intercept ¶
func (c *ResourceClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `resource.Intercept(f(g(h())))`.
func (*ResourceClient) Interceptors ¶
func (c *ResourceClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ResourceClient) Query ¶
func (c *ResourceClient) Query() *ResourceQuery
Query returns a query builder for Resource.
func (*ResourceClient) QueryAuthorization ¶
func (c *ResourceClient) QueryAuthorization(r *Resource) *AuthorizationQuery
QueryAuthorization queries the authorization edge of a Resource.
func (*ResourceClient) QueryRole ¶
func (c *ResourceClient) QueryRole(r *Resource) *RoleQuery
QueryRole queries the role edge of a Resource.
func (*ResourceClient) QueryUser ¶
func (c *ResourceClient) QueryUser(r *Resource) *UserQuery
QueryUser queries the user edge of a Resource.
func (*ResourceClient) Update ¶
func (c *ResourceClient) Update() *ResourceUpdate
Update returns an update builder for Resource.
func (*ResourceClient) UpdateOne ¶
func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ResourceClient) UpdateOneID ¶
func (c *ResourceClient) UpdateOneID(id int) *ResourceUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ResourceClient) Use ¶
func (c *ResourceClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `resource.Hooks(f(g(h())))`.
type ResourceCreate ¶
type ResourceCreate struct {
// contains filtered or unexported fields
}
ResourceCreate is the builder for creating a Resource entity.
func (*ResourceCreate) AddAuthorization ¶
func (rc *ResourceCreate) AddAuthorization(a ...*Authorization) *ResourceCreate
AddAuthorization adds the "authorization" edges to the Authorization entity.
func (*ResourceCreate) AddAuthorizationIDs ¶
func (rc *ResourceCreate) AddAuthorizationIDs(ids ...int) *ResourceCreate
AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.
func (*ResourceCreate) AddRole ¶
func (rc *ResourceCreate) AddRole(r ...*Role) *ResourceCreate
AddRole adds the "role" edges to the Role entity.
func (*ResourceCreate) AddRoleIDs ¶
func (rc *ResourceCreate) AddRoleIDs(ids ...int) *ResourceCreate
AddRoleIDs adds the "role" edge to the Role entity by IDs.
func (*ResourceCreate) AddUser ¶
func (rc *ResourceCreate) AddUser(u ...*User) *ResourceCreate
AddUser adds the "user" edges to the User entity.
func (*ResourceCreate) AddUserIDs ¶
func (rc *ResourceCreate) AddUserIDs(ids ...int) *ResourceCreate
AddUserIDs adds the "user" edge to the User entity by IDs.
func (*ResourceCreate) Exec ¶
func (rc *ResourceCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceCreate) ExecX ¶
func (rc *ResourceCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceCreate) Mutation ¶
func (rc *ResourceCreate) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceCreate) Save ¶
func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)
Save creates the Resource in the database.
func (*ResourceCreate) SaveX ¶
func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource
SaveX calls Save and panics if Save returns an error.
func (*ResourceCreate) SetResourceName ¶
func (rc *ResourceCreate) SetResourceName(s string) *ResourceCreate
SetResourceName sets the "resource_name" field.
func (*ResourceCreate) SetResourceValue ¶
func (rc *ResourceCreate) SetResourceValue(s string) *ResourceCreate
SetResourceValue sets the "resource_value" field.
type ResourceCreateBulk ¶
type ResourceCreateBulk struct {
// contains filtered or unexported fields
}
ResourceCreateBulk is the builder for creating many Resource entities in bulk.
func (*ResourceCreateBulk) Exec ¶
func (rcb *ResourceCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceCreateBulk) ExecX ¶
func (rcb *ResourceCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ResourceDelete ¶
type ResourceDelete struct {
// contains filtered or unexported fields
}
ResourceDelete is the builder for deleting a Resource entity.
func (*ResourceDelete) Exec ¶
func (rd *ResourceDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ResourceDelete) ExecX ¶
func (rd *ResourceDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ResourceDelete) Where ¶
func (rd *ResourceDelete) Where(ps ...predicate.Resource) *ResourceDelete
Where appends a list predicates to the ResourceDelete builder.
type ResourceDeleteOne ¶
type ResourceDeleteOne struct {
// contains filtered or unexported fields
}
ResourceDeleteOne is the builder for deleting a single Resource entity.
func (*ResourceDeleteOne) Exec ¶
func (rdo *ResourceDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ResourceDeleteOne) ExecX ¶
func (rdo *ResourceDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceDeleteOne) Where ¶
func (rdo *ResourceDeleteOne) Where(ps ...predicate.Resource) *ResourceDeleteOne
Where appends a list predicates to the ResourceDelete builder.
type ResourceEdges ¶
type ResourceEdges struct { // Role holds the value of the role edge. Role []*Role `json:"role,omitempty"` // User holds the value of the user edge. User []*User `json:"user,omitempty"` // Authorization holds the value of the authorization edge. Authorization []*Authorization `json:"authorization,omitempty"` // contains filtered or unexported fields }
ResourceEdges holds the relations/edges for other nodes in the graph.
func (ResourceEdges) AuthorizationOrErr ¶
func (e ResourceEdges) AuthorizationOrErr() ([]*Authorization, error)
AuthorizationOrErr returns the Authorization value or an error if the edge was not loaded in eager-loading.
func (ResourceEdges) RoleOrErr ¶
func (e ResourceEdges) RoleOrErr() ([]*Role, error)
RoleOrErr returns the Role value or an error if the edge was not loaded in eager-loading.
func (ResourceEdges) UserOrErr ¶
func (e ResourceEdges) UserOrErr() ([]*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.
type ResourceGroupBy ¶
type ResourceGroupBy struct {
// contains filtered or unexported fields
}
ResourceGroupBy is the group-by builder for Resource entities.
func (*ResourceGroupBy) Aggregate ¶
func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ResourceGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Scan ¶
func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ResourceGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ResourceMutation ¶
type ResourceMutation struct {
// contains filtered or unexported fields
}
ResourceMutation represents an operation that mutates the Resource nodes in the graph.
func (*ResourceMutation) AddAuthorizationIDs ¶
func (m *ResourceMutation) AddAuthorizationIDs(ids ...int)
AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by ids.
func (*ResourceMutation) AddField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) AddRoleIDs ¶
func (m *ResourceMutation) AddRoleIDs(ids ...int)
AddRoleIDs adds the "role" edge to the Role entity by ids.
func (*ResourceMutation) AddUserIDs ¶
func (m *ResourceMutation) AddUserIDs(ids ...int)
AddUserIDs adds the "user" edge to the User entity by ids.
func (*ResourceMutation) AddedEdges ¶
func (m *ResourceMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ResourceMutation) AddedField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) AddedFields ¶
func (m *ResourceMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ResourceMutation) AddedIDs ¶
func (m *ResourceMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ResourceMutation) AuthorizationCleared ¶
func (m *ResourceMutation) AuthorizationCleared() bool
AuthorizationCleared reports if the "authorization" edge to the Authorization entity was cleared.
func (*ResourceMutation) AuthorizationIDs ¶
func (m *ResourceMutation) AuthorizationIDs() (ids []int)
AuthorizationIDs returns the "authorization" edge IDs in the mutation.
func (*ResourceMutation) ClearAuthorization ¶
func (m *ResourceMutation) ClearAuthorization()
ClearAuthorization clears the "authorization" edge to the Authorization entity.
func (*ResourceMutation) ClearEdge ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ClearField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ClearRole ¶
func (m *ResourceMutation) ClearRole()
ClearRole clears the "role" edge to the Role entity.
func (*ResourceMutation) ClearUser ¶
func (m *ResourceMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ResourceMutation) ClearedEdges ¶
func (m *ResourceMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ResourceMutation) ClearedFields ¶
func (m *ResourceMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ResourceMutation) Client ¶
func (m ResourceMutation) 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 (*ResourceMutation) EdgeCleared ¶
func (m *ResourceMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ResourceMutation) Field ¶
func (m *ResourceMutation) 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 (*ResourceMutation) FieldCleared ¶
func (m *ResourceMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ResourceMutation) Fields ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ID ¶
func (m *ResourceMutation) 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 (*ResourceMutation) IDs ¶
func (m *ResourceMutation) 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 (*ResourceMutation) 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 (*ResourceMutation) OldResourceName ¶
func (m *ResourceMutation) OldResourceName(ctx context.Context) (v string, err error)
OldResourceName returns the old "resource_name" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldResourceValue ¶
func (m *ResourceMutation) OldResourceValue(ctx context.Context) (v string, err error)
OldResourceValue returns the old "resource_value" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) RemoveAuthorizationIDs ¶
func (m *ResourceMutation) RemoveAuthorizationIDs(ids ...int)
RemoveAuthorizationIDs removes the "authorization" edge to the Authorization entity by IDs.
func (*ResourceMutation) RemoveRoleIDs ¶
func (m *ResourceMutation) RemoveRoleIDs(ids ...int)
RemoveRoleIDs removes the "role" edge to the Role entity by IDs.
func (*ResourceMutation) RemoveUserIDs ¶
func (m *ResourceMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the "user" edge to the User entity by IDs.
func (*ResourceMutation) RemovedAuthorizationIDs ¶
func (m *ResourceMutation) RemovedAuthorizationIDs() (ids []int)
RemovedAuthorization returns the removed IDs of the "authorization" edge to the Authorization entity.
func (*ResourceMutation) RemovedEdges ¶
func (m *ResourceMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ResourceMutation) RemovedIDs ¶
func (m *ResourceMutation) 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 (*ResourceMutation) RemovedRoleIDs ¶
func (m *ResourceMutation) RemovedRoleIDs() (ids []int)
RemovedRole returns the removed IDs of the "role" edge to the Role entity.
func (*ResourceMutation) RemovedUserIDs ¶
func (m *ResourceMutation) RemovedUserIDs() (ids []int)
RemovedUser returns the removed IDs of the "user" edge to the User entity.
func (*ResourceMutation) ResetAuthorization ¶
func (m *ResourceMutation) ResetAuthorization()
ResetAuthorization resets all changes to the "authorization" edge.
func (*ResourceMutation) ResetEdge ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ResetField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ResetResourceName ¶
func (m *ResourceMutation) ResetResourceName()
ResetResourceName resets all changes to the "resource_name" field.
func (*ResourceMutation) ResetResourceValue ¶
func (m *ResourceMutation) ResetResourceValue()
ResetResourceValue resets all changes to the "resource_value" field.
func (*ResourceMutation) ResetRole ¶
func (m *ResourceMutation) ResetRole()
ResetRole resets all changes to the "role" edge.
func (*ResourceMutation) ResetUser ¶
func (m *ResourceMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ResourceMutation) ResourceName ¶
func (m *ResourceMutation) ResourceName() (r string, exists bool)
ResourceName returns the value of the "resource_name" field in the mutation.
func (*ResourceMutation) ResourceValue ¶
func (m *ResourceMutation) ResourceValue() (r string, exists bool)
ResourceValue returns the value of the "resource_value" field in the mutation.
func (*ResourceMutation) RoleCleared ¶
func (m *ResourceMutation) RoleCleared() bool
RoleCleared reports if the "role" edge to the Role entity was cleared.
func (*ResourceMutation) RoleIDs ¶
func (m *ResourceMutation) RoleIDs() (ids []int)
RoleIDs returns the "role" edge IDs in the mutation.
func (*ResourceMutation) SetField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) SetOp ¶
func (m *ResourceMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ResourceMutation) SetResourceName ¶
func (m *ResourceMutation) SetResourceName(s string)
SetResourceName sets the "resource_name" field.
func (*ResourceMutation) SetResourceValue ¶
func (m *ResourceMutation) SetResourceValue(s string)
SetResourceValue sets the "resource_value" field.
func (ResourceMutation) Tx ¶
func (m ResourceMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ResourceMutation) Type ¶
func (m *ResourceMutation) Type() string
Type returns the node type of this mutation (Resource).
func (*ResourceMutation) UserCleared ¶
func (m *ResourceMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ResourceMutation) UserIDs ¶
func (m *ResourceMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation.
func (*ResourceMutation) Where ¶
func (m *ResourceMutation) Where(ps ...predicate.Resource)
Where appends a list predicates to the ResourceMutation builder.
func (*ResourceMutation) WhereP ¶
func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ResourceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ResourceQuery ¶
type ResourceQuery struct {
// contains filtered or unexported fields
}
ResourceQuery is the builder for querying Resource entities.
func (*ResourceQuery) Aggregate ¶
func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect
Aggregate returns a ResourceSelect configured with the given aggregations.
func (*ResourceQuery) All ¶
func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)
All executes the query and returns a list of Resources.
func (*ResourceQuery) AllX ¶
func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource
AllX is like All, but panics if an error occurs.
func (*ResourceQuery) Clone ¶
func (rq *ResourceQuery) Clone() *ResourceQuery
Clone returns a duplicate of the ResourceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ResourceQuery) Count ¶
func (rq *ResourceQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ResourceQuery) CountX ¶
func (rq *ResourceQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ResourceQuery) Exist ¶
func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ResourceQuery) ExistX ¶
func (rq *ResourceQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ResourceQuery) First ¶
func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)
First returns the first Resource entity from the query. Returns a *NotFoundError when no Resource was found.
func (*ResourceQuery) FirstID ¶
func (rq *ResourceQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Resource ID from the query. Returns a *NotFoundError when no Resource ID was found.
func (*ResourceQuery) FirstIDX ¶
func (rq *ResourceQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ResourceQuery) FirstX ¶
func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource
FirstX is like First, but panics if an error occurs.
func (*ResourceQuery) GroupBy ¶
func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy
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 { ResourceName string `json:"resource_name,omitempty"` Count int `json:"count,omitempty"` } client.Resource.Query(). GroupBy(resource.FieldResourceName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*ResourceQuery) IDs ¶
func (rq *ResourceQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Resource IDs.
func (*ResourceQuery) IDsX ¶
func (rq *ResourceQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ResourceQuery) Limit ¶
func (rq *ResourceQuery) Limit(limit int) *ResourceQuery
Limit the number of records to be returned by this query.
func (*ResourceQuery) Offset ¶
func (rq *ResourceQuery) Offset(offset int) *ResourceQuery
Offset to start from.
func (*ResourceQuery) Only ¶
func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)
Only returns a single Resource entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Resource entity is found. Returns a *NotFoundError when no Resource entities are found.
func (*ResourceQuery) OnlyID ¶
func (rq *ResourceQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Resource ID in the query. Returns a *NotSingularError when more than one Resource ID is found. Returns a *NotFoundError when no entities are found.
func (*ResourceQuery) OnlyIDX ¶
func (rq *ResourceQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ResourceQuery) OnlyX ¶
func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource
OnlyX is like Only, but panics if an error occurs.
func (*ResourceQuery) Order ¶
func (rq *ResourceQuery) Order(o ...OrderFunc) *ResourceQuery
Order specifies how the records should be ordered.
func (*ResourceQuery) QueryAuthorization ¶
func (rq *ResourceQuery) QueryAuthorization() *AuthorizationQuery
QueryAuthorization chains the current query on the "authorization" edge.
func (*ResourceQuery) QueryRole ¶
func (rq *ResourceQuery) QueryRole() *RoleQuery
QueryRole chains the current query on the "role" edge.
func (*ResourceQuery) QueryUser ¶
func (rq *ResourceQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ResourceQuery) Select ¶
func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect
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 { ResourceName string `json:"resource_name,omitempty"` } client.Resource.Query(). Select(resource.FieldResourceName). Scan(ctx, &v)
func (*ResourceQuery) Unique ¶
func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery
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 (*ResourceQuery) Where ¶
func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery
Where adds a new predicate for the ResourceQuery builder.
func (*ResourceQuery) WithAuthorization ¶
func (rq *ResourceQuery) WithAuthorization(opts ...func(*AuthorizationQuery)) *ResourceQuery
WithAuthorization tells the query-builder to eager-load the nodes that are connected to the "authorization" edge. The optional arguments are used to configure the query builder of the edge.
func (*ResourceQuery) WithRole ¶
func (rq *ResourceQuery) WithRole(opts ...func(*RoleQuery)) *ResourceQuery
WithRole tells the query-builder to eager-load the nodes that are connected to the "role" edge. The optional arguments are used to configure the query builder of the edge.
func (*ResourceQuery) WithUser ¶
func (rq *ResourceQuery) WithUser(opts ...func(*UserQuery)) *ResourceQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type ResourceSelect ¶
type ResourceSelect struct { *ResourceQuery // contains filtered or unexported fields }
ResourceSelect is the builder for selecting fields of Resource entities.
func (*ResourceSelect) Aggregate ¶
func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ResourceSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Scan ¶
func (rs *ResourceSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ResourceSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ResourceUpdate ¶
type ResourceUpdate struct {
// contains filtered or unexported fields
}
ResourceUpdate is the builder for updating Resource entities.
func (*ResourceUpdate) AddAuthorization ¶
func (ru *ResourceUpdate) AddAuthorization(a ...*Authorization) *ResourceUpdate
AddAuthorization adds the "authorization" edges to the Authorization entity.
func (*ResourceUpdate) AddAuthorizationIDs ¶
func (ru *ResourceUpdate) AddAuthorizationIDs(ids ...int) *ResourceUpdate
AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.
func (*ResourceUpdate) AddRole ¶
func (ru *ResourceUpdate) AddRole(r ...*Role) *ResourceUpdate
AddRole adds the "role" edges to the Role entity.
func (*ResourceUpdate) AddRoleIDs ¶
func (ru *ResourceUpdate) AddRoleIDs(ids ...int) *ResourceUpdate
AddRoleIDs adds the "role" edge to the Role entity by IDs.
func (*ResourceUpdate) AddUser ¶
func (ru *ResourceUpdate) AddUser(u ...*User) *ResourceUpdate
AddUser adds the "user" edges to the User entity.
func (*ResourceUpdate) AddUserIDs ¶
func (ru *ResourceUpdate) AddUserIDs(ids ...int) *ResourceUpdate
AddUserIDs adds the "user" edge to the User entity by IDs.
func (*ResourceUpdate) ClearAuthorization ¶
func (ru *ResourceUpdate) ClearAuthorization() *ResourceUpdate
ClearAuthorization clears all "authorization" edges to the Authorization entity.
func (*ResourceUpdate) ClearRole ¶
func (ru *ResourceUpdate) ClearRole() *ResourceUpdate
ClearRole clears all "role" edges to the Role entity.
func (*ResourceUpdate) ClearUser ¶
func (ru *ResourceUpdate) ClearUser() *ResourceUpdate
ClearUser clears all "user" edges to the User entity.
func (*ResourceUpdate) Exec ¶
func (ru *ResourceUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceUpdate) ExecX ¶
func (ru *ResourceUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpdate) Mutation ¶
func (ru *ResourceUpdate) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceUpdate) RemoveAuthorization ¶
func (ru *ResourceUpdate) RemoveAuthorization(a ...*Authorization) *ResourceUpdate
RemoveAuthorization removes "authorization" edges to Authorization entities.
func (*ResourceUpdate) RemoveAuthorizationIDs ¶
func (ru *ResourceUpdate) RemoveAuthorizationIDs(ids ...int) *ResourceUpdate
RemoveAuthorizationIDs removes the "authorization" edge to Authorization entities by IDs.
func (*ResourceUpdate) RemoveRole ¶
func (ru *ResourceUpdate) RemoveRole(r ...*Role) *ResourceUpdate
RemoveRole removes "role" edges to Role entities.
func (*ResourceUpdate) RemoveRoleIDs ¶
func (ru *ResourceUpdate) RemoveRoleIDs(ids ...int) *ResourceUpdate
RemoveRoleIDs removes the "role" edge to Role entities by IDs.
func (*ResourceUpdate) RemoveUser ¶
func (ru *ResourceUpdate) RemoveUser(u ...*User) *ResourceUpdate
RemoveUser removes "user" edges to User entities.
func (*ResourceUpdate) RemoveUserIDs ¶
func (ru *ResourceUpdate) RemoveUserIDs(ids ...int) *ResourceUpdate
RemoveUserIDs removes the "user" edge to User entities by IDs.
func (*ResourceUpdate) Save ¶
func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ResourceUpdate) SaveX ¶
func (ru *ResourceUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ResourceUpdate) SetResourceName ¶
func (ru *ResourceUpdate) SetResourceName(s string) *ResourceUpdate
SetResourceName sets the "resource_name" field.
func (*ResourceUpdate) SetResourceValue ¶
func (ru *ResourceUpdate) SetResourceValue(s string) *ResourceUpdate
SetResourceValue sets the "resource_value" field.
func (*ResourceUpdate) Where ¶
func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate
Where appends a list predicates to the ResourceUpdate builder.
type ResourceUpdateOne ¶
type ResourceUpdateOne struct {
// contains filtered or unexported fields
}
ResourceUpdateOne is the builder for updating a single Resource entity.
func (*ResourceUpdateOne) AddAuthorization ¶
func (ruo *ResourceUpdateOne) AddAuthorization(a ...*Authorization) *ResourceUpdateOne
AddAuthorization adds the "authorization" edges to the Authorization entity.
func (*ResourceUpdateOne) AddAuthorizationIDs ¶
func (ruo *ResourceUpdateOne) AddAuthorizationIDs(ids ...int) *ResourceUpdateOne
AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.
func (*ResourceUpdateOne) AddRole ¶
func (ruo *ResourceUpdateOne) AddRole(r ...*Role) *ResourceUpdateOne
AddRole adds the "role" edges to the Role entity.
func (*ResourceUpdateOne) AddRoleIDs ¶
func (ruo *ResourceUpdateOne) AddRoleIDs(ids ...int) *ResourceUpdateOne
AddRoleIDs adds the "role" edge to the Role entity by IDs.
func (*ResourceUpdateOne) AddUser ¶
func (ruo *ResourceUpdateOne) AddUser(u ...*User) *ResourceUpdateOne
AddUser adds the "user" edges to the User entity.
func (*ResourceUpdateOne) AddUserIDs ¶
func (ruo *ResourceUpdateOne) AddUserIDs(ids ...int) *ResourceUpdateOne
AddUserIDs adds the "user" edge to the User entity by IDs.
func (*ResourceUpdateOne) ClearAuthorization ¶
func (ruo *ResourceUpdateOne) ClearAuthorization() *ResourceUpdateOne
ClearAuthorization clears all "authorization" edges to the Authorization entity.
func (*ResourceUpdateOne) ClearRole ¶
func (ruo *ResourceUpdateOne) ClearRole() *ResourceUpdateOne
ClearRole clears all "role" edges to the Role entity.
func (*ResourceUpdateOne) ClearUser ¶
func (ruo *ResourceUpdateOne) ClearUser() *ResourceUpdateOne
ClearUser clears all "user" edges to the User entity.
func (*ResourceUpdateOne) Exec ¶
func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ResourceUpdateOne) ExecX ¶
func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpdateOne) Mutation ¶
func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceUpdateOne) RemoveAuthorization ¶
func (ruo *ResourceUpdateOne) RemoveAuthorization(a ...*Authorization) *ResourceUpdateOne
RemoveAuthorization removes "authorization" edges to Authorization entities.
func (*ResourceUpdateOne) RemoveAuthorizationIDs ¶
func (ruo *ResourceUpdateOne) RemoveAuthorizationIDs(ids ...int) *ResourceUpdateOne
RemoveAuthorizationIDs removes the "authorization" edge to Authorization entities by IDs.
func (*ResourceUpdateOne) RemoveRole ¶
func (ruo *ResourceUpdateOne) RemoveRole(r ...*Role) *ResourceUpdateOne
RemoveRole removes "role" edges to Role entities.
func (*ResourceUpdateOne) RemoveRoleIDs ¶
func (ruo *ResourceUpdateOne) RemoveRoleIDs(ids ...int) *ResourceUpdateOne
RemoveRoleIDs removes the "role" edge to Role entities by IDs.
func (*ResourceUpdateOne) RemoveUser ¶
func (ruo *ResourceUpdateOne) RemoveUser(u ...*User) *ResourceUpdateOne
RemoveUser removes "user" edges to User entities.
func (*ResourceUpdateOne) RemoveUserIDs ¶
func (ruo *ResourceUpdateOne) RemoveUserIDs(ids ...int) *ResourceUpdateOne
RemoveUserIDs removes the "user" edge to User entities by IDs.
func (*ResourceUpdateOne) Save ¶
func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)
Save executes the query and returns the updated Resource entity.
func (*ResourceUpdateOne) SaveX ¶
func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource
SaveX is like Save, but panics if an error occurs.
func (*ResourceUpdateOne) Select ¶
func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ResourceUpdateOne) SetResourceName ¶
func (ruo *ResourceUpdateOne) SetResourceName(s string) *ResourceUpdateOne
SetResourceName sets the "resource_name" field.
func (*ResourceUpdateOne) SetResourceValue ¶
func (ruo *ResourceUpdateOne) SetResourceValue(s string) *ResourceUpdateOne
SetResourceValue sets the "resource_value" field.
func (*ResourceUpdateOne) Where ¶
func (ruo *ResourceUpdateOne) Where(ps ...predicate.Resource) *ResourceUpdateOne
Where appends a list predicates to the ResourceUpdate builder.
type Role ¶
type Role struct { // ID of the ent. ID int `json:"id,omitempty"` // RoleName holds the value of the "role_name" field. RoleName string `json:"role_name,omitempty"` // RoleValue holds the value of the "role_value" field. RoleValue string `json:"role_value,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RoleQuery when eager-loading is set. Edges RoleEdges `json:"edges"` // contains filtered or unexported fields }
Role is the model entity for the Role schema.
func (*Role) QueryResource ¶
func (r *Role) QueryResource() *ResourceQuery
QueryResource queries the "resource" edge of the Role entity.
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 builder for creating a Role entity.
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 builder for deleting the given entity.
func (*RoleClient) DeleteOneID ¶
func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RoleClient) GetX ¶
func (c *RoleClient) GetX(ctx context.Context, id int) *Role
GetX is like Get, but panics if an error occurs.
func (*RoleClient) Intercept ¶
func (c *RoleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.
func (*RoleClient) Interceptors ¶
func (c *RoleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RoleClient) Query ¶
func (c *RoleClient) Query() *RoleQuery
Query returns a query builder for Role.
func (*RoleClient) QueryResource ¶
func (c *RoleClient) QueryResource(r *Role) *ResourceQuery
QueryResource queries the resource edge of a Role.
func (*RoleClient) QueryUser ¶
func (c *RoleClient) QueryUser(r *Role) *UserQuery
QueryUser queries the user edge of a 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 int) *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) AddResource ¶
func (rc *RoleCreate) AddResource(r ...*Resource) *RoleCreate
AddResource adds the "resource" edges to the Resource entity.
func (*RoleCreate) AddResourceIDs ¶
func (rc *RoleCreate) AddResourceIDs(ids ...int) *RoleCreate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*RoleCreate) AddUser ¶
func (rc *RoleCreate) AddUser(u ...*User) *RoleCreate
AddUser adds the "user" edges to the User entity.
func (*RoleCreate) AddUserIDs ¶
func (rc *RoleCreate) AddUserIDs(ids ...int) *RoleCreate
AddUserIDs adds the "user" edge to the User entity by IDs.
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) SetRoleName ¶
func (rc *RoleCreate) SetRoleName(s string) *RoleCreate
SetRoleName sets the "role_name" field.
func (*RoleCreate) SetRoleValue ¶
func (rc *RoleCreate) SetRoleValue(s string) *RoleCreate
SetRoleValue sets the "role_value" 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.
func (*RoleDeleteOne) Where ¶
func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne
Where appends a list predicates to the RoleDelete builder.
type RoleEdges ¶
type RoleEdges struct { // Resource holds the value of the resource edge. Resource []*Resource `json:"resource,omitempty"` // User holds the value of the user edge. User []*User `json:"user,omitempty"` // contains filtered or unexported fields }
RoleEdges holds the relations/edges for other nodes in the graph.
func (RoleEdges) ResourceOrErr ¶
ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Scan ¶
func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleMutation ¶
type RoleMutation struct {
// contains filtered or unexported fields
}
RoleMutation represents an operation that mutates the Role nodes in the graph.
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) AddResourceIDs ¶
func (m *RoleMutation) AddResourceIDs(ids ...int)
AddResourceIDs adds the "resource" edge to the Resource entity by ids.
func (*RoleMutation) AddUserIDs ¶
func (m *RoleMutation) AddUserIDs(ids ...int)
AddUserIDs adds the "user" edge to the User entity by ids.
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) 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) ClearResource ¶
func (m *RoleMutation) ClearResource()
ClearResource clears the "resource" edge to the Resource entity.
func (*RoleMutation) ClearUser ¶
func (m *RoleMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
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) 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 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 (*RoleMutation) IDs ¶
func (m *RoleMutation) 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 (*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) OldRoleName ¶
func (m *RoleMutation) OldRoleName(ctx context.Context) (v string, err error)
OldRoleName returns the old "role_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) OldRoleValue ¶
func (m *RoleMutation) OldRoleValue(ctx context.Context) (v string, err error)
OldRoleValue returns the old "role_value" 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) RemoveResourceIDs ¶
func (m *RoleMutation) RemoveResourceIDs(ids ...int)
RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.
func (*RoleMutation) RemoveUserIDs ¶
func (m *RoleMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the "user" edge to the User entity by IDs.
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) RemovedResourceIDs ¶
func (m *RoleMutation) RemovedResourceIDs() (ids []int)
RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.
func (*RoleMutation) RemovedUserIDs ¶
func (m *RoleMutation) RemovedUserIDs() (ids []int)
RemovedUser returns the removed IDs of the "user" edge to the User entity.
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) ResetResource ¶
func (m *RoleMutation) ResetResource()
ResetResource resets all changes to the "resource" edge.
func (*RoleMutation) ResetRoleName ¶
func (m *RoleMutation) ResetRoleName()
ResetRoleName resets all changes to the "role_name" field.
func (*RoleMutation) ResetRoleValue ¶
func (m *RoleMutation) ResetRoleValue()
ResetRoleValue resets all changes to the "role_value" field.
func (*RoleMutation) ResetUser ¶
func (m *RoleMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*RoleMutation) ResourceCleared ¶
func (m *RoleMutation) ResourceCleared() bool
ResourceCleared reports if the "resource" edge to the Resource entity was cleared.
func (*RoleMutation) ResourceIDs ¶
func (m *RoleMutation) ResourceIDs() (ids []int)
ResourceIDs returns the "resource" edge IDs in the mutation.
func (*RoleMutation) RoleName ¶
func (m *RoleMutation) RoleName() (r string, exists bool)
RoleName returns the value of the "role_name" field in the mutation.
func (*RoleMutation) RoleValue ¶
func (m *RoleMutation) RoleValue() (r string, exists bool)
RoleValue returns the value of the "role_value" field in the mutation.
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) SetOp ¶
func (m *RoleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RoleMutation) SetRoleName ¶
func (m *RoleMutation) SetRoleName(s string)
SetRoleName sets the "role_name" field.
func (*RoleMutation) SetRoleValue ¶
func (m *RoleMutation) SetRoleValue(s string)
SetRoleValue sets the "role_value" field.
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) UserCleared ¶
func (m *RoleMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*RoleMutation) UserIDs ¶
func (m *RoleMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation.
func (*RoleMutation) Where ¶
func (m *RoleMutation) Where(ps ...predicate.Role)
Where appends a list predicates to the RoleMutation builder.
func (*RoleMutation) WhereP ¶
func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RoleQuery ¶
type RoleQuery struct {
// contains filtered or unexported fields
}
RoleQuery is the builder for querying Role entities.
func (*RoleQuery) Aggregate ¶
func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect
Aggregate returns a RoleSelect configured with the given aggregations.
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 { RoleName string `json:"role_name,omitempty"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldRoleName). Aggregate(domain.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) QueryResource ¶
func (rq *RoleQuery) QueryResource() *ResourceQuery
QueryResource chains the current query on the "resource" edge.
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 { RoleName string `json:"role_name,omitempty"` } client.Role.Query(). Select(role.FieldRoleName). Scan(ctx, &v)
func (*RoleQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*RoleQuery) WithResource ¶
func (rq *RoleQuery) WithResource(opts ...func(*ResourceQuery)) *RoleQuery
WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.
type RoleSelect ¶
type RoleSelect struct { *RoleQuery // contains filtered or unexported fields }
RoleSelect is the builder for selecting fields of Role entities.
func (*RoleSelect) Aggregate ¶
func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RoleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Scan ¶
func (rs *RoleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleUpdate ¶
type RoleUpdate struct {
// contains filtered or unexported fields
}
RoleUpdate is the builder for updating Role entities.
func (*RoleUpdate) AddResource ¶
func (ru *RoleUpdate) AddResource(r ...*Resource) *RoleUpdate
AddResource adds the "resource" edges to the Resource entity.
func (*RoleUpdate) AddResourceIDs ¶
func (ru *RoleUpdate) AddResourceIDs(ids ...int) *RoleUpdate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*RoleUpdate) AddUser ¶
func (ru *RoleUpdate) AddUser(u ...*User) *RoleUpdate
AddUser adds the "user" edges to the User entity.
func (*RoleUpdate) AddUserIDs ¶
func (ru *RoleUpdate) AddUserIDs(ids ...int) *RoleUpdate
AddUserIDs adds the "user" edge to the User entity by IDs.
func (*RoleUpdate) ClearResource ¶
func (ru *RoleUpdate) ClearResource() *RoleUpdate
ClearResource clears all "resource" edges to the Resource entity.
func (*RoleUpdate) ClearUser ¶
func (ru *RoleUpdate) ClearUser() *RoleUpdate
ClearUser clears all "user" edges to the User entity.
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) RemoveResource ¶
func (ru *RoleUpdate) RemoveResource(r ...*Resource) *RoleUpdate
RemoveResource removes "resource" edges to Resource entities.
func (*RoleUpdate) RemoveResourceIDs ¶
func (ru *RoleUpdate) RemoveResourceIDs(ids ...int) *RoleUpdate
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*RoleUpdate) RemoveUser ¶
func (ru *RoleUpdate) RemoveUser(u ...*User) *RoleUpdate
RemoveUser removes "user" edges to User entities.
func (*RoleUpdate) RemoveUserIDs ¶
func (ru *RoleUpdate) RemoveUserIDs(ids ...int) *RoleUpdate
RemoveUserIDs removes the "user" edge to User entities by IDs.
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) SetRoleName ¶
func (ru *RoleUpdate) SetRoleName(s string) *RoleUpdate
SetRoleName sets the "role_name" field.
func (*RoleUpdate) SetRoleValue ¶
func (ru *RoleUpdate) SetRoleValue(s string) *RoleUpdate
SetRoleValue sets the "role_value" 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) AddResource ¶
func (ruo *RoleUpdateOne) AddResource(r ...*Resource) *RoleUpdateOne
AddResource adds the "resource" edges to the Resource entity.
func (*RoleUpdateOne) AddResourceIDs ¶
func (ruo *RoleUpdateOne) AddResourceIDs(ids ...int) *RoleUpdateOne
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*RoleUpdateOne) AddUser ¶
func (ruo *RoleUpdateOne) AddUser(u ...*User) *RoleUpdateOne
AddUser adds the "user" edges to the User entity.
func (*RoleUpdateOne) AddUserIDs ¶
func (ruo *RoleUpdateOne) AddUserIDs(ids ...int) *RoleUpdateOne
AddUserIDs adds the "user" edge to the User entity by IDs.
func (*RoleUpdateOne) ClearResource ¶
func (ruo *RoleUpdateOne) ClearResource() *RoleUpdateOne
ClearResource clears all "resource" edges to the Resource entity.
func (*RoleUpdateOne) ClearUser ¶
func (ruo *RoleUpdateOne) ClearUser() *RoleUpdateOne
ClearUser clears all "user" edges to the User entity.
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) RemoveResource ¶
func (ruo *RoleUpdateOne) RemoveResource(r ...*Resource) *RoleUpdateOne
RemoveResource removes "resource" edges to Resource entities.
func (*RoleUpdateOne) RemoveResourceIDs ¶
func (ruo *RoleUpdateOne) RemoveResourceIDs(ids ...int) *RoleUpdateOne
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*RoleUpdateOne) RemoveUser ¶
func (ruo *RoleUpdateOne) RemoveUser(u ...*User) *RoleUpdateOne
RemoveUser removes "user" edges to User entities.
func (*RoleUpdateOne) RemoveUserIDs ¶
func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...int) *RoleUpdateOne
RemoveUserIDs removes the "user" edge to User entities by IDs.
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) SetRoleName ¶
func (ruo *RoleUpdateOne) SetRoleName(s string) *RoleUpdateOne
SetRoleName sets the "role_name" field.
func (*RoleUpdateOne) SetRoleValue ¶
func (ruo *RoleUpdateOne) SetRoleValue(s string) *RoleUpdateOne
SetRoleValue sets the "role_value" field.
func (*RoleUpdateOne) Where ¶
func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
Where appends a list predicates to the RoleUpdate builder.
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 Student ¶
type Student struct { // ID of the ent. ID int `json:"id,omitempty"` // 姓名 Name string `json:"name,omitempty"` // 年龄 Age int `json:"age,omitempty"` // 性别 Sex string `json:"sex,omitempty"` // 学号 Code string `json:"code,omitempty"` // 头像 Avatar []byte `json:"avatar,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the StudentQuery when eager-loading is set. Edges StudentEdges `json:"edges"` // contains filtered or unexported fields }
Student is the model entity for the Student schema.
func (*Student) QueryCertificate ¶
func (s *Student) QueryCertificate() *CertificateQuery
QueryCertificate queries the "certificate" edge of the Student entity.
func (*Student) QueryClass ¶
func (s *Student) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the Student entity.
func (*Student) QueryClassLeader ¶
func (s *Student) QueryClassLeader() *ClassLeaderQuery
QueryClassLeader queries the "class_leader" edge of the Student entity.
func (*Student) QueryDepartment ¶
func (s *Student) QueryDepartment() *DepartmentQuery
QueryDepartment queries the "department" edge of the Student entity.
func (*Student) QueryEducationLevel ¶
func (s *Student) QueryEducationLevel() *EducationLevelQuery
QueryEducationLevel queries the "education_level" edge of the Student entity.
func (*Student) QueryEnrollmentStatus ¶
func (s *Student) QueryEnrollmentStatus() *EnrollmentStatusQuery
QueryEnrollmentStatus queries the "enrollment_status" edge of the Student entity.
func (*Student) QueryFamilyInfo ¶
func (s *Student) QueryFamilyInfo() *FamilyInfoQuery
QueryFamilyInfo queries the "family_info" edge of the Student entity.
func (*Student) QueryMajor ¶
func (s *Student) QueryMajor() *MajorQuery
QueryMajor queries the "major" edge of the Student entity.
func (*Student) QueryPracticalExperience ¶
func (s *Student) QueryPracticalExperience() *PracticalExperienceQuery
QueryPracticalExperience queries the "practical_experience" edge of the Student entity.
func (*Student) QueryTutor ¶
func (s *Student) QueryTutor() *TutorQuery
QueryTutor queries the "tutor" edge of the Student entity.
func (*Student) Unwrap ¶
Unwrap unwraps the Student 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 (*Student) Update ¶
func (s *Student) Update() *StudentUpdateOne
Update returns a builder for updating this Student. Note that you need to call Student.Unwrap() before calling this method if this Student was returned from a transaction, and the transaction was committed or rolled back.
type StudentClient ¶
type StudentClient struct {
// contains filtered or unexported fields
}
StudentClient is a client for the Student schema.
func NewStudentClient ¶
func NewStudentClient(c config) *StudentClient
NewStudentClient returns a client for the Student from the given config.
func (*StudentClient) Create ¶
func (c *StudentClient) Create() *StudentCreate
Create returns a builder for creating a Student entity.
func (*StudentClient) CreateBulk ¶
func (c *StudentClient) CreateBulk(builders ...*StudentCreate) *StudentCreateBulk
CreateBulk returns a builder for creating a bulk of Student entities.
func (*StudentClient) Delete ¶
func (c *StudentClient) Delete() *StudentDelete
Delete returns a delete builder for Student.
func (*StudentClient) DeleteOne ¶
func (c *StudentClient) DeleteOne(s *Student) *StudentDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*StudentClient) DeleteOneID ¶
func (c *StudentClient) DeleteOneID(id int) *StudentDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*StudentClient) GetX ¶
func (c *StudentClient) GetX(ctx context.Context, id int) *Student
GetX is like Get, but panics if an error occurs.
func (*StudentClient) Hooks ¶
func (c *StudentClient) Hooks() []Hook
Hooks returns the client hooks.
func (*StudentClient) Intercept ¶
func (c *StudentClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `student.Intercept(f(g(h())))`.
func (*StudentClient) Interceptors ¶
func (c *StudentClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*StudentClient) Query ¶
func (c *StudentClient) Query() *StudentQuery
Query returns a query builder for Student.
func (*StudentClient) QueryCertificate ¶
func (c *StudentClient) QueryCertificate(s *Student) *CertificateQuery
QueryCertificate queries the certificate edge of a Student.
func (*StudentClient) QueryClass ¶
func (c *StudentClient) QueryClass(s *Student) *ClassQuery
QueryClass queries the class edge of a Student.
func (*StudentClient) QueryClassLeader ¶
func (c *StudentClient) QueryClassLeader(s *Student) *ClassLeaderQuery
QueryClassLeader queries the class_leader edge of a Student.
func (*StudentClient) QueryDepartment ¶
func (c *StudentClient) QueryDepartment(s *Student) *DepartmentQuery
QueryDepartment queries the department edge of a Student.
func (*StudentClient) QueryEducationLevel ¶
func (c *StudentClient) QueryEducationLevel(s *Student) *EducationLevelQuery
QueryEducationLevel queries the education_level edge of a Student.
func (*StudentClient) QueryEnrollmentStatus ¶
func (c *StudentClient) QueryEnrollmentStatus(s *Student) *EnrollmentStatusQuery
QueryEnrollmentStatus queries the enrollment_status edge of a Student.
func (*StudentClient) QueryFamilyInfo ¶
func (c *StudentClient) QueryFamilyInfo(s *Student) *FamilyInfoQuery
QueryFamilyInfo queries the family_info edge of a Student.
func (*StudentClient) QueryMajor ¶
func (c *StudentClient) QueryMajor(s *Student) *MajorQuery
QueryMajor queries the major edge of a Student.
func (*StudentClient) QueryPracticalExperience ¶
func (c *StudentClient) QueryPracticalExperience(s *Student) *PracticalExperienceQuery
QueryPracticalExperience queries the practical_experience edge of a Student.
func (*StudentClient) QueryTutor ¶
func (c *StudentClient) QueryTutor(s *Student) *TutorQuery
QueryTutor queries the tutor edge of a Student.
func (*StudentClient) QueryUser ¶
func (c *StudentClient) QueryUser(s *Student) *UserQuery
QueryUser queries the user edge of a Student.
func (*StudentClient) Update ¶
func (c *StudentClient) Update() *StudentUpdate
Update returns an update builder for Student.
func (*StudentClient) UpdateOne ¶
func (c *StudentClient) UpdateOne(s *Student) *StudentUpdateOne
UpdateOne returns an update builder for the given entity.
func (*StudentClient) UpdateOneID ¶
func (c *StudentClient) UpdateOneID(id int) *StudentUpdateOne
UpdateOneID returns an update builder for the given id.
func (*StudentClient) Use ¶
func (c *StudentClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `student.Hooks(f(g(h())))`.
type StudentCreate ¶
type StudentCreate struct {
// contains filtered or unexported fields
}
StudentCreate is the builder for creating a Student entity.
func (*StudentCreate) AddCertificate ¶
func (sc *StudentCreate) AddCertificate(c ...*Certificate) *StudentCreate
AddCertificate adds the "certificate" edges to the Certificate entity.
func (*StudentCreate) AddCertificateIDs ¶
func (sc *StudentCreate) AddCertificateIDs(ids ...int) *StudentCreate
AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.
func (*StudentCreate) AddEducationLevel ¶
func (sc *StudentCreate) AddEducationLevel(e ...*EducationLevel) *StudentCreate
AddEducationLevel adds the "education_level" edges to the EducationLevel entity.
func (*StudentCreate) AddEducationLevelIDs ¶
func (sc *StudentCreate) AddEducationLevelIDs(ids ...int) *StudentCreate
AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.
func (*StudentCreate) AddEnrollmentStatuIDs ¶
func (sc *StudentCreate) AddEnrollmentStatuIDs(ids ...int) *StudentCreate
AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.
func (*StudentCreate) AddEnrollmentStatus ¶
func (sc *StudentCreate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentCreate
AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.
func (*StudentCreate) AddFamilyInfo ¶
func (sc *StudentCreate) AddFamilyInfo(f ...*FamilyInfo) *StudentCreate
AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.
func (*StudentCreate) AddFamilyInfoIDs ¶
func (sc *StudentCreate) AddFamilyInfoIDs(ids ...int) *StudentCreate
AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.
func (*StudentCreate) AddPracticalExperience ¶
func (sc *StudentCreate) AddPracticalExperience(p ...*PracticalExperience) *StudentCreate
AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.
func (*StudentCreate) AddPracticalExperienceIDs ¶
func (sc *StudentCreate) AddPracticalExperienceIDs(ids ...int) *StudentCreate
AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.
func (*StudentCreate) Exec ¶
func (sc *StudentCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*StudentCreate) ExecX ¶
func (sc *StudentCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StudentCreate) Mutation ¶
func (sc *StudentCreate) Mutation() *StudentMutation
Mutation returns the StudentMutation object of the builder.
func (*StudentCreate) Save ¶
func (sc *StudentCreate) Save(ctx context.Context) (*Student, error)
Save creates the Student in the database.
func (*StudentCreate) SaveX ¶
func (sc *StudentCreate) SaveX(ctx context.Context) *Student
SaveX calls Save and panics if Save returns an error.
func (*StudentCreate) SetAge ¶
func (sc *StudentCreate) SetAge(i int) *StudentCreate
SetAge sets the "age" field.
func (*StudentCreate) SetAvatar ¶
func (sc *StudentCreate) SetAvatar(b []byte) *StudentCreate
SetAvatar sets the "avatar" field.
func (*StudentCreate) SetClass ¶
func (sc *StudentCreate) SetClass(c *Class) *StudentCreate
SetClass sets the "class" edge to the Class entity.
func (*StudentCreate) SetClassID ¶
func (sc *StudentCreate) SetClassID(id int) *StudentCreate
SetClassID sets the "class" edge to the Class entity by ID.
func (*StudentCreate) SetClassLeader ¶
func (sc *StudentCreate) SetClassLeader(c *ClassLeader) *StudentCreate
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*StudentCreate) SetClassLeaderID ¶
func (sc *StudentCreate) SetClassLeaderID(id int) *StudentCreate
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*StudentCreate) SetCode ¶
func (sc *StudentCreate) SetCode(s string) *StudentCreate
SetCode sets the "code" field.
func (*StudentCreate) SetDepartment ¶
func (sc *StudentCreate) SetDepartment(d *Department) *StudentCreate
SetDepartment sets the "department" edge to the Department entity.
func (*StudentCreate) SetDepartmentID ¶
func (sc *StudentCreate) SetDepartmentID(id int) *StudentCreate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*StudentCreate) SetMajor ¶
func (sc *StudentCreate) SetMajor(m *Major) *StudentCreate
SetMajor sets the "major" edge to the Major entity.
func (*StudentCreate) SetMajorID ¶
func (sc *StudentCreate) SetMajorID(id int) *StudentCreate
SetMajorID sets the "major" edge to the Major entity by ID.
func (*StudentCreate) SetName ¶
func (sc *StudentCreate) SetName(s string) *StudentCreate
SetName sets the "name" field.
func (*StudentCreate) SetNillableClassID ¶
func (sc *StudentCreate) SetNillableClassID(id *int) *StudentCreate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*StudentCreate) SetNillableClassLeaderID ¶
func (sc *StudentCreate) SetNillableClassLeaderID(id *int) *StudentCreate
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*StudentCreate) SetNillableDepartmentID ¶
func (sc *StudentCreate) SetNillableDepartmentID(id *int) *StudentCreate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*StudentCreate) SetNillableMajorID ¶
func (sc *StudentCreate) SetNillableMajorID(id *int) *StudentCreate
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*StudentCreate) SetNillableTutorID ¶
func (sc *StudentCreate) SetNillableTutorID(id *int) *StudentCreate
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*StudentCreate) SetNillableUserID ¶
func (sc *StudentCreate) SetNillableUserID(id *int) *StudentCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*StudentCreate) SetSex ¶
func (sc *StudentCreate) SetSex(s string) *StudentCreate
SetSex sets the "sex" field.
func (*StudentCreate) SetTutor ¶
func (sc *StudentCreate) SetTutor(t *Tutor) *StudentCreate
SetTutor sets the "tutor" edge to the Tutor entity.
func (*StudentCreate) SetTutorID ¶
func (sc *StudentCreate) SetTutorID(id int) *StudentCreate
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*StudentCreate) SetUser ¶
func (sc *StudentCreate) SetUser(u *User) *StudentCreate
SetUser sets the "user" edge to the User entity.
func (*StudentCreate) SetUserID ¶
func (sc *StudentCreate) SetUserID(id int) *StudentCreate
SetUserID sets the "user" edge to the User entity by ID.
type StudentCreateBulk ¶
type StudentCreateBulk struct {
// contains filtered or unexported fields
}
StudentCreateBulk is the builder for creating many Student entities in bulk.
func (*StudentCreateBulk) Exec ¶
func (scb *StudentCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*StudentCreateBulk) ExecX ¶
func (scb *StudentCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type StudentDelete ¶
type StudentDelete struct {
// contains filtered or unexported fields
}
StudentDelete is the builder for deleting a Student entity.
func (*StudentDelete) Exec ¶
func (sd *StudentDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*StudentDelete) ExecX ¶
func (sd *StudentDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*StudentDelete) Where ¶
func (sd *StudentDelete) Where(ps ...predicate.Student) *StudentDelete
Where appends a list predicates to the StudentDelete builder.
type StudentDeleteOne ¶
type StudentDeleteOne struct {
// contains filtered or unexported fields
}
StudentDeleteOne is the builder for deleting a single Student entity.
func (*StudentDeleteOne) Exec ¶
func (sdo *StudentDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*StudentDeleteOne) ExecX ¶
func (sdo *StudentDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StudentDeleteOne) Where ¶
func (sdo *StudentDeleteOne) Where(ps ...predicate.Student) *StudentDeleteOne
Where appends a list predicates to the StudentDelete builder.
type StudentEdges ¶
type StudentEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Department holds the value of the department edge. Department *Department `json:"department,omitempty"` // Major holds the value of the major edge. Major *Major `json:"major,omitempty"` // Class holds the value of the class edge. Class *Class `json:"class,omitempty"` // ClassLeader holds the value of the class_leader edge. ClassLeader *ClassLeader `json:"class_leader,omitempty"` // Tutor holds the value of the tutor edge. Tutor *Tutor `json:"tutor,omitempty"` // Certificate holds the value of the certificate edge. Certificate []*Certificate `json:"certificate,omitempty"` // EducationLevel holds the value of the education_level edge. EducationLevel []*EducationLevel `json:"education_level,omitempty"` // EnrollmentStatus holds the value of the enrollment_status edge. EnrollmentStatus []*EnrollmentStatus `json:"enrollment_status,omitempty"` // FamilyInfo holds the value of the family_info edge. FamilyInfo []*FamilyInfo `json:"family_info,omitempty"` // PracticalExperience holds the value of the practical_experience edge. PracticalExperience []*PracticalExperience `json:"practical_experience,omitempty"` // contains filtered or unexported fields }
StudentEdges holds the relations/edges for other nodes in the graph.
func (StudentEdges) CertificateOrErr ¶
func (e StudentEdges) CertificateOrErr() ([]*Certificate, error)
CertificateOrErr returns the Certificate value or an error if the edge was not loaded in eager-loading.
func (StudentEdges) ClassLeaderOrErr ¶
func (e StudentEdges) ClassLeaderOrErr() (*ClassLeader, error)
ClassLeaderOrErr returns the ClassLeader value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StudentEdges) ClassOrErr ¶
func (e StudentEdges) ClassOrErr() (*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StudentEdges) DepartmentOrErr ¶
func (e StudentEdges) DepartmentOrErr() (*Department, error)
DepartmentOrErr returns the Department value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StudentEdges) EducationLevelOrErr ¶
func (e StudentEdges) EducationLevelOrErr() ([]*EducationLevel, error)
EducationLevelOrErr returns the EducationLevel value or an error if the edge was not loaded in eager-loading.
func (StudentEdges) EnrollmentStatusOrErr ¶
func (e StudentEdges) EnrollmentStatusOrErr() ([]*EnrollmentStatus, error)
EnrollmentStatusOrErr returns the EnrollmentStatus value or an error if the edge was not loaded in eager-loading.
func (StudentEdges) FamilyInfoOrErr ¶
func (e StudentEdges) FamilyInfoOrErr() ([]*FamilyInfo, error)
FamilyInfoOrErr returns the FamilyInfo value or an error if the edge was not loaded in eager-loading.
func (StudentEdges) MajorOrErr ¶
func (e StudentEdges) MajorOrErr() (*Major, error)
MajorOrErr returns the Major value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StudentEdges) PracticalExperienceOrErr ¶
func (e StudentEdges) PracticalExperienceOrErr() ([]*PracticalExperience, error)
PracticalExperienceOrErr returns the PracticalExperience value or an error if the edge was not loaded in eager-loading.
func (StudentEdges) TutorOrErr ¶
func (e StudentEdges) TutorOrErr() (*Tutor, error)
TutorOrErr returns the Tutor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StudentEdges) UserOrErr ¶
func (e StudentEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type StudentGroupBy ¶
type StudentGroupBy struct {
// contains filtered or unexported fields
}
StudentGroupBy is the group-by builder for Student entities.
func (*StudentGroupBy) Aggregate ¶
func (sgb *StudentGroupBy) Aggregate(fns ...AggregateFunc) *StudentGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*StudentGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StudentGroupBy) Scan ¶
func (sgb *StudentGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*StudentGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type StudentMutation ¶
type StudentMutation struct {
// contains filtered or unexported fields
}
StudentMutation represents an operation that mutates the Student nodes in the graph.
func (*StudentMutation) AddAge ¶
func (m *StudentMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*StudentMutation) AddCertificateIDs ¶
func (m *StudentMutation) AddCertificateIDs(ids ...int)
AddCertificateIDs adds the "certificate" edge to the Certificate entity by ids.
func (*StudentMutation) AddEducationLevelIDs ¶
func (m *StudentMutation) AddEducationLevelIDs(ids ...int)
AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by ids.
func (*StudentMutation) AddEnrollmentStatuIDs ¶
func (m *StudentMutation) AddEnrollmentStatuIDs(ids ...int)
AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by ids.
func (*StudentMutation) AddFamilyInfoIDs ¶
func (m *StudentMutation) AddFamilyInfoIDs(ids ...int)
AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by ids.
func (*StudentMutation) AddField ¶
func (m *StudentMutation) 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 (*StudentMutation) AddPracticalExperienceIDs ¶
func (m *StudentMutation) AddPracticalExperienceIDs(ids ...int)
AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by ids.
func (*StudentMutation) AddedAge ¶
func (m *StudentMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*StudentMutation) AddedEdges ¶
func (m *StudentMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*StudentMutation) AddedField ¶
func (m *StudentMutation) 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 (*StudentMutation) AddedFields ¶
func (m *StudentMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*StudentMutation) AddedIDs ¶
func (m *StudentMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*StudentMutation) Age ¶
func (m *StudentMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*StudentMutation) Avatar ¶
func (m *StudentMutation) Avatar() (r []byte, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*StudentMutation) CertificateCleared ¶
func (m *StudentMutation) CertificateCleared() bool
CertificateCleared reports if the "certificate" edge to the Certificate entity was cleared.
func (*StudentMutation) CertificateIDs ¶
func (m *StudentMutation) CertificateIDs() (ids []int)
CertificateIDs returns the "certificate" edge IDs in the mutation.
func (*StudentMutation) ClassCleared ¶
func (m *StudentMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*StudentMutation) ClassID ¶
func (m *StudentMutation) ClassID() (id int, exists bool)
ClassID returns the "class" edge ID in the mutation.
func (*StudentMutation) ClassIDs ¶
func (m *StudentMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.
func (*StudentMutation) ClassLeaderCleared ¶
func (m *StudentMutation) ClassLeaderCleared() bool
ClassLeaderCleared reports if the "class_leader" edge to the ClassLeader entity was cleared.
func (*StudentMutation) ClassLeaderID ¶
func (m *StudentMutation) ClassLeaderID() (id int, exists bool)
ClassLeaderID returns the "class_leader" edge ID in the mutation.
func (*StudentMutation) ClassLeaderIDs ¶
func (m *StudentMutation) ClassLeaderIDs() (ids []int)
ClassLeaderIDs returns the "class_leader" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassLeaderID instead. It exists only for internal usage by the builders.
func (*StudentMutation) ClearCertificate ¶
func (m *StudentMutation) ClearCertificate()
ClearCertificate clears the "certificate" edge to the Certificate entity.
func (*StudentMutation) ClearClass ¶
func (m *StudentMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*StudentMutation) ClearClassLeader ¶
func (m *StudentMutation) ClearClassLeader()
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*StudentMutation) ClearDepartment ¶
func (m *StudentMutation) ClearDepartment()
ClearDepartment clears the "department" edge to the Department entity.
func (*StudentMutation) ClearEdge ¶
func (m *StudentMutation) 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 (*StudentMutation) ClearEducationLevel ¶
func (m *StudentMutation) ClearEducationLevel()
ClearEducationLevel clears the "education_level" edge to the EducationLevel entity.
func (*StudentMutation) ClearEnrollmentStatus ¶
func (m *StudentMutation) ClearEnrollmentStatus()
ClearEnrollmentStatus clears the "enrollment_status" edge to the EnrollmentStatus entity.
func (*StudentMutation) ClearFamilyInfo ¶
func (m *StudentMutation) ClearFamilyInfo()
ClearFamilyInfo clears the "family_info" edge to the FamilyInfo entity.
func (*StudentMutation) ClearField ¶
func (m *StudentMutation) 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 (*StudentMutation) ClearMajor ¶
func (m *StudentMutation) ClearMajor()
ClearMajor clears the "major" edge to the Major entity.
func (*StudentMutation) ClearPracticalExperience ¶
func (m *StudentMutation) ClearPracticalExperience()
ClearPracticalExperience clears the "practical_experience" edge to the PracticalExperience entity.
func (*StudentMutation) ClearTutor ¶
func (m *StudentMutation) ClearTutor()
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*StudentMutation) ClearUser ¶
func (m *StudentMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*StudentMutation) ClearedEdges ¶
func (m *StudentMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*StudentMutation) ClearedFields ¶
func (m *StudentMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (StudentMutation) Client ¶
func (m StudentMutation) 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 (*StudentMutation) Code ¶
func (m *StudentMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*StudentMutation) DepartmentCleared ¶
func (m *StudentMutation) DepartmentCleared() bool
DepartmentCleared reports if the "department" edge to the Department entity was cleared.
func (*StudentMutation) DepartmentID ¶
func (m *StudentMutation) DepartmentID() (id int, exists bool)
DepartmentID returns the "department" edge ID in the mutation.
func (*StudentMutation) DepartmentIDs ¶
func (m *StudentMutation) DepartmentIDs() (ids []int)
DepartmentIDs returns the "department" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentID instead. It exists only for internal usage by the builders.
func (*StudentMutation) EdgeCleared ¶
func (m *StudentMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*StudentMutation) EducationLevelCleared ¶
func (m *StudentMutation) EducationLevelCleared() bool
EducationLevelCleared reports if the "education_level" edge to the EducationLevel entity was cleared.
func (*StudentMutation) EducationLevelIDs ¶
func (m *StudentMutation) EducationLevelIDs() (ids []int)
EducationLevelIDs returns the "education_level" edge IDs in the mutation.
func (*StudentMutation) EnrollmentStatusCleared ¶
func (m *StudentMutation) EnrollmentStatusCleared() bool
EnrollmentStatusCleared reports if the "enrollment_status" edge to the EnrollmentStatus entity was cleared.
func (*StudentMutation) EnrollmentStatusIDs ¶
func (m *StudentMutation) EnrollmentStatusIDs() (ids []int)
EnrollmentStatusIDs returns the "enrollment_status" edge IDs in the mutation.
func (*StudentMutation) FamilyInfoCleared ¶
func (m *StudentMutation) FamilyInfoCleared() bool
FamilyInfoCleared reports if the "family_info" edge to the FamilyInfo entity was cleared.
func (*StudentMutation) FamilyInfoIDs ¶
func (m *StudentMutation) FamilyInfoIDs() (ids []int)
FamilyInfoIDs returns the "family_info" edge IDs in the mutation.
func (*StudentMutation) Field ¶
func (m *StudentMutation) 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 (*StudentMutation) FieldCleared ¶
func (m *StudentMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*StudentMutation) Fields ¶
func (m *StudentMutation) 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 (*StudentMutation) ID ¶
func (m *StudentMutation) 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 (*StudentMutation) IDs ¶
func (m *StudentMutation) 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 (*StudentMutation) MajorCleared ¶
func (m *StudentMutation) MajorCleared() bool
MajorCleared reports if the "major" edge to the Major entity was cleared.
func (*StudentMutation) MajorID ¶
func (m *StudentMutation) MajorID() (id int, exists bool)
MajorID returns the "major" edge ID in the mutation.
func (*StudentMutation) MajorIDs ¶
func (m *StudentMutation) MajorIDs() (ids []int)
MajorIDs returns the "major" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MajorID instead. It exists only for internal usage by the builders.
func (*StudentMutation) Name ¶
func (m *StudentMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*StudentMutation) OldAge ¶
func (m *StudentMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the Student entity. If the Student 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 (*StudentMutation) OldAvatar ¶
func (m *StudentMutation) OldAvatar(ctx context.Context) (v []byte, err error)
OldAvatar returns the old "avatar" field's value of the Student entity. If the Student 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 (*StudentMutation) OldCode ¶
func (m *StudentMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Student entity. If the Student 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 (*StudentMutation) 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 (*StudentMutation) OldName ¶
func (m *StudentMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Student entity. If the Student 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 (*StudentMutation) OldSex ¶
func (m *StudentMutation) OldSex(ctx context.Context) (v string, err error)
OldSex returns the old "sex" field's value of the Student entity. If the Student 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 (*StudentMutation) PracticalExperienceCleared ¶
func (m *StudentMutation) PracticalExperienceCleared() bool
PracticalExperienceCleared reports if the "practical_experience" edge to the PracticalExperience entity was cleared.
func (*StudentMutation) PracticalExperienceIDs ¶
func (m *StudentMutation) PracticalExperienceIDs() (ids []int)
PracticalExperienceIDs returns the "practical_experience" edge IDs in the mutation.
func (*StudentMutation) RemoveCertificateIDs ¶
func (m *StudentMutation) RemoveCertificateIDs(ids ...int)
RemoveCertificateIDs removes the "certificate" edge to the Certificate entity by IDs.
func (*StudentMutation) RemoveEducationLevelIDs ¶
func (m *StudentMutation) RemoveEducationLevelIDs(ids ...int)
RemoveEducationLevelIDs removes the "education_level" edge to the EducationLevel entity by IDs.
func (*StudentMutation) RemoveEnrollmentStatuIDs ¶
func (m *StudentMutation) RemoveEnrollmentStatuIDs(ids ...int)
RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to the EnrollmentStatus entity by IDs.
func (*StudentMutation) RemoveFamilyInfoIDs ¶
func (m *StudentMutation) RemoveFamilyInfoIDs(ids ...int)
RemoveFamilyInfoIDs removes the "family_info" edge to the FamilyInfo entity by IDs.
func (*StudentMutation) RemovePracticalExperienceIDs ¶
func (m *StudentMutation) RemovePracticalExperienceIDs(ids ...int)
RemovePracticalExperienceIDs removes the "practical_experience" edge to the PracticalExperience entity by IDs.
func (*StudentMutation) RemovedCertificateIDs ¶
func (m *StudentMutation) RemovedCertificateIDs() (ids []int)
RemovedCertificate returns the removed IDs of the "certificate" edge to the Certificate entity.
func (*StudentMutation) RemovedEdges ¶
func (m *StudentMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*StudentMutation) RemovedEducationLevelIDs ¶
func (m *StudentMutation) RemovedEducationLevelIDs() (ids []int)
RemovedEducationLevel returns the removed IDs of the "education_level" edge to the EducationLevel entity.
func (*StudentMutation) RemovedEnrollmentStatusIDs ¶
func (m *StudentMutation) RemovedEnrollmentStatusIDs() (ids []int)
RemovedEnrollmentStatus returns the removed IDs of the "enrollment_status" edge to the EnrollmentStatus entity.
func (*StudentMutation) RemovedFamilyInfoIDs ¶
func (m *StudentMutation) RemovedFamilyInfoIDs() (ids []int)
RemovedFamilyInfo returns the removed IDs of the "family_info" edge to the FamilyInfo entity.
func (*StudentMutation) RemovedIDs ¶
func (m *StudentMutation) 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 (*StudentMutation) RemovedPracticalExperienceIDs ¶
func (m *StudentMutation) RemovedPracticalExperienceIDs() (ids []int)
RemovedPracticalExperience returns the removed IDs of the "practical_experience" edge to the PracticalExperience entity.
func (*StudentMutation) ResetAge ¶
func (m *StudentMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*StudentMutation) ResetAvatar ¶
func (m *StudentMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*StudentMutation) ResetCertificate ¶
func (m *StudentMutation) ResetCertificate()
ResetCertificate resets all changes to the "certificate" edge.
func (*StudentMutation) ResetClass ¶
func (m *StudentMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*StudentMutation) ResetClassLeader ¶
func (m *StudentMutation) ResetClassLeader()
ResetClassLeader resets all changes to the "class_leader" edge.
func (*StudentMutation) ResetCode ¶
func (m *StudentMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*StudentMutation) ResetDepartment ¶
func (m *StudentMutation) ResetDepartment()
ResetDepartment resets all changes to the "department" edge.
func (*StudentMutation) ResetEdge ¶
func (m *StudentMutation) 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 (*StudentMutation) ResetEducationLevel ¶
func (m *StudentMutation) ResetEducationLevel()
ResetEducationLevel resets all changes to the "education_level" edge.
func (*StudentMutation) ResetEnrollmentStatus ¶
func (m *StudentMutation) ResetEnrollmentStatus()
ResetEnrollmentStatus resets all changes to the "enrollment_status" edge.
func (*StudentMutation) ResetFamilyInfo ¶
func (m *StudentMutation) ResetFamilyInfo()
ResetFamilyInfo resets all changes to the "family_info" edge.
func (*StudentMutation) ResetField ¶
func (m *StudentMutation) 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 (*StudentMutation) ResetMajor ¶
func (m *StudentMutation) ResetMajor()
ResetMajor resets all changes to the "major" edge.
func (*StudentMutation) ResetName ¶
func (m *StudentMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*StudentMutation) ResetPracticalExperience ¶
func (m *StudentMutation) ResetPracticalExperience()
ResetPracticalExperience resets all changes to the "practical_experience" edge.
func (*StudentMutation) ResetSex ¶
func (m *StudentMutation) ResetSex()
ResetSex resets all changes to the "sex" field.
func (*StudentMutation) ResetTutor ¶
func (m *StudentMutation) ResetTutor()
ResetTutor resets all changes to the "tutor" edge.
func (*StudentMutation) ResetUser ¶
func (m *StudentMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*StudentMutation) SetAge ¶
func (m *StudentMutation) SetAge(i int)
SetAge sets the "age" field.
func (*StudentMutation) SetAvatar ¶
func (m *StudentMutation) SetAvatar(b []byte)
SetAvatar sets the "avatar" field.
func (*StudentMutation) SetClassID ¶
func (m *StudentMutation) SetClassID(id int)
SetClassID sets the "class" edge to the Class entity by id.
func (*StudentMutation) SetClassLeaderID ¶
func (m *StudentMutation) SetClassLeaderID(id int)
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by id.
func (*StudentMutation) SetCode ¶
func (m *StudentMutation) SetCode(s string)
SetCode sets the "code" field.
func (*StudentMutation) SetDepartmentID ¶
func (m *StudentMutation) SetDepartmentID(id int)
SetDepartmentID sets the "department" edge to the Department entity by id.
func (*StudentMutation) SetField ¶
func (m *StudentMutation) 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 (*StudentMutation) SetMajorID ¶
func (m *StudentMutation) SetMajorID(id int)
SetMajorID sets the "major" edge to the Major entity by id.
func (*StudentMutation) SetName ¶
func (m *StudentMutation) SetName(s string)
SetName sets the "name" field.
func (*StudentMutation) SetOp ¶
func (m *StudentMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*StudentMutation) SetSex ¶
func (m *StudentMutation) SetSex(s string)
SetSex sets the "sex" field.
func (*StudentMutation) SetTutorID ¶
func (m *StudentMutation) SetTutorID(id int)
SetTutorID sets the "tutor" edge to the Tutor entity by id.
func (*StudentMutation) SetUserID ¶
func (m *StudentMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*StudentMutation) Sex ¶
func (m *StudentMutation) Sex() (r string, exists bool)
Sex returns the value of the "sex" field in the mutation.
func (*StudentMutation) TutorCleared ¶
func (m *StudentMutation) TutorCleared() bool
TutorCleared reports if the "tutor" edge to the Tutor entity was cleared.
func (*StudentMutation) TutorID ¶
func (m *StudentMutation) TutorID() (id int, exists bool)
TutorID returns the "tutor" edge ID in the mutation.
func (*StudentMutation) TutorIDs ¶
func (m *StudentMutation) TutorIDs() (ids []int)
TutorIDs returns the "tutor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TutorID instead. It exists only for internal usage by the builders.
func (StudentMutation) Tx ¶
func (m StudentMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*StudentMutation) Type ¶
func (m *StudentMutation) Type() string
Type returns the node type of this mutation (Student).
func (*StudentMutation) UserCleared ¶
func (m *StudentMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*StudentMutation) UserID ¶
func (m *StudentMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*StudentMutation) UserIDs ¶
func (m *StudentMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*StudentMutation) Where ¶
func (m *StudentMutation) Where(ps ...predicate.Student)
Where appends a list predicates to the StudentMutation builder.
func (*StudentMutation) WhereP ¶
func (m *StudentMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the StudentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type StudentQuery ¶
type StudentQuery struct {
// contains filtered or unexported fields
}
StudentQuery is the builder for querying Student entities.
func (*StudentQuery) Aggregate ¶
func (sq *StudentQuery) Aggregate(fns ...AggregateFunc) *StudentSelect
Aggregate returns a StudentSelect configured with the given aggregations.
func (*StudentQuery) All ¶
func (sq *StudentQuery) All(ctx context.Context) ([]*Student, error)
All executes the query and returns a list of Students.
func (*StudentQuery) AllX ¶
func (sq *StudentQuery) AllX(ctx context.Context) []*Student
AllX is like All, but panics if an error occurs.
func (*StudentQuery) Clone ¶
func (sq *StudentQuery) Clone() *StudentQuery
Clone returns a duplicate of the StudentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*StudentQuery) Count ¶
func (sq *StudentQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*StudentQuery) CountX ¶
func (sq *StudentQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*StudentQuery) Exist ¶
func (sq *StudentQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*StudentQuery) ExistX ¶
func (sq *StudentQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*StudentQuery) First ¶
func (sq *StudentQuery) First(ctx context.Context) (*Student, error)
First returns the first Student entity from the query. Returns a *NotFoundError when no Student was found.
func (*StudentQuery) FirstID ¶
func (sq *StudentQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Student ID from the query. Returns a *NotFoundError when no Student ID was found.
func (*StudentQuery) FirstIDX ¶
func (sq *StudentQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*StudentQuery) FirstX ¶
func (sq *StudentQuery) FirstX(ctx context.Context) *Student
FirstX is like First, but panics if an error occurs.
func (*StudentQuery) GroupBy ¶
func (sq *StudentQuery) GroupBy(field string, fields ...string) *StudentGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Student.Query(). GroupBy(student.FieldName). Aggregate(domain.Count()). Scan(ctx, &v)
func (*StudentQuery) IDs ¶
func (sq *StudentQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Student IDs.
func (*StudentQuery) IDsX ¶
func (sq *StudentQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*StudentQuery) Limit ¶
func (sq *StudentQuery) Limit(limit int) *StudentQuery
Limit the number of records to be returned by this query.
func (*StudentQuery) Offset ¶
func (sq *StudentQuery) Offset(offset int) *StudentQuery
Offset to start from.
func (*StudentQuery) Only ¶
func (sq *StudentQuery) Only(ctx context.Context) (*Student, error)
Only returns a single Student entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Student entity is found. Returns a *NotFoundError when no Student entities are found.
func (*StudentQuery) OnlyID ¶
func (sq *StudentQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Student ID in the query. Returns a *NotSingularError when more than one Student ID is found. Returns a *NotFoundError when no entities are found.
func (*StudentQuery) OnlyIDX ¶
func (sq *StudentQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*StudentQuery) OnlyX ¶
func (sq *StudentQuery) OnlyX(ctx context.Context) *Student
OnlyX is like Only, but panics if an error occurs.
func (*StudentQuery) Order ¶
func (sq *StudentQuery) Order(o ...OrderFunc) *StudentQuery
Order specifies how the records should be ordered.
func (*StudentQuery) QueryCertificate ¶
func (sq *StudentQuery) QueryCertificate() *CertificateQuery
QueryCertificate chains the current query on the "certificate" edge.
func (*StudentQuery) QueryClass ¶
func (sq *StudentQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*StudentQuery) QueryClassLeader ¶
func (sq *StudentQuery) QueryClassLeader() *ClassLeaderQuery
QueryClassLeader chains the current query on the "class_leader" edge.
func (*StudentQuery) QueryDepartment ¶
func (sq *StudentQuery) QueryDepartment() *DepartmentQuery
QueryDepartment chains the current query on the "department" edge.
func (*StudentQuery) QueryEducationLevel ¶
func (sq *StudentQuery) QueryEducationLevel() *EducationLevelQuery
QueryEducationLevel chains the current query on the "education_level" edge.
func (*StudentQuery) QueryEnrollmentStatus ¶
func (sq *StudentQuery) QueryEnrollmentStatus() *EnrollmentStatusQuery
QueryEnrollmentStatus chains the current query on the "enrollment_status" edge.
func (*StudentQuery) QueryFamilyInfo ¶
func (sq *StudentQuery) QueryFamilyInfo() *FamilyInfoQuery
QueryFamilyInfo chains the current query on the "family_info" edge.
func (*StudentQuery) QueryMajor ¶
func (sq *StudentQuery) QueryMajor() *MajorQuery
QueryMajor chains the current query on the "major" edge.
func (*StudentQuery) QueryPracticalExperience ¶
func (sq *StudentQuery) QueryPracticalExperience() *PracticalExperienceQuery
QueryPracticalExperience chains the current query on the "practical_experience" edge.
func (*StudentQuery) QueryTutor ¶
func (sq *StudentQuery) QueryTutor() *TutorQuery
QueryTutor chains the current query on the "tutor" edge.
func (*StudentQuery) QueryUser ¶
func (sq *StudentQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*StudentQuery) Select ¶
func (sq *StudentQuery) Select(fields ...string) *StudentSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Student.Query(). Select(student.FieldName). Scan(ctx, &v)
func (*StudentQuery) Unique ¶
func (sq *StudentQuery) Unique(unique bool) *StudentQuery
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 (*StudentQuery) Where ¶
func (sq *StudentQuery) Where(ps ...predicate.Student) *StudentQuery
Where adds a new predicate for the StudentQuery builder.
func (*StudentQuery) WithCertificate ¶
func (sq *StudentQuery) WithCertificate(opts ...func(*CertificateQuery)) *StudentQuery
WithCertificate tells the query-builder to eager-load the nodes that are connected to the "certificate" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithClass ¶
func (sq *StudentQuery) WithClass(opts ...func(*ClassQuery)) *StudentQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithClassLeader ¶
func (sq *StudentQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *StudentQuery
WithClassLeader tells the query-builder to eager-load the nodes that are connected to the "class_leader" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithDepartment ¶
func (sq *StudentQuery) WithDepartment(opts ...func(*DepartmentQuery)) *StudentQuery
WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithEducationLevel ¶
func (sq *StudentQuery) WithEducationLevel(opts ...func(*EducationLevelQuery)) *StudentQuery
WithEducationLevel tells the query-builder to eager-load the nodes that are connected to the "education_level" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithEnrollmentStatus ¶
func (sq *StudentQuery) WithEnrollmentStatus(opts ...func(*EnrollmentStatusQuery)) *StudentQuery
WithEnrollmentStatus tells the query-builder to eager-load the nodes that are connected to the "enrollment_status" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithFamilyInfo ¶
func (sq *StudentQuery) WithFamilyInfo(opts ...func(*FamilyInfoQuery)) *StudentQuery
WithFamilyInfo tells the query-builder to eager-load the nodes that are connected to the "family_info" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithMajor ¶
func (sq *StudentQuery) WithMajor(opts ...func(*MajorQuery)) *StudentQuery
WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithPracticalExperience ¶
func (sq *StudentQuery) WithPracticalExperience(opts ...func(*PracticalExperienceQuery)) *StudentQuery
WithPracticalExperience tells the query-builder to eager-load the nodes that are connected to the "practical_experience" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithTutor ¶
func (sq *StudentQuery) WithTutor(opts ...func(*TutorQuery)) *StudentQuery
WithTutor tells the query-builder to eager-load the nodes that are connected to the "tutor" edge. The optional arguments are used to configure the query builder of the edge.
func (*StudentQuery) WithUser ¶
func (sq *StudentQuery) WithUser(opts ...func(*UserQuery)) *StudentQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type StudentSelect ¶
type StudentSelect struct { *StudentQuery // contains filtered or unexported fields }
StudentSelect is the builder for selecting fields of Student entities.
func (*StudentSelect) Aggregate ¶
func (ss *StudentSelect) Aggregate(fns ...AggregateFunc) *StudentSelect
Aggregate adds the given aggregation functions to the selector query.
func (*StudentSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StudentSelect) Scan ¶
func (ss *StudentSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*StudentSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type StudentUpdate ¶
type StudentUpdate struct {
// contains filtered or unexported fields
}
StudentUpdate is the builder for updating Student entities.
func (*StudentUpdate) AddAge ¶
func (su *StudentUpdate) AddAge(i int) *StudentUpdate
AddAge adds i to the "age" field.
func (*StudentUpdate) AddCertificate ¶
func (su *StudentUpdate) AddCertificate(c ...*Certificate) *StudentUpdate
AddCertificate adds the "certificate" edges to the Certificate entity.
func (*StudentUpdate) AddCertificateIDs ¶
func (su *StudentUpdate) AddCertificateIDs(ids ...int) *StudentUpdate
AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.
func (*StudentUpdate) AddEducationLevel ¶
func (su *StudentUpdate) AddEducationLevel(e ...*EducationLevel) *StudentUpdate
AddEducationLevel adds the "education_level" edges to the EducationLevel entity.
func (*StudentUpdate) AddEducationLevelIDs ¶
func (su *StudentUpdate) AddEducationLevelIDs(ids ...int) *StudentUpdate
AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.
func (*StudentUpdate) AddEnrollmentStatuIDs ¶
func (su *StudentUpdate) AddEnrollmentStatuIDs(ids ...int) *StudentUpdate
AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.
func (*StudentUpdate) AddEnrollmentStatus ¶
func (su *StudentUpdate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate
AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.
func (*StudentUpdate) AddFamilyInfo ¶
func (su *StudentUpdate) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdate
AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.
func (*StudentUpdate) AddFamilyInfoIDs ¶
func (su *StudentUpdate) AddFamilyInfoIDs(ids ...int) *StudentUpdate
AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.
func (*StudentUpdate) AddPracticalExperience ¶
func (su *StudentUpdate) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdate
AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.
func (*StudentUpdate) AddPracticalExperienceIDs ¶
func (su *StudentUpdate) AddPracticalExperienceIDs(ids ...int) *StudentUpdate
AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.
func (*StudentUpdate) ClearCertificate ¶
func (su *StudentUpdate) ClearCertificate() *StudentUpdate
ClearCertificate clears all "certificate" edges to the Certificate entity.
func (*StudentUpdate) ClearClass ¶
func (su *StudentUpdate) ClearClass() *StudentUpdate
ClearClass clears the "class" edge to the Class entity.
func (*StudentUpdate) ClearClassLeader ¶
func (su *StudentUpdate) ClearClassLeader() *StudentUpdate
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*StudentUpdate) ClearDepartment ¶
func (su *StudentUpdate) ClearDepartment() *StudentUpdate
ClearDepartment clears the "department" edge to the Department entity.
func (*StudentUpdate) ClearEducationLevel ¶
func (su *StudentUpdate) ClearEducationLevel() *StudentUpdate
ClearEducationLevel clears all "education_level" edges to the EducationLevel entity.
func (*StudentUpdate) ClearEnrollmentStatus ¶
func (su *StudentUpdate) ClearEnrollmentStatus() *StudentUpdate
ClearEnrollmentStatus clears all "enrollment_status" edges to the EnrollmentStatus entity.
func (*StudentUpdate) ClearFamilyInfo ¶
func (su *StudentUpdate) ClearFamilyInfo() *StudentUpdate
ClearFamilyInfo clears all "family_info" edges to the FamilyInfo entity.
func (*StudentUpdate) ClearMajor ¶
func (su *StudentUpdate) ClearMajor() *StudentUpdate
ClearMajor clears the "major" edge to the Major entity.
func (*StudentUpdate) ClearPracticalExperience ¶
func (su *StudentUpdate) ClearPracticalExperience() *StudentUpdate
ClearPracticalExperience clears all "practical_experience" edges to the PracticalExperience entity.
func (*StudentUpdate) ClearTutor ¶
func (su *StudentUpdate) ClearTutor() *StudentUpdate
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*StudentUpdate) ClearUser ¶
func (su *StudentUpdate) ClearUser() *StudentUpdate
ClearUser clears the "user" edge to the User entity.
func (*StudentUpdate) Exec ¶
func (su *StudentUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*StudentUpdate) ExecX ¶
func (su *StudentUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StudentUpdate) Mutation ¶
func (su *StudentUpdate) Mutation() *StudentMutation
Mutation returns the StudentMutation object of the builder.
func (*StudentUpdate) RemoveCertificate ¶
func (su *StudentUpdate) RemoveCertificate(c ...*Certificate) *StudentUpdate
RemoveCertificate removes "certificate" edges to Certificate entities.
func (*StudentUpdate) RemoveCertificateIDs ¶
func (su *StudentUpdate) RemoveCertificateIDs(ids ...int) *StudentUpdate
RemoveCertificateIDs removes the "certificate" edge to Certificate entities by IDs.
func (*StudentUpdate) RemoveEducationLevel ¶
func (su *StudentUpdate) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdate
RemoveEducationLevel removes "education_level" edges to EducationLevel entities.
func (*StudentUpdate) RemoveEducationLevelIDs ¶
func (su *StudentUpdate) RemoveEducationLevelIDs(ids ...int) *StudentUpdate
RemoveEducationLevelIDs removes the "education_level" edge to EducationLevel entities by IDs.
func (*StudentUpdate) RemoveEnrollmentStatuIDs ¶
func (su *StudentUpdate) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdate
RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to EnrollmentStatus entities by IDs.
func (*StudentUpdate) RemoveEnrollmentStatus ¶
func (su *StudentUpdate) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate
RemoveEnrollmentStatus removes "enrollment_status" edges to EnrollmentStatus entities.
func (*StudentUpdate) RemoveFamilyInfo ¶
func (su *StudentUpdate) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdate
RemoveFamilyInfo removes "family_info" edges to FamilyInfo entities.
func (*StudentUpdate) RemoveFamilyInfoIDs ¶
func (su *StudentUpdate) RemoveFamilyInfoIDs(ids ...int) *StudentUpdate
RemoveFamilyInfoIDs removes the "family_info" edge to FamilyInfo entities by IDs.
func (*StudentUpdate) RemovePracticalExperience ¶
func (su *StudentUpdate) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdate
RemovePracticalExperience removes "practical_experience" edges to PracticalExperience entities.
func (*StudentUpdate) RemovePracticalExperienceIDs ¶
func (su *StudentUpdate) RemovePracticalExperienceIDs(ids ...int) *StudentUpdate
RemovePracticalExperienceIDs removes the "practical_experience" edge to PracticalExperience entities by IDs.
func (*StudentUpdate) Save ¶
func (su *StudentUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*StudentUpdate) SaveX ¶
func (su *StudentUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*StudentUpdate) SetAge ¶
func (su *StudentUpdate) SetAge(i int) *StudentUpdate
SetAge sets the "age" field.
func (*StudentUpdate) SetAvatar ¶
func (su *StudentUpdate) SetAvatar(b []byte) *StudentUpdate
SetAvatar sets the "avatar" field.
func (*StudentUpdate) SetClass ¶
func (su *StudentUpdate) SetClass(c *Class) *StudentUpdate
SetClass sets the "class" edge to the Class entity.
func (*StudentUpdate) SetClassID ¶
func (su *StudentUpdate) SetClassID(id int) *StudentUpdate
SetClassID sets the "class" edge to the Class entity by ID.
func (*StudentUpdate) SetClassLeader ¶
func (su *StudentUpdate) SetClassLeader(c *ClassLeader) *StudentUpdate
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*StudentUpdate) SetClassLeaderID ¶
func (su *StudentUpdate) SetClassLeaderID(id int) *StudentUpdate
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*StudentUpdate) SetCode ¶
func (su *StudentUpdate) SetCode(s string) *StudentUpdate
SetCode sets the "code" field.
func (*StudentUpdate) SetDepartment ¶
func (su *StudentUpdate) SetDepartment(d *Department) *StudentUpdate
SetDepartment sets the "department" edge to the Department entity.
func (*StudentUpdate) SetDepartmentID ¶
func (su *StudentUpdate) SetDepartmentID(id int) *StudentUpdate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*StudentUpdate) SetMajor ¶
func (su *StudentUpdate) SetMajor(m *Major) *StudentUpdate
SetMajor sets the "major" edge to the Major entity.
func (*StudentUpdate) SetMajorID ¶
func (su *StudentUpdate) SetMajorID(id int) *StudentUpdate
SetMajorID sets the "major" edge to the Major entity by ID.
func (*StudentUpdate) SetName ¶
func (su *StudentUpdate) SetName(s string) *StudentUpdate
SetName sets the "name" field.
func (*StudentUpdate) SetNillableClassID ¶
func (su *StudentUpdate) SetNillableClassID(id *int) *StudentUpdate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*StudentUpdate) SetNillableClassLeaderID ¶
func (su *StudentUpdate) SetNillableClassLeaderID(id *int) *StudentUpdate
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*StudentUpdate) SetNillableDepartmentID ¶
func (su *StudentUpdate) SetNillableDepartmentID(id *int) *StudentUpdate
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*StudentUpdate) SetNillableMajorID ¶
func (su *StudentUpdate) SetNillableMajorID(id *int) *StudentUpdate
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*StudentUpdate) SetNillableTutorID ¶
func (su *StudentUpdate) SetNillableTutorID(id *int) *StudentUpdate
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*StudentUpdate) SetNillableUserID ¶
func (su *StudentUpdate) SetNillableUserID(id *int) *StudentUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*StudentUpdate) SetSex ¶
func (su *StudentUpdate) SetSex(s string) *StudentUpdate
SetSex sets the "sex" field.
func (*StudentUpdate) SetTutor ¶
func (su *StudentUpdate) SetTutor(t *Tutor) *StudentUpdate
SetTutor sets the "tutor" edge to the Tutor entity.
func (*StudentUpdate) SetTutorID ¶
func (su *StudentUpdate) SetTutorID(id int) *StudentUpdate
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*StudentUpdate) SetUser ¶
func (su *StudentUpdate) SetUser(u *User) *StudentUpdate
SetUser sets the "user" edge to the User entity.
func (*StudentUpdate) SetUserID ¶
func (su *StudentUpdate) SetUserID(id int) *StudentUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*StudentUpdate) Where ¶
func (su *StudentUpdate) Where(ps ...predicate.Student) *StudentUpdate
Where appends a list predicates to the StudentUpdate builder.
type StudentUpdateOne ¶
type StudentUpdateOne struct {
// contains filtered or unexported fields
}
StudentUpdateOne is the builder for updating a single Student entity.
func (*StudentUpdateOne) AddAge ¶
func (suo *StudentUpdateOne) AddAge(i int) *StudentUpdateOne
AddAge adds i to the "age" field.
func (*StudentUpdateOne) AddCertificate ¶
func (suo *StudentUpdateOne) AddCertificate(c ...*Certificate) *StudentUpdateOne
AddCertificate adds the "certificate" edges to the Certificate entity.
func (*StudentUpdateOne) AddCertificateIDs ¶
func (suo *StudentUpdateOne) AddCertificateIDs(ids ...int) *StudentUpdateOne
AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.
func (*StudentUpdateOne) AddEducationLevel ¶
func (suo *StudentUpdateOne) AddEducationLevel(e ...*EducationLevel) *StudentUpdateOne
AddEducationLevel adds the "education_level" edges to the EducationLevel entity.
func (*StudentUpdateOne) AddEducationLevelIDs ¶
func (suo *StudentUpdateOne) AddEducationLevelIDs(ids ...int) *StudentUpdateOne
AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.
func (*StudentUpdateOne) AddEnrollmentStatuIDs ¶
func (suo *StudentUpdateOne) AddEnrollmentStatuIDs(ids ...int) *StudentUpdateOne
AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.
func (*StudentUpdateOne) AddEnrollmentStatus ¶
func (suo *StudentUpdateOne) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne
AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.
func (*StudentUpdateOne) AddFamilyInfo ¶
func (suo *StudentUpdateOne) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne
AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.
func (*StudentUpdateOne) AddFamilyInfoIDs ¶
func (suo *StudentUpdateOne) AddFamilyInfoIDs(ids ...int) *StudentUpdateOne
AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.
func (*StudentUpdateOne) AddPracticalExperience ¶
func (suo *StudentUpdateOne) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdateOne
AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.
func (*StudentUpdateOne) AddPracticalExperienceIDs ¶
func (suo *StudentUpdateOne) AddPracticalExperienceIDs(ids ...int) *StudentUpdateOne
AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.
func (*StudentUpdateOne) ClearCertificate ¶
func (suo *StudentUpdateOne) ClearCertificate() *StudentUpdateOne
ClearCertificate clears all "certificate" edges to the Certificate entity.
func (*StudentUpdateOne) ClearClass ¶
func (suo *StudentUpdateOne) ClearClass() *StudentUpdateOne
ClearClass clears the "class" edge to the Class entity.
func (*StudentUpdateOne) ClearClassLeader ¶
func (suo *StudentUpdateOne) ClearClassLeader() *StudentUpdateOne
ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.
func (*StudentUpdateOne) ClearDepartment ¶
func (suo *StudentUpdateOne) ClearDepartment() *StudentUpdateOne
ClearDepartment clears the "department" edge to the Department entity.
func (*StudentUpdateOne) ClearEducationLevel ¶
func (suo *StudentUpdateOne) ClearEducationLevel() *StudentUpdateOne
ClearEducationLevel clears all "education_level" edges to the EducationLevel entity.
func (*StudentUpdateOne) ClearEnrollmentStatus ¶
func (suo *StudentUpdateOne) ClearEnrollmentStatus() *StudentUpdateOne
ClearEnrollmentStatus clears all "enrollment_status" edges to the EnrollmentStatus entity.
func (*StudentUpdateOne) ClearFamilyInfo ¶
func (suo *StudentUpdateOne) ClearFamilyInfo() *StudentUpdateOne
ClearFamilyInfo clears all "family_info" edges to the FamilyInfo entity.
func (*StudentUpdateOne) ClearMajor ¶
func (suo *StudentUpdateOne) ClearMajor() *StudentUpdateOne
ClearMajor clears the "major" edge to the Major entity.
func (*StudentUpdateOne) ClearPracticalExperience ¶
func (suo *StudentUpdateOne) ClearPracticalExperience() *StudentUpdateOne
ClearPracticalExperience clears all "practical_experience" edges to the PracticalExperience entity.
func (*StudentUpdateOne) ClearTutor ¶
func (suo *StudentUpdateOne) ClearTutor() *StudentUpdateOne
ClearTutor clears the "tutor" edge to the Tutor entity.
func (*StudentUpdateOne) ClearUser ¶
func (suo *StudentUpdateOne) ClearUser() *StudentUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*StudentUpdateOne) Exec ¶
func (suo *StudentUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*StudentUpdateOne) ExecX ¶
func (suo *StudentUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StudentUpdateOne) Mutation ¶
func (suo *StudentUpdateOne) Mutation() *StudentMutation
Mutation returns the StudentMutation object of the builder.
func (*StudentUpdateOne) RemoveCertificate ¶
func (suo *StudentUpdateOne) RemoveCertificate(c ...*Certificate) *StudentUpdateOne
RemoveCertificate removes "certificate" edges to Certificate entities.
func (*StudentUpdateOne) RemoveCertificateIDs ¶
func (suo *StudentUpdateOne) RemoveCertificateIDs(ids ...int) *StudentUpdateOne
RemoveCertificateIDs removes the "certificate" edge to Certificate entities by IDs.
func (*StudentUpdateOne) RemoveEducationLevel ¶
func (suo *StudentUpdateOne) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdateOne
RemoveEducationLevel removes "education_level" edges to EducationLevel entities.
func (*StudentUpdateOne) RemoveEducationLevelIDs ¶
func (suo *StudentUpdateOne) RemoveEducationLevelIDs(ids ...int) *StudentUpdateOne
RemoveEducationLevelIDs removes the "education_level" edge to EducationLevel entities by IDs.
func (*StudentUpdateOne) RemoveEnrollmentStatuIDs ¶
func (suo *StudentUpdateOne) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdateOne
RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to EnrollmentStatus entities by IDs.
func (*StudentUpdateOne) RemoveEnrollmentStatus ¶
func (suo *StudentUpdateOne) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne
RemoveEnrollmentStatus removes "enrollment_status" edges to EnrollmentStatus entities.
func (*StudentUpdateOne) RemoveFamilyInfo ¶
func (suo *StudentUpdateOne) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne
RemoveFamilyInfo removes "family_info" edges to FamilyInfo entities.
func (*StudentUpdateOne) RemoveFamilyInfoIDs ¶
func (suo *StudentUpdateOne) RemoveFamilyInfoIDs(ids ...int) *StudentUpdateOne
RemoveFamilyInfoIDs removes the "family_info" edge to FamilyInfo entities by IDs.
func (*StudentUpdateOne) RemovePracticalExperience ¶
func (suo *StudentUpdateOne) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdateOne
RemovePracticalExperience removes "practical_experience" edges to PracticalExperience entities.
func (*StudentUpdateOne) RemovePracticalExperienceIDs ¶
func (suo *StudentUpdateOne) RemovePracticalExperienceIDs(ids ...int) *StudentUpdateOne
RemovePracticalExperienceIDs removes the "practical_experience" edge to PracticalExperience entities by IDs.
func (*StudentUpdateOne) Save ¶
func (suo *StudentUpdateOne) Save(ctx context.Context) (*Student, error)
Save executes the query and returns the updated Student entity.
func (*StudentUpdateOne) SaveX ¶
func (suo *StudentUpdateOne) SaveX(ctx context.Context) *Student
SaveX is like Save, but panics if an error occurs.
func (*StudentUpdateOne) Select ¶
func (suo *StudentUpdateOne) Select(field string, fields ...string) *StudentUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*StudentUpdateOne) SetAge ¶
func (suo *StudentUpdateOne) SetAge(i int) *StudentUpdateOne
SetAge sets the "age" field.
func (*StudentUpdateOne) SetAvatar ¶
func (suo *StudentUpdateOne) SetAvatar(b []byte) *StudentUpdateOne
SetAvatar sets the "avatar" field.
func (*StudentUpdateOne) SetClass ¶
func (suo *StudentUpdateOne) SetClass(c *Class) *StudentUpdateOne
SetClass sets the "class" edge to the Class entity.
func (*StudentUpdateOne) SetClassID ¶
func (suo *StudentUpdateOne) SetClassID(id int) *StudentUpdateOne
SetClassID sets the "class" edge to the Class entity by ID.
func (*StudentUpdateOne) SetClassLeader ¶
func (suo *StudentUpdateOne) SetClassLeader(c *ClassLeader) *StudentUpdateOne
SetClassLeader sets the "class_leader" edge to the ClassLeader entity.
func (*StudentUpdateOne) SetClassLeaderID ¶
func (suo *StudentUpdateOne) SetClassLeaderID(id int) *StudentUpdateOne
SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.
func (*StudentUpdateOne) SetCode ¶
func (suo *StudentUpdateOne) SetCode(s string) *StudentUpdateOne
SetCode sets the "code" field.
func (*StudentUpdateOne) SetDepartment ¶
func (suo *StudentUpdateOne) SetDepartment(d *Department) *StudentUpdateOne
SetDepartment sets the "department" edge to the Department entity.
func (*StudentUpdateOne) SetDepartmentID ¶
func (suo *StudentUpdateOne) SetDepartmentID(id int) *StudentUpdateOne
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*StudentUpdateOne) SetMajor ¶
func (suo *StudentUpdateOne) SetMajor(m *Major) *StudentUpdateOne
SetMajor sets the "major" edge to the Major entity.
func (*StudentUpdateOne) SetMajorID ¶
func (suo *StudentUpdateOne) SetMajorID(id int) *StudentUpdateOne
SetMajorID sets the "major" edge to the Major entity by ID.
func (*StudentUpdateOne) SetName ¶
func (suo *StudentUpdateOne) SetName(s string) *StudentUpdateOne
SetName sets the "name" field.
func (*StudentUpdateOne) SetNillableClassID ¶
func (suo *StudentUpdateOne) SetNillableClassID(id *int) *StudentUpdateOne
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetNillableClassLeaderID ¶
func (suo *StudentUpdateOne) SetNillableClassLeaderID(id *int) *StudentUpdateOne
SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetNillableDepartmentID ¶
func (suo *StudentUpdateOne) SetNillableDepartmentID(id *int) *StudentUpdateOne
SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetNillableMajorID ¶
func (suo *StudentUpdateOne) SetNillableMajorID(id *int) *StudentUpdateOne
SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetNillableTutorID ¶
func (suo *StudentUpdateOne) SetNillableTutorID(id *int) *StudentUpdateOne
SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetNillableUserID ¶
func (suo *StudentUpdateOne) SetNillableUserID(id *int) *StudentUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*StudentUpdateOne) SetSex ¶
func (suo *StudentUpdateOne) SetSex(s string) *StudentUpdateOne
SetSex sets the "sex" field.
func (*StudentUpdateOne) SetTutor ¶
func (suo *StudentUpdateOne) SetTutor(t *Tutor) *StudentUpdateOne
SetTutor sets the "tutor" edge to the Tutor entity.
func (*StudentUpdateOne) SetTutorID ¶
func (suo *StudentUpdateOne) SetTutorID(id int) *StudentUpdateOne
SetTutorID sets the "tutor" edge to the Tutor entity by ID.
func (*StudentUpdateOne) SetUser ¶
func (suo *StudentUpdateOne) SetUser(u *User) *StudentUpdateOne
SetUser sets the "user" edge to the User entity.
func (*StudentUpdateOne) SetUserID ¶
func (suo *StudentUpdateOne) SetUserID(id int) *StudentUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*StudentUpdateOne) Where ¶
func (suo *StudentUpdateOne) Where(ps ...predicate.Student) *StudentUpdateOne
Where appends a list predicates to the StudentUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tutor ¶
type Tutor struct { // ID of the ent. ID int `json:"id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TutorQuery when eager-loading is set. Edges TutorEdges `json:"edges"` // contains filtered or unexported fields }
Tutor is the model entity for the Tutor schema.
func (*Tutor) QueryClass ¶
func (t *Tutor) QueryClass() *ClassQuery
QueryClass queries the "class" edge of the Tutor entity.
func (*Tutor) QueryStudent ¶
func (t *Tutor) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the Tutor entity.
func (*Tutor) Unwrap ¶
Unwrap unwraps the Tutor 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 (*Tutor) Update ¶
func (t *Tutor) Update() *TutorUpdateOne
Update returns a builder for updating this Tutor. Note that you need to call Tutor.Unwrap() before calling this method if this Tutor was returned from a transaction, and the transaction was committed or rolled back.
type TutorClient ¶
type TutorClient struct {
// contains filtered or unexported fields
}
TutorClient is a client for the Tutor schema.
func NewTutorClient ¶
func NewTutorClient(c config) *TutorClient
NewTutorClient returns a client for the Tutor from the given config.
func (*TutorClient) Create ¶
func (c *TutorClient) Create() *TutorCreate
Create returns a builder for creating a Tutor entity.
func (*TutorClient) CreateBulk ¶
func (c *TutorClient) CreateBulk(builders ...*TutorCreate) *TutorCreateBulk
CreateBulk returns a builder for creating a bulk of Tutor entities.
func (*TutorClient) Delete ¶
func (c *TutorClient) Delete() *TutorDelete
Delete returns a delete builder for Tutor.
func (*TutorClient) DeleteOne ¶
func (c *TutorClient) DeleteOne(t *Tutor) *TutorDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TutorClient) DeleteOneID ¶
func (c *TutorClient) DeleteOneID(id int) *TutorDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TutorClient) GetX ¶
func (c *TutorClient) GetX(ctx context.Context, id int) *Tutor
GetX is like Get, but panics if an error occurs.
func (*TutorClient) Intercept ¶
func (c *TutorClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tutor.Intercept(f(g(h())))`.
func (*TutorClient) Interceptors ¶
func (c *TutorClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TutorClient) Query ¶
func (c *TutorClient) Query() *TutorQuery
Query returns a query builder for Tutor.
func (*TutorClient) QueryClass ¶
func (c *TutorClient) QueryClass(t *Tutor) *ClassQuery
QueryClass queries the class edge of a Tutor.
func (*TutorClient) QueryStudent ¶
func (c *TutorClient) QueryStudent(t *Tutor) *StudentQuery
QueryStudent queries the student edge of a Tutor.
func (*TutorClient) Update ¶
func (c *TutorClient) Update() *TutorUpdate
Update returns an update builder for Tutor.
func (*TutorClient) UpdateOne ¶
func (c *TutorClient) UpdateOne(t *Tutor) *TutorUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TutorClient) UpdateOneID ¶
func (c *TutorClient) UpdateOneID(id int) *TutorUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TutorClient) Use ¶
func (c *TutorClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tutor.Hooks(f(g(h())))`.
type TutorCreate ¶
type TutorCreate struct {
// contains filtered or unexported fields
}
TutorCreate is the builder for creating a Tutor entity.
func (*TutorCreate) Exec ¶
func (tc *TutorCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TutorCreate) ExecX ¶
func (tc *TutorCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TutorCreate) Mutation ¶
func (tc *TutorCreate) Mutation() *TutorMutation
Mutation returns the TutorMutation object of the builder.
func (*TutorCreate) Save ¶
func (tc *TutorCreate) Save(ctx context.Context) (*Tutor, error)
Save creates the Tutor in the database.
func (*TutorCreate) SaveX ¶
func (tc *TutorCreate) SaveX(ctx context.Context) *Tutor
SaveX calls Save and panics if Save returns an error.
func (*TutorCreate) SetClass ¶
func (tc *TutorCreate) SetClass(c *Class) *TutorCreate
SetClass sets the "class" edge to the Class entity.
func (*TutorCreate) SetClassID ¶
func (tc *TutorCreate) SetClassID(id int) *TutorCreate
SetClassID sets the "class" edge to the Class entity by ID.
func (*TutorCreate) SetNillableClassID ¶
func (tc *TutorCreate) SetNillableClassID(id *int) *TutorCreate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*TutorCreate) SetNillableStudentID ¶
func (tc *TutorCreate) SetNillableStudentID(id *int) *TutorCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*TutorCreate) SetStudent ¶
func (tc *TutorCreate) SetStudent(s *Student) *TutorCreate
SetStudent sets the "student" edge to the Student entity.
func (*TutorCreate) SetStudentID ¶
func (tc *TutorCreate) SetStudentID(id int) *TutorCreate
SetStudentID sets the "student" edge to the Student entity by ID.
type TutorCreateBulk ¶
type TutorCreateBulk struct {
// contains filtered or unexported fields
}
TutorCreateBulk is the builder for creating many Tutor entities in bulk.
func (*TutorCreateBulk) Exec ¶
func (tcb *TutorCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TutorCreateBulk) ExecX ¶
func (tcb *TutorCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TutorDelete ¶
type TutorDelete struct {
// contains filtered or unexported fields
}
TutorDelete is the builder for deleting a Tutor entity.
func (*TutorDelete) Exec ¶
func (td *TutorDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TutorDelete) ExecX ¶
func (td *TutorDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TutorDelete) Where ¶
func (td *TutorDelete) Where(ps ...predicate.Tutor) *TutorDelete
Where appends a list predicates to the TutorDelete builder.
type TutorDeleteOne ¶
type TutorDeleteOne struct {
// contains filtered or unexported fields
}
TutorDeleteOne is the builder for deleting a single Tutor entity.
func (*TutorDeleteOne) Exec ¶
func (tdo *TutorDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TutorDeleteOne) ExecX ¶
func (tdo *TutorDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TutorDeleteOne) Where ¶
func (tdo *TutorDeleteOne) Where(ps ...predicate.Tutor) *TutorDeleteOne
Where appends a list predicates to the TutorDelete builder.
type TutorEdges ¶
type TutorEdges struct { // Class holds the value of the class edge. Class *Class `json:"class,omitempty"` // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
TutorEdges holds the relations/edges for other nodes in the graph.
func (TutorEdges) ClassOrErr ¶
func (e TutorEdges) ClassOrErr() (*Class, error)
ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (TutorEdges) StudentOrErr ¶
func (e TutorEdges) StudentOrErr() (*Student, error)
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type TutorGroupBy ¶
type TutorGroupBy struct {
// contains filtered or unexported fields
}
TutorGroupBy is the group-by builder for Tutor entities.
func (*TutorGroupBy) Aggregate ¶
func (tgb *TutorGroupBy) Aggregate(fns ...AggregateFunc) *TutorGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TutorGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TutorGroupBy) Scan ¶
func (tgb *TutorGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TutorGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TutorMutation ¶
type TutorMutation struct {
// contains filtered or unexported fields
}
TutorMutation represents an operation that mutates the Tutor nodes in the graph.
func (*TutorMutation) AddField ¶
func (m *TutorMutation) 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 (*TutorMutation) AddedEdges ¶
func (m *TutorMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TutorMutation) AddedField ¶
func (m *TutorMutation) 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 (*TutorMutation) AddedFields ¶
func (m *TutorMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TutorMutation) AddedIDs ¶
func (m *TutorMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TutorMutation) ClassCleared ¶
func (m *TutorMutation) ClassCleared() bool
ClassCleared reports if the "class" edge to the Class entity was cleared.
func (*TutorMutation) ClassID ¶
func (m *TutorMutation) ClassID() (id int, exists bool)
ClassID returns the "class" edge ID in the mutation.
func (*TutorMutation) ClassIDs ¶
func (m *TutorMutation) ClassIDs() (ids []int)
ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.
func (*TutorMutation) ClearClass ¶
func (m *TutorMutation) ClearClass()
ClearClass clears the "class" edge to the Class entity.
func (*TutorMutation) ClearEdge ¶
func (m *TutorMutation) 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 (*TutorMutation) ClearField ¶
func (m *TutorMutation) 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 (*TutorMutation) ClearStudent ¶
func (m *TutorMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student entity.
func (*TutorMutation) ClearedEdges ¶
func (m *TutorMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TutorMutation) ClearedFields ¶
func (m *TutorMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TutorMutation) Client ¶
func (m TutorMutation) 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 (*TutorMutation) EdgeCleared ¶
func (m *TutorMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TutorMutation) Field ¶
func (m *TutorMutation) 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 (*TutorMutation) FieldCleared ¶
func (m *TutorMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TutorMutation) Fields ¶
func (m *TutorMutation) 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 (*TutorMutation) ID ¶
func (m *TutorMutation) 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 (*TutorMutation) IDs ¶
func (m *TutorMutation) 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 (*TutorMutation) 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 (*TutorMutation) RemovedEdges ¶
func (m *TutorMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TutorMutation) RemovedIDs ¶
func (m *TutorMutation) 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 (*TutorMutation) ResetClass ¶
func (m *TutorMutation) ResetClass()
ResetClass resets all changes to the "class" edge.
func (*TutorMutation) ResetEdge ¶
func (m *TutorMutation) 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 (*TutorMutation) ResetField ¶
func (m *TutorMutation) 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 (*TutorMutation) ResetStudent ¶
func (m *TutorMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*TutorMutation) SetClassID ¶
func (m *TutorMutation) SetClassID(id int)
SetClassID sets the "class" edge to the Class entity by id.
func (*TutorMutation) SetField ¶
func (m *TutorMutation) 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 (*TutorMutation) SetOp ¶
func (m *TutorMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TutorMutation) SetStudentID ¶
func (m *TutorMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*TutorMutation) StudentCleared ¶
func (m *TutorMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*TutorMutation) StudentID ¶
func (m *TutorMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*TutorMutation) StudentIDs ¶
func (m *TutorMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
func (TutorMutation) Tx ¶
func (m TutorMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TutorMutation) Type ¶
func (m *TutorMutation) Type() string
Type returns the node type of this mutation (Tutor).
func (*TutorMutation) Where ¶
func (m *TutorMutation) Where(ps ...predicate.Tutor)
Where appends a list predicates to the TutorMutation builder.
func (*TutorMutation) WhereP ¶
func (m *TutorMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TutorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TutorQuery ¶
type TutorQuery struct {
// contains filtered or unexported fields
}
TutorQuery is the builder for querying Tutor entities.
func (*TutorQuery) Aggregate ¶
func (tq *TutorQuery) Aggregate(fns ...AggregateFunc) *TutorSelect
Aggregate returns a TutorSelect configured with the given aggregations.
func (*TutorQuery) All ¶
func (tq *TutorQuery) All(ctx context.Context) ([]*Tutor, error)
All executes the query and returns a list of Tutors.
func (*TutorQuery) AllX ¶
func (tq *TutorQuery) AllX(ctx context.Context) []*Tutor
AllX is like All, but panics if an error occurs.
func (*TutorQuery) Clone ¶
func (tq *TutorQuery) Clone() *TutorQuery
Clone returns a duplicate of the TutorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TutorQuery) Count ¶
func (tq *TutorQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TutorQuery) CountX ¶
func (tq *TutorQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TutorQuery) Exist ¶
func (tq *TutorQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TutorQuery) ExistX ¶
func (tq *TutorQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TutorQuery) First ¶
func (tq *TutorQuery) First(ctx context.Context) (*Tutor, error)
First returns the first Tutor entity from the query. Returns a *NotFoundError when no Tutor was found.
func (*TutorQuery) FirstID ¶
func (tq *TutorQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Tutor ID from the query. Returns a *NotFoundError when no Tutor ID was found.
func (*TutorQuery) FirstIDX ¶
func (tq *TutorQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TutorQuery) FirstX ¶
func (tq *TutorQuery) FirstX(ctx context.Context) *Tutor
FirstX is like First, but panics if an error occurs.
func (*TutorQuery) GroupBy ¶
func (tq *TutorQuery) GroupBy(field string, fields ...string) *TutorGroupBy
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.
func (*TutorQuery) IDs ¶
func (tq *TutorQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Tutor IDs.
func (*TutorQuery) IDsX ¶
func (tq *TutorQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TutorQuery) Limit ¶
func (tq *TutorQuery) Limit(limit int) *TutorQuery
Limit the number of records to be returned by this query.
func (*TutorQuery) Offset ¶
func (tq *TutorQuery) Offset(offset int) *TutorQuery
Offset to start from.
func (*TutorQuery) Only ¶
func (tq *TutorQuery) Only(ctx context.Context) (*Tutor, error)
Only returns a single Tutor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tutor entity is found. Returns a *NotFoundError when no Tutor entities are found.
func (*TutorQuery) OnlyID ¶
func (tq *TutorQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Tutor ID in the query. Returns a *NotSingularError when more than one Tutor ID is found. Returns a *NotFoundError when no entities are found.
func (*TutorQuery) OnlyIDX ¶
func (tq *TutorQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TutorQuery) OnlyX ¶
func (tq *TutorQuery) OnlyX(ctx context.Context) *Tutor
OnlyX is like Only, but panics if an error occurs.
func (*TutorQuery) Order ¶
func (tq *TutorQuery) Order(o ...OrderFunc) *TutorQuery
Order specifies how the records should be ordered.
func (*TutorQuery) QueryClass ¶
func (tq *TutorQuery) QueryClass() *ClassQuery
QueryClass chains the current query on the "class" edge.
func (*TutorQuery) QueryStudent ¶
func (tq *TutorQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" edge.
func (*TutorQuery) Select ¶
func (tq *TutorQuery) Select(fields ...string) *TutorSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
func (*TutorQuery) Unique ¶
func (tq *TutorQuery) Unique(unique bool) *TutorQuery
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 (*TutorQuery) Where ¶
func (tq *TutorQuery) Where(ps ...predicate.Tutor) *TutorQuery
Where adds a new predicate for the TutorQuery builder.
func (*TutorQuery) WithClass ¶
func (tq *TutorQuery) WithClass(opts ...func(*ClassQuery)) *TutorQuery
WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.
func (*TutorQuery) WithStudent ¶
func (tq *TutorQuery) WithStudent(opts ...func(*StudentQuery)) *TutorQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type TutorSelect ¶
type TutorSelect struct { *TutorQuery // contains filtered or unexported fields }
TutorSelect is the builder for selecting fields of Tutor entities.
func (*TutorSelect) Aggregate ¶
func (ts *TutorSelect) Aggregate(fns ...AggregateFunc) *TutorSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TutorSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TutorSelect) Scan ¶
func (ts *TutorSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TutorSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TutorUpdate ¶
type TutorUpdate struct {
// contains filtered or unexported fields
}
TutorUpdate is the builder for updating Tutor entities.
func (*TutorUpdate) ClearClass ¶
func (tu *TutorUpdate) ClearClass() *TutorUpdate
ClearClass clears the "class" edge to the Class entity.
func (*TutorUpdate) ClearStudent ¶
func (tu *TutorUpdate) ClearStudent() *TutorUpdate
ClearStudent clears the "student" edge to the Student entity.
func (*TutorUpdate) Exec ¶
func (tu *TutorUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TutorUpdate) ExecX ¶
func (tu *TutorUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TutorUpdate) Mutation ¶
func (tu *TutorUpdate) Mutation() *TutorMutation
Mutation returns the TutorMutation object of the builder.
func (*TutorUpdate) Save ¶
func (tu *TutorUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TutorUpdate) SaveX ¶
func (tu *TutorUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TutorUpdate) SetClass ¶
func (tu *TutorUpdate) SetClass(c *Class) *TutorUpdate
SetClass sets the "class" edge to the Class entity.
func (*TutorUpdate) SetClassID ¶
func (tu *TutorUpdate) SetClassID(id int) *TutorUpdate
SetClassID sets the "class" edge to the Class entity by ID.
func (*TutorUpdate) SetNillableClassID ¶
func (tu *TutorUpdate) SetNillableClassID(id *int) *TutorUpdate
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*TutorUpdate) SetNillableStudentID ¶
func (tu *TutorUpdate) SetNillableStudentID(id *int) *TutorUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*TutorUpdate) SetStudent ¶
func (tu *TutorUpdate) SetStudent(s *Student) *TutorUpdate
SetStudent sets the "student" edge to the Student entity.
func (*TutorUpdate) SetStudentID ¶
func (tu *TutorUpdate) SetStudentID(id int) *TutorUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*TutorUpdate) Where ¶
func (tu *TutorUpdate) Where(ps ...predicate.Tutor) *TutorUpdate
Where appends a list predicates to the TutorUpdate builder.
type TutorUpdateOne ¶
type TutorUpdateOne struct {
// contains filtered or unexported fields
}
TutorUpdateOne is the builder for updating a single Tutor entity.
func (*TutorUpdateOne) ClearClass ¶
func (tuo *TutorUpdateOne) ClearClass() *TutorUpdateOne
ClearClass clears the "class" edge to the Class entity.
func (*TutorUpdateOne) ClearStudent ¶
func (tuo *TutorUpdateOne) ClearStudent() *TutorUpdateOne
ClearStudent clears the "student" edge to the Student entity.
func (*TutorUpdateOne) Exec ¶
func (tuo *TutorUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TutorUpdateOne) ExecX ¶
func (tuo *TutorUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TutorUpdateOne) Mutation ¶
func (tuo *TutorUpdateOne) Mutation() *TutorMutation
Mutation returns the TutorMutation object of the builder.
func (*TutorUpdateOne) Save ¶
func (tuo *TutorUpdateOne) Save(ctx context.Context) (*Tutor, error)
Save executes the query and returns the updated Tutor entity.
func (*TutorUpdateOne) SaveX ¶
func (tuo *TutorUpdateOne) SaveX(ctx context.Context) *Tutor
SaveX is like Save, but panics if an error occurs.
func (*TutorUpdateOne) Select ¶
func (tuo *TutorUpdateOne) Select(field string, fields ...string) *TutorUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TutorUpdateOne) SetClass ¶
func (tuo *TutorUpdateOne) SetClass(c *Class) *TutorUpdateOne
SetClass sets the "class" edge to the Class entity.
func (*TutorUpdateOne) SetClassID ¶
func (tuo *TutorUpdateOne) SetClassID(id int) *TutorUpdateOne
SetClassID sets the "class" edge to the Class entity by ID.
func (*TutorUpdateOne) SetNillableClassID ¶
func (tuo *TutorUpdateOne) SetNillableClassID(id *int) *TutorUpdateOne
SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.
func (*TutorUpdateOne) SetNillableStudentID ¶
func (tuo *TutorUpdateOne) SetNillableStudentID(id *int) *TutorUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*TutorUpdateOne) SetStudent ¶
func (tuo *TutorUpdateOne) SetStudent(s *Student) *TutorUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*TutorUpdateOne) SetStudentID ¶
func (tuo *TutorUpdateOne) SetStudentID(id int) *TutorUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*TutorUpdateOne) Where ¶
func (tuo *TutorUpdateOne) Where(ps ...predicate.Tutor) *TutorUpdateOne
Where appends a list predicates to the TutorUpdate builder.
type Tx ¶
type Tx struct { // Authorization is the client for interacting with the Authorization builders. Authorization *AuthorizationClient // Campus is the client for interacting with the Campus builders. Campus *CampusClient // Certificate is the client for interacting with the Certificate builders. Certificate *CertificateClient // Class is the client for interacting with the Class builders. Class *ClassClient // ClassLeader is the client for interacting with the ClassLeader builders. ClassLeader *ClassLeaderClient // Department is the client for interacting with the Department builders. Department *DepartmentClient // EducationLevel is the client for interacting with the EducationLevel builders. EducationLevel *EducationLevelClient // EnrollmentStatus is the client for interacting with the EnrollmentStatus builders. EnrollmentStatus *EnrollmentStatusClient // FamilyInfo is the client for interacting with the FamilyInfo builders. FamilyInfo *FamilyInfoClient // Major is the client for interacting with the Major builders. Major *MajorClient // MajorDirection is the client for interacting with the MajorDirection builders. MajorDirection *MajorDirectionClient // PracticalExperience is the client for interacting with the PracticalExperience builders. PracticalExperience *PracticalExperienceClient // Resource is the client for interacting with the Resource builders. Resource *ResourceClient // Role is the client for interacting with the Role builders. Role *RoleClient // Student is the client for interacting with the Student builders. Student *StudentClient // Tutor is the client for interacting with the Tutor builders. Tutor *TutorClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Account holds the value of the "account" field. Account string `json:"account,omitempty"` // Passwd holds the value of the "passwd" field. Passwd string `json:"passwd,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // Avatar holds the value of the "avatar" field. Avatar *[]byte `json:"avatar,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryResource ¶
func (u *User) QueryResource() *ResourceQuery
QueryResource queries the "resource" edge of the User entity.
func (*User) QueryStudent ¶
func (u *User) QueryStudent() *StudentQuery
QueryStudent queries the "student" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryResource ¶
func (c *UserClient) QueryResource(u *User) *ResourceQuery
QueryResource queries the resource edge of a User.
func (*UserClient) QueryRole ¶
func (c *UserClient) QueryRole(u *User) *RoleQuery
QueryRole queries the role edge of a User.
func (*UserClient) QueryStudent ¶
func (c *UserClient) QueryStudent(u *User) *StudentQuery
QueryStudent queries the student edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddResource ¶
func (uc *UserCreate) AddResource(r ...*Resource) *UserCreate
AddResource adds the "resource" edges to the Resource entity.
func (*UserCreate) AddResourceIDs ¶
func (uc *UserCreate) AddResourceIDs(ids ...int) *UserCreate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*UserCreate) AddRole ¶
func (uc *UserCreate) AddRole(r ...*Role) *UserCreate
AddRole adds the "role" edges to the Role entity.
func (*UserCreate) AddRoleIDs ¶
func (uc *UserCreate) AddRoleIDs(ids ...int) *UserCreate
AddRoleIDs adds the "role" edge to the Role entity by IDs.
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) SetAccount ¶
func (uc *UserCreate) SetAccount(s string) *UserCreate
SetAccount sets the "account" field.
func (*UserCreate) SetAvatar ¶
func (uc *UserCreate) SetAvatar(b []byte) *UserCreate
SetAvatar sets the "avatar" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetNillableStudentID ¶
func (uc *UserCreate) SetNillableStudentID(id *int) *UserCreate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*UserCreate) SetPasswd ¶
func (uc *UserCreate) SetPasswd(s string) *UserCreate
SetPasswd sets the "passwd" field.
func (*UserCreate) SetStudent ¶
func (uc *UserCreate) SetStudent(s *Student) *UserCreate
SetStudent sets the "student" edge to the Student entity.
func (*UserCreate) SetStudentID ¶
func (uc *UserCreate) SetStudentID(id int) *UserCreate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Role holds the value of the role edge. Role []*Role `json:"role,omitempty"` // Resource holds the value of the resource edge. Resource []*Resource `json:"resource,omitempty"` // Student holds the value of the student edge. Student *Student `json:"student,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) ResourceOrErr ¶
ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading.
func (UserEdges) RoleOrErr ¶
RoleOrErr returns the Role value or an error if the edge was not loaded in eager-loading.
func (UserEdges) StudentOrErr ¶
StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) Account ¶
func (m *UserMutation) Account() (r string, exists bool)
Account returns the value of the "account" field in the mutation.
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) AddResourceIDs ¶
func (m *UserMutation) AddResourceIDs(ids ...int)
AddResourceIDs adds the "resource" edge to the Resource entity by ids.
func (*UserMutation) AddRoleIDs ¶
func (m *UserMutation) AddRoleIDs(ids ...int)
AddRoleIDs adds the "role" edge to the Role entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) Avatar ¶
func (m *UserMutation) Avatar() (r []byte, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*UserMutation) 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) ClearResource ¶
func (m *UserMutation) ClearResource()
ClearResource clears the "resource" edge to the Resource entity.
func (*UserMutation) ClearRole ¶
func (m *UserMutation) ClearRole()
ClearRole clears the "role" edge to the Role entity.
func (*UserMutation) ClearStudent ¶
func (m *UserMutation) ClearStudent()
ClearStudent clears the "student" edge to the Student 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) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) OldAccount ¶
func (m *UserMutation) OldAccount(ctx context.Context) (v string, err error)
OldAccount returns the old "account" 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) OldAvatar ¶
func (m *UserMutation) OldAvatar(ctx context.Context) (v *[]byte, err error)
OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldPasswd ¶
func (m *UserMutation) OldPasswd(ctx context.Context) (v string, err error)
OldPasswd returns the old "passwd" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) Passwd ¶
func (m *UserMutation) Passwd() (r string, exists bool)
Passwd returns the value of the "passwd" field in the mutation.
func (*UserMutation) RemoveResourceIDs ¶
func (m *UserMutation) RemoveResourceIDs(ids ...int)
RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.
func (*UserMutation) RemoveRoleIDs ¶
func (m *UserMutation) RemoveRoleIDs(ids ...int)
RemoveRoleIDs removes the "role" 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) RemovedResourceIDs ¶
func (m *UserMutation) RemovedResourceIDs() (ids []int)
RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.
func (*UserMutation) RemovedRoleIDs ¶
func (m *UserMutation) RemovedRoleIDs() (ids []int)
RemovedRole returns the removed IDs of the "role" edge to the Role entity.
func (*UserMutation) ResetAccount ¶
func (m *UserMutation) ResetAccount()
ResetAccount resets all changes to the "account" field.
func (*UserMutation) ResetAvatar ¶
func (m *UserMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetPasswd ¶
func (m *UserMutation) ResetPasswd()
ResetPasswd resets all changes to the "passwd" field.
func (*UserMutation) ResetResource ¶
func (m *UserMutation) ResetResource()
ResetResource resets all changes to the "resource" edge.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" edge.
func (*UserMutation) ResetStudent ¶
func (m *UserMutation) ResetStudent()
ResetStudent resets all changes to the "student" edge.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) ResourceCleared ¶
func (m *UserMutation) ResourceCleared() bool
ResourceCleared reports if the "resource" edge to the Resource entity was cleared.
func (*UserMutation) ResourceIDs ¶
func (m *UserMutation) ResourceIDs() (ids []int)
ResourceIDs returns the "resource" edge IDs in the mutation.
func (*UserMutation) RoleCleared ¶
func (m *UserMutation) RoleCleared() bool
RoleCleared reports if the "role" edge to the Role entity was cleared.
func (*UserMutation) RoleIDs ¶
func (m *UserMutation) RoleIDs() (ids []int)
RoleIDs returns the "role" edge IDs in the mutation.
func (*UserMutation) SetAccount ¶
func (m *UserMutation) SetAccount(s string)
SetAccount sets the "account" field.
func (*UserMutation) SetAvatar ¶
func (m *UserMutation) SetAvatar(b []byte)
SetAvatar sets the "avatar" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPasswd ¶
func (m *UserMutation) SetPasswd(s string)
SetPasswd sets the "passwd" field.
func (*UserMutation) SetStudentID ¶
func (m *UserMutation) SetStudentID(id int)
SetStudentID sets the "student" edge to the Student entity by id.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (*UserMutation) StudentCleared ¶
func (m *UserMutation) StudentCleared() bool
StudentCleared reports if the "student" edge to the Student entity was cleared.
func (*UserMutation) StudentID ¶
func (m *UserMutation) StudentID() (id int, exists bool)
StudentID returns the "student" edge ID in the mutation.
func (*UserMutation) StudentIDs ¶
func (m *UserMutation) StudentIDs() (ids []int)
StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.
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) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Account string `json:"account,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldAccount). Aggregate(domain.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) QueryResource ¶
func (uq *UserQuery) QueryResource() *ResourceQuery
QueryResource chains the current query on the "resource" edge.
func (*UserQuery) QueryStudent ¶
func (uq *UserQuery) QueryStudent() *StudentQuery
QueryStudent chains the current query on the "student" 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 { Account string `json:"account,omitempty"` } client.User.Query(). Select(user.FieldAccount). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithResource ¶
func (uq *UserQuery) WithResource(opts ...func(*ResourceQuery)) *UserQuery
WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithRole ¶
WithRole tells the query-builder to eager-load the nodes that are connected to the "role" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithStudent ¶
func (uq *UserQuery) WithStudent(opts ...func(*StudentQuery)) *UserQuery
WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddResource ¶
func (uu *UserUpdate) AddResource(r ...*Resource) *UserUpdate
AddResource adds the "resource" edges to the Resource entity.
func (*UserUpdate) AddResourceIDs ¶
func (uu *UserUpdate) AddResourceIDs(ids ...int) *UserUpdate
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*UserUpdate) AddRole ¶
func (uu *UserUpdate) AddRole(r ...*Role) *UserUpdate
AddRole adds the "role" edges to the Role entity.
func (*UserUpdate) AddRoleIDs ¶
func (uu *UserUpdate) AddRoleIDs(ids ...int) *UserUpdate
AddRoleIDs adds the "role" edge to the Role entity by IDs.
func (*UserUpdate) ClearResource ¶
func (uu *UserUpdate) ClearResource() *UserUpdate
ClearResource clears all "resource" edges to the Resource entity.
func (*UserUpdate) ClearRole ¶
func (uu *UserUpdate) ClearRole() *UserUpdate
ClearRole clears all "role" edges to the Role entity.
func (*UserUpdate) ClearStudent ¶
func (uu *UserUpdate) ClearStudent() *UserUpdate
ClearStudent clears the "student" edge to the Student 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) RemoveResource ¶
func (uu *UserUpdate) RemoveResource(r ...*Resource) *UserUpdate
RemoveResource removes "resource" edges to Resource entities.
func (*UserUpdate) RemoveResourceIDs ¶
func (uu *UserUpdate) RemoveResourceIDs(ids ...int) *UserUpdate
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*UserUpdate) RemoveRole ¶
func (uu *UserUpdate) RemoveRole(r ...*Role) *UserUpdate
RemoveRole removes "role" edges to Role entities.
func (*UserUpdate) RemoveRoleIDs ¶
func (uu *UserUpdate) RemoveRoleIDs(ids ...int) *UserUpdate
RemoveRoleIDs removes the "role" edge to Role entities by IDs.
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) SetAccount ¶
func (uu *UserUpdate) SetAccount(s string) *UserUpdate
SetAccount sets the "account" field.
func (*UserUpdate) SetAvatar ¶
func (uu *UserUpdate) SetAvatar(b []byte) *UserUpdate
SetAvatar sets the "avatar" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNillableStudentID ¶
func (uu *UserUpdate) SetNillableStudentID(id *int) *UserUpdate
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*UserUpdate) SetPasswd ¶
func (uu *UserUpdate) SetPasswd(s string) *UserUpdate
SetPasswd sets the "passwd" field.
func (*UserUpdate) SetStudent ¶
func (uu *UserUpdate) SetStudent(s *Student) *UserUpdate
SetStudent sets the "student" edge to the Student entity.
func (*UserUpdate) SetStudentID ¶
func (uu *UserUpdate) SetStudentID(id int) *UserUpdate
SetStudentID sets the "student" edge to the Student entity by ID.
func (*UserUpdate) SetUsername ¶
func (uu *UserUpdate) SetUsername(s string) *UserUpdate
SetUsername sets the "username" 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) AddResource ¶
func (uuo *UserUpdateOne) AddResource(r ...*Resource) *UserUpdateOne
AddResource adds the "resource" edges to the Resource entity.
func (*UserUpdateOne) AddResourceIDs ¶
func (uuo *UserUpdateOne) AddResourceIDs(ids ...int) *UserUpdateOne
AddResourceIDs adds the "resource" edge to the Resource entity by IDs.
func (*UserUpdateOne) AddRole ¶
func (uuo *UserUpdateOne) AddRole(r ...*Role) *UserUpdateOne
AddRole adds the "role" edges to the Role entity.
func (*UserUpdateOne) AddRoleIDs ¶
func (uuo *UserUpdateOne) AddRoleIDs(ids ...int) *UserUpdateOne
AddRoleIDs adds the "role" edge to the Role entity by IDs.
func (*UserUpdateOne) ClearResource ¶
func (uuo *UserUpdateOne) ClearResource() *UserUpdateOne
ClearResource clears all "resource" edges to the Resource entity.
func (*UserUpdateOne) ClearRole ¶
func (uuo *UserUpdateOne) ClearRole() *UserUpdateOne
ClearRole clears all "role" edges to the Role entity.
func (*UserUpdateOne) ClearStudent ¶
func (uuo *UserUpdateOne) ClearStudent() *UserUpdateOne
ClearStudent clears the "student" edge to the Student 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) RemoveResource ¶
func (uuo *UserUpdateOne) RemoveResource(r ...*Resource) *UserUpdateOne
RemoveResource removes "resource" edges to Resource entities.
func (*UserUpdateOne) RemoveResourceIDs ¶
func (uuo *UserUpdateOne) RemoveResourceIDs(ids ...int) *UserUpdateOne
RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.
func (*UserUpdateOne) RemoveRole ¶
func (uuo *UserUpdateOne) RemoveRole(r ...*Role) *UserUpdateOne
RemoveRole removes "role" edges to Role entities.
func (*UserUpdateOne) RemoveRoleIDs ¶
func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int) *UserUpdateOne
RemoveRoleIDs removes the "role" edge to Role entities by IDs.
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) SetAccount ¶
func (uuo *UserUpdateOne) SetAccount(s string) *UserUpdateOne
SetAccount sets the "account" field.
func (*UserUpdateOne) SetAvatar ¶
func (uuo *UserUpdateOne) SetAvatar(b []byte) *UserUpdateOne
SetAvatar sets the "avatar" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNillableStudentID ¶
func (uuo *UserUpdateOne) SetNillableStudentID(id *int) *UserUpdateOne
SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.
func (*UserUpdateOne) SetPasswd ¶
func (uuo *UserUpdateOne) SetPasswd(s string) *UserUpdateOne
SetPasswd sets the "passwd" field.
func (*UserUpdateOne) SetStudent ¶
func (uuo *UserUpdateOne) SetStudent(s *Student) *UserUpdateOne
SetStudent sets the "student" edge to the Student entity.
func (*UserUpdateOne) SetStudentID ¶
func (uuo *UserUpdateOne) SetStudentID(id int) *UserUpdateOne
SetStudentID sets the "student" edge to the Student entity by ID.
func (*UserUpdateOne) SetUsername ¶
func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
SetUsername sets the "username" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- authorization.go
- authorization_create.go
- authorization_delete.go
- authorization_query.go
- authorization_update.go
- campus.go
- campus_create.go
- campus_delete.go
- campus_query.go
- campus_update.go
- certificate.go
- certificate_create.go
- certificate_delete.go
- certificate_query.go
- certificate_update.go
- class.go
- class_create.go
- class_delete.go
- class_query.go
- class_update.go
- classleader.go
- classleader_create.go
- classleader_delete.go
- classleader_query.go
- classleader_update.go
- client.go
- department.go
- department_create.go
- department_delete.go
- department_query.go
- department_update.go
- educationlevel.go
- educationlevel_create.go
- educationlevel_delete.go
- educationlevel_query.go
- educationlevel_update.go
- enrollmentstatus.go
- enrollmentstatus_create.go
- enrollmentstatus_delete.go
- enrollmentstatus_query.go
- enrollmentstatus_update.go
- ent.go
- familyinfo.go
- familyinfo_create.go
- familyinfo_delete.go
- familyinfo_query.go
- familyinfo_update.go
- major.go
- major_create.go
- major_delete.go
- major_query.go
- major_update.go
- majordirection.go
- majordirection_create.go
- majordirection_delete.go
- majordirection_query.go
- majordirection_update.go
- mutation.go
- practicalexperience.go
- practicalexperience_create.go
- practicalexperience_delete.go
- practicalexperience_query.go
- practicalexperience_update.go
- resource.go
- resource_create.go
- resource_delete.go
- resource_query.go
- resource_update.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- runtime.go
- student.go
- student_create.go
- student_delete.go
- student_query.go
- student_update.go
- tutor.go
- tutor_create.go
- tutor_delete.go
- tutor_query.go
- tutor_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go