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 Issue
- type IssueClient
- func (c *IssueClient) Create() *IssueCreate
- func (c *IssueClient) CreateBulk(builders ...*IssueCreate) *IssueCreateBulk
- func (c *IssueClient) Delete() *IssueDelete
- func (c *IssueClient) DeleteOne(i *Issue) *IssueDeleteOne
- func (c *IssueClient) DeleteOneID(id uuid.UUID) *IssueDeleteOne
- func (c *IssueClient) Get(ctx context.Context, id uuid.UUID) (*Issue, error)
- func (c *IssueClient) GetX(ctx context.Context, id uuid.UUID) *Issue
- func (c *IssueClient) Hooks() []Hook
- func (c *IssueClient) Query() *IssueQuery
- func (c *IssueClient) QueryOwner(i *Issue) *ProjectQuery
- func (c *IssueClient) Update() *IssueUpdate
- func (c *IssueClient) UpdateOne(i *Issue) *IssueUpdateOne
- func (c *IssueClient) UpdateOneID(id uuid.UUID) *IssueUpdateOne
- func (c *IssueClient) Use(hooks ...Hook)
- type IssueCreate
- func (ic *IssueCreate) Exec(ctx context.Context) error
- func (ic *IssueCreate) ExecX(ctx context.Context)
- func (ic *IssueCreate) Mutation() *IssueMutation
- func (ic *IssueCreate) Save(ctx context.Context) (*Issue, error)
- func (ic *IssueCreate) SaveX(ctx context.Context) *Issue
- func (ic *IssueCreate) SetCreateTime(t time.Time) *IssueCreate
- func (ic *IssueCreate) SetDescription(s string) *IssueCreate
- func (ic *IssueCreate) SetID(u uuid.UUID) *IssueCreate
- func (ic *IssueCreate) SetNillableCreateTime(t *time.Time) *IssueCreate
- func (ic *IssueCreate) SetNillableID(u *uuid.UUID) *IssueCreate
- func (ic *IssueCreate) SetNillableOwnerID(id *uuid.UUID) *IssueCreate
- func (ic *IssueCreate) SetNillableUpdateTime(t *time.Time) *IssueCreate
- func (ic *IssueCreate) SetOwner(p *Project) *IssueCreate
- func (ic *IssueCreate) SetOwnerID(id uuid.UUID) *IssueCreate
- func (ic *IssueCreate) SetTitle(s string) *IssueCreate
- func (ic *IssueCreate) SetUpdateTime(t time.Time) *IssueCreate
- type IssueCreateBulk
- type IssueDelete
- type IssueDeleteOne
- type IssueEdges
- type IssueGroupBy
- func (igb *IssueGroupBy) Aggregate(fns ...AggregateFunc) *IssueGroupBy
- func (s *IssueGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *IssueGroupBy) BoolX(ctx context.Context) bool
- func (s *IssueGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *IssueGroupBy) BoolsX(ctx context.Context) []bool
- func (s *IssueGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *IssueGroupBy) Float64X(ctx context.Context) float64
- func (s *IssueGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *IssueGroupBy) Float64sX(ctx context.Context) []float64
- func (s *IssueGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *IssueGroupBy) IntX(ctx context.Context) int
- func (s *IssueGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *IssueGroupBy) IntsX(ctx context.Context) []int
- func (igb *IssueGroupBy) Scan(ctx context.Context, v any) error
- func (s *IssueGroupBy) ScanX(ctx context.Context, v any)
- func (s *IssueGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *IssueGroupBy) StringX(ctx context.Context) string
- func (s *IssueGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *IssueGroupBy) StringsX(ctx context.Context) []string
- type IssueMutation
- func (m *IssueMutation) AddField(name string, value ent.Value) error
- func (m *IssueMutation) AddedEdges() []string
- func (m *IssueMutation) AddedField(name string) (ent.Value, bool)
- func (m *IssueMutation) AddedFields() []string
- func (m *IssueMutation) AddedIDs(name string) []ent.Value
- func (m *IssueMutation) ClearEdge(name string) error
- func (m *IssueMutation) ClearField(name string) error
- func (m *IssueMutation) ClearOwner()
- func (m *IssueMutation) ClearedEdges() []string
- func (m *IssueMutation) ClearedFields() []string
- func (m IssueMutation) Client() *Client
- func (m *IssueMutation) CreateTime() (r time.Time, exists bool)
- func (m *IssueMutation) Description() (r string, exists bool)
- func (m *IssueMutation) EdgeCleared(name string) bool
- func (m *IssueMutation) Field(name string) (ent.Value, bool)
- func (m *IssueMutation) FieldCleared(name string) bool
- func (m *IssueMutation) Fields() []string
- func (m *IssueMutation) ID() (id uuid.UUID, exists bool)
- func (m *IssueMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *IssueMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *IssueMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *IssueMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *IssueMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *IssueMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *IssueMutation) Op() Op
- func (m *IssueMutation) OwnerCleared() bool
- func (m *IssueMutation) OwnerID() (id uuid.UUID, exists bool)
- func (m *IssueMutation) OwnerIDs() (ids []uuid.UUID)
- func (m *IssueMutation) RemovedEdges() []string
- func (m *IssueMutation) RemovedIDs(name string) []ent.Value
- func (m *IssueMutation) ResetCreateTime()
- func (m *IssueMutation) ResetDescription()
- func (m *IssueMutation) ResetEdge(name string) error
- func (m *IssueMutation) ResetField(name string) error
- func (m *IssueMutation) ResetOwner()
- func (m *IssueMutation) ResetTitle()
- func (m *IssueMutation) ResetUpdateTime()
- func (m *IssueMutation) SetCreateTime(t time.Time)
- func (m *IssueMutation) SetDescription(s string)
- func (m *IssueMutation) SetField(name string, value ent.Value) error
- func (m *IssueMutation) SetID(id uuid.UUID)
- func (m *IssueMutation) SetOwnerID(id uuid.UUID)
- func (m *IssueMutation) SetTitle(s string)
- func (m *IssueMutation) SetUpdateTime(t time.Time)
- func (m *IssueMutation) Title() (r string, exists bool)
- func (m IssueMutation) Tx() (*Tx, error)
- func (m *IssueMutation) Type() string
- func (m *IssueMutation) UpdateTime() (r time.Time, exists bool)
- func (m *IssueMutation) Where(ps ...predicate.Issue)
- type IssueQuery
- func (iq *IssueQuery) Aggregate(fns ...AggregateFunc) *IssueSelect
- func (iq *IssueQuery) All(ctx context.Context) ([]*Issue, error)
- func (iq *IssueQuery) AllX(ctx context.Context) []*Issue
- func (iq *IssueQuery) Clone() *IssueQuery
- func (iq *IssueQuery) Count(ctx context.Context) (int, error)
- func (iq *IssueQuery) CountX(ctx context.Context) int
- func (iq *IssueQuery) Exist(ctx context.Context) (bool, error)
- func (iq *IssueQuery) ExistX(ctx context.Context) bool
- func (iq *IssueQuery) First(ctx context.Context) (*Issue, error)
- func (iq *IssueQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (iq *IssueQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (iq *IssueQuery) FirstX(ctx context.Context) *Issue
- func (iq *IssueQuery) GroupBy(field string, fields ...string) *IssueGroupBy
- func (iq *IssueQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (iq *IssueQuery) IDsX(ctx context.Context) []uuid.UUID
- func (iq *IssueQuery) Limit(limit int) *IssueQuery
- func (iq *IssueQuery) Offset(offset int) *IssueQuery
- func (iq *IssueQuery) Only(ctx context.Context) (*Issue, error)
- func (iq *IssueQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (iq *IssueQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (iq *IssueQuery) OnlyX(ctx context.Context) *Issue
- func (iq *IssueQuery) Order(o ...OrderFunc) *IssueQuery
- func (iq *IssueQuery) QueryOwner() *ProjectQuery
- func (iq *IssueQuery) Select(fields ...string) *IssueSelect
- func (iq *IssueQuery) Unique(unique bool) *IssueQuery
- func (iq *IssueQuery) Where(ps ...predicate.Issue) *IssueQuery
- func (iq *IssueQuery) WithOwner(opts ...func(*ProjectQuery)) *IssueQuery
- type IssueSelect
- func (is *IssueSelect) Aggregate(fns ...AggregateFunc) *IssueSelect
- func (s *IssueSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *IssueSelect) BoolX(ctx context.Context) bool
- func (s *IssueSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *IssueSelect) BoolsX(ctx context.Context) []bool
- func (s *IssueSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *IssueSelect) Float64X(ctx context.Context) float64
- func (s *IssueSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *IssueSelect) Float64sX(ctx context.Context) []float64
- func (s *IssueSelect) Int(ctx context.Context) (_ int, err error)
- func (s *IssueSelect) IntX(ctx context.Context) int
- func (s *IssueSelect) Ints(ctx context.Context) ([]int, error)
- func (s *IssueSelect) IntsX(ctx context.Context) []int
- func (is *IssueSelect) Scan(ctx context.Context, v any) error
- func (s *IssueSelect) ScanX(ctx context.Context, v any)
- func (s *IssueSelect) String(ctx context.Context) (_ string, err error)
- func (s *IssueSelect) StringX(ctx context.Context) string
- func (s *IssueSelect) Strings(ctx context.Context) ([]string, error)
- func (s *IssueSelect) StringsX(ctx context.Context) []string
- type IssueUpdate
- func (iu *IssueUpdate) ClearOwner() *IssueUpdate
- func (iu *IssueUpdate) Exec(ctx context.Context) error
- func (iu *IssueUpdate) ExecX(ctx context.Context)
- func (iu *IssueUpdate) Mutation() *IssueMutation
- func (iu *IssueUpdate) Save(ctx context.Context) (int, error)
- func (iu *IssueUpdate) SaveX(ctx context.Context) int
- func (iu *IssueUpdate) SetDescription(s string) *IssueUpdate
- func (iu *IssueUpdate) SetNillableOwnerID(id *uuid.UUID) *IssueUpdate
- func (iu *IssueUpdate) SetOwner(p *Project) *IssueUpdate
- func (iu *IssueUpdate) SetOwnerID(id uuid.UUID) *IssueUpdate
- func (iu *IssueUpdate) SetTitle(s string) *IssueUpdate
- func (iu *IssueUpdate) SetUpdateTime(t time.Time) *IssueUpdate
- func (iu *IssueUpdate) Where(ps ...predicate.Issue) *IssueUpdate
- type IssueUpdateOne
- func (iuo *IssueUpdateOne) ClearOwner() *IssueUpdateOne
- func (iuo *IssueUpdateOne) Exec(ctx context.Context) error
- func (iuo *IssueUpdateOne) ExecX(ctx context.Context)
- func (iuo *IssueUpdateOne) Mutation() *IssueMutation
- func (iuo *IssueUpdateOne) Save(ctx context.Context) (*Issue, error)
- func (iuo *IssueUpdateOne) SaveX(ctx context.Context) *Issue
- func (iuo *IssueUpdateOne) Select(field string, fields ...string) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetDescription(s string) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetNillableOwnerID(id *uuid.UUID) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetOwner(p *Project) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetOwnerID(id uuid.UUID) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetTitle(s string) *IssueUpdateOne
- func (iuo *IssueUpdateOne) SetUpdateTime(t time.Time) *IssueUpdateOne
- type Issues
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Project
- type ProjectClient
- func (c *ProjectClient) Create() *ProjectCreate
- func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk
- func (c *ProjectClient) Delete() *ProjectDelete
- func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne
- func (c *ProjectClient) DeleteOneID(id uuid.UUID) *ProjectDeleteOne
- func (c *ProjectClient) Get(ctx context.Context, id uuid.UUID) (*Project, error)
- func (c *ProjectClient) GetX(ctx context.Context, id uuid.UUID) *Project
- func (c *ProjectClient) Hooks() []Hook
- func (c *ProjectClient) Query() *ProjectQuery
- func (c *ProjectClient) QueryIssues(pr *Project) *IssueQuery
- func (c *ProjectClient) Update() *ProjectUpdate
- func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne
- func (c *ProjectClient) UpdateOneID(id uuid.UUID) *ProjectUpdateOne
- func (c *ProjectClient) Use(hooks ...Hook)
- type ProjectCreate
- func (pc *ProjectCreate) AddIssueIDs(ids ...uuid.UUID) *ProjectCreate
- func (pc *ProjectCreate) AddIssues(i ...*Issue) *ProjectCreate
- func (pc *ProjectCreate) Exec(ctx context.Context) error
- func (pc *ProjectCreate) ExecX(ctx context.Context)
- func (pc *ProjectCreate) Mutation() *ProjectMutation
- func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)
- func (pc *ProjectCreate) SaveX(ctx context.Context) *Project
- func (pc *ProjectCreate) SetCreateTime(t time.Time) *ProjectCreate
- func (pc *ProjectCreate) SetDescription(s string) *ProjectCreate
- func (pc *ProjectCreate) SetID(u uuid.UUID) *ProjectCreate
- func (pc *ProjectCreate) SetNillableCreateTime(t *time.Time) *ProjectCreate
- func (pc *ProjectCreate) SetNillableID(u *uuid.UUID) *ProjectCreate
- func (pc *ProjectCreate) SetNillableUpdateTime(t *time.Time) *ProjectCreate
- func (pc *ProjectCreate) SetTitle(s string) *ProjectCreate
- func (pc *ProjectCreate) SetUpdateTime(t time.Time) *ProjectCreate
- type ProjectCreateBulk
- type ProjectDelete
- type ProjectDeleteOne
- type ProjectEdges
- type ProjectGroupBy
- func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy
- func (s *ProjectGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectGroupBy) BoolX(ctx context.Context) bool
- func (s *ProjectGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProjectGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectGroupBy) Float64X(ctx context.Context) float64
- func (s *ProjectGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProjectGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectGroupBy) IntX(ctx context.Context) int
- func (s *ProjectGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProjectGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProjectGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProjectGroupBy) StringX(ctx context.Context) string
- func (s *ProjectGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectGroupBy) StringsX(ctx context.Context) []string
- type ProjectMutation
- func (m *ProjectMutation) AddField(name string, value ent.Value) error
- func (m *ProjectMutation) AddIssueIDs(ids ...uuid.UUID)
- func (m *ProjectMutation) AddedEdges() []string
- func (m *ProjectMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProjectMutation) AddedFields() []string
- func (m *ProjectMutation) AddedIDs(name string) []ent.Value
- func (m *ProjectMutation) ClearEdge(name string) error
- func (m *ProjectMutation) ClearField(name string) error
- func (m *ProjectMutation) ClearIssues()
- func (m *ProjectMutation) ClearedEdges() []string
- func (m *ProjectMutation) ClearedFields() []string
- func (m ProjectMutation) Client() *Client
- func (m *ProjectMutation) CreateTime() (r time.Time, exists bool)
- func (m *ProjectMutation) Description() (r string, exists bool)
- func (m *ProjectMutation) EdgeCleared(name string) bool
- func (m *ProjectMutation) Field(name string) (ent.Value, bool)
- func (m *ProjectMutation) FieldCleared(name string) bool
- func (m *ProjectMutation) Fields() []string
- func (m *ProjectMutation) ID() (id uuid.UUID, exists bool)
- func (m *ProjectMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *ProjectMutation) IssuesCleared() bool
- func (m *ProjectMutation) IssuesIDs() (ids []uuid.UUID)
- func (m *ProjectMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProjectMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) Op() Op
- func (m *ProjectMutation) RemoveIssueIDs(ids ...uuid.UUID)
- func (m *ProjectMutation) RemovedEdges() []string
- func (m *ProjectMutation) RemovedIDs(name string) []ent.Value
- func (m *ProjectMutation) RemovedIssuesIDs() (ids []uuid.UUID)
- func (m *ProjectMutation) ResetCreateTime()
- func (m *ProjectMutation) ResetDescription()
- func (m *ProjectMutation) ResetEdge(name string) error
- func (m *ProjectMutation) ResetField(name string) error
- func (m *ProjectMutation) ResetIssues()
- func (m *ProjectMutation) ResetTitle()
- func (m *ProjectMutation) ResetUpdateTime()
- func (m *ProjectMutation) SetCreateTime(t time.Time)
- func (m *ProjectMutation) SetDescription(s string)
- func (m *ProjectMutation) SetField(name string, value ent.Value) error
- func (m *ProjectMutation) SetID(id uuid.UUID)
- func (m *ProjectMutation) SetTitle(s string)
- func (m *ProjectMutation) SetUpdateTime(t time.Time)
- func (m *ProjectMutation) Title() (r string, exists bool)
- func (m ProjectMutation) Tx() (*Tx, error)
- func (m *ProjectMutation) Type() string
- func (m *ProjectMutation) UpdateTime() (r time.Time, exists bool)
- func (m *ProjectMutation) Where(ps ...predicate.Project)
- type ProjectQuery
- func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
- func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)
- func (pq *ProjectQuery) AllX(ctx context.Context) []*Project
- func (pq *ProjectQuery) Clone() *ProjectQuery
- func (pq *ProjectQuery) Count(ctx context.Context) (int, error)
- func (pq *ProjectQuery) CountX(ctx context.Context) int
- func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProjectQuery) ExistX(ctx context.Context) bool
- func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)
- func (pq *ProjectQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *ProjectQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (pq *ProjectQuery) FirstX(ctx context.Context) *Project
- func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy
- func (pq *ProjectQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (pq *ProjectQuery) IDsX(ctx context.Context) []uuid.UUID
- func (pq *ProjectQuery) Limit(limit int) *ProjectQuery
- func (pq *ProjectQuery) Offset(offset int) *ProjectQuery
- func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)
- func (pq *ProjectQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *ProjectQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project
- func (pq *ProjectQuery) Order(o ...OrderFunc) *ProjectQuery
- func (pq *ProjectQuery) QueryIssues() *IssueQuery
- func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect
- func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery
- func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
- func (pq *ProjectQuery) WithIssues(opts ...func(*IssueQuery)) *ProjectQuery
- type ProjectSelect
- func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect
- func (s *ProjectSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectSelect) BoolX(ctx context.Context) bool
- func (s *ProjectSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectSelect) BoolsX(ctx context.Context) []bool
- func (s *ProjectSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectSelect) Float64X(ctx context.Context) float64
- func (s *ProjectSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectSelect) Float64sX(ctx context.Context) []float64
- func (s *ProjectSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectSelect) IntX(ctx context.Context) int
- func (s *ProjectSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectSelect) IntsX(ctx context.Context) []int
- func (ps *ProjectSelect) Scan(ctx context.Context, v any) error
- func (s *ProjectSelect) ScanX(ctx context.Context, v any)
- func (s *ProjectSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProjectSelect) StringX(ctx context.Context) string
- func (s *ProjectSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectSelect) StringsX(ctx context.Context) []string
- type ProjectUpdate
- func (pu *ProjectUpdate) AddIssueIDs(ids ...uuid.UUID) *ProjectUpdate
- func (pu *ProjectUpdate) AddIssues(i ...*Issue) *ProjectUpdate
- func (pu *ProjectUpdate) ClearIssues() *ProjectUpdate
- func (pu *ProjectUpdate) Exec(ctx context.Context) error
- func (pu *ProjectUpdate) ExecX(ctx context.Context)
- func (pu *ProjectUpdate) Mutation() *ProjectMutation
- func (pu *ProjectUpdate) RemoveIssueIDs(ids ...uuid.UUID) *ProjectUpdate
- func (pu *ProjectUpdate) RemoveIssues(i ...*Issue) *ProjectUpdate
- func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProjectUpdate) SaveX(ctx context.Context) int
- func (pu *ProjectUpdate) SetDescription(s string) *ProjectUpdate
- func (pu *ProjectUpdate) SetTitle(s string) *ProjectUpdate
- func (pu *ProjectUpdate) SetUpdateTime(t time.Time) *ProjectUpdate
- func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate
- type ProjectUpdateOne
- func (puo *ProjectUpdateOne) AddIssueIDs(ids ...uuid.UUID) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) AddIssues(i ...*Issue) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) ClearIssues() *ProjectUpdateOne
- func (puo *ProjectUpdateOne) Exec(ctx context.Context) error
- func (puo *ProjectUpdateOne) ExecX(ctx context.Context)
- func (puo *ProjectUpdateOne) Mutation() *ProjectMutation
- func (puo *ProjectUpdateOne) RemoveIssueIDs(ids ...uuid.UUID) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) RemoveIssues(i ...*Issue) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
- func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project
- func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) SetDescription(s string) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) SetTitle(s string) *ProjectUpdateOne
- func (puo *ProjectUpdateOne) SetUpdateTime(t time.Time) *ProjectUpdateOne
- type Projects
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- 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. TypeIssue = "Issue" TypeProject = "Project" )
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 validation 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 // Issue is the client for interacting with the Issue builders. Issue *IssueClient // Project is the client for interacting with the Project builders. Project *ProjectClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside 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(). Issue. 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(ctx 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 Issue ¶
type Issue struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,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"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the IssueQuery when eager-loading is set. Edges IssueEdges `json:"edges"` // contains filtered or unexported fields }
Issue is the model entity for the Issue schema.
func (*Issue) QueryOwner ¶
func (i *Issue) QueryOwner() *ProjectQuery
QueryOwner queries the "owner" edge of the Issue entity.
func (*Issue) Unwrap ¶
Unwrap unwraps the Issue entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Issue) Update ¶
func (i *Issue) Update() *IssueUpdateOne
Update returns a builder for updating this Issue. Note that you need to call Issue.Unwrap() before calling this method if this Issue was returned from a transaction, and the transaction was committed or rolled back.
type IssueClient ¶
type IssueClient struct {
// contains filtered or unexported fields
}
IssueClient is a client for the Issue schema.
func NewIssueClient ¶
func NewIssueClient(c config) *IssueClient
NewIssueClient returns a client for the Issue from the given config.
func (*IssueClient) Create ¶
func (c *IssueClient) Create() *IssueCreate
Create returns a builder for creating a Issue entity.
func (*IssueClient) CreateBulk ¶
func (c *IssueClient) CreateBulk(builders ...*IssueCreate) *IssueCreateBulk
CreateBulk returns a builder for creating a bulk of Issue entities.
func (*IssueClient) Delete ¶
func (c *IssueClient) Delete() *IssueDelete
Delete returns a delete builder for Issue.
func (*IssueClient) DeleteOne ¶
func (c *IssueClient) DeleteOne(i *Issue) *IssueDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*IssueClient) DeleteOneID ¶
func (c *IssueClient) DeleteOneID(id uuid.UUID) *IssueDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*IssueClient) Query ¶
func (c *IssueClient) Query() *IssueQuery
Query returns a query builder for Issue.
func (*IssueClient) QueryOwner ¶
func (c *IssueClient) QueryOwner(i *Issue) *ProjectQuery
QueryOwner queries the owner edge of a Issue.
func (*IssueClient) Update ¶
func (c *IssueClient) Update() *IssueUpdate
Update returns an update builder for Issue.
func (*IssueClient) UpdateOne ¶
func (c *IssueClient) UpdateOne(i *Issue) *IssueUpdateOne
UpdateOne returns an update builder for the given entity.
func (*IssueClient) UpdateOneID ¶
func (c *IssueClient) UpdateOneID(id uuid.UUID) *IssueUpdateOne
UpdateOneID returns an update builder for the given id.
func (*IssueClient) Use ¶
func (c *IssueClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `issue.Hooks(f(g(h())))`.
type IssueCreate ¶
type IssueCreate struct {
// contains filtered or unexported fields
}
IssueCreate is the builder for creating a Issue entity.
func (*IssueCreate) Exec ¶
func (ic *IssueCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*IssueCreate) ExecX ¶
func (ic *IssueCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IssueCreate) Mutation ¶
func (ic *IssueCreate) Mutation() *IssueMutation
Mutation returns the IssueMutation object of the builder.
func (*IssueCreate) Save ¶
func (ic *IssueCreate) Save(ctx context.Context) (*Issue, error)
Save creates the Issue in the database.
func (*IssueCreate) SaveX ¶
func (ic *IssueCreate) SaveX(ctx context.Context) *Issue
SaveX calls Save and panics if Save returns an error.
func (*IssueCreate) SetCreateTime ¶
func (ic *IssueCreate) SetCreateTime(t time.Time) *IssueCreate
SetCreateTime sets the "create_time" field.
func (*IssueCreate) SetDescription ¶
func (ic *IssueCreate) SetDescription(s string) *IssueCreate
SetDescription sets the "description" field.
func (*IssueCreate) SetID ¶
func (ic *IssueCreate) SetID(u uuid.UUID) *IssueCreate
SetID sets the "id" field.
func (*IssueCreate) SetNillableCreateTime ¶
func (ic *IssueCreate) SetNillableCreateTime(t *time.Time) *IssueCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*IssueCreate) SetNillableID ¶
func (ic *IssueCreate) SetNillableID(u *uuid.UUID) *IssueCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*IssueCreate) SetNillableOwnerID ¶
func (ic *IssueCreate) SetNillableOwnerID(id *uuid.UUID) *IssueCreate
SetNillableOwnerID sets the "owner" edge to the Project entity by ID if the given value is not nil.
func (*IssueCreate) SetNillableUpdateTime ¶
func (ic *IssueCreate) SetNillableUpdateTime(t *time.Time) *IssueCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*IssueCreate) SetOwner ¶
func (ic *IssueCreate) SetOwner(p *Project) *IssueCreate
SetOwner sets the "owner" edge to the Project entity.
func (*IssueCreate) SetOwnerID ¶
func (ic *IssueCreate) SetOwnerID(id uuid.UUID) *IssueCreate
SetOwnerID sets the "owner" edge to the Project entity by ID.
func (*IssueCreate) SetTitle ¶
func (ic *IssueCreate) SetTitle(s string) *IssueCreate
SetTitle sets the "title" field.
func (*IssueCreate) SetUpdateTime ¶
func (ic *IssueCreate) SetUpdateTime(t time.Time) *IssueCreate
SetUpdateTime sets the "update_time" field.
type IssueCreateBulk ¶
type IssueCreateBulk struct {
// contains filtered or unexported fields
}
IssueCreateBulk is the builder for creating many Issue entities in bulk.
func (*IssueCreateBulk) Exec ¶
func (icb *IssueCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*IssueCreateBulk) ExecX ¶
func (icb *IssueCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type IssueDelete ¶
type IssueDelete struct {
// contains filtered or unexported fields
}
IssueDelete is the builder for deleting a Issue entity.
func (*IssueDelete) Exec ¶
func (id *IssueDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*IssueDelete) ExecX ¶
func (id *IssueDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*IssueDelete) Where ¶
func (id *IssueDelete) Where(ps ...predicate.Issue) *IssueDelete
Where appends a list predicates to the IssueDelete builder.
type IssueDeleteOne ¶
type IssueDeleteOne struct {
// contains filtered or unexported fields
}
IssueDeleteOne is the builder for deleting a single Issue entity.
func (*IssueDeleteOne) Exec ¶
func (ido *IssueDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*IssueDeleteOne) ExecX ¶
func (ido *IssueDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type IssueEdges ¶
type IssueEdges struct { // Owner holds the value of the owner edge. Owner *Project `json:"owner,omitempty"` // contains filtered or unexported fields }
IssueEdges holds the relations/edges for other nodes in the graph.
func (IssueEdges) OwnerOrErr ¶
func (e IssueEdges) OwnerOrErr() (*Project, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type IssueGroupBy ¶
type IssueGroupBy struct {
// contains filtered or unexported fields
}
IssueGroupBy is the group-by builder for Issue entities.
func (*IssueGroupBy) Aggregate ¶
func (igb *IssueGroupBy) Aggregate(fns ...AggregateFunc) *IssueGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*IssueGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*IssueGroupBy) Scan ¶
func (igb *IssueGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*IssueGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type IssueMutation ¶
type IssueMutation struct {
// contains filtered or unexported fields
}
IssueMutation represents an operation that mutates the Issue nodes in the graph.
func (*IssueMutation) AddField ¶
func (m *IssueMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*IssueMutation) AddedEdges ¶
func (m *IssueMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*IssueMutation) AddedField ¶
func (m *IssueMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*IssueMutation) AddedFields ¶
func (m *IssueMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*IssueMutation) AddedIDs ¶
func (m *IssueMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*IssueMutation) ClearEdge ¶
func (m *IssueMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*IssueMutation) ClearField ¶
func (m *IssueMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*IssueMutation) ClearOwner ¶
func (m *IssueMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Project entity.
func (*IssueMutation) ClearedEdges ¶
func (m *IssueMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*IssueMutation) ClearedFields ¶
func (m *IssueMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (IssueMutation) Client ¶
func (m IssueMutation) 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 (*IssueMutation) CreateTime ¶
func (m *IssueMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*IssueMutation) Description ¶
func (m *IssueMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*IssueMutation) EdgeCleared ¶
func (m *IssueMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*IssueMutation) Field ¶
func (m *IssueMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*IssueMutation) FieldCleared ¶
func (m *IssueMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*IssueMutation) Fields ¶
func (m *IssueMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*IssueMutation) ID ¶
func (m *IssueMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*IssueMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*IssueMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Issue entity. If the Issue 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 the database query fails.
func (*IssueMutation) OldDescription ¶
func (m *IssueMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Issue entity. If the Issue 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 the database query fails.
func (*IssueMutation) OldField ¶
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 failed.
func (*IssueMutation) OldTitle ¶
func (m *IssueMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Issue entity. If the Issue 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 the database query fails.
func (*IssueMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Issue entity. If the Issue 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 the database query fails.
func (*IssueMutation) OwnerCleared ¶
func (m *IssueMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Project entity was cleared.
func (*IssueMutation) OwnerID ¶
func (m *IssueMutation) OwnerID() (id uuid.UUID, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*IssueMutation) OwnerIDs ¶
func (m *IssueMutation) OwnerIDs() (ids []uuid.UUID)
OwnerIDs returns the "owner" edge 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 (*IssueMutation) RemovedEdges ¶
func (m *IssueMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*IssueMutation) RemovedIDs ¶
func (m *IssueMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*IssueMutation) ResetCreateTime ¶
func (m *IssueMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*IssueMutation) ResetDescription ¶
func (m *IssueMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*IssueMutation) ResetEdge ¶
func (m *IssueMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*IssueMutation) ResetField ¶
func (m *IssueMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*IssueMutation) ResetOwner ¶
func (m *IssueMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*IssueMutation) ResetTitle ¶
func (m *IssueMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*IssueMutation) ResetUpdateTime ¶
func (m *IssueMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*IssueMutation) SetCreateTime ¶
func (m *IssueMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*IssueMutation) SetDescription ¶
func (m *IssueMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*IssueMutation) SetField ¶
func (m *IssueMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*IssueMutation) SetID ¶
func (m *IssueMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Issue entities.
func (*IssueMutation) SetOwnerID ¶
func (m *IssueMutation) SetOwnerID(id uuid.UUID)
SetOwnerID sets the "owner" edge to the Project entity by id.
func (*IssueMutation) SetTitle ¶
func (m *IssueMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*IssueMutation) SetUpdateTime ¶
func (m *IssueMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*IssueMutation) Title ¶
func (m *IssueMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (IssueMutation) Tx ¶
func (m IssueMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*IssueMutation) Type ¶
func (m *IssueMutation) Type() string
Type returns the node type of this mutation (Issue).
func (*IssueMutation) UpdateTime ¶
func (m *IssueMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*IssueMutation) Where ¶
func (m *IssueMutation) Where(ps ...predicate.Issue)
Where appends a list predicates to the IssueMutation builder.
type IssueQuery ¶
type IssueQuery struct {
// contains filtered or unexported fields
}
IssueQuery is the builder for querying Issue entities.
func (*IssueQuery) Aggregate ¶
func (iq *IssueQuery) Aggregate(fns ...AggregateFunc) *IssueSelect
Aggregate returns a IssueSelect configured with the given aggregations.
func (*IssueQuery) All ¶
func (iq *IssueQuery) All(ctx context.Context) ([]*Issue, error)
All executes the query and returns a list of Issues.
func (*IssueQuery) AllX ¶
func (iq *IssueQuery) AllX(ctx context.Context) []*Issue
AllX is like All, but panics if an error occurs.
func (*IssueQuery) Clone ¶
func (iq *IssueQuery) Clone() *IssueQuery
Clone returns a duplicate of the IssueQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*IssueQuery) Count ¶
func (iq *IssueQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*IssueQuery) CountX ¶
func (iq *IssueQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*IssueQuery) Exist ¶
func (iq *IssueQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*IssueQuery) ExistX ¶
func (iq *IssueQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*IssueQuery) First ¶
func (iq *IssueQuery) First(ctx context.Context) (*Issue, error)
First returns the first Issue entity from the query. Returns a *NotFoundError when no Issue was found.
func (*IssueQuery) FirstID ¶
FirstID returns the first Issue ID from the query. Returns a *NotFoundError when no Issue ID was found.
func (*IssueQuery) FirstIDX ¶
func (iq *IssueQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*IssueQuery) FirstX ¶
func (iq *IssueQuery) FirstX(ctx context.Context) *Issue
FirstX is like First, but panics if an error occurs.
func (*IssueQuery) GroupBy ¶
func (iq *IssueQuery) GroupBy(field string, fields ...string) *IssueGroupBy
GroupBy is 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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Issue.Query(). GroupBy(issue.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*IssueQuery) IDsX ¶
func (iq *IssueQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*IssueQuery) Limit ¶
func (iq *IssueQuery) Limit(limit int) *IssueQuery
Limit adds a limit step to the query.
func (*IssueQuery) Offset ¶
func (iq *IssueQuery) Offset(offset int) *IssueQuery
Offset adds an offset step to the query.
func (*IssueQuery) Only ¶
func (iq *IssueQuery) Only(ctx context.Context) (*Issue, error)
Only returns a single Issue entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Issue entity is found. Returns a *NotFoundError when no Issue entities are found.
func (*IssueQuery) OnlyID ¶
OnlyID is like Only, but returns the only Issue ID in the query. Returns a *NotSingularError when more than one Issue ID is found. Returns a *NotFoundError when no entities are found.
func (*IssueQuery) OnlyIDX ¶
func (iq *IssueQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*IssueQuery) OnlyX ¶
func (iq *IssueQuery) OnlyX(ctx context.Context) *Issue
OnlyX is like Only, but panics if an error occurs.
func (*IssueQuery) Order ¶
func (iq *IssueQuery) Order(o ...OrderFunc) *IssueQuery
Order adds an order step to the query.
func (*IssueQuery) QueryOwner ¶
func (iq *IssueQuery) QueryOwner() *ProjectQuery
QueryOwner chains the current query on the "owner" edge.
func (*IssueQuery) Select ¶
func (iq *IssueQuery) Select(fields ...string) *IssueSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.Issue.Query(). Select(issue.FieldCreateTime). Scan(ctx, &v)
func (*IssueQuery) Unique ¶
func (iq *IssueQuery) Unique(unique bool) *IssueQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*IssueQuery) Where ¶
func (iq *IssueQuery) Where(ps ...predicate.Issue) *IssueQuery
Where adds a new predicate for the IssueQuery builder.
func (*IssueQuery) WithOwner ¶
func (iq *IssueQuery) WithOwner(opts ...func(*ProjectQuery)) *IssueQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
type IssueSelect ¶
type IssueSelect struct { *IssueQuery // contains filtered or unexported fields }
IssueSelect is the builder for selecting fields of Issue entities.
func (*IssueSelect) Aggregate ¶
func (is *IssueSelect) Aggregate(fns ...AggregateFunc) *IssueSelect
Aggregate adds the given aggregation functions to the selector query.
func (*IssueSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*IssueSelect) Scan ¶
func (is *IssueSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*IssueSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type IssueUpdate ¶
type IssueUpdate struct {
// contains filtered or unexported fields
}
IssueUpdate is the builder for updating Issue entities.
func (*IssueUpdate) ClearOwner ¶
func (iu *IssueUpdate) ClearOwner() *IssueUpdate
ClearOwner clears the "owner" edge to the Project entity.
func (*IssueUpdate) Exec ¶
func (iu *IssueUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*IssueUpdate) ExecX ¶
func (iu *IssueUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IssueUpdate) Mutation ¶
func (iu *IssueUpdate) Mutation() *IssueMutation
Mutation returns the IssueMutation object of the builder.
func (*IssueUpdate) Save ¶
func (iu *IssueUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*IssueUpdate) SaveX ¶
func (iu *IssueUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*IssueUpdate) SetDescription ¶
func (iu *IssueUpdate) SetDescription(s string) *IssueUpdate
SetDescription sets the "description" field.
func (*IssueUpdate) SetNillableOwnerID ¶
func (iu *IssueUpdate) SetNillableOwnerID(id *uuid.UUID) *IssueUpdate
SetNillableOwnerID sets the "owner" edge to the Project entity by ID if the given value is not nil.
func (*IssueUpdate) SetOwner ¶
func (iu *IssueUpdate) SetOwner(p *Project) *IssueUpdate
SetOwner sets the "owner" edge to the Project entity.
func (*IssueUpdate) SetOwnerID ¶
func (iu *IssueUpdate) SetOwnerID(id uuid.UUID) *IssueUpdate
SetOwnerID sets the "owner" edge to the Project entity by ID.
func (*IssueUpdate) SetTitle ¶
func (iu *IssueUpdate) SetTitle(s string) *IssueUpdate
SetTitle sets the "title" field.
func (*IssueUpdate) SetUpdateTime ¶
func (iu *IssueUpdate) SetUpdateTime(t time.Time) *IssueUpdate
SetUpdateTime sets the "update_time" field.
func (*IssueUpdate) Where ¶
func (iu *IssueUpdate) Where(ps ...predicate.Issue) *IssueUpdate
Where appends a list predicates to the IssueUpdate builder.
type IssueUpdateOne ¶
type IssueUpdateOne struct {
// contains filtered or unexported fields
}
IssueUpdateOne is the builder for updating a single Issue entity.
func (*IssueUpdateOne) ClearOwner ¶
func (iuo *IssueUpdateOne) ClearOwner() *IssueUpdateOne
ClearOwner clears the "owner" edge to the Project entity.
func (*IssueUpdateOne) Exec ¶
func (iuo *IssueUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*IssueUpdateOne) ExecX ¶
func (iuo *IssueUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IssueUpdateOne) Mutation ¶
func (iuo *IssueUpdateOne) Mutation() *IssueMutation
Mutation returns the IssueMutation object of the builder.
func (*IssueUpdateOne) Save ¶
func (iuo *IssueUpdateOne) Save(ctx context.Context) (*Issue, error)
Save executes the query and returns the updated Issue entity.
func (*IssueUpdateOne) SaveX ¶
func (iuo *IssueUpdateOne) SaveX(ctx context.Context) *Issue
SaveX is like Save, but panics if an error occurs.
func (*IssueUpdateOne) Select ¶
func (iuo *IssueUpdateOne) Select(field string, fields ...string) *IssueUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*IssueUpdateOne) SetDescription ¶
func (iuo *IssueUpdateOne) SetDescription(s string) *IssueUpdateOne
SetDescription sets the "description" field.
func (*IssueUpdateOne) SetNillableOwnerID ¶
func (iuo *IssueUpdateOne) SetNillableOwnerID(id *uuid.UUID) *IssueUpdateOne
SetNillableOwnerID sets the "owner" edge to the Project entity by ID if the given value is not nil.
func (*IssueUpdateOne) SetOwner ¶
func (iuo *IssueUpdateOne) SetOwner(p *Project) *IssueUpdateOne
SetOwner sets the "owner" edge to the Project entity.
func (*IssueUpdateOne) SetOwnerID ¶
func (iuo *IssueUpdateOne) SetOwnerID(id uuid.UUID) *IssueUpdateOne
SetOwnerID sets the "owner" edge to the Project entity by ID.
func (*IssueUpdateOne) SetTitle ¶
func (iuo *IssueUpdateOne) SetTitle(s string) *IssueUpdateOne
SetTitle sets the "title" field.
func (*IssueUpdateOne) SetUpdateTime ¶
func (iuo *IssueUpdateOne) SetUpdateTime(t time.Time) *IssueUpdateOne
SetUpdateTime sets the "update_time" field.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts 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 Project ¶
type Project struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,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"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProjectQuery when eager-loading is set. Edges ProjectEdges `json:"edges"` // contains filtered or unexported fields }
Project is the model entity for the Project schema.
func (*Project) QueryIssues ¶
func (pr *Project) QueryIssues() *IssueQuery
QueryIssues queries the "issues" edge of the Project entity.
func (*Project) Unwrap ¶
Unwrap unwraps the Project entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Project) Update ¶
func (pr *Project) Update() *ProjectUpdateOne
Update returns a builder for updating this Project. Note that you need to call Project.Unwrap() before calling this method if this Project was returned from a transaction, and the transaction was committed or rolled back.
type ProjectClient ¶
type ProjectClient struct {
// contains filtered or unexported fields
}
ProjectClient is a client for the Project schema.
func NewProjectClient ¶
func NewProjectClient(c config) *ProjectClient
NewProjectClient returns a client for the Project from the given config.
func (*ProjectClient) Create ¶
func (c *ProjectClient) Create() *ProjectCreate
Create returns a builder for creating a Project entity.
func (*ProjectClient) CreateBulk ¶
func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk
CreateBulk returns a builder for creating a bulk of Project entities.
func (*ProjectClient) Delete ¶
func (c *ProjectClient) Delete() *ProjectDelete
Delete returns a delete builder for Project.
func (*ProjectClient) DeleteOne ¶
func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProjectClient) DeleteOneID ¶
func (c *ProjectClient) DeleteOneID(id uuid.UUID) *ProjectDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProjectClient) Hooks ¶
func (c *ProjectClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProjectClient) Query ¶
func (c *ProjectClient) Query() *ProjectQuery
Query returns a query builder for Project.
func (*ProjectClient) QueryIssues ¶
func (c *ProjectClient) QueryIssues(pr *Project) *IssueQuery
QueryIssues queries the issues edge of a Project.
func (*ProjectClient) Update ¶
func (c *ProjectClient) Update() *ProjectUpdate
Update returns an update builder for Project.
func (*ProjectClient) UpdateOne ¶
func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProjectClient) UpdateOneID ¶
func (c *ProjectClient) UpdateOneID(id uuid.UUID) *ProjectUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProjectClient) Use ¶
func (c *ProjectClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `project.Hooks(f(g(h())))`.
type ProjectCreate ¶
type ProjectCreate struct {
// contains filtered or unexported fields
}
ProjectCreate is the builder for creating a Project entity.
func (*ProjectCreate) AddIssueIDs ¶
func (pc *ProjectCreate) AddIssueIDs(ids ...uuid.UUID) *ProjectCreate
AddIssueIDs adds the "issues" edge to the Issue entity by IDs.
func (*ProjectCreate) AddIssues ¶
func (pc *ProjectCreate) AddIssues(i ...*Issue) *ProjectCreate
AddIssues adds the "issues" edges to the Issue entity.
func (*ProjectCreate) Exec ¶
func (pc *ProjectCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreate) ExecX ¶
func (pc *ProjectCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectCreate) Mutation ¶
func (pc *ProjectCreate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectCreate) Save ¶
func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)
Save creates the Project in the database.
func (*ProjectCreate) SaveX ¶
func (pc *ProjectCreate) SaveX(ctx context.Context) *Project
SaveX calls Save and panics if Save returns an error.
func (*ProjectCreate) SetCreateTime ¶
func (pc *ProjectCreate) SetCreateTime(t time.Time) *ProjectCreate
SetCreateTime sets the "create_time" field.
func (*ProjectCreate) SetDescription ¶
func (pc *ProjectCreate) SetDescription(s string) *ProjectCreate
SetDescription sets the "description" field.
func (*ProjectCreate) SetID ¶
func (pc *ProjectCreate) SetID(u uuid.UUID) *ProjectCreate
SetID sets the "id" field.
func (*ProjectCreate) SetNillableCreateTime ¶
func (pc *ProjectCreate) SetNillableCreateTime(t *time.Time) *ProjectCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*ProjectCreate) SetNillableID ¶
func (pc *ProjectCreate) SetNillableID(u *uuid.UUID) *ProjectCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*ProjectCreate) SetNillableUpdateTime ¶
func (pc *ProjectCreate) SetNillableUpdateTime(t *time.Time) *ProjectCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*ProjectCreate) SetTitle ¶
func (pc *ProjectCreate) SetTitle(s string) *ProjectCreate
SetTitle sets the "title" field.
func (*ProjectCreate) SetUpdateTime ¶
func (pc *ProjectCreate) SetUpdateTime(t time.Time) *ProjectCreate
SetUpdateTime sets the "update_time" field.
type ProjectCreateBulk ¶
type ProjectCreateBulk struct {
// contains filtered or unexported fields
}
ProjectCreateBulk is the builder for creating many Project entities in bulk.
func (*ProjectCreateBulk) Exec ¶
func (pcb *ProjectCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreateBulk) ExecX ¶
func (pcb *ProjectCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProjectDelete ¶
type ProjectDelete struct {
// contains filtered or unexported fields
}
ProjectDelete is the builder for deleting a Project entity.
func (*ProjectDelete) Exec ¶
func (pd *ProjectDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProjectDelete) ExecX ¶
func (pd *ProjectDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProjectDelete) Where ¶
func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete
Where appends a list predicates to the ProjectDelete builder.
type ProjectDeleteOne ¶
type ProjectDeleteOne struct {
// contains filtered or unexported fields
}
ProjectDeleteOne is the builder for deleting a single Project entity.
func (*ProjectDeleteOne) Exec ¶
func (pdo *ProjectDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProjectDeleteOne) ExecX ¶
func (pdo *ProjectDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProjectEdges ¶
type ProjectEdges struct { // Issues holds the value of the issues edge. Issues []*Issue `json:"issues,omitempty"` // contains filtered or unexported fields }
ProjectEdges holds the relations/edges for other nodes in the graph.
func (ProjectEdges) IssuesOrErr ¶
func (e ProjectEdges) IssuesOrErr() ([]*Issue, error)
IssuesOrErr returns the Issues value or an error if the edge was not loaded in eager-loading.
type ProjectGroupBy ¶
type ProjectGroupBy struct {
// contains filtered or unexported fields
}
ProjectGroupBy is the group-by builder for Project entities.
func (*ProjectGroupBy) Aggregate ¶
func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProjectGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Scan ¶
func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*ProjectGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectMutation ¶
type ProjectMutation struct {
// contains filtered or unexported fields
}
ProjectMutation represents an operation that mutates the Project nodes in the graph.
func (*ProjectMutation) AddField ¶
func (m *ProjectMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ProjectMutation) AddIssueIDs ¶
func (m *ProjectMutation) AddIssueIDs(ids ...uuid.UUID)
AddIssueIDs adds the "issues" edge to the Issue entity by ids.
func (*ProjectMutation) AddedEdges ¶
func (m *ProjectMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProjectMutation) AddedField ¶
func (m *ProjectMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ProjectMutation) AddedFields ¶
func (m *ProjectMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProjectMutation) AddedIDs ¶
func (m *ProjectMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProjectMutation) ClearEdge ¶
func (m *ProjectMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*ProjectMutation) ClearField ¶
func (m *ProjectMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*ProjectMutation) ClearIssues ¶
func (m *ProjectMutation) ClearIssues()
ClearIssues clears the "issues" edge to the Issue entity.
func (*ProjectMutation) ClearedEdges ¶
func (m *ProjectMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProjectMutation) ClearedFields ¶
func (m *ProjectMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProjectMutation) Client ¶
func (m ProjectMutation) 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 (*ProjectMutation) CreateTime ¶
func (m *ProjectMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*ProjectMutation) Description ¶
func (m *ProjectMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ProjectMutation) EdgeCleared ¶
func (m *ProjectMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProjectMutation) Field ¶
func (m *ProjectMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ProjectMutation) FieldCleared ¶
func (m *ProjectMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProjectMutation) Fields ¶
func (m *ProjectMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*ProjectMutation) ID ¶
func (m *ProjectMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ProjectMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ProjectMutation) IssuesCleared ¶
func (m *ProjectMutation) IssuesCleared() bool
IssuesCleared reports if the "issues" edge to the Issue entity was cleared.
func (*ProjectMutation) IssuesIDs ¶
func (m *ProjectMutation) IssuesIDs() (ids []uuid.UUID)
IssuesIDs returns the "issues" edge IDs in the mutation.
func (*ProjectMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Project entity. If the Project 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 the database query fails.
func (*ProjectMutation) OldDescription ¶
func (m *ProjectMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Project entity. If the Project 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 the database query fails.
func (*ProjectMutation) OldField ¶
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 failed.
func (*ProjectMutation) OldTitle ¶
func (m *ProjectMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Project entity. If the Project 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 the database query fails.
func (*ProjectMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Project entity. If the Project 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 the database query fails.
func (*ProjectMutation) RemoveIssueIDs ¶
func (m *ProjectMutation) RemoveIssueIDs(ids ...uuid.UUID)
RemoveIssueIDs removes the "issues" edge to the Issue entity by IDs.
func (*ProjectMutation) RemovedEdges ¶
func (m *ProjectMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProjectMutation) RemovedIDs ¶
func (m *ProjectMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*ProjectMutation) RemovedIssuesIDs ¶
func (m *ProjectMutation) RemovedIssuesIDs() (ids []uuid.UUID)
RemovedIssues returns the removed IDs of the "issues" edge to the Issue entity.
func (*ProjectMutation) ResetCreateTime ¶
func (m *ProjectMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*ProjectMutation) ResetDescription ¶
func (m *ProjectMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ProjectMutation) ResetEdge ¶
func (m *ProjectMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*ProjectMutation) ResetField ¶
func (m *ProjectMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*ProjectMutation) ResetIssues ¶
func (m *ProjectMutation) ResetIssues()
ResetIssues resets all changes to the "issues" edge.
func (*ProjectMutation) ResetTitle ¶
func (m *ProjectMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ProjectMutation) ResetUpdateTime ¶
func (m *ProjectMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*ProjectMutation) SetCreateTime ¶
func (m *ProjectMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*ProjectMutation) SetDescription ¶
func (m *ProjectMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ProjectMutation) SetField ¶
func (m *ProjectMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ProjectMutation) SetID ¶
func (m *ProjectMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Project entities.
func (*ProjectMutation) SetTitle ¶
func (m *ProjectMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ProjectMutation) SetUpdateTime ¶
func (m *ProjectMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*ProjectMutation) Title ¶
func (m *ProjectMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (ProjectMutation) Tx ¶
func (m ProjectMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProjectMutation) Type ¶
func (m *ProjectMutation) Type() string
Type returns the node type of this mutation (Project).
func (*ProjectMutation) UpdateTime ¶
func (m *ProjectMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*ProjectMutation) Where ¶
func (m *ProjectMutation) Where(ps ...predicate.Project)
Where appends a list predicates to the ProjectMutation builder.
type ProjectQuery ¶
type ProjectQuery struct {
// contains filtered or unexported fields
}
ProjectQuery is the builder for querying Project entities.
func (*ProjectQuery) Aggregate ¶
func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
Aggregate returns a ProjectSelect configured with the given aggregations.
func (*ProjectQuery) All ¶
func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)
All executes the query and returns a list of Projects.
func (*ProjectQuery) AllX ¶
func (pq *ProjectQuery) AllX(ctx context.Context) []*Project
AllX is like All, but panics if an error occurs.
func (*ProjectQuery) Clone ¶
func (pq *ProjectQuery) Clone() *ProjectQuery
Clone returns a duplicate of the ProjectQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProjectQuery) Count ¶
func (pq *ProjectQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProjectQuery) CountX ¶
func (pq *ProjectQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProjectQuery) Exist ¶
func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProjectQuery) ExistX ¶
func (pq *ProjectQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProjectQuery) First ¶
func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)
First returns the first Project entity from the query. Returns a *NotFoundError when no Project was found.
func (*ProjectQuery) FirstID ¶
FirstID returns the first Project ID from the query. Returns a *NotFoundError when no Project ID was found.
func (*ProjectQuery) FirstIDX ¶
func (pq *ProjectQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProjectQuery) FirstX ¶
func (pq *ProjectQuery) FirstX(ctx context.Context) *Project
FirstX is like First, but panics if an error occurs.
func (*ProjectQuery) GroupBy ¶
func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy
GroupBy is 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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Project.Query(). GroupBy(project.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProjectQuery) IDsX ¶
func (pq *ProjectQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ProjectQuery) Limit ¶
func (pq *ProjectQuery) Limit(limit int) *ProjectQuery
Limit adds a limit step to the query.
func (*ProjectQuery) Offset ¶
func (pq *ProjectQuery) Offset(offset int) *ProjectQuery
Offset adds an offset step to the query.
func (*ProjectQuery) Only ¶
func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)
Only returns a single Project entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Project entity is found. Returns a *NotFoundError when no Project entities are found.
func (*ProjectQuery) OnlyID ¶
OnlyID is like Only, but returns the only Project ID in the query. Returns a *NotSingularError when more than one Project ID is found. Returns a *NotFoundError when no entities are found.
func (*ProjectQuery) OnlyIDX ¶
func (pq *ProjectQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProjectQuery) OnlyX ¶
func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project
OnlyX is like Only, but panics if an error occurs.
func (*ProjectQuery) Order ¶
func (pq *ProjectQuery) Order(o ...OrderFunc) *ProjectQuery
Order adds an order step to the query.
func (*ProjectQuery) QueryIssues ¶
func (pq *ProjectQuery) QueryIssues() *IssueQuery
QueryIssues chains the current query on the "issues" edge.
func (*ProjectQuery) Select ¶
func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.Project.Query(). Select(project.FieldCreateTime). Scan(ctx, &v)
func (*ProjectQuery) Unique ¶
func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*ProjectQuery) Where ¶
func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
Where adds a new predicate for the ProjectQuery builder.
func (*ProjectQuery) WithIssues ¶
func (pq *ProjectQuery) WithIssues(opts ...func(*IssueQuery)) *ProjectQuery
WithIssues tells the query-builder to eager-load the nodes that are connected to the "issues" edge. The optional arguments are used to configure the query builder of the edge.
type ProjectSelect ¶
type ProjectSelect struct { *ProjectQuery // contains filtered or unexported fields }
ProjectSelect is the builder for selecting fields of Project entities.
func (*ProjectSelect) Aggregate ¶
func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProjectSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Scan ¶
func (ps *ProjectSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProjectSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectUpdate ¶
type ProjectUpdate struct {
// contains filtered or unexported fields
}
ProjectUpdate is the builder for updating Project entities.
func (*ProjectUpdate) AddIssueIDs ¶
func (pu *ProjectUpdate) AddIssueIDs(ids ...uuid.UUID) *ProjectUpdate
AddIssueIDs adds the "issues" edge to the Issue entity by IDs.
func (*ProjectUpdate) AddIssues ¶
func (pu *ProjectUpdate) AddIssues(i ...*Issue) *ProjectUpdate
AddIssues adds the "issues" edges to the Issue entity.
func (*ProjectUpdate) ClearIssues ¶
func (pu *ProjectUpdate) ClearIssues() *ProjectUpdate
ClearIssues clears all "issues" edges to the Issue entity.
func (*ProjectUpdate) Exec ¶
func (pu *ProjectUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectUpdate) ExecX ¶
func (pu *ProjectUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdate) Mutation ¶
func (pu *ProjectUpdate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdate) RemoveIssueIDs ¶
func (pu *ProjectUpdate) RemoveIssueIDs(ids ...uuid.UUID) *ProjectUpdate
RemoveIssueIDs removes the "issues" edge to Issue entities by IDs.
func (*ProjectUpdate) RemoveIssues ¶
func (pu *ProjectUpdate) RemoveIssues(i ...*Issue) *ProjectUpdate
RemoveIssues removes "issues" edges to Issue entities.
func (*ProjectUpdate) Save ¶
func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProjectUpdate) SaveX ¶
func (pu *ProjectUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdate) SetDescription ¶
func (pu *ProjectUpdate) SetDescription(s string) *ProjectUpdate
SetDescription sets the "description" field.
func (*ProjectUpdate) SetTitle ¶
func (pu *ProjectUpdate) SetTitle(s string) *ProjectUpdate
SetTitle sets the "title" field.
func (*ProjectUpdate) SetUpdateTime ¶
func (pu *ProjectUpdate) SetUpdateTime(t time.Time) *ProjectUpdate
SetUpdateTime sets the "update_time" field.
func (*ProjectUpdate) Where ¶
func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate
Where appends a list predicates to the ProjectUpdate builder.
type ProjectUpdateOne ¶
type ProjectUpdateOne struct {
// contains filtered or unexported fields
}
ProjectUpdateOne is the builder for updating a single Project entity.
func (*ProjectUpdateOne) AddIssueIDs ¶
func (puo *ProjectUpdateOne) AddIssueIDs(ids ...uuid.UUID) *ProjectUpdateOne
AddIssueIDs adds the "issues" edge to the Issue entity by IDs.
func (*ProjectUpdateOne) AddIssues ¶
func (puo *ProjectUpdateOne) AddIssues(i ...*Issue) *ProjectUpdateOne
AddIssues adds the "issues" edges to the Issue entity.
func (*ProjectUpdateOne) ClearIssues ¶
func (puo *ProjectUpdateOne) ClearIssues() *ProjectUpdateOne
ClearIssues clears all "issues" edges to the Issue entity.
func (*ProjectUpdateOne) Exec ¶
func (puo *ProjectUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProjectUpdateOne) ExecX ¶
func (puo *ProjectUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdateOne) Mutation ¶
func (puo *ProjectUpdateOne) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdateOne) RemoveIssueIDs ¶
func (puo *ProjectUpdateOne) RemoveIssueIDs(ids ...uuid.UUID) *ProjectUpdateOne
RemoveIssueIDs removes the "issues" edge to Issue entities by IDs.
func (*ProjectUpdateOne) RemoveIssues ¶
func (puo *ProjectUpdateOne) RemoveIssues(i ...*Issue) *ProjectUpdateOne
RemoveIssues removes "issues" edges to Issue entities.
func (*ProjectUpdateOne) Save ¶
func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
Save executes the query and returns the updated Project entity.
func (*ProjectUpdateOne) SaveX ¶
func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdateOne) Select ¶
func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProjectUpdateOne) SetDescription ¶
func (puo *ProjectUpdateOne) SetDescription(s string) *ProjectUpdateOne
SetDescription sets the "description" field.
func (*ProjectUpdateOne) SetTitle ¶
func (puo *ProjectUpdateOne) SetTitle(s string) *ProjectUpdateOne
SetTitle sets the "title" field.
func (*ProjectUpdateOne) SetUpdateTime ¶
func (puo *ProjectUpdateOne) SetUpdateTime(t time.Time) *ProjectUpdateOne
SetUpdateTime sets the "update_time" field.
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(ctx 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 Rollback method.
type Tx ¶
type Tx struct { // Issue is the client for interacting with the Issue builders. Issue *IssueClient // Project is the client for interacting with the Project builders. Project *ProjectClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside 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 ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge 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.