Versions in this module Expand all Collapse all v0 v0.8.4 Jul 24, 2021 v0.8.3 Jul 24, 2021 v0.8.2 Jul 22, 2021 v0.8.1 Jul 22, 2021 Changes in this version + const OpCreate + const OpDelete + const OpDeleteOne + const OpUpdate + const OpUpdateOne + const TypeUser + 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) 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 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(...interface{})) Option + type OrderFunc func(*sql.Selector) + func Asc(fields ...string) OrderFunc + func Desc(fields ...string) OrderFunc + type Policy = ent.Policy + type Query = ent.Query + 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 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 + Dirs []http.Dir + Floats []float64 + ID int + Ints []int + Raw json.RawMessage + Strings []string + T *schema.T + URL *url.URL + func (u *User) String() string + func (u *User) Unwrap() *User + func (u *User) Update() *UserUpdateOne + 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(u *User) *UserDeleteOne + func (c *UserClient) DeleteOneID(id int) *UserDeleteOne + func (c *UserClient) Get(ctx context.Context, id int) (*User, error) + func (c *UserClient) GetX(ctx context.Context, id int) *User + func (c *UserClient) Hooks() []Hook + func (c *UserClient) Query() *UserQuery + func (c *UserClient) Update() *UserUpdate + func (c *UserClient) UpdateOne(u *User) *UserUpdateOne + func (c *UserClient) UpdateOneID(id int) *UserUpdateOne + func (c *UserClient) Use(hooks ...Hook) + type UserCreate struct + func (uc *UserCreate) Mutation() *UserMutation + func (uc *UserCreate) Save(ctx context.Context) (*User, error) + func (uc *UserCreate) SaveX(ctx context.Context) *User + func (uc *UserCreate) SetDirs(h []http.Dir) *UserCreate + func (uc *UserCreate) SetFloats(f []float64) *UserCreate + func (uc *UserCreate) SetInts(i []int) *UserCreate + func (uc *UserCreate) SetRaw(jm json.RawMessage) *UserCreate + func (uc *UserCreate) SetStrings(s []string) *UserCreate + func (uc *UserCreate) SetT(s *schema.T) *UserCreate + func (uc *UserCreate) SetURL(u *url.URL) *UserCreate + type UserCreateBulk struct + func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) + func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User + type UserDelete struct + func (ud *UserDelete) Exec(ctx context.Context) (int, error) + func (ud *UserDelete) ExecX(ctx context.Context) int + func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete + type UserDeleteOne struct + func (udo *UserDeleteOne) Exec(ctx context.Context) error + func (udo *UserDeleteOne) ExecX(ctx context.Context) + type UserGroupBy struct + func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy + func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (ugb *UserGroupBy) BoolX(ctx context.Context) bool + func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error) + func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool + func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (ugb *UserGroupBy) Float64X(ctx context.Context) float64 + func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64 + func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error) + func (ugb *UserGroupBy) IntX(ctx context.Context) int + func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error) + func (ugb *UserGroupBy) IntsX(ctx context.Context) []int + func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error + func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{}) + func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error) + func (ugb *UserGroupBy) StringX(ctx context.Context) string + func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error) + func (ugb *UserGroupBy) StringsX(ctx context.Context) []string + type UserMutation struct + func (m *UserMutation) AddField(name string, value ent.Value) error + 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) ClearDirs() + func (m *UserMutation) ClearEdge(name string) error + func (m *UserMutation) ClearField(name string) error + func (m *UserMutation) ClearFloats() + func (m *UserMutation) ClearInts() + func (m *UserMutation) ClearRaw() + func (m *UserMutation) ClearStrings() + func (m *UserMutation) ClearT() + func (m *UserMutation) ClearURL() + func (m *UserMutation) ClearedEdges() []string + func (m *UserMutation) ClearedFields() []string + func (m *UserMutation) Dirs() (r []http.Dir, exists bool) + func (m *UserMutation) DirsCleared() bool + 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) Floats() (r []float64, exists bool) + func (m *UserMutation) FloatsCleared() bool + func (m *UserMutation) ID() (id int, exists bool) + func (m *UserMutation) Ints() (r []int, exists bool) + func (m *UserMutation) IntsCleared() bool + func (m *UserMutation) OldDirs(ctx context.Context) (v []http.Dir, err error) + func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *UserMutation) OldFloats(ctx context.Context) (v []float64, err error) + func (m *UserMutation) OldInts(ctx context.Context) (v []int, err error) + func (m *UserMutation) OldRaw(ctx context.Context) (v json.RawMessage, err error) + func (m *UserMutation) OldStrings(ctx context.Context) (v []string, err error) + func (m *UserMutation) OldT(ctx context.Context) (v *schema.T, err error) + func (m *UserMutation) OldURL(ctx context.Context) (v *url.URL, err error) + func (m *UserMutation) Op() Op + func (m *UserMutation) Raw() (r json.RawMessage, exists bool) + func (m *UserMutation) RawCleared() bool + func (m *UserMutation) RemovedEdges() []string + func (m *UserMutation) RemovedIDs(name string) []ent.Value + func (m *UserMutation) ResetDirs() + func (m *UserMutation) ResetEdge(name string) error + func (m *UserMutation) ResetField(name string) error + func (m *UserMutation) ResetFloats() + func (m *UserMutation) ResetInts() + func (m *UserMutation) ResetRaw() + func (m *UserMutation) ResetStrings() + func (m *UserMutation) ResetT() + func (m *UserMutation) ResetURL() + func (m *UserMutation) SetDirs(h []http.Dir) + func (m *UserMutation) SetField(name string, value ent.Value) error + func (m *UserMutation) SetFloats(f []float64) + func (m *UserMutation) SetInts(i []int) + func (m *UserMutation) SetRaw(jm json.RawMessage) + func (m *UserMutation) SetStrings(s []string) + func (m *UserMutation) SetT(s *schema.T) + func (m *UserMutation) SetURL(u *url.URL) + func (m *UserMutation) Strings() (r []string, exists bool) + func (m *UserMutation) StringsCleared() bool + func (m *UserMutation) T() (r *schema.T, exists bool) + func (m *UserMutation) TCleared() bool + func (m *UserMutation) Type() string + func (m *UserMutation) URL() (r *url.URL, exists bool) + func (m *UserMutation) URLCleared() bool + func (m *UserMutation) Where(ps ...predicate.User) + func (m UserMutation) Client() *Client + func (m UserMutation) Tx() (*Tx, error) + type UserQuery struct + func (uq *UserQuery) All(ctx context.Context) ([]*User, error) + func (uq *UserQuery) AllX(ctx context.Context) []*User + func (uq *UserQuery) Clone() *UserQuery + func (uq *UserQuery) Count(ctx context.Context) (int, error) + func (uq *UserQuery) CountX(ctx context.Context) int + func (uq *UserQuery) Exist(ctx context.Context) (bool, error) + func (uq *UserQuery) ExistX(ctx context.Context) bool + func (uq *UserQuery) First(ctx context.Context) (*User, error) + func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error) + func (uq *UserQuery) FirstIDX(ctx context.Context) int + func (uq *UserQuery) FirstX(ctx context.Context) *User + func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy + func (uq *UserQuery) IDs(ctx context.Context) ([]int, error) + func (uq *UserQuery) IDsX(ctx context.Context) []int + func (uq *UserQuery) Limit(limit int) *UserQuery + func (uq *UserQuery) Offset(offset int) *UserQuery + func (uq *UserQuery) Only(ctx context.Context) (*User, error) + func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error) + func (uq *UserQuery) OnlyIDX(ctx context.Context) int + func (uq *UserQuery) OnlyX(ctx context.Context) *User + func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery + func (uq *UserQuery) Select(fields ...string) *UserSelect + func (uq *UserQuery) Unique(unique bool) *UserQuery + func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery + type UserSelect struct + func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error) + func (us *UserSelect) BoolX(ctx context.Context) bool + func (us *UserSelect) Bools(ctx context.Context) ([]bool, error) + func (us *UserSelect) BoolsX(ctx context.Context) []bool + func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error) + func (us *UserSelect) Float64X(ctx context.Context) float64 + func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error) + func (us *UserSelect) Float64sX(ctx context.Context) []float64 + func (us *UserSelect) Int(ctx context.Context) (_ int, err error) + func (us *UserSelect) IntX(ctx context.Context) int + func (us *UserSelect) Ints(ctx context.Context) ([]int, error) + func (us *UserSelect) IntsX(ctx context.Context) []int + func (us *UserSelect) Scan(ctx context.Context, v interface{}) error + func (us *UserSelect) ScanX(ctx context.Context, v interface{}) + func (us *UserSelect) String(ctx context.Context) (_ string, err error) + func (us *UserSelect) StringX(ctx context.Context) string + func (us *UserSelect) Strings(ctx context.Context) ([]string, error) + func (us *UserSelect) StringsX(ctx context.Context) []string + type UserUpdate struct + func (uu *UserUpdate) ClearDirs() *UserUpdate + func (uu *UserUpdate) ClearFloats() *UserUpdate + func (uu *UserUpdate) ClearInts() *UserUpdate + func (uu *UserUpdate) ClearRaw() *UserUpdate + func (uu *UserUpdate) ClearStrings() *UserUpdate + func (uu *UserUpdate) ClearT() *UserUpdate + func (uu *UserUpdate) ClearURL() *UserUpdate + func (uu *UserUpdate) Exec(ctx context.Context) error + func (uu *UserUpdate) ExecX(ctx context.Context) + func (uu *UserUpdate) Mutation() *UserMutation + func (uu *UserUpdate) Save(ctx context.Context) (int, error) + func (uu *UserUpdate) SaveX(ctx context.Context) int + func (uu *UserUpdate) SetDirs(h []http.Dir) *UserUpdate + func (uu *UserUpdate) SetFloats(f []float64) *UserUpdate + func (uu *UserUpdate) SetInts(i []int) *UserUpdate + func (uu *UserUpdate) SetRaw(jm json.RawMessage) *UserUpdate + func (uu *UserUpdate) SetStrings(s []string) *UserUpdate + func (uu *UserUpdate) SetT(s *schema.T) *UserUpdate + func (uu *UserUpdate) SetURL(u *url.URL) *UserUpdate + func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate + type UserUpdateOne struct + func (uuo *UserUpdateOne) ClearDirs() *UserUpdateOne + func (uuo *UserUpdateOne) ClearFloats() *UserUpdateOne + func (uuo *UserUpdateOne) ClearInts() *UserUpdateOne + func (uuo *UserUpdateOne) ClearRaw() *UserUpdateOne + func (uuo *UserUpdateOne) ClearStrings() *UserUpdateOne + func (uuo *UserUpdateOne) ClearT() *UserUpdateOne + func (uuo *UserUpdateOne) ClearURL() *UserUpdateOne + func (uuo *UserUpdateOne) Exec(ctx context.Context) error + func (uuo *UserUpdateOne) ExecX(ctx context.Context) + func (uuo *UserUpdateOne) Mutation() *UserMutation + func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) + func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User + func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne + func (uuo *UserUpdateOne) SetDirs(h []http.Dir) *UserUpdateOne + func (uuo *UserUpdateOne) SetFloats(f []float64) *UserUpdateOne + func (uuo *UserUpdateOne) SetInts(i []int) *UserUpdateOne + func (uuo *UserUpdateOne) SetRaw(jm json.RawMessage) *UserUpdateOne + func (uuo *UserUpdateOne) SetStrings(s []string) *UserUpdateOne + func (uuo *UserUpdateOne) SetT(s *schema.T) *UserUpdateOne + func (uuo *UserUpdateOne) SetURL(u *url.URL) *UserUpdateOne + type Users []*User + type ValidationError struct + Name string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Value = ent.Value