Versions in this module Expand all Collapse all v0 v0.1.0 May 15, 2024 Changes in this version + const OpCreate + const OpDelete + const OpDeleteOne + const OpUpdate + const OpUpdateOne + const TypeTodo + var DefaultTodoOrder = &TodoOrder + var ErrEmptyTodoWhereInput = errors.New("generated: empty predicate TodoWhereInput") + var ErrTxStarted = errors.New("generated: 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 + func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error) + 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 + Todo *TodoClient + 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) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error) + func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error) + func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error) + func (c *Client) Tx(ctx context.Context) (*Tx, error) + func (c *Client) Use(hooks ...Hook) + func (c *Client) WithAuthz() + 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 CreateTodoInput struct + Description *string + Name string + func (i *CreateTodoInput) Mutate(m *TodoMutation) + type Cursor = entgql.Cursor[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 NodeOption func(*nodeOptions) + func WithFixedNodeType(t string) NodeOption + func WithNodeType(f func(context.Context, string) (string, error)) NodeOption + type Noder interface + IsNode func() + 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 AlternateSchema(schemaConfig SchemaConfig) Option + func Authz(v fgax.Client) Option + func Debug() Option + func Driver(driver dialect.Driver) Option + func HTTPClient(v *http.Client) Option + func Log(fn func(...any)) Option + func Logger(v zap.SugaredLogger) Option + func SecretsKeeper(v *secrets.Keeper) Option + type OrderDirection = entgql.OrderDirection + type OrderFunc func(*sql.Selector) + type PageInfo = entgql.PageInfo[string] + 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 SchemaConfig = internal.SchemaConfig + type Todo struct + Description string + ID string + Name string + func (n *Todo) IsNode() + func (t *Todo) String() string + func (t *Todo) ToEdge(order *TodoOrder) *TodoEdge + func (t *Todo) Unwrap() *Todo + func (t *Todo) Update() *TodoUpdateOne + func (t *Todo) Value(name string) (ent.Value, error) + type TodoClient struct + func NewTodoClient(c config) *TodoClient + func (c *TodoClient) Create() *TodoCreate + func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk + func (c *TodoClient) Delete() *TodoDelete + func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne + func (c *TodoClient) DeleteOneID(id string) *TodoDeleteOne + func (c *TodoClient) Get(ctx context.Context, id string) (*Todo, error) + func (c *TodoClient) GetX(ctx context.Context, id string) *Todo + func (c *TodoClient) Hooks() []Hook + func (c *TodoClient) Intercept(interceptors ...Interceptor) + func (c *TodoClient) Interceptors() []Interceptor + func (c *TodoClient) MapCreateBulk(slice any, setFunc func(*TodoCreate, int)) *TodoCreateBulk + func (c *TodoClient) Query() *TodoQuery + func (c *TodoClient) Update() *TodoUpdate + func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne + func (c *TodoClient) UpdateOneID(id string) *TodoUpdateOne + func (c *TodoClient) Use(hooks ...Hook) + type TodoConnection struct + Edges []*TodoEdge + PageInfo PageInfo + TotalCount int + type TodoCreate struct + func (c *TodoCreate) SetInput(i CreateTodoInput) *TodoCreate + func (tc *TodoCreate) Exec(ctx context.Context) error + func (tc *TodoCreate) ExecX(ctx context.Context) + func (tc *TodoCreate) Mutation() *TodoMutation + func (tc *TodoCreate) Save(ctx context.Context) (*Todo, error) + func (tc *TodoCreate) SaveX(ctx context.Context) *Todo + func (tc *TodoCreate) SetDescription(s string) *TodoCreate + func (tc *TodoCreate) SetID(s string) *TodoCreate + func (tc *TodoCreate) SetName(s string) *TodoCreate + func (tc *TodoCreate) SetNillableDescription(s *string) *TodoCreate + type TodoCreateBulk struct + func (tcb *TodoCreateBulk) Exec(ctx context.Context) error + func (tcb *TodoCreateBulk) ExecX(ctx context.Context) + func (tcb *TodoCreateBulk) Save(ctx context.Context) ([]*Todo, error) + func (tcb *TodoCreateBulk) SaveX(ctx context.Context) []*Todo + type TodoDelete struct + func (td *TodoDelete) Exec(ctx context.Context) (int, error) + func (td *TodoDelete) ExecX(ctx context.Context) int + func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete + type TodoDeleteOne struct + func (tdo *TodoDeleteOne) Exec(ctx context.Context) error + func (tdo *TodoDeleteOne) ExecX(ctx context.Context) + func (tdo *TodoDeleteOne) Where(ps ...predicate.Todo) *TodoDeleteOne + type TodoEdge struct + Cursor Cursor + Node *Todo + type TodoFilter struct + func (f *TodoFilter) Where(p entql.P) + func (f *TodoFilter) WhereDescription(p entql.StringP) + func (f *TodoFilter) WhereID(p entql.StringP) + func (f *TodoFilter) WhereName(p entql.StringP) + type TodoGroupBy struct + func (s *TodoGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (s *TodoGroupBy) BoolX(ctx context.Context) bool + func (s *TodoGroupBy) Bools(ctx context.Context) ([]bool, error) + func (s *TodoGroupBy) BoolsX(ctx context.Context) []bool + func (s *TodoGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (s *TodoGroupBy) Float64X(ctx context.Context) float64 + func (s *TodoGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (s *TodoGroupBy) Float64sX(ctx context.Context) []float64 + func (s *TodoGroupBy) Int(ctx context.Context) (_ int, err error) + func (s *TodoGroupBy) IntX(ctx context.Context) int + func (s *TodoGroupBy) Ints(ctx context.Context) ([]int, error) + func (s *TodoGroupBy) IntsX(ctx context.Context) []int + func (s *TodoGroupBy) ScanX(ctx context.Context, v any) + func (s *TodoGroupBy) String(ctx context.Context) (_ string, err error) + func (s *TodoGroupBy) StringX(ctx context.Context) string + func (s *TodoGroupBy) Strings(ctx context.Context) ([]string, error) + func (s *TodoGroupBy) StringsX(ctx context.Context) []string + func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy + func (tgb *TodoGroupBy) Scan(ctx context.Context, v any) error + type TodoMutation struct + func (m *TodoMutation) AddField(name string, value ent.Value) error + func (m *TodoMutation) AddedEdges() []string + func (m *TodoMutation) AddedField(name string) (ent.Value, bool) + func (m *TodoMutation) AddedFields() []string + func (m *TodoMutation) AddedIDs(name string) []ent.Value + func (m *TodoMutation) ClearDescription() + func (m *TodoMutation) ClearEdge(name string) error + func (m *TodoMutation) ClearField(name string) error + func (m *TodoMutation) ClearedEdges() []string + func (m *TodoMutation) ClearedFields() []string + func (m *TodoMutation) Description() (r string, exists bool) + func (m *TodoMutation) DescriptionCleared() bool + func (m *TodoMutation) EdgeCleared(name string) bool + func (m *TodoMutation) Field(name string) (ent.Value, bool) + func (m *TodoMutation) FieldCleared(name string) bool + func (m *TodoMutation) Fields() []string + func (m *TodoMutation) Filter() *TodoFilter + func (m *TodoMutation) ID() (id string, exists bool) + func (m *TodoMutation) IDs(ctx context.Context) ([]string, error) + func (m *TodoMutation) Name() (r string, exists bool) + func (m *TodoMutation) OldDescription(ctx context.Context) (v string, err error) + func (m *TodoMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *TodoMutation) OldName(ctx context.Context) (v string, err error) + func (m *TodoMutation) Op() Op + func (m *TodoMutation) RemovedEdges() []string + func (m *TodoMutation) RemovedIDs(name string) []ent.Value + func (m *TodoMutation) ResetDescription() + func (m *TodoMutation) ResetEdge(name string) error + func (m *TodoMutation) ResetField(name string) error + func (m *TodoMutation) ResetName() + func (m *TodoMutation) SetDescription(s string) + func (m *TodoMutation) SetField(name string, value ent.Value) error + func (m *TodoMutation) SetID(id string) + func (m *TodoMutation) SetName(s string) + func (m *TodoMutation) SetOp(op Op) + func (m *TodoMutation) Type() string + func (m *TodoMutation) Where(ps ...predicate.Todo) + func (m *TodoMutation) WhereP(ps ...func(*sql.Selector)) + func (m TodoMutation) Client() *Client + func (m TodoMutation) Tx() (*Tx, error) + type TodoOrder struct + Direction OrderDirection + Field *TodoOrderField + type TodoOrderField struct + Value func(*Todo) (ent.Value, error) + type TodoPaginateOption func(*todoPager) error + func WithTodoFilter(filter func(*TodoQuery) (*TodoQuery, error)) TodoPaginateOption + func WithTodoOrder(order *TodoOrder) TodoPaginateOption + type TodoQuery struct + func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) + func (t *TodoQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TodoConnection, error) + func (tq *TodoQuery) Aggregate(fns ...AggregateFunc) *TodoSelect + func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error) + func (tq *TodoQuery) AllX(ctx context.Context) []*Todo + func (tq *TodoQuery) Clone() *TodoQuery + func (tq *TodoQuery) Count(ctx context.Context) (int, error) + func (tq *TodoQuery) CountX(ctx context.Context) int + func (tq *TodoQuery) Exist(ctx context.Context) (bool, error) + func (tq *TodoQuery) ExistX(ctx context.Context) bool + func (tq *TodoQuery) Filter() *TodoFilter + func (tq *TodoQuery) First(ctx context.Context) (*Todo, error) + func (tq *TodoQuery) FirstID(ctx context.Context) (id string, err error) + func (tq *TodoQuery) FirstIDX(ctx context.Context) string + func (tq *TodoQuery) FirstX(ctx context.Context) *Todo + func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy + func (tq *TodoQuery) IDs(ctx context.Context) (ids []string, err error) + func (tq *TodoQuery) IDsX(ctx context.Context) []string + func (tq *TodoQuery) Limit(limit int) *TodoQuery + func (tq *TodoQuery) Offset(offset int) *TodoQuery + func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error) + func (tq *TodoQuery) OnlyID(ctx context.Context) (id string, err error) + func (tq *TodoQuery) OnlyIDX(ctx context.Context) string + func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo + func (tq *TodoQuery) Order(o ...todo.OrderOption) *TodoQuery + func (tq *TodoQuery) Select(fields ...string) *TodoSelect + func (tq *TodoQuery) Unique(unique bool) *TodoQuery + func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery + type TodoSelect struct + func (s *TodoSelect) Bool(ctx context.Context) (_ bool, err error) + func (s *TodoSelect) BoolX(ctx context.Context) bool + func (s *TodoSelect) Bools(ctx context.Context) ([]bool, error) + func (s *TodoSelect) BoolsX(ctx context.Context) []bool + func (s *TodoSelect) Float64(ctx context.Context) (_ float64, err error) + func (s *TodoSelect) Float64X(ctx context.Context) float64 + func (s *TodoSelect) Float64s(ctx context.Context) ([]float64, error) + func (s *TodoSelect) Float64sX(ctx context.Context) []float64 + func (s *TodoSelect) Int(ctx context.Context) (_ int, err error) + func (s *TodoSelect) IntX(ctx context.Context) int + func (s *TodoSelect) Ints(ctx context.Context) ([]int, error) + func (s *TodoSelect) IntsX(ctx context.Context) []int + func (s *TodoSelect) ScanX(ctx context.Context, v any) + func (s *TodoSelect) String(ctx context.Context) (_ string, err error) + func (s *TodoSelect) StringX(ctx context.Context) string + func (s *TodoSelect) Strings(ctx context.Context) ([]string, error) + func (s *TodoSelect) StringsX(ctx context.Context) []string + func (ts *TodoSelect) Aggregate(fns ...AggregateFunc) *TodoSelect + func (ts *TodoSelect) Scan(ctx context.Context, v any) error + type TodoUpdate struct + func (c *TodoUpdate) SetInput(i UpdateTodoInput) *TodoUpdate + func (tu *TodoUpdate) ClearDescription() *TodoUpdate + func (tu *TodoUpdate) Exec(ctx context.Context) error + func (tu *TodoUpdate) ExecX(ctx context.Context) + func (tu *TodoUpdate) Mutation() *TodoMutation + func (tu *TodoUpdate) Save(ctx context.Context) (int, error) + func (tu *TodoUpdate) SaveX(ctx context.Context) int + func (tu *TodoUpdate) SetDescription(s string) *TodoUpdate + func (tu *TodoUpdate) SetName(s string) *TodoUpdate + func (tu *TodoUpdate) SetNillableDescription(s *string) *TodoUpdate + func (tu *TodoUpdate) SetNillableName(s *string) *TodoUpdate + func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate + type TodoUpdateOne struct + func (c *TodoUpdateOne) SetInput(i UpdateTodoInput) *TodoUpdateOne + func (tuo *TodoUpdateOne) ClearDescription() *TodoUpdateOne + func (tuo *TodoUpdateOne) Exec(ctx context.Context) error + func (tuo *TodoUpdateOne) ExecX(ctx context.Context) + func (tuo *TodoUpdateOne) Mutation() *TodoMutation + func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error) + func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo + func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne + func (tuo *TodoUpdateOne) SetDescription(s string) *TodoUpdateOne + func (tuo *TodoUpdateOne) SetName(s string) *TodoUpdateOne + func (tuo *TodoUpdateOne) SetNillableDescription(s *string) *TodoUpdateOne + func (tuo *TodoUpdateOne) SetNillableName(s *string) *TodoUpdateOne + func (tuo *TodoUpdateOne) Where(ps ...predicate.Todo) *TodoUpdateOne + type TodoWhereInput struct + And []*TodoWhereInput + Description *string + DescriptionContains *string + DescriptionContainsFold *string + DescriptionEqualFold *string + DescriptionGT *string + DescriptionGTE *string + DescriptionHasPrefix *string + DescriptionHasSuffix *string + DescriptionIn []string + DescriptionIsNil bool + DescriptionLT *string + DescriptionLTE *string + DescriptionNEQ *string + DescriptionNotIn []string + DescriptionNotNil bool + ID *string + IDContainsFold *string + IDEqualFold *string + IDGT *string + IDGTE *string + IDIn []string + IDLT *string + IDLTE *string + IDNEQ *string + IDNotIn []string + Name *string + NameContains *string + NameContainsFold *string + NameEqualFold *string + NameGT *string + NameGTE *string + NameHasPrefix *string + NameHasSuffix *string + NameIn []string + NameLT *string + NameLTE *string + NameNEQ *string + NameNotIn []string + Not *TodoWhereInput + Or []*TodoWhereInput + Predicates []predicate.Todo + func (i *TodoWhereInput) AddPredicates(predicates ...predicate.Todo) + func (i *TodoWhereInput) Filter(q *TodoQuery) (*TodoQuery, error) + func (i *TodoWhereInput) P() (predicate.Todo, error) + type Todos []*Todo + type TraverseFunc = ent.TraverseFunc + type Traverser = ent.Traverser + type Tx struct + Todo *TodoClient + 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 UpdateTodoInput struct + ClearDescription bool + Description *string + Name *string + func (i *UpdateTodoInput) Mutate(m *TodoMutation) + type ValidationError struct + Name string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Value = ent.Value