Documentation ¶
Index ¶
- Constants
- 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
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Task
- type TaskClient
- func (c *TaskClient) Create() *TaskCreate
- func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk
- func (c *TaskClient) Delete() *TaskDelete
- func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne
- func (c *TaskClient) DeleteOneID(id int) *TaskDeleteOne
- func (c *TaskClient) Get(ctx context.Context, id int) (*Task, error)
- func (c *TaskClient) GetX(ctx context.Context, id int) *Task
- func (c *TaskClient) Hooks() []Hook
- func (c *TaskClient) Query() *TaskQuery
- func (c *TaskClient) QueryOwner(t *Task) *UserQuery
- func (c *TaskClient) QueryTeams(t *Task) *TeamQuery
- func (c *TaskClient) Update() *TaskUpdate
- func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne
- func (c *TaskClient) UpdateOneID(id int) *TaskUpdateOne
- func (c *TaskClient) Use(hooks ...Hook)
- type TaskCreate
- func (tc *TaskCreate) AddTeamIDs(ids ...int) *TaskCreate
- func (tc *TaskCreate) AddTeams(t ...*Team) *TaskCreate
- func (tc *TaskCreate) Mutation() *TaskMutation
- func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)
- func (tc *TaskCreate) SaveX(ctx context.Context) *Task
- func (tc *TaskCreate) SetDescription(s string) *TaskCreate
- func (tc *TaskCreate) SetNillableDescription(s *string) *TaskCreate
- func (tc *TaskCreate) SetNillableOwnerID(id *int) *TaskCreate
- func (tc *TaskCreate) SetNillableStatus(t *task.Status) *TaskCreate
- func (tc *TaskCreate) SetOwner(u *User) *TaskCreate
- func (tc *TaskCreate) SetOwnerID(id int) *TaskCreate
- func (tc *TaskCreate) SetStatus(t task.Status) *TaskCreate
- func (tc *TaskCreate) SetTitle(s string) *TaskCreate
- type TaskCreateBulk
- type TaskDelete
- type TaskDeleteOne
- type TaskEdges
- type TaskFilter
- func (f *TaskFilter) Where(p entql.P)
- func (f *TaskFilter) WhereDescription(p entql.StringP)
- func (f *TaskFilter) WhereHasOwner()
- func (f *TaskFilter) WhereHasOwnerWith(preds ...predicate.User)
- func (f *TaskFilter) WhereHasTeams()
- func (f *TaskFilter) WhereHasTeamsWith(preds ...predicate.Team)
- func (f *TaskFilter) WhereID(p entql.IntP)
- func (f *TaskFilter) WhereStatus(p entql.StringP)
- func (f *TaskFilter) WhereTitle(p entql.StringP)
- type TaskGroupBy
- func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy
- func (tgb *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (tgb *TaskGroupBy) BoolX(ctx context.Context) bool
- func (tgb *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (tgb *TaskGroupBy) BoolsX(ctx context.Context) []bool
- func (tgb *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (tgb *TaskGroupBy) Float64X(ctx context.Context) float64
- func (tgb *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (tgb *TaskGroupBy) Float64sX(ctx context.Context) []float64
- func (tgb *TaskGroupBy) Int(ctx context.Context) (_ int, err error)
- func (tgb *TaskGroupBy) IntX(ctx context.Context) int
- func (tgb *TaskGroupBy) Ints(ctx context.Context) ([]int, error)
- func (tgb *TaskGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TaskGroupBy) Scan(ctx context.Context, v interface{}) error
- func (tgb *TaskGroupBy) ScanX(ctx context.Context, v interface{})
- func (tgb *TaskGroupBy) String(ctx context.Context) (_ string, err error)
- func (tgb *TaskGroupBy) StringX(ctx context.Context) string
- func (tgb *TaskGroupBy) Strings(ctx context.Context) ([]string, error)
- func (tgb *TaskGroupBy) StringsX(ctx context.Context) []string
- type TaskMutation
- func (m *TaskMutation) AddField(name string, value ent.Value) error
- func (m *TaskMutation) AddTeamIDs(ids ...int)
- func (m *TaskMutation) AddedEdges() []string
- func (m *TaskMutation) AddedField(name string) (ent.Value, bool)
- func (m *TaskMutation) AddedFields() []string
- func (m *TaskMutation) AddedIDs(name string) []ent.Value
- func (m *TaskMutation) ClearDescription()
- func (m *TaskMutation) ClearEdge(name string) error
- func (m *TaskMutation) ClearField(name string) error
- func (m *TaskMutation) ClearOwner()
- func (m *TaskMutation) ClearTeams()
- func (m *TaskMutation) ClearedEdges() []string
- func (m *TaskMutation) ClearedFields() []string
- func (m TaskMutation) Client() *Client
- func (m *TaskMutation) Description() (r string, exists bool)
- func (m *TaskMutation) DescriptionCleared() bool
- func (m *TaskMutation) EdgeCleared(name string) bool
- func (m *TaskMutation) Field(name string) (ent.Value, bool)
- func (m *TaskMutation) FieldCleared(name string) bool
- func (m *TaskMutation) Fields() []string
- func (m *TaskMutation) Filter() *TaskFilter
- func (m *TaskMutation) ID() (id int, exists bool)
- func (m *TaskMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TaskMutation) OldStatus(ctx context.Context) (v task.Status, err error)
- func (m *TaskMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *TaskMutation) Op() Op
- func (m *TaskMutation) OwnerCleared() bool
- func (m *TaskMutation) OwnerID() (id int, exists bool)
- func (m *TaskMutation) OwnerIDs() (ids []int)
- func (m *TaskMutation) RemoveTeamIDs(ids ...int)
- func (m *TaskMutation) RemovedEdges() []string
- func (m *TaskMutation) RemovedIDs(name string) []ent.Value
- func (m *TaskMutation) RemovedTeamsIDs() (ids []int)
- func (m *TaskMutation) ResetDescription()
- func (m *TaskMutation) ResetEdge(name string) error
- func (m *TaskMutation) ResetField(name string) error
- func (m *TaskMutation) ResetOwner()
- func (m *TaskMutation) ResetStatus()
- func (m *TaskMutation) ResetTeams()
- func (m *TaskMutation) ResetTitle()
- func (m *TaskMutation) SetDescription(s string)
- func (m *TaskMutation) SetField(name string, value ent.Value) error
- func (m *TaskMutation) SetOwnerID(id int)
- func (m *TaskMutation) SetStatus(t task.Status)
- func (m *TaskMutation) SetTitle(s string)
- func (m *TaskMutation) Status() (r task.Status, exists bool)
- func (m *TaskMutation) TeamsCleared() bool
- func (m *TaskMutation) TeamsIDs() (ids []int)
- func (m *TaskMutation) Title() (r string, exists bool)
- func (m TaskMutation) Tx() (*Tx, error)
- func (m *TaskMutation) Type() string
- type TaskQuery
- func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)
- func (tq *TaskQuery) AllX(ctx context.Context) []*Task
- func (tq *TaskQuery) Clone() *TaskQuery
- func (tq *TaskQuery) Count(ctx context.Context) (int, error)
- func (tq *TaskQuery) CountX(ctx context.Context) int
- func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TaskQuery) ExistX(ctx context.Context) bool
- func (tq *TaskQuery) Filter() *TaskFilter
- func (tq *TaskQuery) First(ctx context.Context) (*Task, error)
- func (tq *TaskQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TaskQuery) FirstIDX(ctx context.Context) int
- func (tq *TaskQuery) FirstX(ctx context.Context) *Task
- func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy
- func (tq *TaskQuery) IDs(ctx context.Context) ([]int, error)
- func (tq *TaskQuery) IDsX(ctx context.Context) []int
- func (tq *TaskQuery) Limit(limit int) *TaskQuery
- func (tq *TaskQuery) Offset(offset int) *TaskQuery
- func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)
- func (tq *TaskQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TaskQuery) OnlyIDX(ctx context.Context) int
- func (tq *TaskQuery) OnlyX(ctx context.Context) *Task
- func (tq *TaskQuery) Order(o ...OrderFunc) *TaskQuery
- func (tq *TaskQuery) QueryOwner() *UserQuery
- func (tq *TaskQuery) QueryTeams() *TeamQuery
- func (tq *TaskQuery) Select(field string, fields ...string) *TaskSelect
- func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery
- func (tq *TaskQuery) WithOwner(opts ...func(*UserQuery)) *TaskQuery
- func (tq *TaskQuery) WithTeams(opts ...func(*TeamQuery)) *TaskQuery
- type TaskSelect
- func (ts *TaskSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ts *TaskSelect) BoolX(ctx context.Context) bool
- func (ts *TaskSelect) Bools(ctx context.Context) ([]bool, error)
- func (ts *TaskSelect) BoolsX(ctx context.Context) []bool
- func (ts *TaskSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ts *TaskSelect) Float64X(ctx context.Context) float64
- func (ts *TaskSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ts *TaskSelect) Float64sX(ctx context.Context) []float64
- func (ts *TaskSelect) Int(ctx context.Context) (_ int, err error)
- func (ts *TaskSelect) IntX(ctx context.Context) int
- func (ts *TaskSelect) Ints(ctx context.Context) ([]int, error)
- func (ts *TaskSelect) IntsX(ctx context.Context) []int
- func (ts *TaskSelect) Scan(ctx context.Context, v interface{}) error
- func (ts *TaskSelect) ScanX(ctx context.Context, v interface{})
- func (ts *TaskSelect) String(ctx context.Context) (_ string, err error)
- func (ts *TaskSelect) StringX(ctx context.Context) string
- func (ts *TaskSelect) Strings(ctx context.Context) ([]string, error)
- func (ts *TaskSelect) StringsX(ctx context.Context) []string
- type TaskUpdate
- func (tu *TaskUpdate) AddTeamIDs(ids ...int) *TaskUpdate
- func (tu *TaskUpdate) AddTeams(t ...*Team) *TaskUpdate
- func (tu *TaskUpdate) ClearDescription() *TaskUpdate
- func (tu *TaskUpdate) ClearOwner() *TaskUpdate
- func (tu *TaskUpdate) ClearTeams() *TaskUpdate
- func (tu *TaskUpdate) Exec(ctx context.Context) error
- func (tu *TaskUpdate) ExecX(ctx context.Context)
- func (tu *TaskUpdate) Mutation() *TaskMutation
- func (tu *TaskUpdate) RemoveTeamIDs(ids ...int) *TaskUpdate
- func (tu *TaskUpdate) RemoveTeams(t ...*Team) *TaskUpdate
- func (tu *TaskUpdate) Save(ctx context.Context) (int, error)
- func (tu *TaskUpdate) SaveX(ctx context.Context) int
- func (tu *TaskUpdate) SetDescription(s string) *TaskUpdate
- func (tu *TaskUpdate) SetNillableDescription(s *string) *TaskUpdate
- func (tu *TaskUpdate) SetNillableOwnerID(id *int) *TaskUpdate
- func (tu *TaskUpdate) SetNillableStatus(t *task.Status) *TaskUpdate
- func (tu *TaskUpdate) SetOwner(u *User) *TaskUpdate
- func (tu *TaskUpdate) SetOwnerID(id int) *TaskUpdate
- func (tu *TaskUpdate) SetStatus(t task.Status) *TaskUpdate
- func (tu *TaskUpdate) SetTitle(s string) *TaskUpdate
- func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate
- type TaskUpdateOne
- func (tuo *TaskUpdateOne) AddTeamIDs(ids ...int) *TaskUpdateOne
- func (tuo *TaskUpdateOne) AddTeams(t ...*Team) *TaskUpdateOne
- func (tuo *TaskUpdateOne) ClearDescription() *TaskUpdateOne
- func (tuo *TaskUpdateOne) ClearOwner() *TaskUpdateOne
- func (tuo *TaskUpdateOne) ClearTeams() *TaskUpdateOne
- func (tuo *TaskUpdateOne) Exec(ctx context.Context) error
- func (tuo *TaskUpdateOne) ExecX(ctx context.Context)
- func (tuo *TaskUpdateOne) Mutation() *TaskMutation
- func (tuo *TaskUpdateOne) RemoveTeamIDs(ids ...int) *TaskUpdateOne
- func (tuo *TaskUpdateOne) RemoveTeams(t ...*Team) *TaskUpdateOne
- func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)
- func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task
- func (tuo *TaskUpdateOne) SetDescription(s string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetNillableDescription(s *string) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetNillableOwnerID(id *int) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetNillableStatus(t *task.Status) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetOwner(u *User) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetOwnerID(id int) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetStatus(t task.Status) *TaskUpdateOne
- func (tuo *TaskUpdateOne) SetTitle(s string) *TaskUpdateOne
- type Tasks
- type Team
- type TeamClient
- func (c *TeamClient) Create() *TeamCreate
- func (c *TeamClient) CreateBulk(builders ...*TeamCreate) *TeamCreateBulk
- func (c *TeamClient) Delete() *TeamDelete
- func (c *TeamClient) DeleteOne(t *Team) *TeamDeleteOne
- func (c *TeamClient) DeleteOneID(id int) *TeamDeleteOne
- func (c *TeamClient) Get(ctx context.Context, id int) (*Team, error)
- func (c *TeamClient) GetX(ctx context.Context, id int) *Team
- func (c *TeamClient) Hooks() []Hook
- func (c *TeamClient) Query() *TeamQuery
- func (c *TeamClient) QueryTasks(t *Team) *TaskQuery
- func (c *TeamClient) QueryUsers(t *Team) *UserQuery
- func (c *TeamClient) Update() *TeamUpdate
- func (c *TeamClient) UpdateOne(t *Team) *TeamUpdateOne
- func (c *TeamClient) UpdateOneID(id int) *TeamUpdateOne
- func (c *TeamClient) Use(hooks ...Hook)
- type TeamCreate
- func (tc *TeamCreate) AddTaskIDs(ids ...int) *TeamCreate
- func (tc *TeamCreate) AddTasks(t ...*Task) *TeamCreate
- func (tc *TeamCreate) AddUserIDs(ids ...int) *TeamCreate
- func (tc *TeamCreate) AddUsers(u ...*User) *TeamCreate
- func (tc *TeamCreate) Mutation() *TeamMutation
- func (tc *TeamCreate) Save(ctx context.Context) (*Team, error)
- func (tc *TeamCreate) SaveX(ctx context.Context) *Team
- func (tc *TeamCreate) SetName(s string) *TeamCreate
- type TeamCreateBulk
- type TeamDelete
- type TeamDeleteOne
- type TeamEdges
- type TeamFilter
- func (f *TeamFilter) Where(p entql.P)
- func (f *TeamFilter) WhereHasTasks()
- func (f *TeamFilter) WhereHasTasksWith(preds ...predicate.Task)
- func (f *TeamFilter) WhereHasUsers()
- func (f *TeamFilter) WhereHasUsersWith(preds ...predicate.User)
- func (f *TeamFilter) WhereID(p entql.IntP)
- func (f *TeamFilter) WhereName(p entql.StringP)
- type TeamGroupBy
- func (tgb *TeamGroupBy) Aggregate(fns ...AggregateFunc) *TeamGroupBy
- func (tgb *TeamGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (tgb *TeamGroupBy) BoolX(ctx context.Context) bool
- func (tgb *TeamGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (tgb *TeamGroupBy) BoolsX(ctx context.Context) []bool
- func (tgb *TeamGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (tgb *TeamGroupBy) Float64X(ctx context.Context) float64
- func (tgb *TeamGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (tgb *TeamGroupBy) Float64sX(ctx context.Context) []float64
- func (tgb *TeamGroupBy) Int(ctx context.Context) (_ int, err error)
- func (tgb *TeamGroupBy) IntX(ctx context.Context) int
- func (tgb *TeamGroupBy) Ints(ctx context.Context) ([]int, error)
- func (tgb *TeamGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TeamGroupBy) Scan(ctx context.Context, v interface{}) error
- func (tgb *TeamGroupBy) ScanX(ctx context.Context, v interface{})
- func (tgb *TeamGroupBy) String(ctx context.Context) (_ string, err error)
- func (tgb *TeamGroupBy) StringX(ctx context.Context) string
- func (tgb *TeamGroupBy) Strings(ctx context.Context) ([]string, error)
- func (tgb *TeamGroupBy) StringsX(ctx context.Context) []string
- type TeamMutation
- func (m *TeamMutation) AddField(name string, value ent.Value) error
- func (m *TeamMutation) AddTaskIDs(ids ...int)
- func (m *TeamMutation) AddUserIDs(ids ...int)
- func (m *TeamMutation) AddedEdges() []string
- func (m *TeamMutation) AddedField(name string) (ent.Value, bool)
- func (m *TeamMutation) AddedFields() []string
- func (m *TeamMutation) AddedIDs(name string) []ent.Value
- func (m *TeamMutation) ClearEdge(name string) error
- func (m *TeamMutation) ClearField(name string) error
- func (m *TeamMutation) ClearTasks()
- func (m *TeamMutation) ClearUsers()
- func (m *TeamMutation) ClearedEdges() []string
- func (m *TeamMutation) ClearedFields() []string
- func (m TeamMutation) Client() *Client
- func (m *TeamMutation) EdgeCleared(name string) bool
- func (m *TeamMutation) Field(name string) (ent.Value, bool)
- func (m *TeamMutation) FieldCleared(name string) bool
- func (m *TeamMutation) Fields() []string
- func (m *TeamMutation) Filter() *TeamFilter
- func (m *TeamMutation) ID() (id int, exists bool)
- func (m *TeamMutation) Name() (r string, exists bool)
- func (m *TeamMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TeamMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TeamMutation) Op() Op
- func (m *TeamMutation) RemoveTaskIDs(ids ...int)
- func (m *TeamMutation) RemoveUserIDs(ids ...int)
- func (m *TeamMutation) RemovedEdges() []string
- func (m *TeamMutation) RemovedIDs(name string) []ent.Value
- func (m *TeamMutation) RemovedTasksIDs() (ids []int)
- func (m *TeamMutation) RemovedUsersIDs() (ids []int)
- func (m *TeamMutation) ResetEdge(name string) error
- func (m *TeamMutation) ResetField(name string) error
- func (m *TeamMutation) ResetName()
- func (m *TeamMutation) ResetTasks()
- func (m *TeamMutation) ResetUsers()
- func (m *TeamMutation) SetField(name string, value ent.Value) error
- func (m *TeamMutation) SetName(s string)
- func (m *TeamMutation) TasksCleared() bool
- func (m *TeamMutation) TasksIDs() (ids []int)
- func (m TeamMutation) Tx() (*Tx, error)
- func (m *TeamMutation) Type() string
- func (m *TeamMutation) UsersCleared() bool
- func (m *TeamMutation) UsersIDs() (ids []int)
- type TeamQuery
- func (tq *TeamQuery) All(ctx context.Context) ([]*Team, error)
- func (tq *TeamQuery) AllX(ctx context.Context) []*Team
- func (tq *TeamQuery) Clone() *TeamQuery
- func (tq *TeamQuery) Count(ctx context.Context) (int, error)
- func (tq *TeamQuery) CountX(ctx context.Context) int
- func (tq *TeamQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TeamQuery) ExistX(ctx context.Context) bool
- func (tq *TeamQuery) Filter() *TeamFilter
- func (tq *TeamQuery) First(ctx context.Context) (*Team, error)
- func (tq *TeamQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TeamQuery) FirstIDX(ctx context.Context) int
- func (tq *TeamQuery) FirstX(ctx context.Context) *Team
- func (tq *TeamQuery) GroupBy(field string, fields ...string) *TeamGroupBy
- func (tq *TeamQuery) IDs(ctx context.Context) ([]int, error)
- func (tq *TeamQuery) IDsX(ctx context.Context) []int
- func (tq *TeamQuery) Limit(limit int) *TeamQuery
- func (tq *TeamQuery) Offset(offset int) *TeamQuery
- func (tq *TeamQuery) Only(ctx context.Context) (*Team, error)
- func (tq *TeamQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TeamQuery) OnlyIDX(ctx context.Context) int
- func (tq *TeamQuery) OnlyX(ctx context.Context) *Team
- func (tq *TeamQuery) Order(o ...OrderFunc) *TeamQuery
- func (tq *TeamQuery) QueryTasks() *TaskQuery
- func (tq *TeamQuery) QueryUsers() *UserQuery
- func (tq *TeamQuery) Select(field string, fields ...string) *TeamSelect
- func (tq *TeamQuery) Where(ps ...predicate.Team) *TeamQuery
- func (tq *TeamQuery) WithTasks(opts ...func(*TaskQuery)) *TeamQuery
- func (tq *TeamQuery) WithUsers(opts ...func(*UserQuery)) *TeamQuery
- type TeamSelect
- func (ts *TeamSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ts *TeamSelect) BoolX(ctx context.Context) bool
- func (ts *TeamSelect) Bools(ctx context.Context) ([]bool, error)
- func (ts *TeamSelect) BoolsX(ctx context.Context) []bool
- func (ts *TeamSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ts *TeamSelect) Float64X(ctx context.Context) float64
- func (ts *TeamSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ts *TeamSelect) Float64sX(ctx context.Context) []float64
- func (ts *TeamSelect) Int(ctx context.Context) (_ int, err error)
- func (ts *TeamSelect) IntX(ctx context.Context) int
- func (ts *TeamSelect) Ints(ctx context.Context) ([]int, error)
- func (ts *TeamSelect) IntsX(ctx context.Context) []int
- func (ts *TeamSelect) Scan(ctx context.Context, v interface{}) error
- func (ts *TeamSelect) ScanX(ctx context.Context, v interface{})
- func (ts *TeamSelect) String(ctx context.Context) (_ string, err error)
- func (ts *TeamSelect) StringX(ctx context.Context) string
- func (ts *TeamSelect) Strings(ctx context.Context) ([]string, error)
- func (ts *TeamSelect) StringsX(ctx context.Context) []string
- type TeamUpdate
- func (tu *TeamUpdate) AddTaskIDs(ids ...int) *TeamUpdate
- func (tu *TeamUpdate) AddTasks(t ...*Task) *TeamUpdate
- func (tu *TeamUpdate) AddUserIDs(ids ...int) *TeamUpdate
- func (tu *TeamUpdate) AddUsers(u ...*User) *TeamUpdate
- func (tu *TeamUpdate) ClearTasks() *TeamUpdate
- func (tu *TeamUpdate) ClearUsers() *TeamUpdate
- func (tu *TeamUpdate) Exec(ctx context.Context) error
- func (tu *TeamUpdate) ExecX(ctx context.Context)
- func (tu *TeamUpdate) Mutation() *TeamMutation
- func (tu *TeamUpdate) RemoveTaskIDs(ids ...int) *TeamUpdate
- func (tu *TeamUpdate) RemoveTasks(t ...*Task) *TeamUpdate
- func (tu *TeamUpdate) RemoveUserIDs(ids ...int) *TeamUpdate
- func (tu *TeamUpdate) RemoveUsers(u ...*User) *TeamUpdate
- func (tu *TeamUpdate) Save(ctx context.Context) (int, error)
- func (tu *TeamUpdate) SaveX(ctx context.Context) int
- func (tu *TeamUpdate) SetName(s string) *TeamUpdate
- func (tu *TeamUpdate) Where(ps ...predicate.Team) *TeamUpdate
- type TeamUpdateOne
- func (tuo *TeamUpdateOne) AddTaskIDs(ids ...int) *TeamUpdateOne
- func (tuo *TeamUpdateOne) AddTasks(t ...*Task) *TeamUpdateOne
- func (tuo *TeamUpdateOne) AddUserIDs(ids ...int) *TeamUpdateOne
- func (tuo *TeamUpdateOne) AddUsers(u ...*User) *TeamUpdateOne
- func (tuo *TeamUpdateOne) ClearTasks() *TeamUpdateOne
- func (tuo *TeamUpdateOne) ClearUsers() *TeamUpdateOne
- func (tuo *TeamUpdateOne) Exec(ctx context.Context) error
- func (tuo *TeamUpdateOne) ExecX(ctx context.Context)
- func (tuo *TeamUpdateOne) Mutation() *TeamMutation
- func (tuo *TeamUpdateOne) RemoveTaskIDs(ids ...int) *TeamUpdateOne
- func (tuo *TeamUpdateOne) RemoveTasks(t ...*Task) *TeamUpdateOne
- func (tuo *TeamUpdateOne) RemoveUserIDs(ids ...int) *TeamUpdateOne
- func (tuo *TeamUpdateOne) RemoveUsers(u ...*User) *TeamUpdateOne
- func (tuo *TeamUpdateOne) Save(ctx context.Context) (*Team, error)
- func (tuo *TeamUpdateOne) SaveX(ctx context.Context) *Team
- func (tuo *TeamUpdateOne) SetName(s string) *TeamUpdateOne
- type Teams
- type Tx
- type User
- type 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) QueryTasks(u *User) *TaskQuery
- func (c *UserClient) QueryTeams(u *User) *TeamQuery
- 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
- func (uc *UserCreate) AddTaskIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddTasks(t ...*Task) *UserCreate
- func (uc *UserCreate) AddTeamIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddTeams(t ...*Team) *UserCreate
- 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) SetAge(u uint) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableAge(u *uint) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserFilter
- func (f *UserFilter) Where(p entql.P)
- func (f *UserFilter) WhereAge(p entql.UintP)
- func (f *UserFilter) WhereHasTasks()
- func (f *UserFilter) WhereHasTasksWith(preds ...predicate.Task)
- func (f *UserFilter) WhereHasTeams()
- func (f *UserFilter) WhereHasTeamsWith(preds ...predicate.Team)
- func (f *UserFilter) WhereID(p entql.IntP)
- func (f *UserFilter) WhereName(p entql.StringP)
- type UserGroupBy
- 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
- func (m *UserMutation) AddAge(u uint)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddTaskIDs(ids ...int)
- func (m *UserMutation) AddTeamIDs(ids ...int)
- func (m *UserMutation) AddedAge() (r uint, exists bool)
- 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) Age() (r uint, exists bool)
- func (m *UserMutation) AgeCleared() bool
- func (m *UserMutation) ClearAge()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearTasks()
- func (m *UserMutation) ClearTeams()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- 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) Filter() *UserFilter
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldAge(ctx context.Context) (v uint, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemoveTaskIDs(ids ...int)
- func (m *UserMutation) RemoveTeamIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedTasksIDs() (ids []int)
- func (m *UserMutation) RemovedTeamsIDs() (ids []int)
- func (m *UserMutation) ResetAge()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetTasks()
- func (m *UserMutation) ResetTeams()
- func (m *UserMutation) SetAge(u uint)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) TasksCleared() bool
- func (m *UserMutation) TasksIDs() (ids []int)
- func (m *UserMutation) TeamsCleared() bool
- func (m *UserMutation) TeamsIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- type UserQuery
- 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) Filter() *UserFilter
- 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) QueryTasks() *TaskQuery
- func (uq *UserQuery) QueryTeams() *TeamQuery
- func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithTasks(opts ...func(*TaskQuery)) *UserQuery
- func (uq *UserQuery) WithTeams(opts ...func(*TeamQuery)) *UserQuery
- type UserSelect
- 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
- func (uu *UserUpdate) AddAge(u uint) *UserUpdate
- func (uu *UserUpdate) AddTaskIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddTasks(t ...*Task) *UserUpdate
- func (uu *UserUpdate) AddTeamIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddTeams(t ...*Team) *UserUpdate
- func (uu *UserUpdate) ClearAge() *UserUpdate
- func (uu *UserUpdate) ClearTasks() *UserUpdate
- func (uu *UserUpdate) ClearTeams() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveTaskIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveTasks(t ...*Task) *UserUpdate
- func (uu *UserUpdate) RemoveTeamIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveTeams(t ...*Team) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAge(u uint) *UserUpdate
- func (uu *UserUpdate) SetNillableAge(u *uint) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAge(u uint) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTaskIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTasks(t ...*Task) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTeamIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTeams(t ...*Team) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAge() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearTasks() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearTeams() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveTaskIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveTasks(t ...*Task) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveTeamIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveTeams(t ...*Team) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) SetAge(u uint) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAge(u *uint) *UserUpdateOne
- type Users
- 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. TypeTask = "Task" TypeTeam = "Team" TypeUser = "User" )
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 validaton 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 // Task is the client for interacting with the Task builders. Task *TaskClient // Team is the client for interacting with the Team builders. Team *TeamClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns the Client stored in 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(). Task. Query(). Count(ctx)
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(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 MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflict 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 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(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 Rollbacker method.
type Task ¶ added in v0.5.0
type Task struct { // ID of the ent. ID int `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Status holds the value of the "status" field. Status task.Status `json:"status,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TaskQuery when eager-loading is set. Edges TaskEdges `json:"edges"` // contains filtered or unexported fields }
Task is the model entity for the Task schema.
func (*Task) QueryOwner ¶ added in v0.5.0
QueryOwner queries the owner edge of the Task.
func (*Task) QueryTeams ¶ added in v0.5.0
QueryTeams queries the teams edge of the Task.
func (*Task) Unwrap ¶ added in v0.5.0
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*Task) Update ¶ added in v0.5.0
func (t *Task) Update() *TaskUpdateOne
Update returns a builder for updating this Task. Note that, you need to call Task.Unwrap() before calling this method, if this Task was returned from a transaction, and the transaction was committed or rolled back.
type TaskClient ¶ added in v0.5.0
type TaskClient struct {
// contains filtered or unexported fields
}
TaskClient is a client for the Task schema.
func NewTaskClient ¶ added in v0.5.0
func NewTaskClient(c config) *TaskClient
NewTaskClient returns a client for the Task from the given config.
func (*TaskClient) Create ¶ added in v0.5.0
func (c *TaskClient) Create() *TaskCreate
Create returns a create builder for Task.
func (*TaskClient) CreateBulk ¶ added in v0.5.0
func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk
CreateBulk returns a builder for creating a bulk of Task entities.
func (*TaskClient) Delete ¶ added in v0.5.0
func (c *TaskClient) Delete() *TaskDelete
Delete returns a delete builder for Task.
func (*TaskClient) DeleteOne ¶ added in v0.5.0
func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*TaskClient) DeleteOneID ¶ added in v0.5.0
func (c *TaskClient) DeleteOneID(id int) *TaskDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*TaskClient) GetX ¶ added in v0.5.0
func (c *TaskClient) GetX(ctx context.Context, id int) *Task
GetX is like Get, but panics if an error occurs.
func (*TaskClient) Hooks ¶ added in v0.5.0
func (c *TaskClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TaskClient) Query ¶ added in v0.5.0
func (c *TaskClient) Query() *TaskQuery
Query returns a query builder for Task.
func (*TaskClient) QueryOwner ¶ added in v0.5.0
func (c *TaskClient) QueryOwner(t *Task) *UserQuery
QueryOwner queries the owner edge of a Task.
func (*TaskClient) QueryTeams ¶ added in v0.5.0
func (c *TaskClient) QueryTeams(t *Task) *TeamQuery
QueryTeams queries the teams edge of a Task.
func (*TaskClient) Update ¶ added in v0.5.0
func (c *TaskClient) Update() *TaskUpdate
Update returns an update builder for Task.
func (*TaskClient) UpdateOne ¶ added in v0.5.0
func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TaskClient) UpdateOneID ¶ added in v0.5.0
func (c *TaskClient) UpdateOneID(id int) *TaskUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TaskClient) Use ¶ added in v0.5.0
func (c *TaskClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `task.Hooks(f(g(h())))`.
type TaskCreate ¶ added in v0.5.0
type TaskCreate struct {
// contains filtered or unexported fields
}
TaskCreate is the builder for creating a Task entity.
func (*TaskCreate) AddTeamIDs ¶ added in v0.5.0
func (tc *TaskCreate) AddTeamIDs(ids ...int) *TaskCreate
AddTeamIDs adds the teams edge to Team by ids.
func (*TaskCreate) AddTeams ¶ added in v0.5.0
func (tc *TaskCreate) AddTeams(t ...*Team) *TaskCreate
AddTeams adds the teams edges to Team.
func (*TaskCreate) Mutation ¶ added in v0.5.0
func (tc *TaskCreate) Mutation() *TaskMutation
Mutation returns the TaskMutation object of the builder.
func (*TaskCreate) Save ¶ added in v0.5.0
func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)
Save creates the Task in the database.
func (*TaskCreate) SaveX ¶ added in v0.5.0
func (tc *TaskCreate) SaveX(ctx context.Context) *Task
SaveX calls Save and panics if Save returns an error.
func (*TaskCreate) SetDescription ¶ added in v0.5.0
func (tc *TaskCreate) SetDescription(s string) *TaskCreate
SetDescription sets the description field.
func (*TaskCreate) SetNillableDescription ¶ added in v0.5.0
func (tc *TaskCreate) SetNillableDescription(s *string) *TaskCreate
SetNillableDescription sets the description field if the given value is not nil.
func (*TaskCreate) SetNillableOwnerID ¶ added in v0.5.0
func (tc *TaskCreate) SetNillableOwnerID(id *int) *TaskCreate
SetNillableOwnerID sets the owner edge to User by id if the given value is not nil.
func (*TaskCreate) SetNillableStatus ¶ added in v0.5.0
func (tc *TaskCreate) SetNillableStatus(t *task.Status) *TaskCreate
SetNillableStatus sets the status field if the given value is not nil.
func (*TaskCreate) SetOwner ¶ added in v0.5.0
func (tc *TaskCreate) SetOwner(u *User) *TaskCreate
SetOwner sets the owner edge to User.
func (*TaskCreate) SetOwnerID ¶ added in v0.5.0
func (tc *TaskCreate) SetOwnerID(id int) *TaskCreate
SetOwnerID sets the owner edge to User by id.
func (*TaskCreate) SetStatus ¶ added in v0.5.0
func (tc *TaskCreate) SetStatus(t task.Status) *TaskCreate
SetStatus sets the status field.
func (*TaskCreate) SetTitle ¶ added in v0.5.0
func (tc *TaskCreate) SetTitle(s string) *TaskCreate
SetTitle sets the title field.
type TaskCreateBulk ¶ added in v0.5.0
type TaskCreateBulk struct {
// contains filtered or unexported fields
}
TaskCreateBulk is the builder for creating a bulk of Task entities.
type TaskDelete ¶ added in v0.5.0
type TaskDelete struct {
// contains filtered or unexported fields
}
TaskDelete is the builder for deleting a Task entity.
func (*TaskDelete) Exec ¶ added in v0.5.0
func (td *TaskDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TaskDelete) ExecX ¶ added in v0.5.0
func (td *TaskDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TaskDelete) Where ¶ added in v0.5.0
func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete
Where adds a new predicate to the delete builder.
type TaskDeleteOne ¶ added in v0.5.0
type TaskDeleteOne struct {
// contains filtered or unexported fields
}
TaskDeleteOne is the builder for deleting a single Task entity.
func (*TaskDeleteOne) Exec ¶ added in v0.5.0
func (tdo *TaskDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TaskDeleteOne) ExecX ¶ added in v0.5.0
func (tdo *TaskDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TaskEdges ¶ added in v0.5.0
type TaskEdges struct { // Teams holds the value of the teams edge. Teams []*Team // Owner holds the value of the owner edge. Owner *User // contains filtered or unexported fields }
TaskEdges holds the relations/edges for other nodes in the graph.
func (TaskEdges) OwnerOrErr ¶ added in v0.5.0
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (TaskEdges) TeamsOrErr ¶ added in v0.5.0
TeamsOrErr returns the Teams value or an error if the edge was not loaded in eager-loading.
type TaskFilter ¶ added in v0.5.0
type TaskFilter struct {
// contains filtered or unexported fields
}
TaskFilter provides a generic filtering capability at runtime for TaskQuery.
func (*TaskFilter) Where ¶ added in v0.5.0
func (f *TaskFilter) Where(p entql.P)
Where applies the entql predicate on the query filter.
func (*TaskFilter) WhereDescription ¶ added in v0.5.0
func (f *TaskFilter) WhereDescription(p entql.StringP)
WhereDescription applies the entql string predicate on the description field.
func (*TaskFilter) WhereHasOwner ¶ added in v0.5.0
func (f *TaskFilter) WhereHasOwner()
WhereHasOwner applies a predicate to check if query has an edge owner.
func (*TaskFilter) WhereHasOwnerWith ¶ added in v0.5.0
func (f *TaskFilter) WhereHasOwnerWith(preds ...predicate.User)
WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates).
func (*TaskFilter) WhereHasTeams ¶ added in v0.5.0
func (f *TaskFilter) WhereHasTeams()
WhereHasTeams applies a predicate to check if query has an edge teams.
func (*TaskFilter) WhereHasTeamsWith ¶ added in v0.5.0
func (f *TaskFilter) WhereHasTeamsWith(preds ...predicate.Team)
WhereHasTeamsWith applies a predicate to check if query has an edge teams with a given conditions (other predicates).
func (*TaskFilter) WhereID ¶ added in v0.5.0
func (f *TaskFilter) WhereID(p entql.IntP)
WhereID applies the entql int predicate on the id field.
func (*TaskFilter) WhereStatus ¶ added in v0.5.0
func (f *TaskFilter) WhereStatus(p entql.StringP)
WhereStatus applies the entql string predicate on the status field.
func (*TaskFilter) WhereTitle ¶ added in v0.5.0
func (f *TaskFilter) WhereTitle(p entql.StringP)
WhereTitle applies the entql string predicate on the title field.
type TaskGroupBy ¶ added in v0.5.0
type TaskGroupBy struct {
// contains filtered or unexported fields
}
TaskGroupBy is the builder for group-by Task entities.
func (*TaskGroupBy) Aggregate ¶ added in v0.5.0
func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TaskGroupBy) Bool ¶ added in v0.5.0
func (tgb *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) BoolX ¶ added in v0.5.0
func (tgb *TaskGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*TaskGroupBy) Bools ¶ added in v0.5.0
func (tgb *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) BoolsX ¶ added in v0.5.0
func (tgb *TaskGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*TaskGroupBy) Float64 ¶ added in v0.5.0
func (tgb *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) Float64X ¶ added in v0.5.0
func (tgb *TaskGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*TaskGroupBy) Float64s ¶ added in v0.5.0
func (tgb *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) Float64sX ¶ added in v0.5.0
func (tgb *TaskGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*TaskGroupBy) Int ¶ added in v0.5.0
func (tgb *TaskGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) IntX ¶ added in v0.5.0
func (tgb *TaskGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*TaskGroupBy) Ints ¶ added in v0.5.0
func (tgb *TaskGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) IntsX ¶ added in v0.5.0
func (tgb *TaskGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*TaskGroupBy) Scan ¶ added in v0.5.0
func (tgb *TaskGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*TaskGroupBy) ScanX ¶ added in v0.5.0
func (tgb *TaskGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*TaskGroupBy) String ¶ added in v0.5.0
func (tgb *TaskGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*TaskGroupBy) StringX ¶ added in v0.5.0
func (tgb *TaskGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type TaskMutation ¶ added in v0.5.0
type TaskMutation struct {
// contains filtered or unexported fields
}
TaskMutation represents an operation that mutate the Tasks nodes in the graph.
func (*TaskMutation) AddField ¶ added in v0.5.0
func (m *TaskMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TaskMutation) AddTeamIDs ¶ added in v0.5.0
func (m *TaskMutation) AddTeamIDs(ids ...int)
AddTeamIDs adds the teams edge to Team by ids.
func (*TaskMutation) AddedEdges ¶ added in v0.5.0
func (m *TaskMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TaskMutation) AddedField ¶ added in v0.5.0
func (m *TaskMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*TaskMutation) AddedFields ¶ added in v0.5.0
func (m *TaskMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*TaskMutation) AddedIDs ¶ added in v0.5.0
func (m *TaskMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*TaskMutation) ClearDescription ¶ added in v0.5.0
func (m *TaskMutation) ClearDescription()
ClearDescription clears the value of description.
func (*TaskMutation) ClearEdge ¶ added in v0.5.0
func (m *TaskMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*TaskMutation) ClearField ¶ added in v0.5.0
func (m *TaskMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*TaskMutation) ClearOwner ¶ added in v0.5.0
func (m *TaskMutation) ClearOwner()
ClearOwner clears the owner edge to User.
func (*TaskMutation) ClearTeams ¶ added in v0.5.0
func (m *TaskMutation) ClearTeams()
ClearTeams clears the teams edge to Team.
func (*TaskMutation) ClearedEdges ¶ added in v0.5.0
func (m *TaskMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TaskMutation) ClearedFields ¶ added in v0.5.0
func (m *TaskMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TaskMutation) Client ¶ added in v0.5.0
func (m TaskMutation) 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 (*TaskMutation) Description ¶ added in v0.5.0
func (m *TaskMutation) Description() (r string, exists bool)
Description returns the description value in the mutation.
func (*TaskMutation) DescriptionCleared ¶ added in v0.5.0
func (m *TaskMutation) DescriptionCleared() bool
DescriptionCleared returns if the field description was cleared in this mutation.
func (*TaskMutation) EdgeCleared ¶ added in v0.5.0
func (m *TaskMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*TaskMutation) Field ¶ added in v0.5.0
func (m *TaskMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*TaskMutation) FieldCleared ¶ added in v0.5.0
func (m *TaskMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*TaskMutation) Fields ¶ added in v0.5.0
func (m *TaskMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*TaskMutation) Filter ¶ added in v0.5.0
func (m *TaskMutation) Filter() *TaskFilter
Filter returns an entql.Where implementation to apply filters on the TaskMutation builder.
func (*TaskMutation) ID ¶ added in v0.5.0
func (m *TaskMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*TaskMutation) OldDescription ¶ added in v0.5.0
func (m *TaskMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old description value of the Task. If the Task 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 database query fails.
func (*TaskMutation) OldField ¶ added in v0.5.0
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 was failed.
func (*TaskMutation) OldStatus ¶ added in v0.5.0
OldStatus returns the old status value of the Task. If the Task 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 database query fails.
func (*TaskMutation) OldTitle ¶ added in v0.5.0
func (m *TaskMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old title value of the Task. If the Task 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 database query fails.
func (*TaskMutation) Op ¶ added in v0.5.0
func (m *TaskMutation) Op() Op
Op returns the operation name.
func (*TaskMutation) OwnerCleared ¶ added in v0.5.0
func (m *TaskMutation) OwnerCleared() bool
OwnerCleared returns if the edge owner was cleared.
func (*TaskMutation) OwnerID ¶ added in v0.5.0
func (m *TaskMutation) OwnerID() (id int, exists bool)
OwnerID returns the owner id in the mutation.
func (*TaskMutation) OwnerIDs ¶ added in v0.5.0
func (m *TaskMutation) OwnerIDs() (ids []int)
OwnerIDs returns the owner ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*TaskMutation) RemoveTeamIDs ¶ added in v0.5.0
func (m *TaskMutation) RemoveTeamIDs(ids ...int)
RemoveTeamIDs removes the teams edge to Team by ids.
func (*TaskMutation) RemovedEdges ¶ added in v0.5.0
func (m *TaskMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TaskMutation) RemovedIDs ¶ added in v0.5.0
func (m *TaskMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*TaskMutation) RemovedTeamsIDs ¶ added in v0.5.0
func (m *TaskMutation) RemovedTeamsIDs() (ids []int)
RemovedTeams returns the removed ids of teams.
func (*TaskMutation) ResetDescription ¶ added in v0.5.0
func (m *TaskMutation) ResetDescription()
ResetDescription reset all changes of the "description" field.
func (*TaskMutation) ResetEdge ¶ added in v0.5.0
func (m *TaskMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*TaskMutation) ResetField ¶ added in v0.5.0
func (m *TaskMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*TaskMutation) ResetOwner ¶ added in v0.5.0
func (m *TaskMutation) ResetOwner()
ResetOwner reset all changes of the "owner" edge.
func (*TaskMutation) ResetStatus ¶ added in v0.5.0
func (m *TaskMutation) ResetStatus()
ResetStatus reset all changes of the "status" field.
func (*TaskMutation) ResetTeams ¶ added in v0.5.0
func (m *TaskMutation) ResetTeams()
ResetTeams reset all changes of the "teams" edge.
func (*TaskMutation) ResetTitle ¶ added in v0.5.0
func (m *TaskMutation) ResetTitle()
ResetTitle reset all changes of the "title" field.
func (*TaskMutation) SetDescription ¶ added in v0.5.0
func (m *TaskMutation) SetDescription(s string)
SetDescription sets the description field.
func (*TaskMutation) SetField ¶ added in v0.5.0
func (m *TaskMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TaskMutation) SetOwnerID ¶ added in v0.5.0
func (m *TaskMutation) SetOwnerID(id int)
SetOwnerID sets the owner edge to User by id.
func (*TaskMutation) SetStatus ¶ added in v0.5.0
func (m *TaskMutation) SetStatus(t task.Status)
SetStatus sets the status field.
func (*TaskMutation) SetTitle ¶ added in v0.5.0
func (m *TaskMutation) SetTitle(s string)
SetTitle sets the title field.
func (*TaskMutation) Status ¶ added in v0.5.0
func (m *TaskMutation) Status() (r task.Status, exists bool)
Status returns the status value in the mutation.
func (*TaskMutation) TeamsCleared ¶ added in v0.5.0
func (m *TaskMutation) TeamsCleared() bool
TeamsCleared returns if the edge teams was cleared.
func (*TaskMutation) TeamsIDs ¶ added in v0.5.0
func (m *TaskMutation) TeamsIDs() (ids []int)
TeamsIDs returns the teams ids in the mutation.
func (*TaskMutation) Title ¶ added in v0.5.0
func (m *TaskMutation) Title() (r string, exists bool)
Title returns the title value in the mutation.
func (TaskMutation) Tx ¶ added in v0.5.0
func (m TaskMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TaskMutation) Type ¶ added in v0.5.0
func (m *TaskMutation) Type() string
Type returns the node type of this mutation (Task).
type TaskQuery ¶ added in v0.5.0
type TaskQuery struct {
// contains filtered or unexported fields
}
TaskQuery is the builder for querying Task entities.
func (*TaskQuery) Clone ¶ added in v0.5.0
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TaskQuery) Exist ¶ added in v0.5.0
Exist returns true if the query has elements in the graph.
func (*TaskQuery) Filter ¶ added in v0.5.0
func (tq *TaskQuery) Filter() *TaskFilter
Filter returns a Filter implementation to apply filters on the TaskQuery builder.
func (*TaskQuery) First ¶ added in v0.5.0
First returns the first Task entity in the query. Returns *NotFoundError when no task was found.
func (*TaskQuery) FirstID ¶ added in v0.5.0
FirstID returns the first Task id in the query. Returns *NotFoundError when no id was found.
func (*TaskQuery) FirstIDX ¶ added in v0.5.0
FirstIDX is like FirstID, but panics if an error occurs.
func (*TaskQuery) GroupBy ¶ added in v0.5.0
func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy
GroupBy 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 { Title string `json:"title,omitempty"` Count int `json:"count,omitempty"` } client.Task.Query(). GroupBy(task.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TaskQuery) Only ¶ added in v0.5.0
Only returns the only Task entity in the query, returns an error if not exactly one entity was returned.
func (*TaskQuery) OnlyID ¶ added in v0.5.0
OnlyID returns the only Task id in the query, returns an error if not exactly one id was returned.
func (*TaskQuery) QueryOwner ¶ added in v0.5.0
QueryOwner chains the current query on the owner edge.
func (*TaskQuery) QueryTeams ¶ added in v0.5.0
QueryTeams chains the current query on the teams edge.
func (*TaskQuery) Select ¶ added in v0.5.0
func (tq *TaskQuery) Select(field string, fields ...string) *TaskSelect
Select one or more fields from the given query.
Example:
var v []struct { Title string `json:"title,omitempty"` } client.Task.Query(). Select(task.FieldTitle). Scan(ctx, &v)
type TaskSelect ¶ added in v0.5.0
type TaskSelect struct {
// contains filtered or unexported fields
}
TaskSelect is the builder for select fields of Task entities.
func (*TaskSelect) Bool ¶ added in v0.5.0
func (ts *TaskSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from selector. It is only allowed when selecting one field.
func (*TaskSelect) BoolX ¶ added in v0.5.0
func (ts *TaskSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*TaskSelect) Bools ¶ added in v0.5.0
func (ts *TaskSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*TaskSelect) BoolsX ¶ added in v0.5.0
func (ts *TaskSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*TaskSelect) Float64 ¶ added in v0.5.0
func (ts *TaskSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from selector. It is only allowed when selecting one field.
func (*TaskSelect) Float64X ¶ added in v0.5.0
func (ts *TaskSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*TaskSelect) Float64s ¶ added in v0.5.0
func (ts *TaskSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*TaskSelect) Float64sX ¶ added in v0.5.0
func (ts *TaskSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*TaskSelect) Int ¶ added in v0.5.0
func (ts *TaskSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from selector. It is only allowed when selecting one field.
func (*TaskSelect) IntX ¶ added in v0.5.0
func (ts *TaskSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*TaskSelect) Ints ¶ added in v0.5.0
func (ts *TaskSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*TaskSelect) IntsX ¶ added in v0.5.0
func (ts *TaskSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*TaskSelect) Scan ¶ added in v0.5.0
func (ts *TaskSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*TaskSelect) ScanX ¶ added in v0.5.0
func (ts *TaskSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*TaskSelect) String ¶ added in v0.5.0
func (ts *TaskSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from selector. It is only allowed when selecting one field.
func (*TaskSelect) StringX ¶ added in v0.5.0
func (ts *TaskSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type TaskUpdate ¶ added in v0.5.0
type TaskUpdate struct {
// contains filtered or unexported fields
}
TaskUpdate is the builder for updating Task entities.
func (*TaskUpdate) AddTeamIDs ¶ added in v0.5.0
func (tu *TaskUpdate) AddTeamIDs(ids ...int) *TaskUpdate
AddTeamIDs adds the teams edge to Team by ids.
func (*TaskUpdate) AddTeams ¶ added in v0.5.0
func (tu *TaskUpdate) AddTeams(t ...*Team) *TaskUpdate
AddTeams adds the teams edges to Team.
func (*TaskUpdate) ClearDescription ¶ added in v0.5.0
func (tu *TaskUpdate) ClearDescription() *TaskUpdate
ClearDescription clears the value of description.
func (*TaskUpdate) ClearOwner ¶ added in v0.5.0
func (tu *TaskUpdate) ClearOwner() *TaskUpdate
ClearOwner clears the "owner" edge to type User.
func (*TaskUpdate) ClearTeams ¶ added in v0.5.0
func (tu *TaskUpdate) ClearTeams() *TaskUpdate
ClearTeams clears all "teams" edges to type Team.
func (*TaskUpdate) Exec ¶ added in v0.5.0
func (tu *TaskUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TaskUpdate) ExecX ¶ added in v0.5.0
func (tu *TaskUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TaskUpdate) Mutation ¶ added in v0.5.0
func (tu *TaskUpdate) Mutation() *TaskMutation
Mutation returns the TaskMutation object of the builder.
func (*TaskUpdate) RemoveTeamIDs ¶ added in v0.5.0
func (tu *TaskUpdate) RemoveTeamIDs(ids ...int) *TaskUpdate
RemoveTeamIDs removes the teams edge to Team by ids.
func (*TaskUpdate) RemoveTeams ¶ added in v0.5.0
func (tu *TaskUpdate) RemoveTeams(t ...*Team) *TaskUpdate
RemoveTeams removes teams edges to Team.
func (*TaskUpdate) Save ¶ added in v0.5.0
func (tu *TaskUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TaskUpdate) SaveX ¶ added in v0.5.0
func (tu *TaskUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TaskUpdate) SetDescription ¶ added in v0.5.0
func (tu *TaskUpdate) SetDescription(s string) *TaskUpdate
SetDescription sets the description field.
func (*TaskUpdate) SetNillableDescription ¶ added in v0.5.0
func (tu *TaskUpdate) SetNillableDescription(s *string) *TaskUpdate
SetNillableDescription sets the description field if the given value is not nil.
func (*TaskUpdate) SetNillableOwnerID ¶ added in v0.5.0
func (tu *TaskUpdate) SetNillableOwnerID(id *int) *TaskUpdate
SetNillableOwnerID sets the owner edge to User by id if the given value is not nil.
func (*TaskUpdate) SetNillableStatus ¶ added in v0.5.0
func (tu *TaskUpdate) SetNillableStatus(t *task.Status) *TaskUpdate
SetNillableStatus sets the status field if the given value is not nil.
func (*TaskUpdate) SetOwner ¶ added in v0.5.0
func (tu *TaskUpdate) SetOwner(u *User) *TaskUpdate
SetOwner sets the owner edge to User.
func (*TaskUpdate) SetOwnerID ¶ added in v0.5.0
func (tu *TaskUpdate) SetOwnerID(id int) *TaskUpdate
SetOwnerID sets the owner edge to User by id.
func (*TaskUpdate) SetStatus ¶ added in v0.5.0
func (tu *TaskUpdate) SetStatus(t task.Status) *TaskUpdate
SetStatus sets the status field.
func (*TaskUpdate) SetTitle ¶ added in v0.5.0
func (tu *TaskUpdate) SetTitle(s string) *TaskUpdate
SetTitle sets the title field.
func (*TaskUpdate) Where ¶ added in v0.5.0
func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate
Where adds a new predicate for the builder.
type TaskUpdateOne ¶ added in v0.5.0
type TaskUpdateOne struct {
// contains filtered or unexported fields
}
TaskUpdateOne is the builder for updating a single Task entity.
func (*TaskUpdateOne) AddTeamIDs ¶ added in v0.5.0
func (tuo *TaskUpdateOne) AddTeamIDs(ids ...int) *TaskUpdateOne
AddTeamIDs adds the teams edge to Team by ids.
func (*TaskUpdateOne) AddTeams ¶ added in v0.5.0
func (tuo *TaskUpdateOne) AddTeams(t ...*Team) *TaskUpdateOne
AddTeams adds the teams edges to Team.
func (*TaskUpdateOne) ClearDescription ¶ added in v0.5.0
func (tuo *TaskUpdateOne) ClearDescription() *TaskUpdateOne
ClearDescription clears the value of description.
func (*TaskUpdateOne) ClearOwner ¶ added in v0.5.0
func (tuo *TaskUpdateOne) ClearOwner() *TaskUpdateOne
ClearOwner clears the "owner" edge to type User.
func (*TaskUpdateOne) ClearTeams ¶ added in v0.5.0
func (tuo *TaskUpdateOne) ClearTeams() *TaskUpdateOne
ClearTeams clears all "teams" edges to type Team.
func (*TaskUpdateOne) Exec ¶ added in v0.5.0
func (tuo *TaskUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TaskUpdateOne) ExecX ¶ added in v0.5.0
func (tuo *TaskUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TaskUpdateOne) Mutation ¶ added in v0.5.0
func (tuo *TaskUpdateOne) Mutation() *TaskMutation
Mutation returns the TaskMutation object of the builder.
func (*TaskUpdateOne) RemoveTeamIDs ¶ added in v0.5.0
func (tuo *TaskUpdateOne) RemoveTeamIDs(ids ...int) *TaskUpdateOne
RemoveTeamIDs removes the teams edge to Team by ids.
func (*TaskUpdateOne) RemoveTeams ¶ added in v0.5.0
func (tuo *TaskUpdateOne) RemoveTeams(t ...*Team) *TaskUpdateOne
RemoveTeams removes teams edges to Team.
func (*TaskUpdateOne) Save ¶ added in v0.5.0
func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)
Save executes the query and returns the updated entity.
func (*TaskUpdateOne) SaveX ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task
SaveX is like Save, but panics if an error occurs.
func (*TaskUpdateOne) SetDescription ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetDescription(s string) *TaskUpdateOne
SetDescription sets the description field.
func (*TaskUpdateOne) SetNillableDescription ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetNillableDescription(s *string) *TaskUpdateOne
SetNillableDescription sets the description field if the given value is not nil.
func (*TaskUpdateOne) SetNillableOwnerID ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetNillableOwnerID(id *int) *TaskUpdateOne
SetNillableOwnerID sets the owner edge to User by id if the given value is not nil.
func (*TaskUpdateOne) SetNillableStatus ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetNillableStatus(t *task.Status) *TaskUpdateOne
SetNillableStatus sets the status field if the given value is not nil.
func (*TaskUpdateOne) SetOwner ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetOwner(u *User) *TaskUpdateOne
SetOwner sets the owner edge to User.
func (*TaskUpdateOne) SetOwnerID ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetOwnerID(id int) *TaskUpdateOne
SetOwnerID sets the owner edge to User by id.
func (*TaskUpdateOne) SetStatus ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetStatus(t task.Status) *TaskUpdateOne
SetStatus sets the status field.
func (*TaskUpdateOne) SetTitle ¶ added in v0.5.0
func (tuo *TaskUpdateOne) SetTitle(s string) *TaskUpdateOne
SetTitle sets the title field.
type Team ¶ added in v0.5.0
type Team struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TeamQuery when eager-loading is set. Edges TeamEdges `json:"edges"` // contains filtered or unexported fields }
Team is the model entity for the Team schema.
func (*Team) QueryTasks ¶ added in v0.5.0
QueryTasks queries the tasks edge of the Team.
func (*Team) QueryUsers ¶ added in v0.5.0
QueryUsers queries the users edge of the Team.
func (*Team) Unwrap ¶ added in v0.5.0
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*Team) Update ¶ added in v0.5.0
func (t *Team) Update() *TeamUpdateOne
Update returns a builder for updating this Team. Note that, you need to call Team.Unwrap() before calling this method, if this Team was returned from a transaction, and the transaction was committed or rolled back.
type TeamClient ¶ added in v0.5.0
type TeamClient struct {
// contains filtered or unexported fields
}
TeamClient is a client for the Team schema.
func NewTeamClient ¶ added in v0.5.0
func NewTeamClient(c config) *TeamClient
NewTeamClient returns a client for the Team from the given config.
func (*TeamClient) Create ¶ added in v0.5.0
func (c *TeamClient) Create() *TeamCreate
Create returns a create builder for Team.
func (*TeamClient) CreateBulk ¶ added in v0.5.0
func (c *TeamClient) CreateBulk(builders ...*TeamCreate) *TeamCreateBulk
CreateBulk returns a builder for creating a bulk of Team entities.
func (*TeamClient) Delete ¶ added in v0.5.0
func (c *TeamClient) Delete() *TeamDelete
Delete returns a delete builder for Team.
func (*TeamClient) DeleteOne ¶ added in v0.5.0
func (c *TeamClient) DeleteOne(t *Team) *TeamDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*TeamClient) DeleteOneID ¶ added in v0.5.0
func (c *TeamClient) DeleteOneID(id int) *TeamDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*TeamClient) GetX ¶ added in v0.5.0
func (c *TeamClient) GetX(ctx context.Context, id int) *Team
GetX is like Get, but panics if an error occurs.
func (*TeamClient) Hooks ¶ added in v0.5.0
func (c *TeamClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TeamClient) Query ¶ added in v0.5.0
func (c *TeamClient) Query() *TeamQuery
Query returns a query builder for Team.
func (*TeamClient) QueryTasks ¶ added in v0.5.0
func (c *TeamClient) QueryTasks(t *Team) *TaskQuery
QueryTasks queries the tasks edge of a Team.
func (*TeamClient) QueryUsers ¶ added in v0.5.0
func (c *TeamClient) QueryUsers(t *Team) *UserQuery
QueryUsers queries the users edge of a Team.
func (*TeamClient) Update ¶ added in v0.5.0
func (c *TeamClient) Update() *TeamUpdate
Update returns an update builder for Team.
func (*TeamClient) UpdateOne ¶ added in v0.5.0
func (c *TeamClient) UpdateOne(t *Team) *TeamUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TeamClient) UpdateOneID ¶ added in v0.5.0
func (c *TeamClient) UpdateOneID(id int) *TeamUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TeamClient) Use ¶ added in v0.5.0
func (c *TeamClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `team.Hooks(f(g(h())))`.
type TeamCreate ¶ added in v0.5.0
type TeamCreate struct {
// contains filtered or unexported fields
}
TeamCreate is the builder for creating a Team entity.
func (*TeamCreate) AddTaskIDs ¶ added in v0.5.0
func (tc *TeamCreate) AddTaskIDs(ids ...int) *TeamCreate
AddTaskIDs adds the tasks edge to Task by ids.
func (*TeamCreate) AddTasks ¶ added in v0.5.0
func (tc *TeamCreate) AddTasks(t ...*Task) *TeamCreate
AddTasks adds the tasks edges to Task.
func (*TeamCreate) AddUserIDs ¶ added in v0.5.0
func (tc *TeamCreate) AddUserIDs(ids ...int) *TeamCreate
AddUserIDs adds the users edge to User by ids.
func (*TeamCreate) AddUsers ¶ added in v0.5.0
func (tc *TeamCreate) AddUsers(u ...*User) *TeamCreate
AddUsers adds the users edges to User.
func (*TeamCreate) Mutation ¶ added in v0.5.0
func (tc *TeamCreate) Mutation() *TeamMutation
Mutation returns the TeamMutation object of the builder.
func (*TeamCreate) Save ¶ added in v0.5.0
func (tc *TeamCreate) Save(ctx context.Context) (*Team, error)
Save creates the Team in the database.
func (*TeamCreate) SaveX ¶ added in v0.5.0
func (tc *TeamCreate) SaveX(ctx context.Context) *Team
SaveX calls Save and panics if Save returns an error.
func (*TeamCreate) SetName ¶ added in v0.5.0
func (tc *TeamCreate) SetName(s string) *TeamCreate
SetName sets the name field.
type TeamCreateBulk ¶ added in v0.5.0
type TeamCreateBulk struct {
// contains filtered or unexported fields
}
TeamCreateBulk is the builder for creating a bulk of Team entities.
type TeamDelete ¶ added in v0.5.0
type TeamDelete struct {
// contains filtered or unexported fields
}
TeamDelete is the builder for deleting a Team entity.
func (*TeamDelete) Exec ¶ added in v0.5.0
func (td *TeamDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TeamDelete) ExecX ¶ added in v0.5.0
func (td *TeamDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TeamDelete) Where ¶ added in v0.5.0
func (td *TeamDelete) Where(ps ...predicate.Team) *TeamDelete
Where adds a new predicate to the delete builder.
type TeamDeleteOne ¶ added in v0.5.0
type TeamDeleteOne struct {
// contains filtered or unexported fields
}
TeamDeleteOne is the builder for deleting a single Team entity.
func (*TeamDeleteOne) Exec ¶ added in v0.5.0
func (tdo *TeamDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TeamDeleteOne) ExecX ¶ added in v0.5.0
func (tdo *TeamDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TeamEdges ¶ added in v0.5.0
type TeamEdges struct { // Tasks holds the value of the tasks edge. Tasks []*Task // Users holds the value of the users edge. Users []*User // contains filtered or unexported fields }
TeamEdges holds the relations/edges for other nodes in the graph.
func (TeamEdges) TasksOrErr ¶ added in v0.5.0
TasksOrErr returns the Tasks value or an error if the edge was not loaded in eager-loading.
func (TeamEdges) UsersOrErr ¶ added in v0.5.0
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
type TeamFilter ¶ added in v0.5.0
type TeamFilter struct {
// contains filtered or unexported fields
}
TeamFilter provides a generic filtering capability at runtime for TeamQuery.
func (*TeamFilter) Where ¶ added in v0.5.0
func (f *TeamFilter) Where(p entql.P)
Where applies the entql predicate on the query filter.
func (*TeamFilter) WhereHasTasks ¶ added in v0.5.0
func (f *TeamFilter) WhereHasTasks()
WhereHasTasks applies a predicate to check if query has an edge tasks.
func (*TeamFilter) WhereHasTasksWith ¶ added in v0.5.0
func (f *TeamFilter) WhereHasTasksWith(preds ...predicate.Task)
WhereHasTasksWith applies a predicate to check if query has an edge tasks with a given conditions (other predicates).
func (*TeamFilter) WhereHasUsers ¶ added in v0.5.0
func (f *TeamFilter) WhereHasUsers()
WhereHasUsers applies a predicate to check if query has an edge users.
func (*TeamFilter) WhereHasUsersWith ¶ added in v0.5.0
func (f *TeamFilter) WhereHasUsersWith(preds ...predicate.User)
WhereHasUsersWith applies a predicate to check if query has an edge users with a given conditions (other predicates).
func (*TeamFilter) WhereID ¶ added in v0.5.0
func (f *TeamFilter) WhereID(p entql.IntP)
WhereID applies the entql int predicate on the id field.
func (*TeamFilter) WhereName ¶ added in v0.5.0
func (f *TeamFilter) WhereName(p entql.StringP)
WhereName applies the entql string predicate on the name field.
type TeamGroupBy ¶ added in v0.5.0
type TeamGroupBy struct {
// contains filtered or unexported fields
}
TeamGroupBy is the builder for group-by Team entities.
func (*TeamGroupBy) Aggregate ¶ added in v0.5.0
func (tgb *TeamGroupBy) Aggregate(fns ...AggregateFunc) *TeamGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TeamGroupBy) Bool ¶ added in v0.5.0
func (tgb *TeamGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) BoolX ¶ added in v0.5.0
func (tgb *TeamGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*TeamGroupBy) Bools ¶ added in v0.5.0
func (tgb *TeamGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) BoolsX ¶ added in v0.5.0
func (tgb *TeamGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*TeamGroupBy) Float64 ¶ added in v0.5.0
func (tgb *TeamGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) Float64X ¶ added in v0.5.0
func (tgb *TeamGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*TeamGroupBy) Float64s ¶ added in v0.5.0
func (tgb *TeamGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) Float64sX ¶ added in v0.5.0
func (tgb *TeamGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*TeamGroupBy) Int ¶ added in v0.5.0
func (tgb *TeamGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) IntX ¶ added in v0.5.0
func (tgb *TeamGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*TeamGroupBy) Ints ¶ added in v0.5.0
func (tgb *TeamGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) IntsX ¶ added in v0.5.0
func (tgb *TeamGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*TeamGroupBy) Scan ¶ added in v0.5.0
func (tgb *TeamGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*TeamGroupBy) ScanX ¶ added in v0.5.0
func (tgb *TeamGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*TeamGroupBy) String ¶ added in v0.5.0
func (tgb *TeamGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*TeamGroupBy) StringX ¶ added in v0.5.0
func (tgb *TeamGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type TeamMutation ¶ added in v0.5.0
type TeamMutation struct {
// contains filtered or unexported fields
}
TeamMutation represents an operation that mutate the Teams nodes in the graph.
func (*TeamMutation) AddField ¶ added in v0.5.0
func (m *TeamMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TeamMutation) AddTaskIDs ¶ added in v0.5.0
func (m *TeamMutation) AddTaskIDs(ids ...int)
AddTaskIDs adds the tasks edge to Task by ids.
func (*TeamMutation) AddUserIDs ¶ added in v0.5.0
func (m *TeamMutation) AddUserIDs(ids ...int)
AddUserIDs adds the users edge to User by ids.
func (*TeamMutation) AddedEdges ¶ added in v0.5.0
func (m *TeamMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TeamMutation) AddedField ¶ added in v0.5.0
func (m *TeamMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*TeamMutation) AddedFields ¶ added in v0.5.0
func (m *TeamMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*TeamMutation) AddedIDs ¶ added in v0.5.0
func (m *TeamMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*TeamMutation) ClearEdge ¶ added in v0.5.0
func (m *TeamMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*TeamMutation) ClearField ¶ added in v0.5.0
func (m *TeamMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*TeamMutation) ClearTasks ¶ added in v0.5.0
func (m *TeamMutation) ClearTasks()
ClearTasks clears the tasks edge to Task.
func (*TeamMutation) ClearUsers ¶ added in v0.5.0
func (m *TeamMutation) ClearUsers()
ClearUsers clears the users edge to User.
func (*TeamMutation) ClearedEdges ¶ added in v0.5.0
func (m *TeamMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TeamMutation) ClearedFields ¶ added in v0.5.0
func (m *TeamMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TeamMutation) Client ¶ added in v0.5.0
func (m TeamMutation) 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 (*TeamMutation) EdgeCleared ¶ added in v0.5.0
func (m *TeamMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*TeamMutation) Field ¶ added in v0.5.0
func (m *TeamMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*TeamMutation) FieldCleared ¶ added in v0.5.0
func (m *TeamMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*TeamMutation) Fields ¶ added in v0.5.0
func (m *TeamMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*TeamMutation) Filter ¶ added in v0.5.0
func (m *TeamMutation) Filter() *TeamFilter
Filter returns an entql.Where implementation to apply filters on the TeamMutation builder.
func (*TeamMutation) ID ¶ added in v0.5.0
func (m *TeamMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*TeamMutation) Name ¶ added in v0.5.0
func (m *TeamMutation) Name() (r string, exists bool)
Name returns the name value in the mutation.
func (*TeamMutation) OldField ¶ added in v0.5.0
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 was failed.
func (*TeamMutation) OldName ¶ added in v0.5.0
func (m *TeamMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old name value of the Team. If the Team 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 database query fails.
func (*TeamMutation) Op ¶ added in v0.5.0
func (m *TeamMutation) Op() Op
Op returns the operation name.
func (*TeamMutation) RemoveTaskIDs ¶ added in v0.5.0
func (m *TeamMutation) RemoveTaskIDs(ids ...int)
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*TeamMutation) RemoveUserIDs ¶ added in v0.5.0
func (m *TeamMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the users edge to User by ids.
func (*TeamMutation) RemovedEdges ¶ added in v0.5.0
func (m *TeamMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TeamMutation) RemovedIDs ¶ added in v0.5.0
func (m *TeamMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*TeamMutation) RemovedTasksIDs ¶ added in v0.5.0
func (m *TeamMutation) RemovedTasksIDs() (ids []int)
RemovedTasks returns the removed ids of tasks.
func (*TeamMutation) RemovedUsersIDs ¶ added in v0.5.0
func (m *TeamMutation) RemovedUsersIDs() (ids []int)
RemovedUsers returns the removed ids of users.
func (*TeamMutation) ResetEdge ¶ added in v0.5.0
func (m *TeamMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*TeamMutation) ResetField ¶ added in v0.5.0
func (m *TeamMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*TeamMutation) ResetName ¶ added in v0.5.0
func (m *TeamMutation) ResetName()
ResetName reset all changes of the "name" field.
func (*TeamMutation) ResetTasks ¶ added in v0.5.0
func (m *TeamMutation) ResetTasks()
ResetTasks reset all changes of the "tasks" edge.
func (*TeamMutation) ResetUsers ¶ added in v0.5.0
func (m *TeamMutation) ResetUsers()
ResetUsers reset all changes of the "users" edge.
func (*TeamMutation) SetField ¶ added in v0.5.0
func (m *TeamMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TeamMutation) SetName ¶ added in v0.5.0
func (m *TeamMutation) SetName(s string)
SetName sets the name field.
func (*TeamMutation) TasksCleared ¶ added in v0.5.0
func (m *TeamMutation) TasksCleared() bool
TasksCleared returns if the edge tasks was cleared.
func (*TeamMutation) TasksIDs ¶ added in v0.5.0
func (m *TeamMutation) TasksIDs() (ids []int)
TasksIDs returns the tasks ids in the mutation.
func (TeamMutation) Tx ¶ added in v0.5.0
func (m TeamMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TeamMutation) Type ¶ added in v0.5.0
func (m *TeamMutation) Type() string
Type returns the node type of this mutation (Team).
func (*TeamMutation) UsersCleared ¶ added in v0.5.0
func (m *TeamMutation) UsersCleared() bool
UsersCleared returns if the edge users was cleared.
func (*TeamMutation) UsersIDs ¶ added in v0.5.0
func (m *TeamMutation) UsersIDs() (ids []int)
UsersIDs returns the users ids in the mutation.
type TeamQuery ¶ added in v0.5.0
type TeamQuery struct {
// contains filtered or unexported fields
}
TeamQuery is the builder for querying Team entities.
func (*TeamQuery) Clone ¶ added in v0.5.0
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TeamQuery) Exist ¶ added in v0.5.0
Exist returns true if the query has elements in the graph.
func (*TeamQuery) Filter ¶ added in v0.5.0
func (tq *TeamQuery) Filter() *TeamFilter
Filter returns a Filter implementation to apply filters on the TeamQuery builder.
func (*TeamQuery) First ¶ added in v0.5.0
First returns the first Team entity in the query. Returns *NotFoundError when no team was found.
func (*TeamQuery) FirstID ¶ added in v0.5.0
FirstID returns the first Team id in the query. Returns *NotFoundError when no id was found.
func (*TeamQuery) FirstIDX ¶ added in v0.5.0
FirstIDX is like FirstID, but panics if an error occurs.
func (*TeamQuery) GroupBy ¶ added in v0.5.0
func (tq *TeamQuery) GroupBy(field string, fields ...string) *TeamGroupBy
GroupBy 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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Team.Query(). GroupBy(team.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TeamQuery) Only ¶ added in v0.5.0
Only returns the only Team entity in the query, returns an error if not exactly one entity was returned.
func (*TeamQuery) OnlyID ¶ added in v0.5.0
OnlyID returns the only Team id in the query, returns an error if not exactly one id was returned.
func (*TeamQuery) QueryTasks ¶ added in v0.5.0
QueryTasks chains the current query on the tasks edge.
func (*TeamQuery) QueryUsers ¶ added in v0.5.0
QueryUsers chains the current query on the users edge.
func (*TeamQuery) Select ¶ added in v0.5.0
func (tq *TeamQuery) Select(field string, fields ...string) *TeamSelect
Select one or more fields from the given query.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Team.Query(). Select(team.FieldName). Scan(ctx, &v)
type TeamSelect ¶ added in v0.5.0
type TeamSelect struct {
// contains filtered or unexported fields
}
TeamSelect is the builder for select fields of Team entities.
func (*TeamSelect) Bool ¶ added in v0.5.0
func (ts *TeamSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from selector. It is only allowed when selecting one field.
func (*TeamSelect) BoolX ¶ added in v0.5.0
func (ts *TeamSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*TeamSelect) Bools ¶ added in v0.5.0
func (ts *TeamSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*TeamSelect) BoolsX ¶ added in v0.5.0
func (ts *TeamSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*TeamSelect) Float64 ¶ added in v0.5.0
func (ts *TeamSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from selector. It is only allowed when selecting one field.
func (*TeamSelect) Float64X ¶ added in v0.5.0
func (ts *TeamSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*TeamSelect) Float64s ¶ added in v0.5.0
func (ts *TeamSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*TeamSelect) Float64sX ¶ added in v0.5.0
func (ts *TeamSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*TeamSelect) Int ¶ added in v0.5.0
func (ts *TeamSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from selector. It is only allowed when selecting one field.
func (*TeamSelect) IntX ¶ added in v0.5.0
func (ts *TeamSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*TeamSelect) Ints ¶ added in v0.5.0
func (ts *TeamSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*TeamSelect) IntsX ¶ added in v0.5.0
func (ts *TeamSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*TeamSelect) Scan ¶ added in v0.5.0
func (ts *TeamSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*TeamSelect) ScanX ¶ added in v0.5.0
func (ts *TeamSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*TeamSelect) String ¶ added in v0.5.0
func (ts *TeamSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from selector. It is only allowed when selecting one field.
func (*TeamSelect) StringX ¶ added in v0.5.0
func (ts *TeamSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type TeamUpdate ¶ added in v0.5.0
type TeamUpdate struct {
// contains filtered or unexported fields
}
TeamUpdate is the builder for updating Team entities.
func (*TeamUpdate) AddTaskIDs ¶ added in v0.5.0
func (tu *TeamUpdate) AddTaskIDs(ids ...int) *TeamUpdate
AddTaskIDs adds the tasks edge to Task by ids.
func (*TeamUpdate) AddTasks ¶ added in v0.5.0
func (tu *TeamUpdate) AddTasks(t ...*Task) *TeamUpdate
AddTasks adds the tasks edges to Task.
func (*TeamUpdate) AddUserIDs ¶ added in v0.5.0
func (tu *TeamUpdate) AddUserIDs(ids ...int) *TeamUpdate
AddUserIDs adds the users edge to User by ids.
func (*TeamUpdate) AddUsers ¶ added in v0.5.0
func (tu *TeamUpdate) AddUsers(u ...*User) *TeamUpdate
AddUsers adds the users edges to User.
func (*TeamUpdate) ClearTasks ¶ added in v0.5.0
func (tu *TeamUpdate) ClearTasks() *TeamUpdate
ClearTasks clears all "tasks" edges to type Task.
func (*TeamUpdate) ClearUsers ¶ added in v0.5.0
func (tu *TeamUpdate) ClearUsers() *TeamUpdate
ClearUsers clears all "users" edges to type User.
func (*TeamUpdate) Exec ¶ added in v0.5.0
func (tu *TeamUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TeamUpdate) ExecX ¶ added in v0.5.0
func (tu *TeamUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TeamUpdate) Mutation ¶ added in v0.5.0
func (tu *TeamUpdate) Mutation() *TeamMutation
Mutation returns the TeamMutation object of the builder.
func (*TeamUpdate) RemoveTaskIDs ¶ added in v0.5.0
func (tu *TeamUpdate) RemoveTaskIDs(ids ...int) *TeamUpdate
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*TeamUpdate) RemoveTasks ¶ added in v0.5.0
func (tu *TeamUpdate) RemoveTasks(t ...*Task) *TeamUpdate
RemoveTasks removes tasks edges to Task.
func (*TeamUpdate) RemoveUserIDs ¶ added in v0.5.0
func (tu *TeamUpdate) RemoveUserIDs(ids ...int) *TeamUpdate
RemoveUserIDs removes the users edge to User by ids.
func (*TeamUpdate) RemoveUsers ¶ added in v0.5.0
func (tu *TeamUpdate) RemoveUsers(u ...*User) *TeamUpdate
RemoveUsers removes users edges to User.
func (*TeamUpdate) Save ¶ added in v0.5.0
func (tu *TeamUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TeamUpdate) SaveX ¶ added in v0.5.0
func (tu *TeamUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TeamUpdate) SetName ¶ added in v0.5.0
func (tu *TeamUpdate) SetName(s string) *TeamUpdate
SetName sets the name field.
func (*TeamUpdate) Where ¶ added in v0.5.0
func (tu *TeamUpdate) Where(ps ...predicate.Team) *TeamUpdate
Where adds a new predicate for the builder.
type TeamUpdateOne ¶ added in v0.5.0
type TeamUpdateOne struct {
// contains filtered or unexported fields
}
TeamUpdateOne is the builder for updating a single Team entity.
func (*TeamUpdateOne) AddTaskIDs ¶ added in v0.5.0
func (tuo *TeamUpdateOne) AddTaskIDs(ids ...int) *TeamUpdateOne
AddTaskIDs adds the tasks edge to Task by ids.
func (*TeamUpdateOne) AddTasks ¶ added in v0.5.0
func (tuo *TeamUpdateOne) AddTasks(t ...*Task) *TeamUpdateOne
AddTasks adds the tasks edges to Task.
func (*TeamUpdateOne) AddUserIDs ¶ added in v0.5.0
func (tuo *TeamUpdateOne) AddUserIDs(ids ...int) *TeamUpdateOne
AddUserIDs adds the users edge to User by ids.
func (*TeamUpdateOne) AddUsers ¶ added in v0.5.0
func (tuo *TeamUpdateOne) AddUsers(u ...*User) *TeamUpdateOne
AddUsers adds the users edges to User.
func (*TeamUpdateOne) ClearTasks ¶ added in v0.5.0
func (tuo *TeamUpdateOne) ClearTasks() *TeamUpdateOne
ClearTasks clears all "tasks" edges to type Task.
func (*TeamUpdateOne) ClearUsers ¶ added in v0.5.0
func (tuo *TeamUpdateOne) ClearUsers() *TeamUpdateOne
ClearUsers clears all "users" edges to type User.
func (*TeamUpdateOne) Exec ¶ added in v0.5.0
func (tuo *TeamUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TeamUpdateOne) ExecX ¶ added in v0.5.0
func (tuo *TeamUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TeamUpdateOne) Mutation ¶ added in v0.5.0
func (tuo *TeamUpdateOne) Mutation() *TeamMutation
Mutation returns the TeamMutation object of the builder.
func (*TeamUpdateOne) RemoveTaskIDs ¶ added in v0.5.0
func (tuo *TeamUpdateOne) RemoveTaskIDs(ids ...int) *TeamUpdateOne
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*TeamUpdateOne) RemoveTasks ¶ added in v0.5.0
func (tuo *TeamUpdateOne) RemoveTasks(t ...*Task) *TeamUpdateOne
RemoveTasks removes tasks edges to Task.
func (*TeamUpdateOne) RemoveUserIDs ¶ added in v0.5.0
func (tuo *TeamUpdateOne) RemoveUserIDs(ids ...int) *TeamUpdateOne
RemoveUserIDs removes the users edge to User by ids.
func (*TeamUpdateOne) RemoveUsers ¶ added in v0.5.0
func (tuo *TeamUpdateOne) RemoveUsers(u ...*User) *TeamUpdateOne
RemoveUsers removes users edges to User.
func (*TeamUpdateOne) Save ¶ added in v0.5.0
func (tuo *TeamUpdateOne) Save(ctx context.Context) (*Team, error)
Save executes the query and returns the updated entity.
func (*TeamUpdateOne) SaveX ¶ added in v0.5.0
func (tuo *TeamUpdateOne) SaveX(ctx context.Context) *Team
SaveX is like Save, but panics if an error occurs.
func (*TeamUpdateOne) SetName ¶ added in v0.5.0
func (tuo *TeamUpdateOne) SetName(s string) *TeamUpdateOne
SetName sets the name field.
type Tx ¶
type Tx struct { // Task is the client for interacting with the Task builders. Task *TaskClient // Team is the client for interacting with the Team builders. Team *TeamClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns the Tx stored in 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 User ¶ added in v0.5.0
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Age holds the value of the "age" field. Age uint `json:"age,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryTasks ¶ added in v0.5.0
QueryTasks queries the tasks edge of the User.
func (*User) QueryTeams ¶ added in v0.5.0
QueryTeams queries the teams edge of the User.
func (*User) Unwrap ¶ added in v0.5.0
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*User) Update ¶ added in v0.5.0
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that, you need to call User.Unwrap() before calling this method, if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶ added in v0.5.0
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶ added in v0.5.0
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶ added in v0.5.0
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶ added in v0.5.0
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶ added in v0.5.0
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶ added in v0.5.0
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶ added in v0.5.0
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) GetX ¶ added in v0.5.0
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Hooks ¶ added in v0.5.0
func (c *UserClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserClient) Query ¶ added in v0.5.0
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryTasks ¶ added in v0.5.0
func (c *UserClient) QueryTasks(u *User) *TaskQuery
QueryTasks queries the tasks edge of a User.
func (*UserClient) QueryTeams ¶ added in v0.5.0
func (c *UserClient) QueryTeams(u *User) *TeamQuery
QueryTeams queries the teams edge of a User.
func (*UserClient) Update ¶ added in v0.5.0
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶ added in v0.5.0
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶ added in v0.5.0
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶ added in v0.5.0
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶ added in v0.5.0
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddTaskIDs ¶ added in v0.5.0
func (uc *UserCreate) AddTaskIDs(ids ...int) *UserCreate
AddTaskIDs adds the tasks edge to Task by ids.
func (*UserCreate) AddTasks ¶ added in v0.5.0
func (uc *UserCreate) AddTasks(t ...*Task) *UserCreate
AddTasks adds the tasks edges to Task.
func (*UserCreate) AddTeamIDs ¶ added in v0.5.0
func (uc *UserCreate) AddTeamIDs(ids ...int) *UserCreate
AddTeamIDs adds the teams edge to Team by ids.
func (*UserCreate) AddTeams ¶ added in v0.5.0
func (uc *UserCreate) AddTeams(t ...*Team) *UserCreate
AddTeams adds the teams edges to Team.
func (*UserCreate) Mutation ¶ added in v0.5.0
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶ added in v0.5.0
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶ added in v0.5.0
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAge ¶ added in v0.5.0
func (uc *UserCreate) SetAge(u uint) *UserCreate
SetAge sets the age field.
func (*UserCreate) SetName ¶ added in v0.5.0
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the name field.
func (*UserCreate) SetNillableAge ¶ added in v0.5.0
func (uc *UserCreate) SetNillableAge(u *uint) *UserCreate
SetNillableAge sets the age field if the given value is not nil.
type UserCreateBulk ¶ added in v0.5.0
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating a bulk of User entities.
type UserDelete ¶ added in v0.5.0
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶ added in v0.5.0
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶ added in v0.5.0
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶ added in v0.5.0
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where adds a new predicate to the delete builder.
type UserDeleteOne ¶ added in v0.5.0
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶ added in v0.5.0
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶ added in v0.5.0
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶ added in v0.5.0
type UserEdges struct { // Teams holds the value of the teams edge. Teams []*Team // Tasks holds the value of the tasks edge. Tasks []*Task // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) TasksOrErr ¶ added in v0.5.0
TasksOrErr returns the Tasks value or an error if the edge was not loaded in eager-loading.
func (UserEdges) TeamsOrErr ¶ added in v0.5.0
TeamsOrErr returns the Teams value or an error if the edge was not loaded in eager-loading.
type UserFilter ¶ added in v0.5.0
type UserFilter struct {
// contains filtered or unexported fields
}
UserFilter provides a generic filtering capability at runtime for UserQuery.
func (*UserFilter) Where ¶ added in v0.5.0
func (f *UserFilter) Where(p entql.P)
Where applies the entql predicate on the query filter.
func (*UserFilter) WhereAge ¶ added in v0.5.0
func (f *UserFilter) WhereAge(p entql.UintP)
WhereAge applies the entql uint predicate on the age field.
func (*UserFilter) WhereHasTasks ¶ added in v0.5.0
func (f *UserFilter) WhereHasTasks()
WhereHasTasks applies a predicate to check if query has an edge tasks.
func (*UserFilter) WhereHasTasksWith ¶ added in v0.5.0
func (f *UserFilter) WhereHasTasksWith(preds ...predicate.Task)
WhereHasTasksWith applies a predicate to check if query has an edge tasks with a given conditions (other predicates).
func (*UserFilter) WhereHasTeams ¶ added in v0.5.0
func (f *UserFilter) WhereHasTeams()
WhereHasTeams applies a predicate to check if query has an edge teams.
func (*UserFilter) WhereHasTeamsWith ¶ added in v0.5.0
func (f *UserFilter) WhereHasTeamsWith(preds ...predicate.Team)
WhereHasTeamsWith applies a predicate to check if query has an edge teams with a given conditions (other predicates).
func (*UserFilter) WhereID ¶ added in v0.5.0
func (f *UserFilter) WhereID(p entql.IntP)
WhereID applies the entql int predicate on the id field.
func (*UserFilter) WhereName ¶ added in v0.5.0
func (f *UserFilter) WhereName(p entql.StringP)
WhereName applies the entql string predicate on the name field.
type UserGroupBy ¶ added in v0.5.0
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the builder for group-by User entities.
func (*UserGroupBy) Aggregate ¶ added in v0.5.0
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶ added in v0.5.0
func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) BoolX ¶ added in v0.5.0
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶ added in v0.5.0
func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) BoolsX ¶ added in v0.5.0
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶ added in v0.5.0
func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) Float64X ¶ added in v0.5.0
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶ added in v0.5.0
func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) Float64sX ¶ added in v0.5.0
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶ added in v0.5.0
func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) IntX ¶ added in v0.5.0
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶ added in v0.5.0
func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) IntsX ¶ added in v0.5.0
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶ added in v0.5.0
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*UserGroupBy) ScanX ¶ added in v0.5.0
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶ added in v0.5.0
func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*UserGroupBy) StringX ¶ added in v0.5.0
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserMutation ¶ added in v0.5.0
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutate the Users nodes in the graph.
func (*UserMutation) AddAge ¶ added in v0.5.0
func (m *UserMutation) AddAge(u uint)
AddAge adds u to age.
func (*UserMutation) AddField ¶ added in v0.5.0
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*UserMutation) AddTaskIDs ¶ added in v0.5.0
func (m *UserMutation) AddTaskIDs(ids ...int)
AddTaskIDs adds the tasks edge to Task by ids.
func (*UserMutation) AddTeamIDs ¶ added in v0.5.0
func (m *UserMutation) AddTeamIDs(ids ...int)
AddTeamIDs adds the teams edge to Team by ids.
func (*UserMutation) AddedAge ¶ added in v0.5.0
func (m *UserMutation) AddedAge() (r uint, exists bool)
AddedAge returns the value that was added to the age field in this mutation.
func (*UserMutation) AddedEdges ¶ added in v0.5.0
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶ added in v0.5.0
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*UserMutation) AddedFields ¶ added in v0.5.0
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*UserMutation) AddedIDs ¶ added in v0.5.0
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*UserMutation) Age ¶ added in v0.5.0
func (m *UserMutation) Age() (r uint, exists bool)
Age returns the age value in the mutation.
func (*UserMutation) AgeCleared ¶ added in v0.5.0
func (m *UserMutation) AgeCleared() bool
AgeCleared returns if the field age was cleared in this mutation.
func (*UserMutation) ClearAge ¶ added in v0.5.0
func (m *UserMutation) ClearAge()
ClearAge clears the value of age.
func (*UserMutation) ClearEdge ¶ added in v0.5.0
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*UserMutation) ClearField ¶ added in v0.5.0
func (m *UserMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearTasks ¶ added in v0.5.0
func (m *UserMutation) ClearTasks()
ClearTasks clears the tasks edge to Task.
func (*UserMutation) ClearTeams ¶ added in v0.5.0
func (m *UserMutation) ClearTeams()
ClearTeams clears the teams edge to Team.
func (*UserMutation) ClearedEdges ¶ added in v0.5.0
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶ added in v0.5.0
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶ added in v0.5.0
func (m UserMutation) 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 (*UserMutation) EdgeCleared ¶ added in v0.5.0
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*UserMutation) Field ¶ added in v0.5.0
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*UserMutation) FieldCleared ¶ added in v0.5.0
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*UserMutation) Fields ¶ added in v0.5.0
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*UserMutation) Filter ¶ added in v0.5.0
func (m *UserMutation) Filter() *UserFilter
Filter returns an entql.Where implementation to apply filters on the UserMutation builder.
func (*UserMutation) ID ¶ added in v0.5.0
func (m *UserMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*UserMutation) Name ¶ added in v0.5.0
func (m *UserMutation) Name() (r string, exists bool)
Name returns the name value in the mutation.
func (*UserMutation) OldAge ¶ added in v0.5.0
func (m *UserMutation) OldAge(ctx context.Context) (v uint, err error)
OldAge returns the old age value of the User. If the User 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 database query fails.
func (*UserMutation) OldField ¶ added in v0.5.0
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 was failed.
func (*UserMutation) OldName ¶ added in v0.5.0
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old name value of the User. If the User 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 database query fails.
func (*UserMutation) Op ¶ added in v0.5.0
func (m *UserMutation) Op() Op
Op returns the operation name.
func (*UserMutation) RemoveTaskIDs ¶ added in v0.5.0
func (m *UserMutation) RemoveTaskIDs(ids ...int)
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*UserMutation) RemoveTeamIDs ¶ added in v0.5.0
func (m *UserMutation) RemoveTeamIDs(ids ...int)
RemoveTeamIDs removes the teams edge to Team by ids.
func (*UserMutation) RemovedEdges ¶ added in v0.5.0
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶ added in v0.5.0
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*UserMutation) RemovedTasksIDs ¶ added in v0.5.0
func (m *UserMutation) RemovedTasksIDs() (ids []int)
RemovedTasks returns the removed ids of tasks.
func (*UserMutation) RemovedTeamsIDs ¶ added in v0.5.0
func (m *UserMutation) RemovedTeamsIDs() (ids []int)
RemovedTeams returns the removed ids of teams.
func (*UserMutation) ResetAge ¶ added in v0.5.0
func (m *UserMutation) ResetAge()
ResetAge reset all changes of the "age" field.
func (*UserMutation) ResetEdge ¶ added in v0.5.0
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶ added in v0.5.0
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetName ¶ added in v0.5.0
func (m *UserMutation) ResetName()
ResetName reset all changes of the "name" field.
func (*UserMutation) ResetTasks ¶ added in v0.5.0
func (m *UserMutation) ResetTasks()
ResetTasks reset all changes of the "tasks" edge.
func (*UserMutation) ResetTeams ¶ added in v0.5.0
func (m *UserMutation) ResetTeams()
ResetTeams reset all changes of the "teams" edge.
func (*UserMutation) SetAge ¶ added in v0.5.0
func (m *UserMutation) SetAge(u uint)
SetAge sets the age field.
func (*UserMutation) SetField ¶ added in v0.5.0
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*UserMutation) SetName ¶ added in v0.5.0
func (m *UserMutation) SetName(s string)
SetName sets the name field.
func (*UserMutation) TasksCleared ¶ added in v0.5.0
func (m *UserMutation) TasksCleared() bool
TasksCleared returns if the edge tasks was cleared.
func (*UserMutation) TasksIDs ¶ added in v0.5.0
func (m *UserMutation) TasksIDs() (ids []int)
TasksIDs returns the tasks ids in the mutation.
func (*UserMutation) TeamsCleared ¶ added in v0.5.0
func (m *UserMutation) TeamsCleared() bool
TeamsCleared returns if the edge teams was cleared.
func (*UserMutation) TeamsIDs ¶ added in v0.5.0
func (m *UserMutation) TeamsIDs() (ids []int)
TeamsIDs returns the teams ids in the mutation.
func (UserMutation) Tx ¶ added in v0.5.0
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶ added in v0.5.0
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
type UserQuery ¶ added in v0.5.0
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶ added in v0.5.0
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) Exist ¶ added in v0.5.0
Exist returns true if the query has elements in the graph.
func (*UserQuery) Filter ¶ added in v0.5.0
func (uq *UserQuery) Filter() *UserFilter
Filter returns a Filter implementation to apply filters on the UserQuery builder.
func (*UserQuery) First ¶ added in v0.5.0
First returns the first User entity in the query. Returns *NotFoundError when no user was found.
func (*UserQuery) FirstID ¶ added in v0.5.0
FirstID returns the first User id in the query. Returns *NotFoundError when no id was found.
func (*UserQuery) FirstIDX ¶ added in v0.5.0
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserQuery) GroupBy ¶ added in v0.5.0
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy 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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶ added in v0.5.0
Only returns the only User entity in the query, returns an error if not exactly one entity was returned.
func (*UserQuery) OnlyID ¶ added in v0.5.0
OnlyID returns the only User id in the query, returns an error if not exactly one id was returned.
func (*UserQuery) QueryTasks ¶ added in v0.5.0
QueryTasks chains the current query on the tasks edge.
func (*UserQuery) QueryTeams ¶ added in v0.5.0
QueryTeams chains the current query on the teams edge.
func (*UserQuery) Select ¶ added in v0.5.0
func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
Select one or more fields from the given query.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.User.Query(). Select(user.FieldName). Scan(ctx, &v)
type UserSelect ¶ added in v0.5.0
type UserSelect struct {
// contains filtered or unexported fields
}
UserSelect is the builder for select fields of User entities.
func (*UserSelect) Bool ¶ added in v0.5.0
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶ added in v0.5.0
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶ added in v0.5.0
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶ added in v0.5.0
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶ added in v0.5.0
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶ added in v0.5.0
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶ added in v0.5.0
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶ added in v0.5.0
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶ added in v0.5.0
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶ added in v0.5.0
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶ added in v0.5.0
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶ added in v0.5.0
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶ added in v0.5.0
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*UserSelect) ScanX ¶ added in v0.5.0
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶ added in v0.5.0
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶ added in v0.5.0
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶ added in v0.5.0
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAge ¶ added in v0.5.0
func (uu *UserUpdate) AddAge(u uint) *UserUpdate
AddAge adds u to age.
func (*UserUpdate) AddTaskIDs ¶ added in v0.5.0
func (uu *UserUpdate) AddTaskIDs(ids ...int) *UserUpdate
AddTaskIDs adds the tasks edge to Task by ids.
func (*UserUpdate) AddTasks ¶ added in v0.5.0
func (uu *UserUpdate) AddTasks(t ...*Task) *UserUpdate
AddTasks adds the tasks edges to Task.
func (*UserUpdate) AddTeamIDs ¶ added in v0.5.0
func (uu *UserUpdate) AddTeamIDs(ids ...int) *UserUpdate
AddTeamIDs adds the teams edge to Team by ids.
func (*UserUpdate) AddTeams ¶ added in v0.5.0
func (uu *UserUpdate) AddTeams(t ...*Team) *UserUpdate
AddTeams adds the teams edges to Team.
func (*UserUpdate) ClearAge ¶ added in v0.5.0
func (uu *UserUpdate) ClearAge() *UserUpdate
ClearAge clears the value of age.
func (*UserUpdate) ClearTasks ¶ added in v0.5.0
func (uu *UserUpdate) ClearTasks() *UserUpdate
ClearTasks clears all "tasks" edges to type Task.
func (*UserUpdate) ClearTeams ¶ added in v0.5.0
func (uu *UserUpdate) ClearTeams() *UserUpdate
ClearTeams clears all "teams" edges to type Team.
func (*UserUpdate) Exec ¶ added in v0.5.0
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶ added in v0.5.0
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶ added in v0.5.0
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveTaskIDs ¶ added in v0.5.0
func (uu *UserUpdate) RemoveTaskIDs(ids ...int) *UserUpdate
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*UserUpdate) RemoveTasks ¶ added in v0.5.0
func (uu *UserUpdate) RemoveTasks(t ...*Task) *UserUpdate
RemoveTasks removes tasks edges to Task.
func (*UserUpdate) RemoveTeamIDs ¶ added in v0.5.0
func (uu *UserUpdate) RemoveTeamIDs(ids ...int) *UserUpdate
RemoveTeamIDs removes the teams edge to Team by ids.
func (*UserUpdate) RemoveTeams ¶ added in v0.5.0
func (uu *UserUpdate) RemoveTeams(t ...*Team) *UserUpdate
RemoveTeams removes teams edges to Team.
func (*UserUpdate) Save ¶ added in v0.5.0
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶ added in v0.5.0
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAge ¶ added in v0.5.0
func (uu *UserUpdate) SetAge(u uint) *UserUpdate
SetAge sets the age field.
func (*UserUpdate) SetNillableAge ¶ added in v0.5.0
func (uu *UserUpdate) SetNillableAge(u *uint) *UserUpdate
SetNillableAge sets the age field if the given value is not nil.
func (*UserUpdate) Where ¶ added in v0.5.0
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where adds a new predicate for the builder.
type UserUpdateOne ¶ added in v0.5.0
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAge ¶ added in v0.5.0
func (uuo *UserUpdateOne) AddAge(u uint) *UserUpdateOne
AddAge adds u to age.
func (*UserUpdateOne) AddTaskIDs ¶ added in v0.5.0
func (uuo *UserUpdateOne) AddTaskIDs(ids ...int) *UserUpdateOne
AddTaskIDs adds the tasks edge to Task by ids.
func (*UserUpdateOne) AddTasks ¶ added in v0.5.0
func (uuo *UserUpdateOne) AddTasks(t ...*Task) *UserUpdateOne
AddTasks adds the tasks edges to Task.
func (*UserUpdateOne) AddTeamIDs ¶ added in v0.5.0
func (uuo *UserUpdateOne) AddTeamIDs(ids ...int) *UserUpdateOne
AddTeamIDs adds the teams edge to Team by ids.
func (*UserUpdateOne) AddTeams ¶ added in v0.5.0
func (uuo *UserUpdateOne) AddTeams(t ...*Team) *UserUpdateOne
AddTeams adds the teams edges to Team.
func (*UserUpdateOne) ClearAge ¶ added in v0.5.0
func (uuo *UserUpdateOne) ClearAge() *UserUpdateOne
ClearAge clears the value of age.
func (*UserUpdateOne) ClearTasks ¶ added in v0.5.0
func (uuo *UserUpdateOne) ClearTasks() *UserUpdateOne
ClearTasks clears all "tasks" edges to type Task.
func (*UserUpdateOne) ClearTeams ¶ added in v0.5.0
func (uuo *UserUpdateOne) ClearTeams() *UserUpdateOne
ClearTeams clears all "teams" edges to type Team.
func (*UserUpdateOne) Exec ¶ added in v0.5.0
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶ added in v0.5.0
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶ added in v0.5.0
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveTaskIDs ¶ added in v0.5.0
func (uuo *UserUpdateOne) RemoveTaskIDs(ids ...int) *UserUpdateOne
RemoveTaskIDs removes the tasks edge to Task by ids.
func (*UserUpdateOne) RemoveTasks ¶ added in v0.5.0
func (uuo *UserUpdateOne) RemoveTasks(t ...*Task) *UserUpdateOne
RemoveTasks removes tasks edges to Task.
func (*UserUpdateOne) RemoveTeamIDs ¶ added in v0.5.0
func (uuo *UserUpdateOne) RemoveTeamIDs(ids ...int) *UserUpdateOne
RemoveTeamIDs removes the teams edge to Team by ids.
func (*UserUpdateOne) RemoveTeams ¶ added in v0.5.0
func (uuo *UserUpdateOne) RemoveTeams(t ...*Team) *UserUpdateOne
RemoveTeams removes teams edges to Team.
func (*UserUpdateOne) Save ¶ added in v0.5.0
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated entity.
func (*UserUpdateOne) SaveX ¶ added in v0.5.0
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) SetAge ¶ added in v0.5.0
func (uuo *UserUpdateOne) SetAge(u uint) *UserUpdateOne
SetAge sets the age field.
func (*UserUpdateOne) SetNillableAge ¶ added in v0.5.0
func (uuo *UserUpdateOne) SetNillableAge(u *uint) *UserUpdateOne
SetNillableAge sets the age field if the given value is not nil.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field 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.