Documentation ¶
Index ¶
- Constants
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type 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) QueryDeptManager(d *Department) *DeptManagerQuery
- 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) AddDeptManager(d ...*DeptManager) *DepartmentCreate
- func (dc *DepartmentCreate) AddDeptManagerIDs(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) OnConflict(opts ...sql.ConflictOption) *DepartmentUpsertOne
- func (dc *DepartmentCreate) OnConflictColumns(columns ...string) *DepartmentUpsertOne
- func (dc *DepartmentCreate) Save(ctx context.Context) (*Department, error)
- func (dc *DepartmentCreate) SaveX(ctx context.Context) *Department
- func (dc *DepartmentCreate) SetCreatedAt(t time.Time) *DepartmentCreate
- func (dc *DepartmentCreate) SetDeptName(s string) *DepartmentCreate
- func (dc *DepartmentCreate) SetNillableCreatedAt(t *time.Time) *DepartmentCreate
- func (dc *DepartmentCreate) SetNillableUpdatedAt(t *time.Time) *DepartmentCreate
- func (dc *DepartmentCreate) SetUpdatedAt(t time.Time) *DepartmentCreate
- type DepartmentCreateBulk
- func (dcb *DepartmentCreateBulk) Exec(ctx context.Context) error
- func (dcb *DepartmentCreateBulk) ExecX(ctx context.Context)
- func (dcb *DepartmentCreateBulk) OnConflict(opts ...sql.ConflictOption) *DepartmentUpsertBulk
- func (dcb *DepartmentCreateBulk) OnConflictColumns(columns ...string) *DepartmentUpsertBulk
- func (dcb *DepartmentCreateBulk) Save(ctx context.Context) ([]*Department, error)
- func (dcb *DepartmentCreateBulk) SaveX(ctx context.Context) []*Department
- 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) AddDeptManagerIDs(ids ...int)
- func (m *DepartmentMutation) AddField(name string, value ent.Value) error
- 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) ClearDeptManager()
- func (m *DepartmentMutation) ClearEdge(name string) error
- func (m *DepartmentMutation) ClearField(name string) error
- func (m *DepartmentMutation) ClearedEdges() []string
- func (m *DepartmentMutation) ClearedFields() []string
- func (m DepartmentMutation) Client() *Client
- func (m *DepartmentMutation) CreatedAt() (r time.Time, exists bool)
- func (m *DepartmentMutation) DeptManagerCleared() bool
- func (m *DepartmentMutation) DeptManagerIDs() (ids []int)
- func (m *DepartmentMutation) DeptName() (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) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DepartmentMutation) OldDeptName(ctx context.Context) (v string, err error)
- func (m *DepartmentMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DepartmentMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DepartmentMutation) Op() Op
- func (m *DepartmentMutation) RemoveDeptManagerIDs(ids ...int)
- func (m *DepartmentMutation) RemovedDeptManagerIDs() (ids []int)
- func (m *DepartmentMutation) RemovedEdges() []string
- func (m *DepartmentMutation) RemovedIDs(name string) []ent.Value
- func (m *DepartmentMutation) ResetCreatedAt()
- func (m *DepartmentMutation) ResetDeptManager()
- func (m *DepartmentMutation) ResetDeptName()
- func (m *DepartmentMutation) ResetEdge(name string) error
- func (m *DepartmentMutation) ResetField(name string) error
- func (m *DepartmentMutation) ResetUpdatedAt()
- func (m *DepartmentMutation) SetCreatedAt(t time.Time)
- func (m *DepartmentMutation) SetDeptName(s string)
- func (m *DepartmentMutation) SetField(name string, value ent.Value) error
- func (m *DepartmentMutation) SetOp(op Op)
- func (m *DepartmentMutation) SetUpdatedAt(t time.Time)
- func (m DepartmentMutation) Tx() (*Tx, error)
- func (m *DepartmentMutation) Type() string
- func (m *DepartmentMutation) UpdatedAt() (r time.Time, exists bool)
- 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 ...department.OrderOption) *DepartmentQuery
- func (dq *DepartmentQuery) QueryDeptManager() *DeptManagerQuery
- 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) WithDeptManager(opts ...func(*DeptManagerQuery)) *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) AddDeptManager(d ...*DeptManager) *DepartmentUpdate
- func (du *DepartmentUpdate) AddDeptManagerIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) ClearDeptManager() *DepartmentUpdate
- func (du *DepartmentUpdate) Exec(ctx context.Context) error
- func (du *DepartmentUpdate) ExecX(ctx context.Context)
- func (du *DepartmentUpdate) Mutation() *DepartmentMutation
- func (du *DepartmentUpdate) RemoveDeptManager(d ...*DeptManager) *DepartmentUpdate
- func (du *DepartmentUpdate) RemoveDeptManagerIDs(ids ...int) *DepartmentUpdate
- func (du *DepartmentUpdate) Save(ctx context.Context) (int, error)
- func (du *DepartmentUpdate) SaveX(ctx context.Context) int
- func (du *DepartmentUpdate) SetCreatedAt(t time.Time) *DepartmentUpdate
- func (du *DepartmentUpdate) SetDeptName(s string) *DepartmentUpdate
- func (du *DepartmentUpdate) SetNillableCreatedAt(t *time.Time) *DepartmentUpdate
- func (du *DepartmentUpdate) SetNillableUpdatedAt(t *time.Time) *DepartmentUpdate
- func (du *DepartmentUpdate) SetUpdatedAt(t time.Time) *DepartmentUpdate
- func (du *DepartmentUpdate) Where(ps ...predicate.Department) *DepartmentUpdate
- type DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddDeptManager(d ...*DeptManager) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) AddDeptManagerIDs(ids ...int) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) ClearDeptManager() *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) Exec(ctx context.Context) error
- func (duo *DepartmentUpdateOne) ExecX(ctx context.Context)
- func (duo *DepartmentUpdateOne) Mutation() *DepartmentMutation
- func (duo *DepartmentUpdateOne) RemoveDeptManager(d ...*DeptManager) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) RemoveDeptManagerIDs(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) SetCreatedAt(t time.Time) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetDeptName(s string) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetNillableCreatedAt(t *time.Time) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetNillableUpdatedAt(t *time.Time) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) SetUpdatedAt(t time.Time) *DepartmentUpdateOne
- func (duo *DepartmentUpdateOne) Where(ps ...predicate.Department) *DepartmentUpdateOne
- type DepartmentUpsert
- func (u *DepartmentUpsert) SetCreatedAt(v time.Time) *DepartmentUpsert
- func (u *DepartmentUpsert) SetDeptName(v string) *DepartmentUpsert
- func (u *DepartmentUpsert) SetUpdatedAt(v time.Time) *DepartmentUpsert
- func (u *DepartmentUpsert) UpdateCreatedAt() *DepartmentUpsert
- func (u *DepartmentUpsert) UpdateDeptName() *DepartmentUpsert
- func (u *DepartmentUpsert) UpdateUpdatedAt() *DepartmentUpsert
- type DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) DoNothing() *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) Exec(ctx context.Context) error
- func (u *DepartmentUpsertBulk) ExecX(ctx context.Context)
- func (u *DepartmentUpsertBulk) Ignore() *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) SetCreatedAt(v time.Time) *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) SetDeptName(v string) *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) SetUpdatedAt(v time.Time) *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) Update(set func(*DepartmentUpsert)) *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) UpdateCreatedAt() *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) UpdateDeptName() *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) UpdateNewValues() *DepartmentUpsertBulk
- func (u *DepartmentUpsertBulk) UpdateUpdatedAt() *DepartmentUpsertBulk
- type DepartmentUpsertOne
- func (u *DepartmentUpsertOne) DoNothing() *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) Exec(ctx context.Context) error
- func (u *DepartmentUpsertOne) ExecX(ctx context.Context)
- func (u *DepartmentUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *DepartmentUpsertOne) IDX(ctx context.Context) int
- func (u *DepartmentUpsertOne) Ignore() *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) SetCreatedAt(v time.Time) *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) SetDeptName(v string) *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) SetUpdatedAt(v time.Time) *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) Update(set func(*DepartmentUpsert)) *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) UpdateCreatedAt() *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) UpdateDeptName() *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) UpdateNewValues() *DepartmentUpsertOne
- func (u *DepartmentUpsertOne) UpdateUpdatedAt() *DepartmentUpsertOne
- type Departments
- type DeptManager
- func (dm *DeptManager) QueryDepartment() *DepartmentQuery
- func (dm *DeptManager) QueryEmployee() *EmployeeQuery
- func (dm *DeptManager) String() string
- func (dm *DeptManager) Unwrap() *DeptManager
- func (dm *DeptManager) Update() *DeptManagerUpdateOne
- func (dm *DeptManager) Value(name string) (ent.Value, error)
- type DeptManagerClient
- func (c *DeptManagerClient) Create() *DeptManagerCreate
- func (c *DeptManagerClient) CreateBulk(builders ...*DeptManagerCreate) *DeptManagerCreateBulk
- func (c *DeptManagerClient) Delete() *DeptManagerDelete
- func (c *DeptManagerClient) DeleteOne(dm *DeptManager) *DeptManagerDeleteOne
- func (c *DeptManagerClient) DeleteOneID(id int) *DeptManagerDeleteOne
- func (c *DeptManagerClient) Get(ctx context.Context, id int) (*DeptManager, error)
- func (c *DeptManagerClient) GetX(ctx context.Context, id int) *DeptManager
- func (c *DeptManagerClient) Hooks() []Hook
- func (c *DeptManagerClient) Intercept(interceptors ...Interceptor)
- func (c *DeptManagerClient) Interceptors() []Interceptor
- func (c *DeptManagerClient) Query() *DeptManagerQuery
- func (c *DeptManagerClient) QueryDepartment(dm *DeptManager) *DepartmentQuery
- func (c *DeptManagerClient) QueryEmployee(dm *DeptManager) *EmployeeQuery
- func (c *DeptManagerClient) Update() *DeptManagerUpdate
- func (c *DeptManagerClient) UpdateOne(dm *DeptManager) *DeptManagerUpdateOne
- func (c *DeptManagerClient) UpdateOneID(id int) *DeptManagerUpdateOne
- func (c *DeptManagerClient) Use(hooks ...Hook)
- type DeptManagerCreate
- func (dmc *DeptManagerCreate) Exec(ctx context.Context) error
- func (dmc *DeptManagerCreate) ExecX(ctx context.Context)
- func (dmc *DeptManagerCreate) Mutation() *DeptManagerMutation
- func (dmc *DeptManagerCreate) OnConflict(opts ...sql.ConflictOption) *DeptManagerUpsertOne
- func (dmc *DeptManagerCreate) OnConflictColumns(columns ...string) *DeptManagerUpsertOne
- func (dmc *DeptManagerCreate) Save(ctx context.Context) (*DeptManager, error)
- func (dmc *DeptManagerCreate) SaveX(ctx context.Context) *DeptManager
- func (dmc *DeptManagerCreate) SetCreatedAt(t time.Time) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetDepartment(d *Department) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetDepartmentID(id int) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetEmployee(e *Employee) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetEmployeeID(id int) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetFromDate(t time.Time) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetNillableCreatedAt(t *time.Time) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetNillableUpdatedAt(t *time.Time) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetToDate(t time.Time) *DeptManagerCreate
- func (dmc *DeptManagerCreate) SetUpdatedAt(t time.Time) *DeptManagerCreate
- type DeptManagerCreateBulk
- func (dmcb *DeptManagerCreateBulk) Exec(ctx context.Context) error
- func (dmcb *DeptManagerCreateBulk) ExecX(ctx context.Context)
- func (dmcb *DeptManagerCreateBulk) OnConflict(opts ...sql.ConflictOption) *DeptManagerUpsertBulk
- func (dmcb *DeptManagerCreateBulk) OnConflictColumns(columns ...string) *DeptManagerUpsertBulk
- func (dmcb *DeptManagerCreateBulk) Save(ctx context.Context) ([]*DeptManager, error)
- func (dmcb *DeptManagerCreateBulk) SaveX(ctx context.Context) []*DeptManager
- type DeptManagerDelete
- type DeptManagerDeleteOne
- type DeptManagerEdges
- type DeptManagerGroupBy
- func (dmgb *DeptManagerGroupBy) Aggregate(fns ...AggregateFunc) *DeptManagerGroupBy
- func (s *DeptManagerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DeptManagerGroupBy) BoolX(ctx context.Context) bool
- func (s *DeptManagerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DeptManagerGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DeptManagerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DeptManagerGroupBy) Float64X(ctx context.Context) float64
- func (s *DeptManagerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DeptManagerGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DeptManagerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DeptManagerGroupBy) IntX(ctx context.Context) int
- func (s *DeptManagerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DeptManagerGroupBy) IntsX(ctx context.Context) []int
- func (dmgb *DeptManagerGroupBy) Scan(ctx context.Context, v any) error
- func (s *DeptManagerGroupBy) ScanX(ctx context.Context, v any)
- func (s *DeptManagerGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DeptManagerGroupBy) StringX(ctx context.Context) string
- func (s *DeptManagerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DeptManagerGroupBy) StringsX(ctx context.Context) []string
- type DeptManagerMutation
- func (m *DeptManagerMutation) AddField(name string, value ent.Value) error
- func (m *DeptManagerMutation) AddedEdges() []string
- func (m *DeptManagerMutation) AddedField(name string) (ent.Value, bool)
- func (m *DeptManagerMutation) AddedFields() []string
- func (m *DeptManagerMutation) AddedIDs(name string) []ent.Value
- func (m *DeptManagerMutation) ClearDepartment()
- func (m *DeptManagerMutation) ClearEdge(name string) error
- func (m *DeptManagerMutation) ClearEmployee()
- func (m *DeptManagerMutation) ClearField(name string) error
- func (m *DeptManagerMutation) ClearedEdges() []string
- func (m *DeptManagerMutation) ClearedFields() []string
- func (m DeptManagerMutation) Client() *Client
- func (m *DeptManagerMutation) CreatedAt() (r time.Time, exists bool)
- func (m *DeptManagerMutation) DepartmentCleared() bool
- func (m *DeptManagerMutation) DepartmentID() (id int, exists bool)
- func (m *DeptManagerMutation) DepartmentIDs() (ids []int)
- func (m *DeptManagerMutation) EdgeCleared(name string) bool
- func (m *DeptManagerMutation) EmployeeCleared() bool
- func (m *DeptManagerMutation) EmployeeID() (id int, exists bool)
- func (m *DeptManagerMutation) EmployeeIDs() (ids []int)
- func (m *DeptManagerMutation) Field(name string) (ent.Value, bool)
- func (m *DeptManagerMutation) FieldCleared(name string) bool
- func (m *DeptManagerMutation) Fields() []string
- func (m *DeptManagerMutation) FromDate() (r time.Time, exists bool)
- func (m *DeptManagerMutation) ID() (id int, exists bool)
- func (m *DeptManagerMutation) IDs(ctx context.Context) ([]int, error)
- func (m *DeptManagerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DeptManagerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DeptManagerMutation) OldFromDate(ctx context.Context) (v time.Time, err error)
- func (m *DeptManagerMutation) OldToDate(ctx context.Context) (v time.Time, err error)
- func (m *DeptManagerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DeptManagerMutation) Op() Op
- func (m *DeptManagerMutation) RemovedEdges() []string
- func (m *DeptManagerMutation) RemovedIDs(name string) []ent.Value
- func (m *DeptManagerMutation) ResetCreatedAt()
- func (m *DeptManagerMutation) ResetDepartment()
- func (m *DeptManagerMutation) ResetEdge(name string) error
- func (m *DeptManagerMutation) ResetEmployee()
- func (m *DeptManagerMutation) ResetField(name string) error
- func (m *DeptManagerMutation) ResetFromDate()
- func (m *DeptManagerMutation) ResetToDate()
- func (m *DeptManagerMutation) ResetUpdatedAt()
- func (m *DeptManagerMutation) SetCreatedAt(t time.Time)
- func (m *DeptManagerMutation) SetDepartmentID(id int)
- func (m *DeptManagerMutation) SetEmployeeID(id int)
- func (m *DeptManagerMutation) SetField(name string, value ent.Value) error
- func (m *DeptManagerMutation) SetFromDate(t time.Time)
- func (m *DeptManagerMutation) SetOp(op Op)
- func (m *DeptManagerMutation) SetToDate(t time.Time)
- func (m *DeptManagerMutation) SetUpdatedAt(t time.Time)
- func (m *DeptManagerMutation) ToDate() (r time.Time, exists bool)
- func (m DeptManagerMutation) Tx() (*Tx, error)
- func (m *DeptManagerMutation) Type() string
- func (m *DeptManagerMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *DeptManagerMutation) Where(ps ...predicate.DeptManager)
- func (m *DeptManagerMutation) WhereP(ps ...func(*sql.Selector))
- type DeptManagerQuery
- func (dmq *DeptManagerQuery) Aggregate(fns ...AggregateFunc) *DeptManagerSelect
- func (dmq *DeptManagerQuery) All(ctx context.Context) ([]*DeptManager, error)
- func (dmq *DeptManagerQuery) AllX(ctx context.Context) []*DeptManager
- func (dmq *DeptManagerQuery) Clone() *DeptManagerQuery
- func (dmq *DeptManagerQuery) Count(ctx context.Context) (int, error)
- func (dmq *DeptManagerQuery) CountX(ctx context.Context) int
- func (dmq *DeptManagerQuery) Exist(ctx context.Context) (bool, error)
- func (dmq *DeptManagerQuery) ExistX(ctx context.Context) bool
- func (dmq *DeptManagerQuery) First(ctx context.Context) (*DeptManager, error)
- func (dmq *DeptManagerQuery) FirstID(ctx context.Context) (id int, err error)
- func (dmq *DeptManagerQuery) FirstIDX(ctx context.Context) int
- func (dmq *DeptManagerQuery) FirstX(ctx context.Context) *DeptManager
- func (dmq *DeptManagerQuery) GroupBy(field string, fields ...string) *DeptManagerGroupBy
- func (dmq *DeptManagerQuery) IDs(ctx context.Context) (ids []int, err error)
- func (dmq *DeptManagerQuery) IDsX(ctx context.Context) []int
- func (dmq *DeptManagerQuery) Limit(limit int) *DeptManagerQuery
- func (dmq *DeptManagerQuery) Offset(offset int) *DeptManagerQuery
- func (dmq *DeptManagerQuery) Only(ctx context.Context) (*DeptManager, error)
- func (dmq *DeptManagerQuery) OnlyID(ctx context.Context) (id int, err error)
- func (dmq *DeptManagerQuery) OnlyIDX(ctx context.Context) int
- func (dmq *DeptManagerQuery) OnlyX(ctx context.Context) *DeptManager
- func (dmq *DeptManagerQuery) Order(o ...deptmanager.OrderOption) *DeptManagerQuery
- func (dmq *DeptManagerQuery) QueryDepartment() *DepartmentQuery
- func (dmq *DeptManagerQuery) QueryEmployee() *EmployeeQuery
- func (dmq *DeptManagerQuery) Select(fields ...string) *DeptManagerSelect
- func (dmq *DeptManagerQuery) Unique(unique bool) *DeptManagerQuery
- func (dmq *DeptManagerQuery) Where(ps ...predicate.DeptManager) *DeptManagerQuery
- func (dmq *DeptManagerQuery) WithDepartment(opts ...func(*DepartmentQuery)) *DeptManagerQuery
- func (dmq *DeptManagerQuery) WithEmployee(opts ...func(*EmployeeQuery)) *DeptManagerQuery
- type DeptManagerSelect
- func (dms *DeptManagerSelect) Aggregate(fns ...AggregateFunc) *DeptManagerSelect
- func (s *DeptManagerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DeptManagerSelect) BoolX(ctx context.Context) bool
- func (s *DeptManagerSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DeptManagerSelect) BoolsX(ctx context.Context) []bool
- func (s *DeptManagerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DeptManagerSelect) Float64X(ctx context.Context) float64
- func (s *DeptManagerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DeptManagerSelect) Float64sX(ctx context.Context) []float64
- func (s *DeptManagerSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DeptManagerSelect) IntX(ctx context.Context) int
- func (s *DeptManagerSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DeptManagerSelect) IntsX(ctx context.Context) []int
- func (dms *DeptManagerSelect) Scan(ctx context.Context, v any) error
- func (s *DeptManagerSelect) ScanX(ctx context.Context, v any)
- func (s *DeptManagerSelect) String(ctx context.Context) (_ string, err error)
- func (s *DeptManagerSelect) StringX(ctx context.Context) string
- func (s *DeptManagerSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DeptManagerSelect) StringsX(ctx context.Context) []string
- type DeptManagerUpdate
- func (dmu *DeptManagerUpdate) ClearDepartment() *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) ClearEmployee() *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) Exec(ctx context.Context) error
- func (dmu *DeptManagerUpdate) ExecX(ctx context.Context)
- func (dmu *DeptManagerUpdate) Mutation() *DeptManagerMutation
- func (dmu *DeptManagerUpdate) Save(ctx context.Context) (int, error)
- func (dmu *DeptManagerUpdate) SaveX(ctx context.Context) int
- func (dmu *DeptManagerUpdate) SetCreatedAt(t time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetDepartment(d *Department) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetDepartmentID(id int) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetEmployee(e *Employee) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetEmployeeID(id int) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetFromDate(t time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetNillableCreatedAt(t *time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetNillableUpdatedAt(t *time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetToDate(t time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) SetUpdatedAt(t time.Time) *DeptManagerUpdate
- func (dmu *DeptManagerUpdate) Where(ps ...predicate.DeptManager) *DeptManagerUpdate
- type DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) ClearDepartment() *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) ClearEmployee() *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) Exec(ctx context.Context) error
- func (dmuo *DeptManagerUpdateOne) ExecX(ctx context.Context)
- func (dmuo *DeptManagerUpdateOne) Mutation() *DeptManagerMutation
- func (dmuo *DeptManagerUpdateOne) Save(ctx context.Context) (*DeptManager, error)
- func (dmuo *DeptManagerUpdateOne) SaveX(ctx context.Context) *DeptManager
- func (dmuo *DeptManagerUpdateOne) Select(field string, fields ...string) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetCreatedAt(t time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetDepartment(d *Department) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetDepartmentID(id int) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetEmployee(e *Employee) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetEmployeeID(id int) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetFromDate(t time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetNillableCreatedAt(t *time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetNillableUpdatedAt(t *time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetToDate(t time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) SetUpdatedAt(t time.Time) *DeptManagerUpdateOne
- func (dmuo *DeptManagerUpdateOne) Where(ps ...predicate.DeptManager) *DeptManagerUpdateOne
- type DeptManagerUpsert
- func (u *DeptManagerUpsert) SetCreatedAt(v time.Time) *DeptManagerUpsert
- func (u *DeptManagerUpsert) SetFromDate(v time.Time) *DeptManagerUpsert
- func (u *DeptManagerUpsert) SetToDate(v time.Time) *DeptManagerUpsert
- func (u *DeptManagerUpsert) SetUpdatedAt(v time.Time) *DeptManagerUpsert
- func (u *DeptManagerUpsert) UpdateCreatedAt() *DeptManagerUpsert
- func (u *DeptManagerUpsert) UpdateFromDate() *DeptManagerUpsert
- func (u *DeptManagerUpsert) UpdateToDate() *DeptManagerUpsert
- func (u *DeptManagerUpsert) UpdateUpdatedAt() *DeptManagerUpsert
- type DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) DoNothing() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) Exec(ctx context.Context) error
- func (u *DeptManagerUpsertBulk) ExecX(ctx context.Context)
- func (u *DeptManagerUpsertBulk) Ignore() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) SetCreatedAt(v time.Time) *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) SetFromDate(v time.Time) *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) SetToDate(v time.Time) *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) SetUpdatedAt(v time.Time) *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) Update(set func(*DeptManagerUpsert)) *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) UpdateCreatedAt() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) UpdateFromDate() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) UpdateNewValues() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) UpdateToDate() *DeptManagerUpsertBulk
- func (u *DeptManagerUpsertBulk) UpdateUpdatedAt() *DeptManagerUpsertBulk
- type DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) DoNothing() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) Exec(ctx context.Context) error
- func (u *DeptManagerUpsertOne) ExecX(ctx context.Context)
- func (u *DeptManagerUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *DeptManagerUpsertOne) IDX(ctx context.Context) int
- func (u *DeptManagerUpsertOne) Ignore() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) SetCreatedAt(v time.Time) *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) SetFromDate(v time.Time) *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) SetToDate(v time.Time) *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) SetUpdatedAt(v time.Time) *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) Update(set func(*DeptManagerUpsert)) *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) UpdateCreatedAt() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) UpdateFromDate() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) UpdateNewValues() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) UpdateToDate() *DeptManagerUpsertOne
- func (u *DeptManagerUpsertOne) UpdateUpdatedAt() *DeptManagerUpsertOne
- type DeptManagers
- type Employee
- type EmployeeClient
- func (c *EmployeeClient) Create() *EmployeeCreate
- func (c *EmployeeClient) CreateBulk(builders ...*EmployeeCreate) *EmployeeCreateBulk
- func (c *EmployeeClient) Delete() *EmployeeDelete
- func (c *EmployeeClient) DeleteOne(e *Employee) *EmployeeDeleteOne
- func (c *EmployeeClient) DeleteOneID(id int) *EmployeeDeleteOne
- func (c *EmployeeClient) Get(ctx context.Context, id int) (*Employee, error)
- func (c *EmployeeClient) GetX(ctx context.Context, id int) *Employee
- func (c *EmployeeClient) Hooks() []Hook
- func (c *EmployeeClient) Intercept(interceptors ...Interceptor)
- func (c *EmployeeClient) Interceptors() []Interceptor
- func (c *EmployeeClient) Query() *EmployeeQuery
- func (c *EmployeeClient) QueryDeptManager(e *Employee) *DeptManagerQuery
- func (c *EmployeeClient) Update() *EmployeeUpdate
- func (c *EmployeeClient) UpdateOne(e *Employee) *EmployeeUpdateOne
- func (c *EmployeeClient) UpdateOneID(id int) *EmployeeUpdateOne
- func (c *EmployeeClient) Use(hooks ...Hook)
- type EmployeeCreate
- func (ec *EmployeeCreate) AddDeptManager(d ...*DeptManager) *EmployeeCreate
- func (ec *EmployeeCreate) AddDeptManagerIDs(ids ...int) *EmployeeCreate
- func (ec *EmployeeCreate) Exec(ctx context.Context) error
- func (ec *EmployeeCreate) ExecX(ctx context.Context)
- func (ec *EmployeeCreate) Mutation() *EmployeeMutation
- func (ec *EmployeeCreate) OnConflict(opts ...sql.ConflictOption) *EmployeeUpsertOne
- func (ec *EmployeeCreate) OnConflictColumns(columns ...string) *EmployeeUpsertOne
- func (ec *EmployeeCreate) Save(ctx context.Context) (*Employee, error)
- func (ec *EmployeeCreate) SaveX(ctx context.Context) *Employee
- func (ec *EmployeeCreate) SetBirthDate(t time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetCreatedAt(t time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetDeletedAt(t time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetFirstName(s string) *EmployeeCreate
- func (ec *EmployeeCreate) SetGender(e employee.Gender) *EmployeeCreate
- func (ec *EmployeeCreate) SetHireDate(t time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetLastName(s string) *EmployeeCreate
- func (ec *EmployeeCreate) SetNillableCreatedAt(t *time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetNillableDeletedAt(t *time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetNillableUpdatedAt(t *time.Time) *EmployeeCreate
- func (ec *EmployeeCreate) SetUpdatedAt(t time.Time) *EmployeeCreate
- type EmployeeCreateBulk
- func (ecb *EmployeeCreateBulk) Exec(ctx context.Context) error
- func (ecb *EmployeeCreateBulk) ExecX(ctx context.Context)
- func (ecb *EmployeeCreateBulk) OnConflict(opts ...sql.ConflictOption) *EmployeeUpsertBulk
- func (ecb *EmployeeCreateBulk) OnConflictColumns(columns ...string) *EmployeeUpsertBulk
- func (ecb *EmployeeCreateBulk) Save(ctx context.Context) ([]*Employee, error)
- func (ecb *EmployeeCreateBulk) SaveX(ctx context.Context) []*Employee
- type EmployeeDelete
- type EmployeeDeleteOne
- type EmployeeEdges
- type EmployeeGroupBy
- func (egb *EmployeeGroupBy) Aggregate(fns ...AggregateFunc) *EmployeeGroupBy
- func (s *EmployeeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *EmployeeGroupBy) BoolX(ctx context.Context) bool
- func (s *EmployeeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *EmployeeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *EmployeeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *EmployeeGroupBy) Float64X(ctx context.Context) float64
- func (s *EmployeeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *EmployeeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *EmployeeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *EmployeeGroupBy) IntX(ctx context.Context) int
- func (s *EmployeeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *EmployeeGroupBy) IntsX(ctx context.Context) []int
- func (egb *EmployeeGroupBy) Scan(ctx context.Context, v any) error
- func (s *EmployeeGroupBy) ScanX(ctx context.Context, v any)
- func (s *EmployeeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *EmployeeGroupBy) StringX(ctx context.Context) string
- func (s *EmployeeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *EmployeeGroupBy) StringsX(ctx context.Context) []string
- type EmployeeMutation
- func (m *EmployeeMutation) AddDeptManagerIDs(ids ...int)
- func (m *EmployeeMutation) AddField(name string, value ent.Value) error
- func (m *EmployeeMutation) AddedEdges() []string
- func (m *EmployeeMutation) AddedField(name string) (ent.Value, bool)
- func (m *EmployeeMutation) AddedFields() []string
- func (m *EmployeeMutation) AddedIDs(name string) []ent.Value
- func (m *EmployeeMutation) BirthDate() (r time.Time, exists bool)
- func (m *EmployeeMutation) ClearDeletedAt()
- func (m *EmployeeMutation) ClearDeptManager()
- func (m *EmployeeMutation) ClearEdge(name string) error
- func (m *EmployeeMutation) ClearField(name string) error
- func (m *EmployeeMutation) ClearedEdges() []string
- func (m *EmployeeMutation) ClearedFields() []string
- func (m EmployeeMutation) Client() *Client
- func (m *EmployeeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *EmployeeMutation) DeletedAt() (r time.Time, exists bool)
- func (m *EmployeeMutation) DeletedAtCleared() bool
- func (m *EmployeeMutation) DeptManagerCleared() bool
- func (m *EmployeeMutation) DeptManagerIDs() (ids []int)
- func (m *EmployeeMutation) EdgeCleared(name string) bool
- func (m *EmployeeMutation) Field(name string) (ent.Value, bool)
- func (m *EmployeeMutation) FieldCleared(name string) bool
- func (m *EmployeeMutation) Fields() []string
- func (m *EmployeeMutation) FirstName() (r string, exists bool)
- func (m *EmployeeMutation) Gender() (r employee.Gender, exists bool)
- func (m *EmployeeMutation) HireDate() (r time.Time, exists bool)
- func (m *EmployeeMutation) ID() (id int, exists bool)
- func (m *EmployeeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *EmployeeMutation) LastName() (r string, exists bool)
- func (m *EmployeeMutation) OldBirthDate(ctx context.Context) (v time.Time, err error)
- func (m *EmployeeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EmployeeMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)
- func (m *EmployeeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EmployeeMutation) OldFirstName(ctx context.Context) (v string, err error)
- func (m *EmployeeMutation) OldGender(ctx context.Context) (v employee.Gender, err error)
- func (m *EmployeeMutation) OldHireDate(ctx context.Context) (v time.Time, err error)
- func (m *EmployeeMutation) OldLastName(ctx context.Context) (v string, err error)
- func (m *EmployeeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EmployeeMutation) Op() Op
- func (m *EmployeeMutation) RemoveDeptManagerIDs(ids ...int)
- func (m *EmployeeMutation) RemovedDeptManagerIDs() (ids []int)
- func (m *EmployeeMutation) RemovedEdges() []string
- func (m *EmployeeMutation) RemovedIDs(name string) []ent.Value
- func (m *EmployeeMutation) ResetBirthDate()
- func (m *EmployeeMutation) ResetCreatedAt()
- func (m *EmployeeMutation) ResetDeletedAt()
- func (m *EmployeeMutation) ResetDeptManager()
- func (m *EmployeeMutation) ResetEdge(name string) error
- func (m *EmployeeMutation) ResetField(name string) error
- func (m *EmployeeMutation) ResetFirstName()
- func (m *EmployeeMutation) ResetGender()
- func (m *EmployeeMutation) ResetHireDate()
- func (m *EmployeeMutation) ResetLastName()
- func (m *EmployeeMutation) ResetUpdatedAt()
- func (m *EmployeeMutation) SetBirthDate(t time.Time)
- func (m *EmployeeMutation) SetCreatedAt(t time.Time)
- func (m *EmployeeMutation) SetDeletedAt(t time.Time)
- func (m *EmployeeMutation) SetField(name string, value ent.Value) error
- func (m *EmployeeMutation) SetFirstName(s string)
- func (m *EmployeeMutation) SetGender(e employee.Gender)
- func (m *EmployeeMutation) SetHireDate(t time.Time)
- func (m *EmployeeMutation) SetLastName(s string)
- func (m *EmployeeMutation) SetOp(op Op)
- func (m *EmployeeMutation) SetUpdatedAt(t time.Time)
- func (m EmployeeMutation) Tx() (*Tx, error)
- func (m *EmployeeMutation) Type() string
- func (m *EmployeeMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *EmployeeMutation) Where(ps ...predicate.Employee)
- func (m *EmployeeMutation) WhereP(ps ...func(*sql.Selector))
- type EmployeeQuery
- func (eq *EmployeeQuery) Aggregate(fns ...AggregateFunc) *EmployeeSelect
- func (eq *EmployeeQuery) All(ctx context.Context) ([]*Employee, error)
- func (eq *EmployeeQuery) AllX(ctx context.Context) []*Employee
- func (eq *EmployeeQuery) Clone() *EmployeeQuery
- func (eq *EmployeeQuery) Count(ctx context.Context) (int, error)
- func (eq *EmployeeQuery) CountX(ctx context.Context) int
- func (eq *EmployeeQuery) Exist(ctx context.Context) (bool, error)
- func (eq *EmployeeQuery) ExistX(ctx context.Context) bool
- func (eq *EmployeeQuery) First(ctx context.Context) (*Employee, error)
- func (eq *EmployeeQuery) FirstID(ctx context.Context) (id int, err error)
- func (eq *EmployeeQuery) FirstIDX(ctx context.Context) int
- func (eq *EmployeeQuery) FirstX(ctx context.Context) *Employee
- func (eq *EmployeeQuery) GroupBy(field string, fields ...string) *EmployeeGroupBy
- func (eq *EmployeeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (eq *EmployeeQuery) IDsX(ctx context.Context) []int
- func (eq *EmployeeQuery) Limit(limit int) *EmployeeQuery
- func (eq *EmployeeQuery) Offset(offset int) *EmployeeQuery
- func (eq *EmployeeQuery) Only(ctx context.Context) (*Employee, error)
- func (eq *EmployeeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (eq *EmployeeQuery) OnlyIDX(ctx context.Context) int
- func (eq *EmployeeQuery) OnlyX(ctx context.Context) *Employee
- func (eq *EmployeeQuery) Order(o ...employee.OrderOption) *EmployeeQuery
- func (eq *EmployeeQuery) QueryDeptManager() *DeptManagerQuery
- func (eq *EmployeeQuery) Select(fields ...string) *EmployeeSelect
- func (eq *EmployeeQuery) Unique(unique bool) *EmployeeQuery
- func (eq *EmployeeQuery) Where(ps ...predicate.Employee) *EmployeeQuery
- func (eq *EmployeeQuery) WithDeptManager(opts ...func(*DeptManagerQuery)) *EmployeeQuery
- type EmployeeSelect
- func (es *EmployeeSelect) Aggregate(fns ...AggregateFunc) *EmployeeSelect
- func (s *EmployeeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *EmployeeSelect) BoolX(ctx context.Context) bool
- func (s *EmployeeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *EmployeeSelect) BoolsX(ctx context.Context) []bool
- func (s *EmployeeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *EmployeeSelect) Float64X(ctx context.Context) float64
- func (s *EmployeeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *EmployeeSelect) Float64sX(ctx context.Context) []float64
- func (s *EmployeeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *EmployeeSelect) IntX(ctx context.Context) int
- func (s *EmployeeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *EmployeeSelect) IntsX(ctx context.Context) []int
- func (es *EmployeeSelect) Scan(ctx context.Context, v any) error
- func (s *EmployeeSelect) ScanX(ctx context.Context, v any)
- func (s *EmployeeSelect) String(ctx context.Context) (_ string, err error)
- func (s *EmployeeSelect) StringX(ctx context.Context) string
- func (s *EmployeeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *EmployeeSelect) StringsX(ctx context.Context) []string
- type EmployeeUpdate
- func (eu *EmployeeUpdate) AddDeptManager(d ...*DeptManager) *EmployeeUpdate
- func (eu *EmployeeUpdate) AddDeptManagerIDs(ids ...int) *EmployeeUpdate
- func (eu *EmployeeUpdate) ClearDeletedAt() *EmployeeUpdate
- func (eu *EmployeeUpdate) ClearDeptManager() *EmployeeUpdate
- func (eu *EmployeeUpdate) Exec(ctx context.Context) error
- func (eu *EmployeeUpdate) ExecX(ctx context.Context)
- func (eu *EmployeeUpdate) Mutation() *EmployeeMutation
- func (eu *EmployeeUpdate) RemoveDeptManager(d ...*DeptManager) *EmployeeUpdate
- func (eu *EmployeeUpdate) RemoveDeptManagerIDs(ids ...int) *EmployeeUpdate
- func (eu *EmployeeUpdate) Save(ctx context.Context) (int, error)
- func (eu *EmployeeUpdate) SaveX(ctx context.Context) int
- func (eu *EmployeeUpdate) SetBirthDate(t time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetCreatedAt(t time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetDeletedAt(t time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetFirstName(s string) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetGender(e employee.Gender) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetHireDate(t time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetLastName(s string) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetNillableCreatedAt(t *time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetNillableDeletedAt(t *time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetNillableUpdatedAt(t *time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) SetUpdatedAt(t time.Time) *EmployeeUpdate
- func (eu *EmployeeUpdate) Where(ps ...predicate.Employee) *EmployeeUpdate
- type EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) AddDeptManager(d ...*DeptManager) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) AddDeptManagerIDs(ids ...int) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) ClearDeletedAt() *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) ClearDeptManager() *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) Exec(ctx context.Context) error
- func (euo *EmployeeUpdateOne) ExecX(ctx context.Context)
- func (euo *EmployeeUpdateOne) Mutation() *EmployeeMutation
- func (euo *EmployeeUpdateOne) RemoveDeptManager(d ...*DeptManager) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) RemoveDeptManagerIDs(ids ...int) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) Save(ctx context.Context) (*Employee, error)
- func (euo *EmployeeUpdateOne) SaveX(ctx context.Context) *Employee
- func (euo *EmployeeUpdateOne) Select(field string, fields ...string) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetBirthDate(t time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetCreatedAt(t time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetDeletedAt(t time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetFirstName(s string) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetGender(e employee.Gender) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetHireDate(t time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetLastName(s string) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetNillableCreatedAt(t *time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetNillableDeletedAt(t *time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetNillableUpdatedAt(t *time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) SetUpdatedAt(t time.Time) *EmployeeUpdateOne
- func (euo *EmployeeUpdateOne) Where(ps ...predicate.Employee) *EmployeeUpdateOne
- type EmployeeUpsert
- func (u *EmployeeUpsert) ClearDeletedAt() *EmployeeUpsert
- func (u *EmployeeUpsert) SetBirthDate(v time.Time) *EmployeeUpsert
- func (u *EmployeeUpsert) SetCreatedAt(v time.Time) *EmployeeUpsert
- func (u *EmployeeUpsert) SetDeletedAt(v time.Time) *EmployeeUpsert
- func (u *EmployeeUpsert) SetFirstName(v string) *EmployeeUpsert
- func (u *EmployeeUpsert) SetGender(v employee.Gender) *EmployeeUpsert
- func (u *EmployeeUpsert) SetHireDate(v time.Time) *EmployeeUpsert
- func (u *EmployeeUpsert) SetLastName(v string) *EmployeeUpsert
- func (u *EmployeeUpsert) SetUpdatedAt(v time.Time) *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateBirthDate() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateCreatedAt() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateDeletedAt() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateFirstName() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateGender() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateHireDate() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateLastName() *EmployeeUpsert
- func (u *EmployeeUpsert) UpdateUpdatedAt() *EmployeeUpsert
- type EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) ClearDeletedAt() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) DoNothing() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) Exec(ctx context.Context) error
- func (u *EmployeeUpsertBulk) ExecX(ctx context.Context)
- func (u *EmployeeUpsertBulk) Ignore() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetBirthDate(v time.Time) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetCreatedAt(v time.Time) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetDeletedAt(v time.Time) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetFirstName(v string) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetGender(v employee.Gender) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetHireDate(v time.Time) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetLastName(v string) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) SetUpdatedAt(v time.Time) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) Update(set func(*EmployeeUpsert)) *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateBirthDate() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateCreatedAt() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateDeletedAt() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateFirstName() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateGender() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateHireDate() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateLastName() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateNewValues() *EmployeeUpsertBulk
- func (u *EmployeeUpsertBulk) UpdateUpdatedAt() *EmployeeUpsertBulk
- type EmployeeUpsertOne
- func (u *EmployeeUpsertOne) ClearDeletedAt() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) DoNothing() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) Exec(ctx context.Context) error
- func (u *EmployeeUpsertOne) ExecX(ctx context.Context)
- func (u *EmployeeUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *EmployeeUpsertOne) IDX(ctx context.Context) int
- func (u *EmployeeUpsertOne) Ignore() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetBirthDate(v time.Time) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetCreatedAt(v time.Time) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetDeletedAt(v time.Time) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetFirstName(v string) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetGender(v employee.Gender) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetHireDate(v time.Time) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetLastName(v string) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) SetUpdatedAt(v time.Time) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) Update(set func(*EmployeeUpsert)) *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateBirthDate() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateCreatedAt() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateDeletedAt() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateFirstName() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateGender() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateHireDate() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateLastName() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateNewValues() *EmployeeUpsertOne
- func (u *EmployeeUpsertOne) UpdateUpdatedAt() *EmployeeUpsertOne
- type Employees
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- 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. TypeDepartment = "Department" TypeDeptManager = "DeptManager" TypeEmployee = "Employee" )
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(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Department is the client for interacting with the Department builders. Department *DepartmentClient // DeptManager is the client for interacting with the DeptManager builders. DeptManager *DeptManagerClient // Employee is the client for interacting with the Employee builders. Employee *EmployeeClient // 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(). Department. 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"` // DeptName holds the value of the "dept_name" field. DeptName string `json:"dept_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,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) QueryDeptManager ¶
func (d *Department) QueryDeptManager() *DeptManagerQuery
QueryDeptManager queries the "dept_manager" 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) QueryDeptManager ¶
func (c *DepartmentClient) QueryDeptManager(d *Department) *DeptManagerQuery
QueryDeptManager queries the dept_manager 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) AddDeptManager ¶
func (dc *DepartmentCreate) AddDeptManager(d ...*DeptManager) *DepartmentCreate
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*DepartmentCreate) AddDeptManagerIDs ¶
func (dc *DepartmentCreate) AddDeptManagerIDs(ids ...int) *DepartmentCreate
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager 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) OnConflict ¶
func (dc *DepartmentCreate) OnConflict(opts ...sql.ConflictOption) *DepartmentUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Department.Create(). SetDeptName(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DepartmentUpsert) { SetDeptName(v+v). }). Exec(ctx)
func (*DepartmentCreate) OnConflictColumns ¶
func (dc *DepartmentCreate) OnConflictColumns(columns ...string) *DepartmentUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Department.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
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) SetCreatedAt ¶
func (dc *DepartmentCreate) SetCreatedAt(t time.Time) *DepartmentCreate
SetCreatedAt sets the "created_at" field.
func (*DepartmentCreate) SetDeptName ¶
func (dc *DepartmentCreate) SetDeptName(s string) *DepartmentCreate
SetDeptName sets the "dept_name" field.
func (*DepartmentCreate) SetNillableCreatedAt ¶
func (dc *DepartmentCreate) SetNillableCreatedAt(t *time.Time) *DepartmentCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DepartmentCreate) SetNillableUpdatedAt ¶
func (dc *DepartmentCreate) SetNillableUpdatedAt(t *time.Time) *DepartmentCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DepartmentCreate) SetUpdatedAt ¶
func (dc *DepartmentCreate) SetUpdatedAt(t time.Time) *DepartmentCreate
SetUpdatedAt sets the "updated_at" 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) OnConflict ¶
func (dcb *DepartmentCreateBulk) OnConflict(opts ...sql.ConflictOption) *DepartmentUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Department.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DepartmentUpsert) { SetDeptName(v+v). }). Exec(ctx)
func (*DepartmentCreateBulk) OnConflictColumns ¶
func (dcb *DepartmentCreateBulk) OnConflictColumns(columns ...string) *DepartmentUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Department.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
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 { // DeptManager holds the value of the dept_manager edge. DeptManager []*DeptManager `json:"dept_manager,omitempty"` // contains filtered or unexported fields }
DepartmentEdges holds the relations/edges for other nodes in the graph.
func (DepartmentEdges) DeptManagerOrErr ¶
func (e DepartmentEdges) DeptManagerOrErr() ([]*DeptManager, error)
DeptManagerOrErr returns the DeptManager 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) AddDeptManagerIDs ¶
func (m *DepartmentMutation) AddDeptManagerIDs(ids ...int)
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager 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) 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) ClearDeptManager ¶
func (m *DepartmentMutation) ClearDeptManager()
ClearDeptManager clears the "dept_manager" edge to the DeptManager 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) 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) CreatedAt ¶
func (m *DepartmentMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*DepartmentMutation) DeptManagerCleared ¶
func (m *DepartmentMutation) DeptManagerCleared() bool
DeptManagerCleared reports if the "dept_manager" edge to the DeptManager entity was cleared.
func (*DepartmentMutation) DeptManagerIDs ¶
func (m *DepartmentMutation) DeptManagerIDs() (ids []int)
DeptManagerIDs returns the "dept_manager" edge IDs in the mutation.
func (*DepartmentMutation) DeptName ¶
func (m *DepartmentMutation) DeptName() (r string, exists bool)
DeptName returns the value of the "dept_name" 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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldDeptName ¶
func (m *DepartmentMutation) OldDeptName(ctx context.Context) (v string, err error)
OldDeptName returns the old "dept_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) 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) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" 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) RemoveDeptManagerIDs ¶
func (m *DepartmentMutation) RemoveDeptManagerIDs(ids ...int)
RemoveDeptManagerIDs removes the "dept_manager" edge to the DeptManager entity by IDs.
func (*DepartmentMutation) RemovedDeptManagerIDs ¶
func (m *DepartmentMutation) RemovedDeptManagerIDs() (ids []int)
RemovedDeptManager returns the removed IDs of the "dept_manager" edge to the DeptManager 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) ResetCreatedAt ¶
func (m *DepartmentMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*DepartmentMutation) ResetDeptManager ¶
func (m *DepartmentMutation) ResetDeptManager()
ResetDeptManager resets all changes to the "dept_manager" edge.
func (*DepartmentMutation) ResetDeptName ¶
func (m *DepartmentMutation) ResetDeptName()
ResetDeptName resets all changes to the "dept_name" 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) ResetUpdatedAt ¶
func (m *DepartmentMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*DepartmentMutation) SetCreatedAt ¶
func (m *DepartmentMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*DepartmentMutation) SetDeptName ¶
func (m *DepartmentMutation) SetDeptName(s string)
SetDeptName sets the "dept_name" 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) SetOp ¶
func (m *DepartmentMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DepartmentMutation) SetUpdatedAt ¶
func (m *DepartmentMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
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) UpdatedAt ¶
func (m *DepartmentMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
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 { DeptName string `json:"dept_name,omitempty"` Count int `json:"count,omitempty"` } client.Department.Query(). GroupBy(department.FieldDeptName). Aggregate(ent.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 ...department.OrderOption) *DepartmentQuery
Order specifies how the records should be ordered.
func (*DepartmentQuery) QueryDeptManager ¶
func (dq *DepartmentQuery) QueryDeptManager() *DeptManagerQuery
QueryDeptManager chains the current query on the "dept_manager" 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 { DeptName string `json:"dept_name,omitempty"` } client.Department.Query(). Select(department.FieldDeptName). 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) WithDeptManager ¶
func (dq *DepartmentQuery) WithDeptManager(opts ...func(*DeptManagerQuery)) *DepartmentQuery
WithDeptManager tells the query-builder to eager-load the nodes that are connected to the "dept_manager" 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) AddDeptManager ¶
func (du *DepartmentUpdate) AddDeptManager(d ...*DeptManager) *DepartmentUpdate
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*DepartmentUpdate) AddDeptManagerIDs ¶
func (du *DepartmentUpdate) AddDeptManagerIDs(ids ...int) *DepartmentUpdate
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by IDs.
func (*DepartmentUpdate) ClearDeptManager ¶
func (du *DepartmentUpdate) ClearDeptManager() *DepartmentUpdate
ClearDeptManager clears all "dept_manager" edges to the DeptManager 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) RemoveDeptManager ¶
func (du *DepartmentUpdate) RemoveDeptManager(d ...*DeptManager) *DepartmentUpdate
RemoveDeptManager removes "dept_manager" edges to DeptManager entities.
func (*DepartmentUpdate) RemoveDeptManagerIDs ¶
func (du *DepartmentUpdate) RemoveDeptManagerIDs(ids ...int) *DepartmentUpdate
RemoveDeptManagerIDs removes the "dept_manager" edge to DeptManager 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) SetCreatedAt ¶
func (du *DepartmentUpdate) SetCreatedAt(t time.Time) *DepartmentUpdate
SetCreatedAt sets the "created_at" field.
func (*DepartmentUpdate) SetDeptName ¶
func (du *DepartmentUpdate) SetDeptName(s string) *DepartmentUpdate
SetDeptName sets the "dept_name" field.
func (*DepartmentUpdate) SetNillableCreatedAt ¶
func (du *DepartmentUpdate) SetNillableCreatedAt(t *time.Time) *DepartmentUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DepartmentUpdate) SetNillableUpdatedAt ¶
func (du *DepartmentUpdate) SetNillableUpdatedAt(t *time.Time) *DepartmentUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DepartmentUpdate) SetUpdatedAt ¶
func (du *DepartmentUpdate) SetUpdatedAt(t time.Time) *DepartmentUpdate
SetUpdatedAt sets the "updated_at" 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) AddDeptManager ¶
func (duo *DepartmentUpdateOne) AddDeptManager(d ...*DeptManager) *DepartmentUpdateOne
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*DepartmentUpdateOne) AddDeptManagerIDs ¶
func (duo *DepartmentUpdateOne) AddDeptManagerIDs(ids ...int) *DepartmentUpdateOne
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by IDs.
func (*DepartmentUpdateOne) ClearDeptManager ¶
func (duo *DepartmentUpdateOne) ClearDeptManager() *DepartmentUpdateOne
ClearDeptManager clears all "dept_manager" edges to the DeptManager 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) RemoveDeptManager ¶
func (duo *DepartmentUpdateOne) RemoveDeptManager(d ...*DeptManager) *DepartmentUpdateOne
RemoveDeptManager removes "dept_manager" edges to DeptManager entities.
func (*DepartmentUpdateOne) RemoveDeptManagerIDs ¶
func (duo *DepartmentUpdateOne) RemoveDeptManagerIDs(ids ...int) *DepartmentUpdateOne
RemoveDeptManagerIDs removes the "dept_manager" edge to DeptManager 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) SetCreatedAt ¶
func (duo *DepartmentUpdateOne) SetCreatedAt(t time.Time) *DepartmentUpdateOne
SetCreatedAt sets the "created_at" field.
func (*DepartmentUpdateOne) SetDeptName ¶
func (duo *DepartmentUpdateOne) SetDeptName(s string) *DepartmentUpdateOne
SetDeptName sets the "dept_name" field.
func (*DepartmentUpdateOne) SetNillableCreatedAt ¶
func (duo *DepartmentUpdateOne) SetNillableCreatedAt(t *time.Time) *DepartmentUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DepartmentUpdateOne) SetNillableUpdatedAt ¶
func (duo *DepartmentUpdateOne) SetNillableUpdatedAt(t *time.Time) *DepartmentUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DepartmentUpdateOne) SetUpdatedAt ¶
func (duo *DepartmentUpdateOne) SetUpdatedAt(t time.Time) *DepartmentUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*DepartmentUpdateOne) Where ¶
func (duo *DepartmentUpdateOne) Where(ps ...predicate.Department) *DepartmentUpdateOne
Where appends a list predicates to the DepartmentUpdate builder.
type DepartmentUpsert ¶
DepartmentUpsert is the "OnConflict" setter.
func (*DepartmentUpsert) SetCreatedAt ¶
func (u *DepartmentUpsert) SetCreatedAt(v time.Time) *DepartmentUpsert
SetCreatedAt sets the "created_at" field.
func (*DepartmentUpsert) SetDeptName ¶
func (u *DepartmentUpsert) SetDeptName(v string) *DepartmentUpsert
SetDeptName sets the "dept_name" field.
func (*DepartmentUpsert) SetUpdatedAt ¶
func (u *DepartmentUpsert) SetUpdatedAt(v time.Time) *DepartmentUpsert
SetUpdatedAt sets the "updated_at" field.
func (*DepartmentUpsert) UpdateCreatedAt ¶
func (u *DepartmentUpsert) UpdateCreatedAt() *DepartmentUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DepartmentUpsert) UpdateDeptName ¶
func (u *DepartmentUpsert) UpdateDeptName() *DepartmentUpsert
UpdateDeptName sets the "dept_name" field to the value that was provided on create.
func (*DepartmentUpsert) UpdateUpdatedAt ¶
func (u *DepartmentUpsert) UpdateUpdatedAt() *DepartmentUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DepartmentUpsertBulk ¶
type DepartmentUpsertBulk struct {
// contains filtered or unexported fields
}
DepartmentUpsertBulk is the builder for "upsert"-ing a bulk of Department nodes.
func (*DepartmentUpsertBulk) DoNothing ¶
func (u *DepartmentUpsertBulk) DoNothing() *DepartmentUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DepartmentUpsertBulk) Exec ¶
func (u *DepartmentUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DepartmentUpsertBulk) ExecX ¶
func (u *DepartmentUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentUpsertBulk) Ignore ¶
func (u *DepartmentUpsertBulk) Ignore() *DepartmentUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Department.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DepartmentUpsertBulk) SetCreatedAt ¶
func (u *DepartmentUpsertBulk) SetCreatedAt(v time.Time) *DepartmentUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*DepartmentUpsertBulk) SetDeptName ¶
func (u *DepartmentUpsertBulk) SetDeptName(v string) *DepartmentUpsertBulk
SetDeptName sets the "dept_name" field.
func (*DepartmentUpsertBulk) SetUpdatedAt ¶
func (u *DepartmentUpsertBulk) SetUpdatedAt(v time.Time) *DepartmentUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*DepartmentUpsertBulk) Update ¶
func (u *DepartmentUpsertBulk) Update(set func(*DepartmentUpsert)) *DepartmentUpsertBulk
Update allows overriding fields `UPDATE` values. See the DepartmentCreateBulk.OnConflict documentation for more info.
func (*DepartmentUpsertBulk) UpdateCreatedAt ¶
func (u *DepartmentUpsertBulk) UpdateCreatedAt() *DepartmentUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DepartmentUpsertBulk) UpdateDeptName ¶
func (u *DepartmentUpsertBulk) UpdateDeptName() *DepartmentUpsertBulk
UpdateDeptName sets the "dept_name" field to the value that was provided on create.
func (*DepartmentUpsertBulk) UpdateNewValues ¶
func (u *DepartmentUpsertBulk) UpdateNewValues() *DepartmentUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Department.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*DepartmentUpsertBulk) UpdateUpdatedAt ¶
func (u *DepartmentUpsertBulk) UpdateUpdatedAt() *DepartmentUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DepartmentUpsertOne ¶
type DepartmentUpsertOne struct {
// contains filtered or unexported fields
}
DepartmentUpsertOne is the builder for "upsert"-ing
one Department node.
func (*DepartmentUpsertOne) DoNothing ¶
func (u *DepartmentUpsertOne) DoNothing() *DepartmentUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DepartmentUpsertOne) Exec ¶
func (u *DepartmentUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*DepartmentUpsertOne) ExecX ¶
func (u *DepartmentUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DepartmentUpsertOne) ID ¶
func (u *DepartmentUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*DepartmentUpsertOne) IDX ¶
func (u *DepartmentUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*DepartmentUpsertOne) Ignore ¶
func (u *DepartmentUpsertOne) Ignore() *DepartmentUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Department.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DepartmentUpsertOne) SetCreatedAt ¶
func (u *DepartmentUpsertOne) SetCreatedAt(v time.Time) *DepartmentUpsertOne
SetCreatedAt sets the "created_at" field.
func (*DepartmentUpsertOne) SetDeptName ¶
func (u *DepartmentUpsertOne) SetDeptName(v string) *DepartmentUpsertOne
SetDeptName sets the "dept_name" field.
func (*DepartmentUpsertOne) SetUpdatedAt ¶
func (u *DepartmentUpsertOne) SetUpdatedAt(v time.Time) *DepartmentUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*DepartmentUpsertOne) Update ¶
func (u *DepartmentUpsertOne) Update(set func(*DepartmentUpsert)) *DepartmentUpsertOne
Update allows overriding fields `UPDATE` values. See the DepartmentCreate.OnConflict documentation for more info.
func (*DepartmentUpsertOne) UpdateCreatedAt ¶
func (u *DepartmentUpsertOne) UpdateCreatedAt() *DepartmentUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DepartmentUpsertOne) UpdateDeptName ¶
func (u *DepartmentUpsertOne) UpdateDeptName() *DepartmentUpsertOne
UpdateDeptName sets the "dept_name" field to the value that was provided on create.
func (*DepartmentUpsertOne) UpdateNewValues ¶
func (u *DepartmentUpsertOne) UpdateNewValues() *DepartmentUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Department.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*DepartmentUpsertOne) UpdateUpdatedAt ¶
func (u *DepartmentUpsertOne) UpdateUpdatedAt() *DepartmentUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DeptManager ¶
type DeptManager struct { // ID of the ent. ID int `json:"id,omitempty"` // FromDate holds the value of the "from_date" field. FromDate time.Time `json:"from_date,omitempty"` // ToDate holds the value of the "to_date" field. ToDate time.Time `json:"to_date,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the DeptManagerQuery when eager-loading is set. Edges DeptManagerEdges `json:"edges"` // contains filtered or unexported fields }
DeptManager is the model entity for the DeptManager schema.
func (*DeptManager) QueryDepartment ¶
func (dm *DeptManager) QueryDepartment() *DepartmentQuery
QueryDepartment queries the "department" edge of the DeptManager entity.
func (*DeptManager) QueryEmployee ¶
func (dm *DeptManager) QueryEmployee() *EmployeeQuery
QueryEmployee queries the "employee" edge of the DeptManager entity.
func (*DeptManager) String ¶
func (dm *DeptManager) String() string
String implements the fmt.Stringer.
func (*DeptManager) Unwrap ¶
func (dm *DeptManager) Unwrap() *DeptManager
Unwrap unwraps the DeptManager 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 (*DeptManager) Update ¶
func (dm *DeptManager) Update() *DeptManagerUpdateOne
Update returns a builder for updating this DeptManager. Note that you need to call DeptManager.Unwrap() before calling this method if this DeptManager was returned from a transaction, and the transaction was committed or rolled back.
type DeptManagerClient ¶
type DeptManagerClient struct {
// contains filtered or unexported fields
}
DeptManagerClient is a client for the DeptManager schema.
func NewDeptManagerClient ¶
func NewDeptManagerClient(c config) *DeptManagerClient
NewDeptManagerClient returns a client for the DeptManager from the given config.
func (*DeptManagerClient) Create ¶
func (c *DeptManagerClient) Create() *DeptManagerCreate
Create returns a builder for creating a DeptManager entity.
func (*DeptManagerClient) CreateBulk ¶
func (c *DeptManagerClient) CreateBulk(builders ...*DeptManagerCreate) *DeptManagerCreateBulk
CreateBulk returns a builder for creating a bulk of DeptManager entities.
func (*DeptManagerClient) Delete ¶
func (c *DeptManagerClient) Delete() *DeptManagerDelete
Delete returns a delete builder for DeptManager.
func (*DeptManagerClient) DeleteOne ¶
func (c *DeptManagerClient) DeleteOne(dm *DeptManager) *DeptManagerDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DeptManagerClient) DeleteOneID ¶
func (c *DeptManagerClient) DeleteOneID(id int) *DeptManagerDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DeptManagerClient) Get ¶
func (c *DeptManagerClient) Get(ctx context.Context, id int) (*DeptManager, error)
Get returns a DeptManager entity by its id.
func (*DeptManagerClient) GetX ¶
func (c *DeptManagerClient) GetX(ctx context.Context, id int) *DeptManager
GetX is like Get, but panics if an error occurs.
func (*DeptManagerClient) Hooks ¶
func (c *DeptManagerClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DeptManagerClient) Intercept ¶
func (c *DeptManagerClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `deptmanager.Intercept(f(g(h())))`.
func (*DeptManagerClient) Interceptors ¶
func (c *DeptManagerClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DeptManagerClient) Query ¶
func (c *DeptManagerClient) Query() *DeptManagerQuery
Query returns a query builder for DeptManager.
func (*DeptManagerClient) QueryDepartment ¶
func (c *DeptManagerClient) QueryDepartment(dm *DeptManager) *DepartmentQuery
QueryDepartment queries the department edge of a DeptManager.
func (*DeptManagerClient) QueryEmployee ¶
func (c *DeptManagerClient) QueryEmployee(dm *DeptManager) *EmployeeQuery
QueryEmployee queries the employee edge of a DeptManager.
func (*DeptManagerClient) Update ¶
func (c *DeptManagerClient) Update() *DeptManagerUpdate
Update returns an update builder for DeptManager.
func (*DeptManagerClient) UpdateOne ¶
func (c *DeptManagerClient) UpdateOne(dm *DeptManager) *DeptManagerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DeptManagerClient) UpdateOneID ¶
func (c *DeptManagerClient) UpdateOneID(id int) *DeptManagerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DeptManagerClient) Use ¶
func (c *DeptManagerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `deptmanager.Hooks(f(g(h())))`.
type DeptManagerCreate ¶
type DeptManagerCreate struct {
// contains filtered or unexported fields
}
DeptManagerCreate is the builder for creating a DeptManager entity.
func (*DeptManagerCreate) Exec ¶
func (dmc *DeptManagerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DeptManagerCreate) ExecX ¶
func (dmc *DeptManagerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerCreate) Mutation ¶
func (dmc *DeptManagerCreate) Mutation() *DeptManagerMutation
Mutation returns the DeptManagerMutation object of the builder.
func (*DeptManagerCreate) OnConflict ¶
func (dmc *DeptManagerCreate) OnConflict(opts ...sql.ConflictOption) *DeptManagerUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DeptManager.Create(). SetFromDate(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DeptManagerUpsert) { SetFromDate(v+v). }). Exec(ctx)
func (*DeptManagerCreate) OnConflictColumns ¶
func (dmc *DeptManagerCreate) OnConflictColumns(columns ...string) *DeptManagerUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DeptManagerCreate) Save ¶
func (dmc *DeptManagerCreate) Save(ctx context.Context) (*DeptManager, error)
Save creates the DeptManager in the database.
func (*DeptManagerCreate) SaveX ¶
func (dmc *DeptManagerCreate) SaveX(ctx context.Context) *DeptManager
SaveX calls Save and panics if Save returns an error.
func (*DeptManagerCreate) SetCreatedAt ¶
func (dmc *DeptManagerCreate) SetCreatedAt(t time.Time) *DeptManagerCreate
SetCreatedAt sets the "created_at" field.
func (*DeptManagerCreate) SetDepartment ¶
func (dmc *DeptManagerCreate) SetDepartment(d *Department) *DeptManagerCreate
SetDepartment sets the "department" edge to the Department entity.
func (*DeptManagerCreate) SetDepartmentID ¶
func (dmc *DeptManagerCreate) SetDepartmentID(id int) *DeptManagerCreate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*DeptManagerCreate) SetEmployee ¶
func (dmc *DeptManagerCreate) SetEmployee(e *Employee) *DeptManagerCreate
SetEmployee sets the "employee" edge to the Employee entity.
func (*DeptManagerCreate) SetEmployeeID ¶
func (dmc *DeptManagerCreate) SetEmployeeID(id int) *DeptManagerCreate
SetEmployeeID sets the "employee" edge to the Employee entity by ID.
func (*DeptManagerCreate) SetFromDate ¶
func (dmc *DeptManagerCreate) SetFromDate(t time.Time) *DeptManagerCreate
SetFromDate sets the "from_date" field.
func (*DeptManagerCreate) SetNillableCreatedAt ¶
func (dmc *DeptManagerCreate) SetNillableCreatedAt(t *time.Time) *DeptManagerCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DeptManagerCreate) SetNillableUpdatedAt ¶
func (dmc *DeptManagerCreate) SetNillableUpdatedAt(t *time.Time) *DeptManagerCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DeptManagerCreate) SetToDate ¶
func (dmc *DeptManagerCreate) SetToDate(t time.Time) *DeptManagerCreate
SetToDate sets the "to_date" field.
func (*DeptManagerCreate) SetUpdatedAt ¶
func (dmc *DeptManagerCreate) SetUpdatedAt(t time.Time) *DeptManagerCreate
SetUpdatedAt sets the "updated_at" field.
type DeptManagerCreateBulk ¶
type DeptManagerCreateBulk struct {
// contains filtered or unexported fields
}
DeptManagerCreateBulk is the builder for creating many DeptManager entities in bulk.
func (*DeptManagerCreateBulk) Exec ¶
func (dmcb *DeptManagerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DeptManagerCreateBulk) ExecX ¶
func (dmcb *DeptManagerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerCreateBulk) OnConflict ¶
func (dmcb *DeptManagerCreateBulk) OnConflict(opts ...sql.ConflictOption) *DeptManagerUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DeptManager.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DeptManagerUpsert) { SetFromDate(v+v). }). Exec(ctx)
func (*DeptManagerCreateBulk) OnConflictColumns ¶
func (dmcb *DeptManagerCreateBulk) OnConflictColumns(columns ...string) *DeptManagerUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DeptManagerCreateBulk) Save ¶
func (dmcb *DeptManagerCreateBulk) Save(ctx context.Context) ([]*DeptManager, error)
Save creates the DeptManager entities in the database.
func (*DeptManagerCreateBulk) SaveX ¶
func (dmcb *DeptManagerCreateBulk) SaveX(ctx context.Context) []*DeptManager
SaveX is like Save, but panics if an error occurs.
type DeptManagerDelete ¶
type DeptManagerDelete struct {
// contains filtered or unexported fields
}
DeptManagerDelete is the builder for deleting a DeptManager entity.
func (*DeptManagerDelete) Exec ¶
func (dmd *DeptManagerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DeptManagerDelete) ExecX ¶
func (dmd *DeptManagerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerDelete) Where ¶
func (dmd *DeptManagerDelete) Where(ps ...predicate.DeptManager) *DeptManagerDelete
Where appends a list predicates to the DeptManagerDelete builder.
type DeptManagerDeleteOne ¶
type DeptManagerDeleteOne struct {
// contains filtered or unexported fields
}
DeptManagerDeleteOne is the builder for deleting a single DeptManager entity.
func (*DeptManagerDeleteOne) Exec ¶
func (dmdo *DeptManagerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DeptManagerDeleteOne) ExecX ¶
func (dmdo *DeptManagerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerDeleteOne) Where ¶
func (dmdo *DeptManagerDeleteOne) Where(ps ...predicate.DeptManager) *DeptManagerDeleteOne
Where appends a list predicates to the DeptManagerDelete builder.
type DeptManagerEdges ¶
type DeptManagerEdges struct { // Employee holds the value of the employee edge. Employee *Employee `json:"employee,omitempty"` // Department holds the value of the department edge. Department *Department `json:"department,omitempty"` // contains filtered or unexported fields }
DeptManagerEdges holds the relations/edges for other nodes in the graph.
func (DeptManagerEdges) DepartmentOrErr ¶
func (e DeptManagerEdges) 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 (DeptManagerEdges) EmployeeOrErr ¶
func (e DeptManagerEdges) EmployeeOrErr() (*Employee, error)
EmployeeOrErr returns the Employee value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type DeptManagerGroupBy ¶
type DeptManagerGroupBy struct {
// contains filtered or unexported fields
}
DeptManagerGroupBy is the group-by builder for DeptManager entities.
func (*DeptManagerGroupBy) Aggregate ¶
func (dmgb *DeptManagerGroupBy) Aggregate(fns ...AggregateFunc) *DeptManagerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DeptManagerGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DeptManagerGroupBy) Scan ¶
func (dmgb *DeptManagerGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DeptManagerGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DeptManagerMutation ¶
type DeptManagerMutation struct {
// contains filtered or unexported fields
}
DeptManagerMutation represents an operation that mutates the DeptManager nodes in the graph.
func (*DeptManagerMutation) AddField ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) AddedEdges ¶
func (m *DeptManagerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DeptManagerMutation) AddedField ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) AddedFields ¶
func (m *DeptManagerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DeptManagerMutation) AddedIDs ¶
func (m *DeptManagerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DeptManagerMutation) ClearDepartment ¶
func (m *DeptManagerMutation) ClearDepartment()
ClearDepartment clears the "department" edge to the Department entity.
func (*DeptManagerMutation) ClearEdge ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) ClearEmployee ¶
func (m *DeptManagerMutation) ClearEmployee()
ClearEmployee clears the "employee" edge to the Employee entity.
func (*DeptManagerMutation) ClearField ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) ClearedEdges ¶
func (m *DeptManagerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DeptManagerMutation) ClearedFields ¶
func (m *DeptManagerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DeptManagerMutation) Client ¶
func (m DeptManagerMutation) 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 (*DeptManagerMutation) CreatedAt ¶
func (m *DeptManagerMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*DeptManagerMutation) DepartmentCleared ¶
func (m *DeptManagerMutation) DepartmentCleared() bool
DepartmentCleared reports if the "department" edge to the Department entity was cleared.
func (*DeptManagerMutation) DepartmentID ¶
func (m *DeptManagerMutation) DepartmentID() (id int, exists bool)
DepartmentID returns the "department" edge ID in the mutation.
func (*DeptManagerMutation) DepartmentIDs ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) EdgeCleared ¶
func (m *DeptManagerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DeptManagerMutation) EmployeeCleared ¶
func (m *DeptManagerMutation) EmployeeCleared() bool
EmployeeCleared reports if the "employee" edge to the Employee entity was cleared.
func (*DeptManagerMutation) EmployeeID ¶
func (m *DeptManagerMutation) EmployeeID() (id int, exists bool)
EmployeeID returns the "employee" edge ID in the mutation.
func (*DeptManagerMutation) EmployeeIDs ¶
func (m *DeptManagerMutation) EmployeeIDs() (ids []int)
EmployeeIDs returns the "employee" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use EmployeeID instead. It exists only for internal usage by the builders.
func (*DeptManagerMutation) Field ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) FieldCleared ¶
func (m *DeptManagerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DeptManagerMutation) Fields ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) FromDate ¶
func (m *DeptManagerMutation) FromDate() (r time.Time, exists bool)
FromDate returns the value of the "from_date" field in the mutation.
func (*DeptManagerMutation) ID ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) IDs ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the DeptManager entity. If the DeptManager 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 (*DeptManagerMutation) 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 (*DeptManagerMutation) OldFromDate ¶
OldFromDate returns the old "from_date" field's value of the DeptManager entity. If the DeptManager 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 (*DeptManagerMutation) OldToDate ¶
OldToDate returns the old "to_date" field's value of the DeptManager entity. If the DeptManager 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 (*DeptManagerMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the DeptManager entity. If the DeptManager 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 (*DeptManagerMutation) Op ¶
func (m *DeptManagerMutation) Op() Op
Op returns the operation name.
func (*DeptManagerMutation) RemovedEdges ¶
func (m *DeptManagerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DeptManagerMutation) RemovedIDs ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) ResetCreatedAt ¶
func (m *DeptManagerMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*DeptManagerMutation) ResetDepartment ¶
func (m *DeptManagerMutation) ResetDepartment()
ResetDepartment resets all changes to the "department" edge.
func (*DeptManagerMutation) ResetEdge ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) ResetEmployee ¶
func (m *DeptManagerMutation) ResetEmployee()
ResetEmployee resets all changes to the "employee" edge.
func (*DeptManagerMutation) ResetField ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) ResetFromDate ¶
func (m *DeptManagerMutation) ResetFromDate()
ResetFromDate resets all changes to the "from_date" field.
func (*DeptManagerMutation) ResetToDate ¶
func (m *DeptManagerMutation) ResetToDate()
ResetToDate resets all changes to the "to_date" field.
func (*DeptManagerMutation) ResetUpdatedAt ¶
func (m *DeptManagerMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*DeptManagerMutation) SetCreatedAt ¶
func (m *DeptManagerMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*DeptManagerMutation) SetDepartmentID ¶
func (m *DeptManagerMutation) SetDepartmentID(id int)
SetDepartmentID sets the "department" edge to the Department entity by id.
func (*DeptManagerMutation) SetEmployeeID ¶
func (m *DeptManagerMutation) SetEmployeeID(id int)
SetEmployeeID sets the "employee" edge to the Employee entity by id.
func (*DeptManagerMutation) SetField ¶
func (m *DeptManagerMutation) 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 (*DeptManagerMutation) SetFromDate ¶
func (m *DeptManagerMutation) SetFromDate(t time.Time)
SetFromDate sets the "from_date" field.
func (*DeptManagerMutation) SetOp ¶
func (m *DeptManagerMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DeptManagerMutation) SetToDate ¶
func (m *DeptManagerMutation) SetToDate(t time.Time)
SetToDate sets the "to_date" field.
func (*DeptManagerMutation) SetUpdatedAt ¶
func (m *DeptManagerMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerMutation) ToDate ¶
func (m *DeptManagerMutation) ToDate() (r time.Time, exists bool)
ToDate returns the value of the "to_date" field in the mutation.
func (DeptManagerMutation) Tx ¶
func (m DeptManagerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DeptManagerMutation) Type ¶
func (m *DeptManagerMutation) Type() string
Type returns the node type of this mutation (DeptManager).
func (*DeptManagerMutation) UpdatedAt ¶
func (m *DeptManagerMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*DeptManagerMutation) Where ¶
func (m *DeptManagerMutation) Where(ps ...predicate.DeptManager)
Where appends a list predicates to the DeptManagerMutation builder.
func (*DeptManagerMutation) WhereP ¶
func (m *DeptManagerMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DeptManagerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DeptManagerQuery ¶
type DeptManagerQuery struct {
// contains filtered or unexported fields
}
DeptManagerQuery is the builder for querying DeptManager entities.
func (*DeptManagerQuery) Aggregate ¶
func (dmq *DeptManagerQuery) Aggregate(fns ...AggregateFunc) *DeptManagerSelect
Aggregate returns a DeptManagerSelect configured with the given aggregations.
func (*DeptManagerQuery) All ¶
func (dmq *DeptManagerQuery) All(ctx context.Context) ([]*DeptManager, error)
All executes the query and returns a list of DeptManagers.
func (*DeptManagerQuery) AllX ¶
func (dmq *DeptManagerQuery) AllX(ctx context.Context) []*DeptManager
AllX is like All, but panics if an error occurs.
func (*DeptManagerQuery) Clone ¶
func (dmq *DeptManagerQuery) Clone() *DeptManagerQuery
Clone returns a duplicate of the DeptManagerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DeptManagerQuery) Count ¶
func (dmq *DeptManagerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DeptManagerQuery) CountX ¶
func (dmq *DeptManagerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DeptManagerQuery) Exist ¶
func (dmq *DeptManagerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DeptManagerQuery) ExistX ¶
func (dmq *DeptManagerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DeptManagerQuery) First ¶
func (dmq *DeptManagerQuery) First(ctx context.Context) (*DeptManager, error)
First returns the first DeptManager entity from the query. Returns a *NotFoundError when no DeptManager was found.
func (*DeptManagerQuery) FirstID ¶
func (dmq *DeptManagerQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first DeptManager ID from the query. Returns a *NotFoundError when no DeptManager ID was found.
func (*DeptManagerQuery) FirstIDX ¶
func (dmq *DeptManagerQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*DeptManagerQuery) FirstX ¶
func (dmq *DeptManagerQuery) FirstX(ctx context.Context) *DeptManager
FirstX is like First, but panics if an error occurs.
func (*DeptManagerQuery) GroupBy ¶
func (dmq *DeptManagerQuery) GroupBy(field string, fields ...string) *DeptManagerGroupBy
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 { FromDate time.Time `json:"from_date,omitempty"` Count int `json:"count,omitempty"` } client.DeptManager.Query(). GroupBy(deptmanager.FieldFromDate). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DeptManagerQuery) IDs ¶
func (dmq *DeptManagerQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of DeptManager IDs.
func (*DeptManagerQuery) IDsX ¶
func (dmq *DeptManagerQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*DeptManagerQuery) Limit ¶
func (dmq *DeptManagerQuery) Limit(limit int) *DeptManagerQuery
Limit the number of records to be returned by this query.
func (*DeptManagerQuery) Offset ¶
func (dmq *DeptManagerQuery) Offset(offset int) *DeptManagerQuery
Offset to start from.
func (*DeptManagerQuery) Only ¶
func (dmq *DeptManagerQuery) Only(ctx context.Context) (*DeptManager, error)
Only returns a single DeptManager entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DeptManager entity is found. Returns a *NotFoundError when no DeptManager entities are found.
func (*DeptManagerQuery) OnlyID ¶
func (dmq *DeptManagerQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only DeptManager ID in the query. Returns a *NotSingularError when more than one DeptManager ID is found. Returns a *NotFoundError when no entities are found.
func (*DeptManagerQuery) OnlyIDX ¶
func (dmq *DeptManagerQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DeptManagerQuery) OnlyX ¶
func (dmq *DeptManagerQuery) OnlyX(ctx context.Context) *DeptManager
OnlyX is like Only, but panics if an error occurs.
func (*DeptManagerQuery) Order ¶
func (dmq *DeptManagerQuery) Order(o ...deptmanager.OrderOption) *DeptManagerQuery
Order specifies how the records should be ordered.
func (*DeptManagerQuery) QueryDepartment ¶
func (dmq *DeptManagerQuery) QueryDepartment() *DepartmentQuery
QueryDepartment chains the current query on the "department" edge.
func (*DeptManagerQuery) QueryEmployee ¶
func (dmq *DeptManagerQuery) QueryEmployee() *EmployeeQuery
QueryEmployee chains the current query on the "employee" edge.
func (*DeptManagerQuery) Select ¶
func (dmq *DeptManagerQuery) Select(fields ...string) *DeptManagerSelect
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 { FromDate time.Time `json:"from_date,omitempty"` } client.DeptManager.Query(). Select(deptmanager.FieldFromDate). Scan(ctx, &v)
func (*DeptManagerQuery) Unique ¶
func (dmq *DeptManagerQuery) Unique(unique bool) *DeptManagerQuery
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 (*DeptManagerQuery) Where ¶
func (dmq *DeptManagerQuery) Where(ps ...predicate.DeptManager) *DeptManagerQuery
Where adds a new predicate for the DeptManagerQuery builder.
func (*DeptManagerQuery) WithDepartment ¶
func (dmq *DeptManagerQuery) WithDepartment(opts ...func(*DepartmentQuery)) *DeptManagerQuery
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 (*DeptManagerQuery) WithEmployee ¶
func (dmq *DeptManagerQuery) WithEmployee(opts ...func(*EmployeeQuery)) *DeptManagerQuery
WithEmployee tells the query-builder to eager-load the nodes that are connected to the "employee" edge. The optional arguments are used to configure the query builder of the edge.
type DeptManagerSelect ¶
type DeptManagerSelect struct { *DeptManagerQuery // contains filtered or unexported fields }
DeptManagerSelect is the builder for selecting fields of DeptManager entities.
func (*DeptManagerSelect) Aggregate ¶
func (dms *DeptManagerSelect) Aggregate(fns ...AggregateFunc) *DeptManagerSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DeptManagerSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DeptManagerSelect) Scan ¶
func (dms *DeptManagerSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DeptManagerSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DeptManagerUpdate ¶
type DeptManagerUpdate struct {
// contains filtered or unexported fields
}
DeptManagerUpdate is the builder for updating DeptManager entities.
func (*DeptManagerUpdate) ClearDepartment ¶
func (dmu *DeptManagerUpdate) ClearDepartment() *DeptManagerUpdate
ClearDepartment clears the "department" edge to the Department entity.
func (*DeptManagerUpdate) ClearEmployee ¶
func (dmu *DeptManagerUpdate) ClearEmployee() *DeptManagerUpdate
ClearEmployee clears the "employee" edge to the Employee entity.
func (*DeptManagerUpdate) Exec ¶
func (dmu *DeptManagerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DeptManagerUpdate) ExecX ¶
func (dmu *DeptManagerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerUpdate) Mutation ¶
func (dmu *DeptManagerUpdate) Mutation() *DeptManagerMutation
Mutation returns the DeptManagerMutation object of the builder.
func (*DeptManagerUpdate) Save ¶
func (dmu *DeptManagerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DeptManagerUpdate) SaveX ¶
func (dmu *DeptManagerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DeptManagerUpdate) SetCreatedAt ¶
func (dmu *DeptManagerUpdate) SetCreatedAt(t time.Time) *DeptManagerUpdate
SetCreatedAt sets the "created_at" field.
func (*DeptManagerUpdate) SetDepartment ¶
func (dmu *DeptManagerUpdate) SetDepartment(d *Department) *DeptManagerUpdate
SetDepartment sets the "department" edge to the Department entity.
func (*DeptManagerUpdate) SetDepartmentID ¶
func (dmu *DeptManagerUpdate) SetDepartmentID(id int) *DeptManagerUpdate
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*DeptManagerUpdate) SetEmployee ¶
func (dmu *DeptManagerUpdate) SetEmployee(e *Employee) *DeptManagerUpdate
SetEmployee sets the "employee" edge to the Employee entity.
func (*DeptManagerUpdate) SetEmployeeID ¶
func (dmu *DeptManagerUpdate) SetEmployeeID(id int) *DeptManagerUpdate
SetEmployeeID sets the "employee" edge to the Employee entity by ID.
func (*DeptManagerUpdate) SetFromDate ¶
func (dmu *DeptManagerUpdate) SetFromDate(t time.Time) *DeptManagerUpdate
SetFromDate sets the "from_date" field.
func (*DeptManagerUpdate) SetNillableCreatedAt ¶
func (dmu *DeptManagerUpdate) SetNillableCreatedAt(t *time.Time) *DeptManagerUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DeptManagerUpdate) SetNillableUpdatedAt ¶
func (dmu *DeptManagerUpdate) SetNillableUpdatedAt(t *time.Time) *DeptManagerUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DeptManagerUpdate) SetToDate ¶
func (dmu *DeptManagerUpdate) SetToDate(t time.Time) *DeptManagerUpdate
SetToDate sets the "to_date" field.
func (*DeptManagerUpdate) SetUpdatedAt ¶
func (dmu *DeptManagerUpdate) SetUpdatedAt(t time.Time) *DeptManagerUpdate
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerUpdate) Where ¶
func (dmu *DeptManagerUpdate) Where(ps ...predicate.DeptManager) *DeptManagerUpdate
Where appends a list predicates to the DeptManagerUpdate builder.
type DeptManagerUpdateOne ¶
type DeptManagerUpdateOne struct {
// contains filtered or unexported fields
}
DeptManagerUpdateOne is the builder for updating a single DeptManager entity.
func (*DeptManagerUpdateOne) ClearDepartment ¶
func (dmuo *DeptManagerUpdateOne) ClearDepartment() *DeptManagerUpdateOne
ClearDepartment clears the "department" edge to the Department entity.
func (*DeptManagerUpdateOne) ClearEmployee ¶
func (dmuo *DeptManagerUpdateOne) ClearEmployee() *DeptManagerUpdateOne
ClearEmployee clears the "employee" edge to the Employee entity.
func (*DeptManagerUpdateOne) Exec ¶
func (dmuo *DeptManagerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DeptManagerUpdateOne) ExecX ¶
func (dmuo *DeptManagerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerUpdateOne) Mutation ¶
func (dmuo *DeptManagerUpdateOne) Mutation() *DeptManagerMutation
Mutation returns the DeptManagerMutation object of the builder.
func (*DeptManagerUpdateOne) Save ¶
func (dmuo *DeptManagerUpdateOne) Save(ctx context.Context) (*DeptManager, error)
Save executes the query and returns the updated DeptManager entity.
func (*DeptManagerUpdateOne) SaveX ¶
func (dmuo *DeptManagerUpdateOne) SaveX(ctx context.Context) *DeptManager
SaveX is like Save, but panics if an error occurs.
func (*DeptManagerUpdateOne) Select ¶
func (dmuo *DeptManagerUpdateOne) Select(field string, fields ...string) *DeptManagerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DeptManagerUpdateOne) SetCreatedAt ¶
func (dmuo *DeptManagerUpdateOne) SetCreatedAt(t time.Time) *DeptManagerUpdateOne
SetCreatedAt sets the "created_at" field.
func (*DeptManagerUpdateOne) SetDepartment ¶
func (dmuo *DeptManagerUpdateOne) SetDepartment(d *Department) *DeptManagerUpdateOne
SetDepartment sets the "department" edge to the Department entity.
func (*DeptManagerUpdateOne) SetDepartmentID ¶
func (dmuo *DeptManagerUpdateOne) SetDepartmentID(id int) *DeptManagerUpdateOne
SetDepartmentID sets the "department" edge to the Department entity by ID.
func (*DeptManagerUpdateOne) SetEmployee ¶
func (dmuo *DeptManagerUpdateOne) SetEmployee(e *Employee) *DeptManagerUpdateOne
SetEmployee sets the "employee" edge to the Employee entity.
func (*DeptManagerUpdateOne) SetEmployeeID ¶
func (dmuo *DeptManagerUpdateOne) SetEmployeeID(id int) *DeptManagerUpdateOne
SetEmployeeID sets the "employee" edge to the Employee entity by ID.
func (*DeptManagerUpdateOne) SetFromDate ¶
func (dmuo *DeptManagerUpdateOne) SetFromDate(t time.Time) *DeptManagerUpdateOne
SetFromDate sets the "from_date" field.
func (*DeptManagerUpdateOne) SetNillableCreatedAt ¶
func (dmuo *DeptManagerUpdateOne) SetNillableCreatedAt(t *time.Time) *DeptManagerUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DeptManagerUpdateOne) SetNillableUpdatedAt ¶
func (dmuo *DeptManagerUpdateOne) SetNillableUpdatedAt(t *time.Time) *DeptManagerUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DeptManagerUpdateOne) SetToDate ¶
func (dmuo *DeptManagerUpdateOne) SetToDate(t time.Time) *DeptManagerUpdateOne
SetToDate sets the "to_date" field.
func (*DeptManagerUpdateOne) SetUpdatedAt ¶
func (dmuo *DeptManagerUpdateOne) SetUpdatedAt(t time.Time) *DeptManagerUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerUpdateOne) Where ¶
func (dmuo *DeptManagerUpdateOne) Where(ps ...predicate.DeptManager) *DeptManagerUpdateOne
Where appends a list predicates to the DeptManagerUpdate builder.
type DeptManagerUpsert ¶
DeptManagerUpsert is the "OnConflict" setter.
func (*DeptManagerUpsert) SetCreatedAt ¶
func (u *DeptManagerUpsert) SetCreatedAt(v time.Time) *DeptManagerUpsert
SetCreatedAt sets the "created_at" field.
func (*DeptManagerUpsert) SetFromDate ¶
func (u *DeptManagerUpsert) SetFromDate(v time.Time) *DeptManagerUpsert
SetFromDate sets the "from_date" field.
func (*DeptManagerUpsert) SetToDate ¶
func (u *DeptManagerUpsert) SetToDate(v time.Time) *DeptManagerUpsert
SetToDate sets the "to_date" field.
func (*DeptManagerUpsert) SetUpdatedAt ¶
func (u *DeptManagerUpsert) SetUpdatedAt(v time.Time) *DeptManagerUpsert
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerUpsert) UpdateCreatedAt ¶
func (u *DeptManagerUpsert) UpdateCreatedAt() *DeptManagerUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DeptManagerUpsert) UpdateFromDate ¶
func (u *DeptManagerUpsert) UpdateFromDate() *DeptManagerUpsert
UpdateFromDate sets the "from_date" field to the value that was provided on create.
func (*DeptManagerUpsert) UpdateToDate ¶
func (u *DeptManagerUpsert) UpdateToDate() *DeptManagerUpsert
UpdateToDate sets the "to_date" field to the value that was provided on create.
func (*DeptManagerUpsert) UpdateUpdatedAt ¶
func (u *DeptManagerUpsert) UpdateUpdatedAt() *DeptManagerUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DeptManagerUpsertBulk ¶
type DeptManagerUpsertBulk struct {
// contains filtered or unexported fields
}
DeptManagerUpsertBulk is the builder for "upsert"-ing a bulk of DeptManager nodes.
func (*DeptManagerUpsertBulk) DoNothing ¶
func (u *DeptManagerUpsertBulk) DoNothing() *DeptManagerUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DeptManagerUpsertBulk) Exec ¶
func (u *DeptManagerUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DeptManagerUpsertBulk) ExecX ¶
func (u *DeptManagerUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerUpsertBulk) Ignore ¶
func (u *DeptManagerUpsertBulk) Ignore() *DeptManagerUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DeptManagerUpsertBulk) SetCreatedAt ¶
func (u *DeptManagerUpsertBulk) SetCreatedAt(v time.Time) *DeptManagerUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*DeptManagerUpsertBulk) SetFromDate ¶
func (u *DeptManagerUpsertBulk) SetFromDate(v time.Time) *DeptManagerUpsertBulk
SetFromDate sets the "from_date" field.
func (*DeptManagerUpsertBulk) SetToDate ¶
func (u *DeptManagerUpsertBulk) SetToDate(v time.Time) *DeptManagerUpsertBulk
SetToDate sets the "to_date" field.
func (*DeptManagerUpsertBulk) SetUpdatedAt ¶
func (u *DeptManagerUpsertBulk) SetUpdatedAt(v time.Time) *DeptManagerUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerUpsertBulk) Update ¶
func (u *DeptManagerUpsertBulk) Update(set func(*DeptManagerUpsert)) *DeptManagerUpsertBulk
Update allows overriding fields `UPDATE` values. See the DeptManagerCreateBulk.OnConflict documentation for more info.
func (*DeptManagerUpsertBulk) UpdateCreatedAt ¶
func (u *DeptManagerUpsertBulk) UpdateCreatedAt() *DeptManagerUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DeptManagerUpsertBulk) UpdateFromDate ¶
func (u *DeptManagerUpsertBulk) UpdateFromDate() *DeptManagerUpsertBulk
UpdateFromDate sets the "from_date" field to the value that was provided on create.
func (*DeptManagerUpsertBulk) UpdateNewValues ¶
func (u *DeptManagerUpsertBulk) UpdateNewValues() *DeptManagerUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*DeptManagerUpsertBulk) UpdateToDate ¶
func (u *DeptManagerUpsertBulk) UpdateToDate() *DeptManagerUpsertBulk
UpdateToDate sets the "to_date" field to the value that was provided on create.
func (*DeptManagerUpsertBulk) UpdateUpdatedAt ¶
func (u *DeptManagerUpsertBulk) UpdateUpdatedAt() *DeptManagerUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DeptManagerUpsertOne ¶
type DeptManagerUpsertOne struct {
// contains filtered or unexported fields
}
DeptManagerUpsertOne is the builder for "upsert"-ing
one DeptManager node.
func (*DeptManagerUpsertOne) DoNothing ¶
func (u *DeptManagerUpsertOne) DoNothing() *DeptManagerUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DeptManagerUpsertOne) Exec ¶
func (u *DeptManagerUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*DeptManagerUpsertOne) ExecX ¶
func (u *DeptManagerUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DeptManagerUpsertOne) ID ¶
func (u *DeptManagerUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*DeptManagerUpsertOne) IDX ¶
func (u *DeptManagerUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*DeptManagerUpsertOne) Ignore ¶
func (u *DeptManagerUpsertOne) Ignore() *DeptManagerUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DeptManagerUpsertOne) SetCreatedAt ¶
func (u *DeptManagerUpsertOne) SetCreatedAt(v time.Time) *DeptManagerUpsertOne
SetCreatedAt sets the "created_at" field.
func (*DeptManagerUpsertOne) SetFromDate ¶
func (u *DeptManagerUpsertOne) SetFromDate(v time.Time) *DeptManagerUpsertOne
SetFromDate sets the "from_date" field.
func (*DeptManagerUpsertOne) SetToDate ¶
func (u *DeptManagerUpsertOne) SetToDate(v time.Time) *DeptManagerUpsertOne
SetToDate sets the "to_date" field.
func (*DeptManagerUpsertOne) SetUpdatedAt ¶
func (u *DeptManagerUpsertOne) SetUpdatedAt(v time.Time) *DeptManagerUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*DeptManagerUpsertOne) Update ¶
func (u *DeptManagerUpsertOne) Update(set func(*DeptManagerUpsert)) *DeptManagerUpsertOne
Update allows overriding fields `UPDATE` values. See the DeptManagerCreate.OnConflict documentation for more info.
func (*DeptManagerUpsertOne) UpdateCreatedAt ¶
func (u *DeptManagerUpsertOne) UpdateCreatedAt() *DeptManagerUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*DeptManagerUpsertOne) UpdateFromDate ¶
func (u *DeptManagerUpsertOne) UpdateFromDate() *DeptManagerUpsertOne
UpdateFromDate sets the "from_date" field to the value that was provided on create.
func (*DeptManagerUpsertOne) UpdateNewValues ¶
func (u *DeptManagerUpsertOne) UpdateNewValues() *DeptManagerUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.DeptManager.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*DeptManagerUpsertOne) UpdateToDate ¶
func (u *DeptManagerUpsertOne) UpdateToDate() *DeptManagerUpsertOne
UpdateToDate sets the "to_date" field to the value that was provided on create.
func (*DeptManagerUpsertOne) UpdateUpdatedAt ¶
func (u *DeptManagerUpsertOne) UpdateUpdatedAt() *DeptManagerUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type DeptManagers ¶
type DeptManagers []*DeptManager
DeptManagers is a parsable slice of DeptManager.
type Employee ¶
type Employee struct { // ID of the ent. ID int `json:"id,omitempty"` // BirthDate holds the value of the "birth_date" field. BirthDate time.Time `json:"birth_date,omitempty"` // FirstName holds the value of the "first_name" field. FirstName string `json:"first_name,omitempty"` // LastName holds the value of the "last_name" field. LastName string `json:"last_name,omitempty"` // Gender holds the value of the "gender" field. Gender employee.Gender `json:"gender,omitempty"` // HireDate holds the value of the "hire_date" field. HireDate time.Time `json:"hire_date,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt time.Time `json:"deleted_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EmployeeQuery when eager-loading is set. Edges EmployeeEdges `json:"edges"` // contains filtered or unexported fields }
Employee is the model entity for the Employee schema.
func (*Employee) QueryDeptManager ¶
func (e *Employee) QueryDeptManager() *DeptManagerQuery
QueryDeptManager queries the "dept_manager" edge of the Employee entity.
func (*Employee) Unwrap ¶
Unwrap unwraps the Employee 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 (*Employee) Update ¶
func (e *Employee) Update() *EmployeeUpdateOne
Update returns a builder for updating this Employee. Note that you need to call Employee.Unwrap() before calling this method if this Employee was returned from a transaction, and the transaction was committed or rolled back.
type EmployeeClient ¶
type EmployeeClient struct {
// contains filtered or unexported fields
}
EmployeeClient is a client for the Employee schema.
func NewEmployeeClient ¶
func NewEmployeeClient(c config) *EmployeeClient
NewEmployeeClient returns a client for the Employee from the given config.
func (*EmployeeClient) Create ¶
func (c *EmployeeClient) Create() *EmployeeCreate
Create returns a builder for creating a Employee entity.
func (*EmployeeClient) CreateBulk ¶
func (c *EmployeeClient) CreateBulk(builders ...*EmployeeCreate) *EmployeeCreateBulk
CreateBulk returns a builder for creating a bulk of Employee entities.
func (*EmployeeClient) Delete ¶
func (c *EmployeeClient) Delete() *EmployeeDelete
Delete returns a delete builder for Employee.
func (*EmployeeClient) DeleteOne ¶
func (c *EmployeeClient) DeleteOne(e *Employee) *EmployeeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*EmployeeClient) DeleteOneID ¶
func (c *EmployeeClient) DeleteOneID(id int) *EmployeeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*EmployeeClient) GetX ¶
func (c *EmployeeClient) GetX(ctx context.Context, id int) *Employee
GetX is like Get, but panics if an error occurs.
func (*EmployeeClient) Hooks ¶
func (c *EmployeeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*EmployeeClient) Intercept ¶
func (c *EmployeeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `employee.Intercept(f(g(h())))`.
func (*EmployeeClient) Interceptors ¶
func (c *EmployeeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*EmployeeClient) Query ¶
func (c *EmployeeClient) Query() *EmployeeQuery
Query returns a query builder for Employee.
func (*EmployeeClient) QueryDeptManager ¶
func (c *EmployeeClient) QueryDeptManager(e *Employee) *DeptManagerQuery
QueryDeptManager queries the dept_manager edge of a Employee.
func (*EmployeeClient) Update ¶
func (c *EmployeeClient) Update() *EmployeeUpdate
Update returns an update builder for Employee.
func (*EmployeeClient) UpdateOne ¶
func (c *EmployeeClient) UpdateOne(e *Employee) *EmployeeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EmployeeClient) UpdateOneID ¶
func (c *EmployeeClient) UpdateOneID(id int) *EmployeeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EmployeeClient) Use ¶
func (c *EmployeeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `employee.Hooks(f(g(h())))`.
type EmployeeCreate ¶
type EmployeeCreate struct {
// contains filtered or unexported fields
}
EmployeeCreate is the builder for creating a Employee entity.
func (*EmployeeCreate) AddDeptManager ¶
func (ec *EmployeeCreate) AddDeptManager(d ...*DeptManager) *EmployeeCreate
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*EmployeeCreate) AddDeptManagerIDs ¶
func (ec *EmployeeCreate) AddDeptManagerIDs(ids ...int) *EmployeeCreate
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by IDs.
func (*EmployeeCreate) Exec ¶
func (ec *EmployeeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*EmployeeCreate) ExecX ¶
func (ec *EmployeeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeCreate) Mutation ¶
func (ec *EmployeeCreate) Mutation() *EmployeeMutation
Mutation returns the EmployeeMutation object of the builder.
func (*EmployeeCreate) OnConflict ¶
func (ec *EmployeeCreate) OnConflict(opts ...sql.ConflictOption) *EmployeeUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Employee.Create(). SetBirthDate(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.EmployeeUpsert) { SetBirthDate(v+v). }). Exec(ctx)
func (*EmployeeCreate) OnConflictColumns ¶
func (ec *EmployeeCreate) OnConflictColumns(columns ...string) *EmployeeUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Employee.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*EmployeeCreate) Save ¶
func (ec *EmployeeCreate) Save(ctx context.Context) (*Employee, error)
Save creates the Employee in the database.
func (*EmployeeCreate) SaveX ¶
func (ec *EmployeeCreate) SaveX(ctx context.Context) *Employee
SaveX calls Save and panics if Save returns an error.
func (*EmployeeCreate) SetBirthDate ¶
func (ec *EmployeeCreate) SetBirthDate(t time.Time) *EmployeeCreate
SetBirthDate sets the "birth_date" field.
func (*EmployeeCreate) SetCreatedAt ¶
func (ec *EmployeeCreate) SetCreatedAt(t time.Time) *EmployeeCreate
SetCreatedAt sets the "created_at" field.
func (*EmployeeCreate) SetDeletedAt ¶
func (ec *EmployeeCreate) SetDeletedAt(t time.Time) *EmployeeCreate
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeCreate) SetFirstName ¶
func (ec *EmployeeCreate) SetFirstName(s string) *EmployeeCreate
SetFirstName sets the "first_name" field.
func (*EmployeeCreate) SetGender ¶
func (ec *EmployeeCreate) SetGender(e employee.Gender) *EmployeeCreate
SetGender sets the "gender" field.
func (*EmployeeCreate) SetHireDate ¶
func (ec *EmployeeCreate) SetHireDate(t time.Time) *EmployeeCreate
SetHireDate sets the "hire_date" field.
func (*EmployeeCreate) SetLastName ¶
func (ec *EmployeeCreate) SetLastName(s string) *EmployeeCreate
SetLastName sets the "last_name" field.
func (*EmployeeCreate) SetNillableCreatedAt ¶
func (ec *EmployeeCreate) SetNillableCreatedAt(t *time.Time) *EmployeeCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*EmployeeCreate) SetNillableDeletedAt ¶
func (ec *EmployeeCreate) SetNillableDeletedAt(t *time.Time) *EmployeeCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*EmployeeCreate) SetNillableUpdatedAt ¶
func (ec *EmployeeCreate) SetNillableUpdatedAt(t *time.Time) *EmployeeCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*EmployeeCreate) SetUpdatedAt ¶
func (ec *EmployeeCreate) SetUpdatedAt(t time.Time) *EmployeeCreate
SetUpdatedAt sets the "updated_at" field.
type EmployeeCreateBulk ¶
type EmployeeCreateBulk struct {
// contains filtered or unexported fields
}
EmployeeCreateBulk is the builder for creating many Employee entities in bulk.
func (*EmployeeCreateBulk) Exec ¶
func (ecb *EmployeeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EmployeeCreateBulk) ExecX ¶
func (ecb *EmployeeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeCreateBulk) OnConflict ¶
func (ecb *EmployeeCreateBulk) OnConflict(opts ...sql.ConflictOption) *EmployeeUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Employee.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.EmployeeUpsert) { SetBirthDate(v+v). }). Exec(ctx)
func (*EmployeeCreateBulk) OnConflictColumns ¶
func (ecb *EmployeeCreateBulk) OnConflictColumns(columns ...string) *EmployeeUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Employee.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type EmployeeDelete ¶
type EmployeeDelete struct {
// contains filtered or unexported fields
}
EmployeeDelete is the builder for deleting a Employee entity.
func (*EmployeeDelete) Exec ¶
func (ed *EmployeeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EmployeeDelete) ExecX ¶
func (ed *EmployeeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeDelete) Where ¶
func (ed *EmployeeDelete) Where(ps ...predicate.Employee) *EmployeeDelete
Where appends a list predicates to the EmployeeDelete builder.
type EmployeeDeleteOne ¶
type EmployeeDeleteOne struct {
// contains filtered or unexported fields
}
EmployeeDeleteOne is the builder for deleting a single Employee entity.
func (*EmployeeDeleteOne) Exec ¶
func (edo *EmployeeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EmployeeDeleteOne) ExecX ¶
func (edo *EmployeeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeDeleteOne) Where ¶
func (edo *EmployeeDeleteOne) Where(ps ...predicate.Employee) *EmployeeDeleteOne
Where appends a list predicates to the EmployeeDelete builder.
type EmployeeEdges ¶
type EmployeeEdges struct { // DeptManager holds the value of the dept_manager edge. DeptManager []*DeptManager `json:"dept_manager,omitempty"` // contains filtered or unexported fields }
EmployeeEdges holds the relations/edges for other nodes in the graph.
func (EmployeeEdges) DeptManagerOrErr ¶
func (e EmployeeEdges) DeptManagerOrErr() ([]*DeptManager, error)
DeptManagerOrErr returns the DeptManager value or an error if the edge was not loaded in eager-loading.
type EmployeeGroupBy ¶
type EmployeeGroupBy struct {
// contains filtered or unexported fields
}
EmployeeGroupBy is the group-by builder for Employee entities.
func (*EmployeeGroupBy) Aggregate ¶
func (egb *EmployeeGroupBy) Aggregate(fns ...AggregateFunc) *EmployeeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EmployeeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EmployeeGroupBy) Scan ¶
func (egb *EmployeeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EmployeeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EmployeeMutation ¶
type EmployeeMutation struct {
// contains filtered or unexported fields
}
EmployeeMutation represents an operation that mutates the Employee nodes in the graph.
func (*EmployeeMutation) AddDeptManagerIDs ¶
func (m *EmployeeMutation) AddDeptManagerIDs(ids ...int)
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by ids.
func (*EmployeeMutation) AddField ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) AddedEdges ¶
func (m *EmployeeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EmployeeMutation) AddedField ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) AddedFields ¶
func (m *EmployeeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*EmployeeMutation) AddedIDs ¶
func (m *EmployeeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*EmployeeMutation) BirthDate ¶
func (m *EmployeeMutation) BirthDate() (r time.Time, exists bool)
BirthDate returns the value of the "birth_date" field in the mutation.
func (*EmployeeMutation) ClearDeletedAt ¶
func (m *EmployeeMutation) ClearDeletedAt()
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeMutation) ClearDeptManager ¶
func (m *EmployeeMutation) ClearDeptManager()
ClearDeptManager clears the "dept_manager" edge to the DeptManager entity.
func (*EmployeeMutation) ClearEdge ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) ClearField ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) ClearedEdges ¶
func (m *EmployeeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EmployeeMutation) ClearedFields ¶
func (m *EmployeeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EmployeeMutation) Client ¶
func (m EmployeeMutation) 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 (*EmployeeMutation) CreatedAt ¶
func (m *EmployeeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*EmployeeMutation) DeletedAt ¶
func (m *EmployeeMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*EmployeeMutation) DeletedAtCleared ¶
func (m *EmployeeMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
func (*EmployeeMutation) DeptManagerCleared ¶
func (m *EmployeeMutation) DeptManagerCleared() bool
DeptManagerCleared reports if the "dept_manager" edge to the DeptManager entity was cleared.
func (*EmployeeMutation) DeptManagerIDs ¶
func (m *EmployeeMutation) DeptManagerIDs() (ids []int)
DeptManagerIDs returns the "dept_manager" edge IDs in the mutation.
func (*EmployeeMutation) EdgeCleared ¶
func (m *EmployeeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*EmployeeMutation) Field ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) FieldCleared ¶
func (m *EmployeeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*EmployeeMutation) Fields ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) FirstName ¶
func (m *EmployeeMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "first_name" field in the mutation.
func (*EmployeeMutation) Gender ¶
func (m *EmployeeMutation) Gender() (r employee.Gender, exists bool)
Gender returns the value of the "gender" field in the mutation.
func (*EmployeeMutation) HireDate ¶
func (m *EmployeeMutation) HireDate() (r time.Time, exists bool)
HireDate returns the value of the "hire_date" field in the mutation.
func (*EmployeeMutation) ID ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) IDs ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) LastName ¶
func (m *EmployeeMutation) LastName() (r string, exists bool)
LastName returns the value of the "last_name" field in the mutation.
func (*EmployeeMutation) OldBirthDate ¶
OldBirthDate returns the old "birth_date" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldDeletedAt ¶
OldDeletedAt returns the old "deleted_at" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) 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 (*EmployeeMutation) OldFirstName ¶
func (m *EmployeeMutation) OldFirstName(ctx context.Context) (v string, err error)
OldFirstName returns the old "first_name" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldGender ¶
OldGender returns the old "gender" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldHireDate ¶
OldHireDate returns the old "hire_date" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldLastName ¶
func (m *EmployeeMutation) OldLastName(ctx context.Context) (v string, err error)
OldLastName returns the old "last_name" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Employee entity. If the Employee 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 (*EmployeeMutation) RemoveDeptManagerIDs ¶
func (m *EmployeeMutation) RemoveDeptManagerIDs(ids ...int)
RemoveDeptManagerIDs removes the "dept_manager" edge to the DeptManager entity by IDs.
func (*EmployeeMutation) RemovedDeptManagerIDs ¶
func (m *EmployeeMutation) RemovedDeptManagerIDs() (ids []int)
RemovedDeptManager returns the removed IDs of the "dept_manager" edge to the DeptManager entity.
func (*EmployeeMutation) RemovedEdges ¶
func (m *EmployeeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EmployeeMutation) RemovedIDs ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetBirthDate ¶
func (m *EmployeeMutation) ResetBirthDate()
ResetBirthDate resets all changes to the "birth_date" field.
func (*EmployeeMutation) ResetCreatedAt ¶
func (m *EmployeeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*EmployeeMutation) ResetDeletedAt ¶
func (m *EmployeeMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*EmployeeMutation) ResetDeptManager ¶
func (m *EmployeeMutation) ResetDeptManager()
ResetDeptManager resets all changes to the "dept_manager" edge.
func (*EmployeeMutation) ResetEdge ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetField ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) ResetFirstName ¶
func (m *EmployeeMutation) ResetFirstName()
ResetFirstName resets all changes to the "first_name" field.
func (*EmployeeMutation) ResetGender ¶
func (m *EmployeeMutation) ResetGender()
ResetGender resets all changes to the "gender" field.
func (*EmployeeMutation) ResetHireDate ¶
func (m *EmployeeMutation) ResetHireDate()
ResetHireDate resets all changes to the "hire_date" field.
func (*EmployeeMutation) ResetLastName ¶
func (m *EmployeeMutation) ResetLastName()
ResetLastName resets all changes to the "last_name" field.
func (*EmployeeMutation) ResetUpdatedAt ¶
func (m *EmployeeMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*EmployeeMutation) SetBirthDate ¶
func (m *EmployeeMutation) SetBirthDate(t time.Time)
SetBirthDate sets the "birth_date" field.
func (*EmployeeMutation) SetCreatedAt ¶
func (m *EmployeeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*EmployeeMutation) SetDeletedAt ¶
func (m *EmployeeMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeMutation) SetField ¶
func (m *EmployeeMutation) 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 (*EmployeeMutation) SetFirstName ¶
func (m *EmployeeMutation) SetFirstName(s string)
SetFirstName sets the "first_name" field.
func (*EmployeeMutation) SetGender ¶
func (m *EmployeeMutation) SetGender(e employee.Gender)
SetGender sets the "gender" field.
func (*EmployeeMutation) SetHireDate ¶
func (m *EmployeeMutation) SetHireDate(t time.Time)
SetHireDate sets the "hire_date" field.
func (*EmployeeMutation) SetLastName ¶
func (m *EmployeeMutation) SetLastName(s string)
SetLastName sets the "last_name" field.
func (*EmployeeMutation) SetOp ¶
func (m *EmployeeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*EmployeeMutation) SetUpdatedAt ¶
func (m *EmployeeMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (EmployeeMutation) Tx ¶
func (m EmployeeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EmployeeMutation) Type ¶
func (m *EmployeeMutation) Type() string
Type returns the node type of this mutation (Employee).
func (*EmployeeMutation) UpdatedAt ¶
func (m *EmployeeMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*EmployeeMutation) Where ¶
func (m *EmployeeMutation) Where(ps ...predicate.Employee)
Where appends a list predicates to the EmployeeMutation builder.
func (*EmployeeMutation) WhereP ¶
func (m *EmployeeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the EmployeeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type EmployeeQuery ¶
type EmployeeQuery struct {
// contains filtered or unexported fields
}
EmployeeQuery is the builder for querying Employee entities.
func (*EmployeeQuery) Aggregate ¶
func (eq *EmployeeQuery) Aggregate(fns ...AggregateFunc) *EmployeeSelect
Aggregate returns a EmployeeSelect configured with the given aggregations.
func (*EmployeeQuery) All ¶
func (eq *EmployeeQuery) All(ctx context.Context) ([]*Employee, error)
All executes the query and returns a list of Employees.
func (*EmployeeQuery) AllX ¶
func (eq *EmployeeQuery) AllX(ctx context.Context) []*Employee
AllX is like All, but panics if an error occurs.
func (*EmployeeQuery) Clone ¶
func (eq *EmployeeQuery) Clone() *EmployeeQuery
Clone returns a duplicate of the EmployeeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EmployeeQuery) Count ¶
func (eq *EmployeeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EmployeeQuery) CountX ¶
func (eq *EmployeeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EmployeeQuery) Exist ¶
func (eq *EmployeeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EmployeeQuery) ExistX ¶
func (eq *EmployeeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EmployeeQuery) First ¶
func (eq *EmployeeQuery) First(ctx context.Context) (*Employee, error)
First returns the first Employee entity from the query. Returns a *NotFoundError when no Employee was found.
func (*EmployeeQuery) FirstID ¶
func (eq *EmployeeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Employee ID from the query. Returns a *NotFoundError when no Employee ID was found.
func (*EmployeeQuery) FirstIDX ¶
func (eq *EmployeeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*EmployeeQuery) FirstX ¶
func (eq *EmployeeQuery) FirstX(ctx context.Context) *Employee
FirstX is like First, but panics if an error occurs.
func (*EmployeeQuery) GroupBy ¶
func (eq *EmployeeQuery) GroupBy(field string, fields ...string) *EmployeeGroupBy
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 { BirthDate time.Time `json:"birth_date,omitempty"` Count int `json:"count,omitempty"` } client.Employee.Query(). GroupBy(employee.FieldBirthDate). Aggregate(ent.Count()). Scan(ctx, &v)
func (*EmployeeQuery) IDs ¶
func (eq *EmployeeQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Employee IDs.
func (*EmployeeQuery) IDsX ¶
func (eq *EmployeeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*EmployeeQuery) Limit ¶
func (eq *EmployeeQuery) Limit(limit int) *EmployeeQuery
Limit the number of records to be returned by this query.
func (*EmployeeQuery) Offset ¶
func (eq *EmployeeQuery) Offset(offset int) *EmployeeQuery
Offset to start from.
func (*EmployeeQuery) Only ¶
func (eq *EmployeeQuery) Only(ctx context.Context) (*Employee, error)
Only returns a single Employee entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Employee entity is found. Returns a *NotFoundError when no Employee entities are found.
func (*EmployeeQuery) OnlyID ¶
func (eq *EmployeeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Employee ID in the query. Returns a *NotSingularError when more than one Employee ID is found. Returns a *NotFoundError when no entities are found.
func (*EmployeeQuery) OnlyIDX ¶
func (eq *EmployeeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EmployeeQuery) OnlyX ¶
func (eq *EmployeeQuery) OnlyX(ctx context.Context) *Employee
OnlyX is like Only, but panics if an error occurs.
func (*EmployeeQuery) Order ¶
func (eq *EmployeeQuery) Order(o ...employee.OrderOption) *EmployeeQuery
Order specifies how the records should be ordered.
func (*EmployeeQuery) QueryDeptManager ¶
func (eq *EmployeeQuery) QueryDeptManager() *DeptManagerQuery
QueryDeptManager chains the current query on the "dept_manager" edge.
func (*EmployeeQuery) Select ¶
func (eq *EmployeeQuery) Select(fields ...string) *EmployeeSelect
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 { BirthDate time.Time `json:"birth_date,omitempty"` } client.Employee.Query(). Select(employee.FieldBirthDate). Scan(ctx, &v)
func (*EmployeeQuery) Unique ¶
func (eq *EmployeeQuery) Unique(unique bool) *EmployeeQuery
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 (*EmployeeQuery) Where ¶
func (eq *EmployeeQuery) Where(ps ...predicate.Employee) *EmployeeQuery
Where adds a new predicate for the EmployeeQuery builder.
func (*EmployeeQuery) WithDeptManager ¶
func (eq *EmployeeQuery) WithDeptManager(opts ...func(*DeptManagerQuery)) *EmployeeQuery
WithDeptManager tells the query-builder to eager-load the nodes that are connected to the "dept_manager" edge. The optional arguments are used to configure the query builder of the edge.
type EmployeeSelect ¶
type EmployeeSelect struct { *EmployeeQuery // contains filtered or unexported fields }
EmployeeSelect is the builder for selecting fields of Employee entities.
func (*EmployeeSelect) Aggregate ¶
func (es *EmployeeSelect) Aggregate(fns ...AggregateFunc) *EmployeeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*EmployeeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EmployeeSelect) Scan ¶
func (es *EmployeeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*EmployeeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type EmployeeUpdate ¶
type EmployeeUpdate struct {
// contains filtered or unexported fields
}
EmployeeUpdate is the builder for updating Employee entities.
func (*EmployeeUpdate) AddDeptManager ¶
func (eu *EmployeeUpdate) AddDeptManager(d ...*DeptManager) *EmployeeUpdate
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*EmployeeUpdate) AddDeptManagerIDs ¶
func (eu *EmployeeUpdate) AddDeptManagerIDs(ids ...int) *EmployeeUpdate
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by IDs.
func (*EmployeeUpdate) ClearDeletedAt ¶
func (eu *EmployeeUpdate) ClearDeletedAt() *EmployeeUpdate
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeUpdate) ClearDeptManager ¶
func (eu *EmployeeUpdate) ClearDeptManager() *EmployeeUpdate
ClearDeptManager clears all "dept_manager" edges to the DeptManager entity.
func (*EmployeeUpdate) Exec ¶
func (eu *EmployeeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EmployeeUpdate) ExecX ¶
func (eu *EmployeeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeUpdate) Mutation ¶
func (eu *EmployeeUpdate) Mutation() *EmployeeMutation
Mutation returns the EmployeeMutation object of the builder.
func (*EmployeeUpdate) RemoveDeptManager ¶
func (eu *EmployeeUpdate) RemoveDeptManager(d ...*DeptManager) *EmployeeUpdate
RemoveDeptManager removes "dept_manager" edges to DeptManager entities.
func (*EmployeeUpdate) RemoveDeptManagerIDs ¶
func (eu *EmployeeUpdate) RemoveDeptManagerIDs(ids ...int) *EmployeeUpdate
RemoveDeptManagerIDs removes the "dept_manager" edge to DeptManager entities by IDs.
func (*EmployeeUpdate) Save ¶
func (eu *EmployeeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EmployeeUpdate) SaveX ¶
func (eu *EmployeeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EmployeeUpdate) SetBirthDate ¶
func (eu *EmployeeUpdate) SetBirthDate(t time.Time) *EmployeeUpdate
SetBirthDate sets the "birth_date" field.
func (*EmployeeUpdate) SetCreatedAt ¶
func (eu *EmployeeUpdate) SetCreatedAt(t time.Time) *EmployeeUpdate
SetCreatedAt sets the "created_at" field.
func (*EmployeeUpdate) SetDeletedAt ¶
func (eu *EmployeeUpdate) SetDeletedAt(t time.Time) *EmployeeUpdate
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeUpdate) SetFirstName ¶
func (eu *EmployeeUpdate) SetFirstName(s string) *EmployeeUpdate
SetFirstName sets the "first_name" field.
func (*EmployeeUpdate) SetGender ¶
func (eu *EmployeeUpdate) SetGender(e employee.Gender) *EmployeeUpdate
SetGender sets the "gender" field.
func (*EmployeeUpdate) SetHireDate ¶
func (eu *EmployeeUpdate) SetHireDate(t time.Time) *EmployeeUpdate
SetHireDate sets the "hire_date" field.
func (*EmployeeUpdate) SetLastName ¶
func (eu *EmployeeUpdate) SetLastName(s string) *EmployeeUpdate
SetLastName sets the "last_name" field.
func (*EmployeeUpdate) SetNillableCreatedAt ¶
func (eu *EmployeeUpdate) SetNillableCreatedAt(t *time.Time) *EmployeeUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*EmployeeUpdate) SetNillableDeletedAt ¶
func (eu *EmployeeUpdate) SetNillableDeletedAt(t *time.Time) *EmployeeUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*EmployeeUpdate) SetNillableUpdatedAt ¶
func (eu *EmployeeUpdate) SetNillableUpdatedAt(t *time.Time) *EmployeeUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*EmployeeUpdate) SetUpdatedAt ¶
func (eu *EmployeeUpdate) SetUpdatedAt(t time.Time) *EmployeeUpdate
SetUpdatedAt sets the "updated_at" field.
func (*EmployeeUpdate) Where ¶
func (eu *EmployeeUpdate) Where(ps ...predicate.Employee) *EmployeeUpdate
Where appends a list predicates to the EmployeeUpdate builder.
type EmployeeUpdateOne ¶
type EmployeeUpdateOne struct {
// contains filtered or unexported fields
}
EmployeeUpdateOne is the builder for updating a single Employee entity.
func (*EmployeeUpdateOne) AddDeptManager ¶
func (euo *EmployeeUpdateOne) AddDeptManager(d ...*DeptManager) *EmployeeUpdateOne
AddDeptManager adds the "dept_manager" edges to the DeptManager entity.
func (*EmployeeUpdateOne) AddDeptManagerIDs ¶
func (euo *EmployeeUpdateOne) AddDeptManagerIDs(ids ...int) *EmployeeUpdateOne
AddDeptManagerIDs adds the "dept_manager" edge to the DeptManager entity by IDs.
func (*EmployeeUpdateOne) ClearDeletedAt ¶
func (euo *EmployeeUpdateOne) ClearDeletedAt() *EmployeeUpdateOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeUpdateOne) ClearDeptManager ¶
func (euo *EmployeeUpdateOne) ClearDeptManager() *EmployeeUpdateOne
ClearDeptManager clears all "dept_manager" edges to the DeptManager entity.
func (*EmployeeUpdateOne) Exec ¶
func (euo *EmployeeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EmployeeUpdateOne) ExecX ¶
func (euo *EmployeeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeUpdateOne) Mutation ¶
func (euo *EmployeeUpdateOne) Mutation() *EmployeeMutation
Mutation returns the EmployeeMutation object of the builder.
func (*EmployeeUpdateOne) RemoveDeptManager ¶
func (euo *EmployeeUpdateOne) RemoveDeptManager(d ...*DeptManager) *EmployeeUpdateOne
RemoveDeptManager removes "dept_manager" edges to DeptManager entities.
func (*EmployeeUpdateOne) RemoveDeptManagerIDs ¶
func (euo *EmployeeUpdateOne) RemoveDeptManagerIDs(ids ...int) *EmployeeUpdateOne
RemoveDeptManagerIDs removes the "dept_manager" edge to DeptManager entities by IDs.
func (*EmployeeUpdateOne) Save ¶
func (euo *EmployeeUpdateOne) Save(ctx context.Context) (*Employee, error)
Save executes the query and returns the updated Employee entity.
func (*EmployeeUpdateOne) SaveX ¶
func (euo *EmployeeUpdateOne) SaveX(ctx context.Context) *Employee
SaveX is like Save, but panics if an error occurs.
func (*EmployeeUpdateOne) Select ¶
func (euo *EmployeeUpdateOne) Select(field string, fields ...string) *EmployeeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*EmployeeUpdateOne) SetBirthDate ¶
func (euo *EmployeeUpdateOne) SetBirthDate(t time.Time) *EmployeeUpdateOne
SetBirthDate sets the "birth_date" field.
func (*EmployeeUpdateOne) SetCreatedAt ¶
func (euo *EmployeeUpdateOne) SetCreatedAt(t time.Time) *EmployeeUpdateOne
SetCreatedAt sets the "created_at" field.
func (*EmployeeUpdateOne) SetDeletedAt ¶
func (euo *EmployeeUpdateOne) SetDeletedAt(t time.Time) *EmployeeUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeUpdateOne) SetFirstName ¶
func (euo *EmployeeUpdateOne) SetFirstName(s string) *EmployeeUpdateOne
SetFirstName sets the "first_name" field.
func (*EmployeeUpdateOne) SetGender ¶
func (euo *EmployeeUpdateOne) SetGender(e employee.Gender) *EmployeeUpdateOne
SetGender sets the "gender" field.
func (*EmployeeUpdateOne) SetHireDate ¶
func (euo *EmployeeUpdateOne) SetHireDate(t time.Time) *EmployeeUpdateOne
SetHireDate sets the "hire_date" field.
func (*EmployeeUpdateOne) SetLastName ¶
func (euo *EmployeeUpdateOne) SetLastName(s string) *EmployeeUpdateOne
SetLastName sets the "last_name" field.
func (*EmployeeUpdateOne) SetNillableCreatedAt ¶
func (euo *EmployeeUpdateOne) SetNillableCreatedAt(t *time.Time) *EmployeeUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*EmployeeUpdateOne) SetNillableDeletedAt ¶
func (euo *EmployeeUpdateOne) SetNillableDeletedAt(t *time.Time) *EmployeeUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*EmployeeUpdateOne) SetNillableUpdatedAt ¶
func (euo *EmployeeUpdateOne) SetNillableUpdatedAt(t *time.Time) *EmployeeUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*EmployeeUpdateOne) SetUpdatedAt ¶
func (euo *EmployeeUpdateOne) SetUpdatedAt(t time.Time) *EmployeeUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*EmployeeUpdateOne) Where ¶
func (euo *EmployeeUpdateOne) Where(ps ...predicate.Employee) *EmployeeUpdateOne
Where appends a list predicates to the EmployeeUpdate builder.
type EmployeeUpsert ¶
EmployeeUpsert is the "OnConflict" setter.
func (*EmployeeUpsert) ClearDeletedAt ¶
func (u *EmployeeUpsert) ClearDeletedAt() *EmployeeUpsert
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeUpsert) SetBirthDate ¶
func (u *EmployeeUpsert) SetBirthDate(v time.Time) *EmployeeUpsert
SetBirthDate sets the "birth_date" field.
func (*EmployeeUpsert) SetCreatedAt ¶
func (u *EmployeeUpsert) SetCreatedAt(v time.Time) *EmployeeUpsert
SetCreatedAt sets the "created_at" field.
func (*EmployeeUpsert) SetDeletedAt ¶
func (u *EmployeeUpsert) SetDeletedAt(v time.Time) *EmployeeUpsert
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeUpsert) SetFirstName ¶
func (u *EmployeeUpsert) SetFirstName(v string) *EmployeeUpsert
SetFirstName sets the "first_name" field.
func (*EmployeeUpsert) SetGender ¶
func (u *EmployeeUpsert) SetGender(v employee.Gender) *EmployeeUpsert
SetGender sets the "gender" field.
func (*EmployeeUpsert) SetHireDate ¶
func (u *EmployeeUpsert) SetHireDate(v time.Time) *EmployeeUpsert
SetHireDate sets the "hire_date" field.
func (*EmployeeUpsert) SetLastName ¶
func (u *EmployeeUpsert) SetLastName(v string) *EmployeeUpsert
SetLastName sets the "last_name" field.
func (*EmployeeUpsert) SetUpdatedAt ¶
func (u *EmployeeUpsert) SetUpdatedAt(v time.Time) *EmployeeUpsert
SetUpdatedAt sets the "updated_at" field.
func (*EmployeeUpsert) UpdateBirthDate ¶
func (u *EmployeeUpsert) UpdateBirthDate() *EmployeeUpsert
UpdateBirthDate sets the "birth_date" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateCreatedAt ¶
func (u *EmployeeUpsert) UpdateCreatedAt() *EmployeeUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateDeletedAt ¶
func (u *EmployeeUpsert) UpdateDeletedAt() *EmployeeUpsert
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateFirstName ¶
func (u *EmployeeUpsert) UpdateFirstName() *EmployeeUpsert
UpdateFirstName sets the "first_name" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateGender ¶
func (u *EmployeeUpsert) UpdateGender() *EmployeeUpsert
UpdateGender sets the "gender" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateHireDate ¶
func (u *EmployeeUpsert) UpdateHireDate() *EmployeeUpsert
UpdateHireDate sets the "hire_date" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateLastName ¶
func (u *EmployeeUpsert) UpdateLastName() *EmployeeUpsert
UpdateLastName sets the "last_name" field to the value that was provided on create.
func (*EmployeeUpsert) UpdateUpdatedAt ¶
func (u *EmployeeUpsert) UpdateUpdatedAt() *EmployeeUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type EmployeeUpsertBulk ¶
type EmployeeUpsertBulk struct {
// contains filtered or unexported fields
}
EmployeeUpsertBulk is the builder for "upsert"-ing a bulk of Employee nodes.
func (*EmployeeUpsertBulk) ClearDeletedAt ¶
func (u *EmployeeUpsertBulk) ClearDeletedAt() *EmployeeUpsertBulk
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeUpsertBulk) DoNothing ¶
func (u *EmployeeUpsertBulk) DoNothing() *EmployeeUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*EmployeeUpsertBulk) Exec ¶
func (u *EmployeeUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EmployeeUpsertBulk) ExecX ¶
func (u *EmployeeUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeUpsertBulk) Ignore ¶
func (u *EmployeeUpsertBulk) Ignore() *EmployeeUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Employee.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*EmployeeUpsertBulk) SetBirthDate ¶
func (u *EmployeeUpsertBulk) SetBirthDate(v time.Time) *EmployeeUpsertBulk
SetBirthDate sets the "birth_date" field.
func (*EmployeeUpsertBulk) SetCreatedAt ¶
func (u *EmployeeUpsertBulk) SetCreatedAt(v time.Time) *EmployeeUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*EmployeeUpsertBulk) SetDeletedAt ¶
func (u *EmployeeUpsertBulk) SetDeletedAt(v time.Time) *EmployeeUpsertBulk
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeUpsertBulk) SetFirstName ¶
func (u *EmployeeUpsertBulk) SetFirstName(v string) *EmployeeUpsertBulk
SetFirstName sets the "first_name" field.
func (*EmployeeUpsertBulk) SetGender ¶
func (u *EmployeeUpsertBulk) SetGender(v employee.Gender) *EmployeeUpsertBulk
SetGender sets the "gender" field.
func (*EmployeeUpsertBulk) SetHireDate ¶
func (u *EmployeeUpsertBulk) SetHireDate(v time.Time) *EmployeeUpsertBulk
SetHireDate sets the "hire_date" field.
func (*EmployeeUpsertBulk) SetLastName ¶
func (u *EmployeeUpsertBulk) SetLastName(v string) *EmployeeUpsertBulk
SetLastName sets the "last_name" field.
func (*EmployeeUpsertBulk) SetUpdatedAt ¶
func (u *EmployeeUpsertBulk) SetUpdatedAt(v time.Time) *EmployeeUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*EmployeeUpsertBulk) Update ¶
func (u *EmployeeUpsertBulk) Update(set func(*EmployeeUpsert)) *EmployeeUpsertBulk
Update allows overriding fields `UPDATE` values. See the EmployeeCreateBulk.OnConflict documentation for more info.
func (*EmployeeUpsertBulk) UpdateBirthDate ¶
func (u *EmployeeUpsertBulk) UpdateBirthDate() *EmployeeUpsertBulk
UpdateBirthDate sets the "birth_date" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateCreatedAt ¶
func (u *EmployeeUpsertBulk) UpdateCreatedAt() *EmployeeUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateDeletedAt ¶
func (u *EmployeeUpsertBulk) UpdateDeletedAt() *EmployeeUpsertBulk
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateFirstName ¶
func (u *EmployeeUpsertBulk) UpdateFirstName() *EmployeeUpsertBulk
UpdateFirstName sets the "first_name" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateGender ¶
func (u *EmployeeUpsertBulk) UpdateGender() *EmployeeUpsertBulk
UpdateGender sets the "gender" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateHireDate ¶
func (u *EmployeeUpsertBulk) UpdateHireDate() *EmployeeUpsertBulk
UpdateHireDate sets the "hire_date" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateLastName ¶
func (u *EmployeeUpsertBulk) UpdateLastName() *EmployeeUpsertBulk
UpdateLastName sets the "last_name" field to the value that was provided on create.
func (*EmployeeUpsertBulk) UpdateNewValues ¶
func (u *EmployeeUpsertBulk) UpdateNewValues() *EmployeeUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Employee.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*EmployeeUpsertBulk) UpdateUpdatedAt ¶
func (u *EmployeeUpsertBulk) UpdateUpdatedAt() *EmployeeUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type EmployeeUpsertOne ¶
type EmployeeUpsertOne struct {
// contains filtered or unexported fields
}
EmployeeUpsertOne is the builder for "upsert"-ing
one Employee node.
func (*EmployeeUpsertOne) ClearDeletedAt ¶
func (u *EmployeeUpsertOne) ClearDeletedAt() *EmployeeUpsertOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*EmployeeUpsertOne) DoNothing ¶
func (u *EmployeeUpsertOne) DoNothing() *EmployeeUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*EmployeeUpsertOne) Exec ¶
func (u *EmployeeUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*EmployeeUpsertOne) ExecX ¶
func (u *EmployeeUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EmployeeUpsertOne) ID ¶
func (u *EmployeeUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*EmployeeUpsertOne) IDX ¶
func (u *EmployeeUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*EmployeeUpsertOne) Ignore ¶
func (u *EmployeeUpsertOne) Ignore() *EmployeeUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Employee.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*EmployeeUpsertOne) SetBirthDate ¶
func (u *EmployeeUpsertOne) SetBirthDate(v time.Time) *EmployeeUpsertOne
SetBirthDate sets the "birth_date" field.
func (*EmployeeUpsertOne) SetCreatedAt ¶
func (u *EmployeeUpsertOne) SetCreatedAt(v time.Time) *EmployeeUpsertOne
SetCreatedAt sets the "created_at" field.
func (*EmployeeUpsertOne) SetDeletedAt ¶
func (u *EmployeeUpsertOne) SetDeletedAt(v time.Time) *EmployeeUpsertOne
SetDeletedAt sets the "deleted_at" field.
func (*EmployeeUpsertOne) SetFirstName ¶
func (u *EmployeeUpsertOne) SetFirstName(v string) *EmployeeUpsertOne
SetFirstName sets the "first_name" field.
func (*EmployeeUpsertOne) SetGender ¶
func (u *EmployeeUpsertOne) SetGender(v employee.Gender) *EmployeeUpsertOne
SetGender sets the "gender" field.
func (*EmployeeUpsertOne) SetHireDate ¶
func (u *EmployeeUpsertOne) SetHireDate(v time.Time) *EmployeeUpsertOne
SetHireDate sets the "hire_date" field.
func (*EmployeeUpsertOne) SetLastName ¶
func (u *EmployeeUpsertOne) SetLastName(v string) *EmployeeUpsertOne
SetLastName sets the "last_name" field.
func (*EmployeeUpsertOne) SetUpdatedAt ¶
func (u *EmployeeUpsertOne) SetUpdatedAt(v time.Time) *EmployeeUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*EmployeeUpsertOne) Update ¶
func (u *EmployeeUpsertOne) Update(set func(*EmployeeUpsert)) *EmployeeUpsertOne
Update allows overriding fields `UPDATE` values. See the EmployeeCreate.OnConflict documentation for more info.
func (*EmployeeUpsertOne) UpdateBirthDate ¶
func (u *EmployeeUpsertOne) UpdateBirthDate() *EmployeeUpsertOne
UpdateBirthDate sets the "birth_date" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateCreatedAt ¶
func (u *EmployeeUpsertOne) UpdateCreatedAt() *EmployeeUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateDeletedAt ¶
func (u *EmployeeUpsertOne) UpdateDeletedAt() *EmployeeUpsertOne
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateFirstName ¶
func (u *EmployeeUpsertOne) UpdateFirstName() *EmployeeUpsertOne
UpdateFirstName sets the "first_name" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateGender ¶
func (u *EmployeeUpsertOne) UpdateGender() *EmployeeUpsertOne
UpdateGender sets the "gender" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateHireDate ¶
func (u *EmployeeUpsertOne) UpdateHireDate() *EmployeeUpsertOne
UpdateHireDate sets the "hire_date" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateLastName ¶
func (u *EmployeeUpsertOne) UpdateLastName() *EmployeeUpsertOne
UpdateLastName sets the "last_name" field to the value that was provided on create.
func (*EmployeeUpsertOne) UpdateNewValues ¶
func (u *EmployeeUpsertOne) UpdateNewValues() *EmployeeUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Employee.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*EmployeeUpsertOne) UpdateUpdatedAt ¶
func (u *EmployeeUpsertOne) UpdateUpdatedAt() *EmployeeUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Department is the client for interacting with the Department builders. Department *DepartmentClient // DeptManager is the client for interacting with the DeptManager builders. DeptManager *DeptManagerClient // Employee is the client for interacting with the Employee builders. Employee *EmployeeClient // 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 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 ¶
- client.go
- department.go
- department_create.go
- department_delete.go
- department_query.go
- department_update.go
- deptmanager.go
- deptmanager_create.go
- deptmanager_delete.go
- deptmanager_query.go
- deptmanager_update.go
- employee.go
- employee_create.go
- employee_delete.go
- employee_query.go
- employee_update.go
- ent.go
- generate.go
- mutation.go
- runtime.go
- tx.go