Versions in this module Expand all Collapse all v1 v1.0.215 Nov 11, 2023 v1.0.214 Nov 11, 2023 Changes in this version + const OpCreate + const OpDelete + const OpDeleteOne + const OpUpdate + const OpUpdateOne + const TypeTest + 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 + Test *TestClient + 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 Test struct + ID int + func (t *Test) String() string + func (t *Test) Unwrap() *Test + func (t *Test) Update() *TestUpdateOne + func (t *Test) Value(name string) (ent.Value, error) + type TestClient struct + func NewTestClient(c config) *TestClient + func (c *TestClient) Create() *TestCreate + func (c *TestClient) CreateBulk(builders ...*TestCreate) *TestCreateBulk + func (c *TestClient) Delete() *TestDelete + func (c *TestClient) DeleteOne(t *Test) *TestDeleteOne + func (c *TestClient) DeleteOneID(id int) *TestDeleteOne + func (c *TestClient) Get(ctx context.Context, id int) (*Test, error) + func (c *TestClient) GetX(ctx context.Context, id int) *Test + func (c *TestClient) Hooks() []Hook + func (c *TestClient) Intercept(interceptors ...Interceptor) + func (c *TestClient) Interceptors() []Interceptor + func (c *TestClient) MapCreateBulk(slice any, setFunc func(*TestCreate, int)) *TestCreateBulk + func (c *TestClient) Query() *TestQuery + func (c *TestClient) Update() *TestUpdate + func (c *TestClient) UpdateOne(t *Test) *TestUpdateOne + func (c *TestClient) UpdateOneID(id int) *TestUpdateOne + func (c *TestClient) Use(hooks ...Hook) + type TestCreate struct + func (tc *TestCreate) Exec(ctx context.Context) error + func (tc *TestCreate) ExecX(ctx context.Context) + func (tc *TestCreate) Mutation() *TestMutation + func (tc *TestCreate) Save(ctx context.Context) (*Test, error) + func (tc *TestCreate) SaveX(ctx context.Context) *Test + type TestCreateBulk struct + func (tcb *TestCreateBulk) Exec(ctx context.Context) error + func (tcb *TestCreateBulk) ExecX(ctx context.Context) + func (tcb *TestCreateBulk) Save(ctx context.Context) ([]*Test, error) + func (tcb *TestCreateBulk) SaveX(ctx context.Context) []*Test + type TestDelete struct + func (td *TestDelete) Exec(ctx context.Context) (int, error) + func (td *TestDelete) ExecX(ctx context.Context) int + func (td *TestDelete) Where(ps ...predicate.Test) *TestDelete + type TestDeleteOne struct + func (tdo *TestDeleteOne) Exec(ctx context.Context) error + func (tdo *TestDeleteOne) ExecX(ctx context.Context) + func (tdo *TestDeleteOne) Where(ps ...predicate.Test) *TestDeleteOne + type TestGroupBy struct + func (s *TestGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (s *TestGroupBy) BoolX(ctx context.Context) bool + func (s *TestGroupBy) Bools(ctx context.Context) ([]bool, error) + func (s *TestGroupBy) BoolsX(ctx context.Context) []bool + func (s *TestGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (s *TestGroupBy) Float64X(ctx context.Context) float64 + func (s *TestGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (s *TestGroupBy) Float64sX(ctx context.Context) []float64 + func (s *TestGroupBy) Int(ctx context.Context) (_ int, err error) + func (s *TestGroupBy) IntX(ctx context.Context) int + func (s *TestGroupBy) Ints(ctx context.Context) ([]int, error) + func (s *TestGroupBy) IntsX(ctx context.Context) []int + func (s *TestGroupBy) ScanX(ctx context.Context, v any) + func (s *TestGroupBy) String(ctx context.Context) (_ string, err error) + func (s *TestGroupBy) StringX(ctx context.Context) string + func (s *TestGroupBy) Strings(ctx context.Context) ([]string, error) + func (s *TestGroupBy) StringsX(ctx context.Context) []string + func (tgb *TestGroupBy) Aggregate(fns ...AggregateFunc) *TestGroupBy + func (tgb *TestGroupBy) Scan(ctx context.Context, v any) error + type TestMutation struct + func (m *TestMutation) AddField(name string, value ent.Value) error + func (m *TestMutation) AddedEdges() []string + func (m *TestMutation) AddedField(name string) (ent.Value, bool) + func (m *TestMutation) AddedFields() []string + func (m *TestMutation) AddedIDs(name string) []ent.Value + func (m *TestMutation) ClearEdge(name string) error + func (m *TestMutation) ClearField(name string) error + func (m *TestMutation) ClearedEdges() []string + func (m *TestMutation) ClearedFields() []string + func (m *TestMutation) EdgeCleared(name string) bool + func (m *TestMutation) Field(name string) (ent.Value, bool) + func (m *TestMutation) FieldCleared(name string) bool + func (m *TestMutation) Fields() []string + func (m *TestMutation) ID() (id int, exists bool) + func (m *TestMutation) IDs(ctx context.Context) ([]int, error) + func (m *TestMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *TestMutation) Op() Op + func (m *TestMutation) RemovedEdges() []string + func (m *TestMutation) RemovedIDs(name string) []ent.Value + func (m *TestMutation) ResetEdge(name string) error + func (m *TestMutation) ResetField(name string) error + func (m *TestMutation) SetField(name string, value ent.Value) error + func (m *TestMutation) SetOp(op Op) + func (m *TestMutation) Type() string + func (m *TestMutation) Where(ps ...predicate.Test) + func (m *TestMutation) WhereP(ps ...func(*sql.Selector)) + func (m TestMutation) Client() *Client + func (m TestMutation) Tx() (*Tx, error) + type TestQuery struct + func (tq *TestQuery) Aggregate(fns ...AggregateFunc) *TestSelect + func (tq *TestQuery) All(ctx context.Context) ([]*Test, error) + func (tq *TestQuery) AllX(ctx context.Context) []*Test + func (tq *TestQuery) Clone() *TestQuery + func (tq *TestQuery) Count(ctx context.Context) (int, error) + func (tq *TestQuery) CountX(ctx context.Context) int + func (tq *TestQuery) Exist(ctx context.Context) (bool, error) + func (tq *TestQuery) ExistX(ctx context.Context) bool + func (tq *TestQuery) First(ctx context.Context) (*Test, error) + func (tq *TestQuery) FirstID(ctx context.Context) (id int, err error) + func (tq *TestQuery) FirstIDX(ctx context.Context) int + func (tq *TestQuery) FirstX(ctx context.Context) *Test + func (tq *TestQuery) GroupBy(field string, fields ...string) *TestGroupBy + func (tq *TestQuery) IDs(ctx context.Context) (ids []int, err error) + func (tq *TestQuery) IDsX(ctx context.Context) []int + func (tq *TestQuery) Limit(limit int) *TestQuery + func (tq *TestQuery) Offset(offset int) *TestQuery + func (tq *TestQuery) Only(ctx context.Context) (*Test, error) + func (tq *TestQuery) OnlyID(ctx context.Context) (id int, err error) + func (tq *TestQuery) OnlyIDX(ctx context.Context) int + func (tq *TestQuery) OnlyX(ctx context.Context) *Test + func (tq *TestQuery) Order(o ...test.OrderOption) *TestQuery + func (tq *TestQuery) Select(fields ...string) *TestSelect + func (tq *TestQuery) Unique(unique bool) *TestQuery + func (tq *TestQuery) Where(ps ...predicate.Test) *TestQuery + type TestSelect struct + func (s *TestSelect) Bool(ctx context.Context) (_ bool, err error) + func (s *TestSelect) BoolX(ctx context.Context) bool + func (s *TestSelect) Bools(ctx context.Context) ([]bool, error) + func (s *TestSelect) BoolsX(ctx context.Context) []bool + func (s *TestSelect) Float64(ctx context.Context) (_ float64, err error) + func (s *TestSelect) Float64X(ctx context.Context) float64 + func (s *TestSelect) Float64s(ctx context.Context) ([]float64, error) + func (s *TestSelect) Float64sX(ctx context.Context) []float64 + func (s *TestSelect) Int(ctx context.Context) (_ int, err error) + func (s *TestSelect) IntX(ctx context.Context) int + func (s *TestSelect) Ints(ctx context.Context) ([]int, error) + func (s *TestSelect) IntsX(ctx context.Context) []int + func (s *TestSelect) ScanX(ctx context.Context, v any) + func (s *TestSelect) String(ctx context.Context) (_ string, err error) + func (s *TestSelect) StringX(ctx context.Context) string + func (s *TestSelect) Strings(ctx context.Context) ([]string, error) + func (s *TestSelect) StringsX(ctx context.Context) []string + func (ts *TestSelect) Aggregate(fns ...AggregateFunc) *TestSelect + func (ts *TestSelect) Scan(ctx context.Context, v any) error + type TestUpdate struct + func (tu *TestUpdate) Exec(ctx context.Context) error + func (tu *TestUpdate) ExecX(ctx context.Context) + func (tu *TestUpdate) Mutation() *TestMutation + func (tu *TestUpdate) Save(ctx context.Context) (int, error) + func (tu *TestUpdate) SaveX(ctx context.Context) int + func (tu *TestUpdate) Where(ps ...predicate.Test) *TestUpdate + type TestUpdateOne struct + func (tuo *TestUpdateOne) Exec(ctx context.Context) error + func (tuo *TestUpdateOne) ExecX(ctx context.Context) + func (tuo *TestUpdateOne) Mutation() *TestMutation + func (tuo *TestUpdateOne) Save(ctx context.Context) (*Test, error) + func (tuo *TestUpdateOne) SaveX(ctx context.Context) *Test + func (tuo *TestUpdateOne) Select(field string, fields ...string) *TestUpdateOne + func (tuo *TestUpdateOne) Where(ps ...predicate.Test) *TestUpdateOne + type Tests []*Test + type TraverseFunc = ent.TraverseFunc + type Traverser = ent.Traverser + type Tx struct + Test *TestClient + 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 ValidationError struct + Name string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Value = ent.Value