Versions in this module Expand all Collapse all v0 v0.1.1 Nov 20, 2026 v0.1.0 Nov 20, 2026 Changes in this version + const OpCreate + const OpDelete + const OpDeleteOne + const OpUpdate + const OpUpdateOne + const TypeUser + var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction") + 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 func(*sql.Selector) string + func As(fn AggregateFunc, end string) AggregateFunc + func Count() AggregateFunc + func Max(field string) AggregateFunc + func Mean(field string) AggregateFunc + func Min(field string) AggregateFunc + func Sum(field string) AggregateFunc + type Client struct + Schema *migrate.Schema + User *UserClient + func FromContext(ctx context.Context) *Client + func NewClient(opts ...Option) *Client + func Open(driverName, dataSourceName string, options ...Option) (*Client, error) + 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 func(context.Context, *Tx) error + func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error + type CommitHook func(Committer) Committer + type Committer interface + Commit func(context.Context, *Tx) error + type ConstraintError struct + func (e *ConstraintError) Unwrap() error + func (e ConstraintError) Error() string + type Hook = ent.Hook + type InterceptFunc = ent.InterceptFunc + type Interceptor = ent.Interceptor + type MutateFunc = ent.MutateFunc + type Mutation = ent.Mutation + type Mutator = ent.Mutator + type NotFoundError struct + func (e *NotFoundError) Error() string + type NotLoadedError struct + func (e *NotLoadedError) Error() string + type NotSingularError struct + func (e *NotSingularError) Error() string + type Op = ent.Op + type Option func(*config) + func Debug() Option + func Driver(driver dialect.Driver) Option + func Log(fn func(...any)) Option + type OrderFunc func(*sql.Selector) + type Policy = ent.Policy + type Querier = ent.Querier + type QuerierFunc = ent.QuerierFunc + type Query = ent.Query + type QueryContext = ent.QueryContext + type RollbackFunc func(context.Context, *Tx) error + func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error + type RollbackHook func(Rollbacker) Rollbacker + type Rollbacker interface + Rollback func(context.Context, *Tx) error + type TraverseFunc = ent.TraverseFunc + type Traverser = ent.Traverser + type Tx struct + User *UserClient + func TxFromContext(ctx context.Context) *Tx + func (tx *Tx) Client() *Client + func (tx *Tx) Commit() error + func (tx *Tx) OnCommit(f CommitHook) + func (tx *Tx) OnRollback(f RollbackHook) + func (tx *Tx) Rollback() error + type User struct + Edges UserEdges + ID int + ManagerID int + Name string + func (_m *User) QueryManager() *UserQuery + func (_m *User) QueryReports() *UserQuery + func (_m *User) String() string + func (_m *User) Unwrap() *User + func (_m *User) Update() *UserUpdateOne + func (_m *User) Value(name string) (ent.Value, error) + type UserClient struct + func NewUserClient(c config) *UserClient + func (c *UserClient) Create() *UserCreate + func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk + func (c *UserClient) Delete() *UserDelete + func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne + func (c *UserClient) DeleteOneID(id int) *UserDeleteOne + func (c *UserClient) Get(ctx context.Context, id int) (*User, error) + func (c *UserClient) GetX(ctx context.Context, id int) *User + func (c *UserClient) Hooks() []Hook + func (c *UserClient) Intercept(interceptors ...Interceptor) + func (c *UserClient) Interceptors() []Interceptor + func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk + func (c *UserClient) Query() *UserQuery + func (c *UserClient) QueryManager(_m *User) *UserQuery + func (c *UserClient) QueryReports(_m *User) *UserQuery + func (c *UserClient) Update() *UserUpdate + func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne + func (c *UserClient) UpdateOneID(id int) *UserUpdateOne + func (c *UserClient) Use(hooks ...Hook) + type UserCreate struct + func (_c *UserCreate) AddReportIDs(ids ...int) *UserCreate + func (_c *UserCreate) AddReports(v ...*User) *UserCreate + func (_c *UserCreate) Exec(ctx context.Context) error + func (_c *UserCreate) ExecX(ctx context.Context) + func (_c *UserCreate) Mutation() *UserMutation + func (_c *UserCreate) Save(ctx context.Context) (*User, error) + func (_c *UserCreate) SaveX(ctx context.Context) *User + func (_c *UserCreate) SetManager(v *User) *UserCreate + func (_c *UserCreate) SetManagerID(v int) *UserCreate + func (_c *UserCreate) SetName(v string) *UserCreate + func (_c *UserCreate) SetNillableManagerID(v *int) *UserCreate + type UserCreateBulk struct + func (_c *UserCreateBulk) Exec(ctx context.Context) error + func (_c *UserCreateBulk) ExecX(ctx context.Context) + func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error) + func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User + type UserDelete struct + func (_d *UserDelete) Exec(ctx context.Context) (int, error) + func (_d *UserDelete) ExecX(ctx context.Context) int + func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete + type UserDeleteOne struct + func (_d *UserDeleteOne) Exec(ctx context.Context) error + func (_d *UserDeleteOne) ExecX(ctx context.Context) + func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne + type UserEdges struct + Manager *User + Reports []*User + func (e UserEdges) ManagerOrErr() (*User, error) + func (e UserEdges) ReportsOrErr() ([]*User, error) + type UserGroupBy struct + func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy + func (_g *UserGroupBy) Scan(ctx context.Context, v any) error + func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (s *UserGroupBy) BoolX(ctx context.Context) bool + func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error) + func (s *UserGroupBy) BoolsX(ctx context.Context) []bool + func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (s *UserGroupBy) Float64X(ctx context.Context) float64 + func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (s *UserGroupBy) Float64sX(ctx context.Context) []float64 + func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error) + func (s *UserGroupBy) IntX(ctx context.Context) int + func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error) + func (s *UserGroupBy) IntsX(ctx context.Context) []int + func (s *UserGroupBy) ScanX(ctx context.Context, v any) + func (s *UserGroupBy) String(ctx context.Context) (_ string, err error) + func (s *UserGroupBy) StringX(ctx context.Context) string + func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error) + func (s *UserGroupBy) StringsX(ctx context.Context) []string + type UserMutation struct + func (m *UserMutation) AddField(name string, value ent.Value) error + func (m *UserMutation) AddReportIDs(ids ...int) + func (m *UserMutation) AddedEdges() []string + func (m *UserMutation) AddedField(name string) (ent.Value, bool) + func (m *UserMutation) AddedFields() []string + func (m *UserMutation) AddedIDs(name string) []ent.Value + func (m *UserMutation) ClearEdge(name string) error + func (m *UserMutation) ClearField(name string) error + func (m *UserMutation) ClearManager() + func (m *UserMutation) ClearManagerID() + func (m *UserMutation) ClearReports() + func (m *UserMutation) ClearedEdges() []string + func (m *UserMutation) ClearedFields() []string + func (m *UserMutation) EdgeCleared(name string) bool + func (m *UserMutation) Field(name string) (ent.Value, bool) + func (m *UserMutation) FieldCleared(name string) bool + func (m *UserMutation) Fields() []string + func (m *UserMutation) ID() (id int, exists bool) + func (m *UserMutation) IDs(ctx context.Context) ([]int, error) + func (m *UserMutation) ManagerCleared() bool + func (m *UserMutation) ManagerID() (r int, exists bool) + func (m *UserMutation) ManagerIDCleared() bool + func (m *UserMutation) ManagerIDs() (ids []int) + func (m *UserMutation) Name() (r string, exists bool) + func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *UserMutation) OldManagerID(ctx context.Context) (v int, err error) + func (m *UserMutation) OldName(ctx context.Context) (v string, err error) + func (m *UserMutation) Op() Op + func (m *UserMutation) RemoveReportIDs(ids ...int) + func (m *UserMutation) RemovedEdges() []string + func (m *UserMutation) RemovedIDs(name string) []ent.Value + func (m *UserMutation) RemovedReportsIDs() (ids []int) + func (m *UserMutation) ReportsCleared() bool + func (m *UserMutation) ReportsIDs() (ids []int) + func (m *UserMutation) ResetEdge(name string) error + func (m *UserMutation) ResetField(name string) error + func (m *UserMutation) ResetManager() + func (m *UserMutation) ResetManagerID() + func (m *UserMutation) ResetName() + func (m *UserMutation) ResetReports() + func (m *UserMutation) SetField(name string, value ent.Value) error + func (m *UserMutation) SetManagerID(i int) + func (m *UserMutation) SetName(s string) + func (m *UserMutation) SetOp(op Op) + func (m *UserMutation) Type() string + func (m *UserMutation) Where(ps ...predicate.User) + func (m *UserMutation) WhereP(ps ...func(*sql.Selector)) + func (m UserMutation) Client() *Client + func (m UserMutation) Tx() (*Tx, error) + type UserQuery struct + func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect + func (_q *UserQuery) All(ctx context.Context) ([]*User, error) + func (_q *UserQuery) AllX(ctx context.Context) []*User + func (_q *UserQuery) Clone() *UserQuery + func (_q *UserQuery) Count(ctx context.Context) (int, error) + func (_q *UserQuery) CountX(ctx context.Context) int + func (_q *UserQuery) Exist(ctx context.Context) (bool, error) + func (_q *UserQuery) ExistX(ctx context.Context) bool + func (_q *UserQuery) First(ctx context.Context) (*User, error) + func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error) + func (_q *UserQuery) FirstIDX(ctx context.Context) int + func (_q *UserQuery) FirstX(ctx context.Context) *User + func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy + func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error) + func (_q *UserQuery) IDsX(ctx context.Context) []int + func (_q *UserQuery) Limit(limit int) *UserQuery + func (_q *UserQuery) Offset(offset int) *UserQuery + func (_q *UserQuery) Only(ctx context.Context) (*User, error) + func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error) + func (_q *UserQuery) OnlyIDX(ctx context.Context) int + func (_q *UserQuery) OnlyX(ctx context.Context) *User + func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery + func (_q *UserQuery) QueryManager() *UserQuery + func (_q *UserQuery) QueryReports() *UserQuery + func (_q *UserQuery) Select(fields ...string) *UserSelect + func (_q *UserQuery) Unique(unique bool) *UserQuery + func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery + func (_q *UserQuery) WithManager(opts ...func(*UserQuery)) *UserQuery + func (_q *UserQuery) WithReports(opts ...func(*UserQuery)) *UserQuery + type UserSelect struct + func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect + func (_s *UserSelect) Scan(ctx context.Context, v any) error + func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error) + func (s *UserSelect) BoolX(ctx context.Context) bool + func (s *UserSelect) Bools(ctx context.Context) ([]bool, error) + func (s *UserSelect) BoolsX(ctx context.Context) []bool + func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error) + func (s *UserSelect) Float64X(ctx context.Context) float64 + func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error) + func (s *UserSelect) Float64sX(ctx context.Context) []float64 + func (s *UserSelect) Int(ctx context.Context) (_ int, err error) + func (s *UserSelect) IntX(ctx context.Context) int + func (s *UserSelect) Ints(ctx context.Context) ([]int, error) + func (s *UserSelect) IntsX(ctx context.Context) []int + func (s *UserSelect) ScanX(ctx context.Context, v any) + func (s *UserSelect) String(ctx context.Context) (_ string, err error) + func (s *UserSelect) StringX(ctx context.Context) string + func (s *UserSelect) Strings(ctx context.Context) ([]string, error) + func (s *UserSelect) StringsX(ctx context.Context) []string + type UserUpdate struct + func (_u *UserUpdate) AddReportIDs(ids ...int) *UserUpdate + func (_u *UserUpdate) AddReports(v ...*User) *UserUpdate + func (_u *UserUpdate) ClearManager() *UserUpdate + func (_u *UserUpdate) ClearManagerID() *UserUpdate + func (_u *UserUpdate) ClearReports() *UserUpdate + func (_u *UserUpdate) Exec(ctx context.Context) error + func (_u *UserUpdate) ExecX(ctx context.Context) + func (_u *UserUpdate) Mutation() *UserMutation + func (_u *UserUpdate) RemoveReportIDs(ids ...int) *UserUpdate + func (_u *UserUpdate) RemoveReports(v ...*User) *UserUpdate + func (_u *UserUpdate) Save(ctx context.Context) (int, error) + func (_u *UserUpdate) SaveX(ctx context.Context) int + func (_u *UserUpdate) SetManager(v *User) *UserUpdate + func (_u *UserUpdate) SetManagerID(v int) *UserUpdate + func (_u *UserUpdate) SetName(v string) *UserUpdate + func (_u *UserUpdate) SetNillableManagerID(v *int) *UserUpdate + func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate + func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate + type UserUpdateOne struct + func (_u *UserUpdateOne) AddReportIDs(ids ...int) *UserUpdateOne + func (_u *UserUpdateOne) AddReports(v ...*User) *UserUpdateOne + func (_u *UserUpdateOne) ClearManager() *UserUpdateOne + func (_u *UserUpdateOne) ClearManagerID() *UserUpdateOne + func (_u *UserUpdateOne) ClearReports() *UserUpdateOne + func (_u *UserUpdateOne) Exec(ctx context.Context) error + func (_u *UserUpdateOne) ExecX(ctx context.Context) + func (_u *UserUpdateOne) Mutation() *UserMutation + func (_u *UserUpdateOne) RemoveReportIDs(ids ...int) *UserUpdateOne + func (_u *UserUpdateOne) RemoveReports(v ...*User) *UserUpdateOne + func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error) + func (_u *UserUpdateOne) SaveX(ctx context.Context) *User + func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne + func (_u *UserUpdateOne) SetManager(v *User) *UserUpdateOne + func (_u *UserUpdateOne) SetManagerID(v int) *UserUpdateOne + func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne + func (_u *UserUpdateOne) SetNillableManagerID(v *int) *UserUpdateOne + func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne + func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne + type Users []*User + type ValidationError struct + Name string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Value = ent.Value