Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Project
- func (_m *Project) QueryMembers() *ProjectMemberQuery
- func (_m *Project) QueryOwner() *UserQuery
- func (_m *Project) QueryRetentionPolicies() *RetentionPolicyQuery
- func (_m *Project) String() string
- func (_m *Project) Unwrap() *Project
- func (_m *Project) Update() *ProjectUpdateOne
- func (_m *Project) Value(name string) (ent.Value, error)
- type ProjectClient
- func (c *ProjectClient) Create() *ProjectCreate
- func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk
- func (c *ProjectClient) Delete() *ProjectDelete
- func (c *ProjectClient) DeleteOne(_m *Project) *ProjectDeleteOne
- func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne
- func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)
- func (c *ProjectClient) GetX(ctx context.Context, id int) *Project
- func (c *ProjectClient) Hooks() []Hook
- func (c *ProjectClient) Intercept(interceptors ...Interceptor)
- func (c *ProjectClient) Interceptors() []Interceptor
- func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk
- func (c *ProjectClient) Query() *ProjectQuery
- func (c *ProjectClient) QueryMembers(_m *Project) *ProjectMemberQuery
- func (c *ProjectClient) QueryOwner(_m *Project) *UserQuery
- func (c *ProjectClient) QueryRetentionPolicies(_m *Project) *RetentionPolicyQuery
- func (c *ProjectClient) Update() *ProjectUpdate
- func (c *ProjectClient) UpdateOne(_m *Project) *ProjectUpdateOne
- func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne
- func (c *ProjectClient) Use(hooks ...Hook)
- type ProjectCreate
- func (_c *ProjectCreate) AddMemberIDs(ids ...int) *ProjectCreate
- func (_c *ProjectCreate) AddMembers(v ...*ProjectMember) *ProjectCreate
- func (_c *ProjectCreate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectCreate
- func (_c *ProjectCreate) AddRetentionPolicyIDs(ids ...int) *ProjectCreate
- func (_c *ProjectCreate) Exec(ctx context.Context) error
- func (_c *ProjectCreate) ExecX(ctx context.Context)
- func (_c *ProjectCreate) Mutation() *ProjectMutation
- func (_c *ProjectCreate) Save(ctx context.Context) (*Project, error)
- func (_c *ProjectCreate) SaveX(ctx context.Context) *Project
- func (_c *ProjectCreate) SetCreatedAt(v time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetDescription(v string) *ProjectCreate
- func (_c *ProjectCreate) SetDsn(v string) *ProjectCreate
- func (_c *ProjectCreate) SetName(v string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableCreatedAt(v *time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetNillableDescription(v *string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableStatus(v *string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableUpdatedAt(v *time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetOwner(v *User) *ProjectCreate
- func (_c *ProjectCreate) SetOwnerID(id int) *ProjectCreate
- func (_c *ProjectCreate) SetStatus(v string) *ProjectCreate
- func (_c *ProjectCreate) SetUpdatedAt(v time.Time) *ProjectCreate
- type ProjectCreateBulk
- type ProjectDelete
- type ProjectDeleteOne
- type ProjectEdges
- type ProjectGroupBy
- func (_g *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 (_g *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 ProjectMember
- func (_m *ProjectMember) QueryProject() *ProjectQuery
- func (_m *ProjectMember) QueryUser() *UserQuery
- func (_m *ProjectMember) String() string
- func (_m *ProjectMember) Unwrap() *ProjectMember
- func (_m *ProjectMember) Update() *ProjectMemberUpdateOne
- func (_m *ProjectMember) Value(name string) (ent.Value, error)
- type ProjectMemberClient
- func (c *ProjectMemberClient) Create() *ProjectMemberCreate
- func (c *ProjectMemberClient) CreateBulk(builders ...*ProjectMemberCreate) *ProjectMemberCreateBulk
- func (c *ProjectMemberClient) Delete() *ProjectMemberDelete
- func (c *ProjectMemberClient) DeleteOne(_m *ProjectMember) *ProjectMemberDeleteOne
- func (c *ProjectMemberClient) DeleteOneID(id int) *ProjectMemberDeleteOne
- func (c *ProjectMemberClient) Get(ctx context.Context, id int) (*ProjectMember, error)
- func (c *ProjectMemberClient) GetX(ctx context.Context, id int) *ProjectMember
- func (c *ProjectMemberClient) Hooks() []Hook
- func (c *ProjectMemberClient) Intercept(interceptors ...Interceptor)
- func (c *ProjectMemberClient) Interceptors() []Interceptor
- func (c *ProjectMemberClient) MapCreateBulk(slice any, setFunc func(*ProjectMemberCreate, int)) *ProjectMemberCreateBulk
- func (c *ProjectMemberClient) Query() *ProjectMemberQuery
- func (c *ProjectMemberClient) QueryProject(_m *ProjectMember) *ProjectQuery
- func (c *ProjectMemberClient) QueryUser(_m *ProjectMember) *UserQuery
- func (c *ProjectMemberClient) Update() *ProjectMemberUpdate
- func (c *ProjectMemberClient) UpdateOne(_m *ProjectMember) *ProjectMemberUpdateOne
- func (c *ProjectMemberClient) UpdateOneID(id int) *ProjectMemberUpdateOne
- func (c *ProjectMemberClient) Use(hooks ...Hook)
- type ProjectMemberCreate
- func (_c *ProjectMemberCreate) Exec(ctx context.Context) error
- func (_c *ProjectMemberCreate) ExecX(ctx context.Context)
- func (_c *ProjectMemberCreate) Mutation() *ProjectMemberMutation
- func (_c *ProjectMemberCreate) Save(ctx context.Context) (*ProjectMember, error)
- func (_c *ProjectMemberCreate) SaveX(ctx context.Context) *ProjectMember
- func (_c *ProjectMemberCreate) SetCreatedAt(v time.Time) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetNillableCreatedAt(v *time.Time) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetNillableRole(v *string) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetNillableUpdatedAt(v *time.Time) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetProject(v *Project) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetProjectID(v int) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetRole(v string) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetUpdatedAt(v time.Time) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetUser(v *User) *ProjectMemberCreate
- func (_c *ProjectMemberCreate) SetUserID(v int) *ProjectMemberCreate
- type ProjectMemberCreateBulk
- type ProjectMemberDelete
- type ProjectMemberDeleteOne
- type ProjectMemberEdges
- type ProjectMemberGroupBy
- func (_g *ProjectMemberGroupBy) Aggregate(fns ...AggregateFunc) *ProjectMemberGroupBy
- func (s *ProjectMemberGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectMemberGroupBy) BoolX(ctx context.Context) bool
- func (s *ProjectMemberGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectMemberGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProjectMemberGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectMemberGroupBy) Float64X(ctx context.Context) float64
- func (s *ProjectMemberGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectMemberGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProjectMemberGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectMemberGroupBy) IntX(ctx context.Context) int
- func (s *ProjectMemberGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectMemberGroupBy) IntsX(ctx context.Context) []int
- func (_g *ProjectMemberGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProjectMemberGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProjectMemberGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProjectMemberGroupBy) StringX(ctx context.Context) string
- func (s *ProjectMemberGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectMemberGroupBy) StringsX(ctx context.Context) []string
- type ProjectMemberMutation
- func (m *ProjectMemberMutation) AddField(name string, value ent.Value) error
- func (m *ProjectMemberMutation) AddedEdges() []string
- func (m *ProjectMemberMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProjectMemberMutation) AddedFields() []string
- func (m *ProjectMemberMutation) AddedIDs(name string) []ent.Value
- func (m *ProjectMemberMutation) ClearEdge(name string) error
- func (m *ProjectMemberMutation) ClearField(name string) error
- func (m *ProjectMemberMutation) ClearProject()
- func (m *ProjectMemberMutation) ClearUser()
- func (m *ProjectMemberMutation) ClearedEdges() []string
- func (m *ProjectMemberMutation) ClearedFields() []string
- func (m ProjectMemberMutation) Client() *Client
- func (m *ProjectMemberMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProjectMemberMutation) EdgeCleared(name string) bool
- func (m *ProjectMemberMutation) Field(name string) (ent.Value, bool)
- func (m *ProjectMemberMutation) FieldCleared(name string) bool
- func (m *ProjectMemberMutation) Fields() []string
- func (m *ProjectMemberMutation) ID() (id int, exists bool)
- func (m *ProjectMemberMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProjectMemberMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMemberMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProjectMemberMutation) OldProjectID(ctx context.Context) (v int, err error)
- func (m *ProjectMemberMutation) OldRole(ctx context.Context) (v string, err error)
- func (m *ProjectMemberMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMemberMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *ProjectMemberMutation) Op() Op
- func (m *ProjectMemberMutation) ProjectCleared() bool
- func (m *ProjectMemberMutation) ProjectID() (r int, exists bool)
- func (m *ProjectMemberMutation) ProjectIDs() (ids []int)
- func (m *ProjectMemberMutation) RemovedEdges() []string
- func (m *ProjectMemberMutation) RemovedIDs(name string) []ent.Value
- func (m *ProjectMemberMutation) ResetCreatedAt()
- func (m *ProjectMemberMutation) ResetEdge(name string) error
- func (m *ProjectMemberMutation) ResetField(name string) error
- func (m *ProjectMemberMutation) ResetProject()
- func (m *ProjectMemberMutation) ResetProjectID()
- func (m *ProjectMemberMutation) ResetRole()
- func (m *ProjectMemberMutation) ResetUpdatedAt()
- func (m *ProjectMemberMutation) ResetUser()
- func (m *ProjectMemberMutation) ResetUserID()
- func (m *ProjectMemberMutation) Role() (r string, exists bool)
- func (m *ProjectMemberMutation) SetCreatedAt(t time.Time)
- func (m *ProjectMemberMutation) SetField(name string, value ent.Value) error
- func (m *ProjectMemberMutation) SetOp(op Op)
- func (m *ProjectMemberMutation) SetProjectID(i int)
- func (m *ProjectMemberMutation) SetRole(s string)
- func (m *ProjectMemberMutation) SetUpdatedAt(t time.Time)
- func (m *ProjectMemberMutation) SetUserID(i int)
- func (m ProjectMemberMutation) Tx() (*Tx, error)
- func (m *ProjectMemberMutation) Type() string
- func (m *ProjectMemberMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProjectMemberMutation) UserCleared() bool
- func (m *ProjectMemberMutation) UserID() (r int, exists bool)
- func (m *ProjectMemberMutation) UserIDs() (ids []int)
- func (m *ProjectMemberMutation) Where(ps ...predicate.ProjectMember)
- func (m *ProjectMemberMutation) WhereP(ps ...func(*sql.Selector))
- type ProjectMemberQuery
- func (_q *ProjectMemberQuery) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect
- func (_q *ProjectMemberQuery) All(ctx context.Context) ([]*ProjectMember, error)
- func (_q *ProjectMemberQuery) AllX(ctx context.Context) []*ProjectMember
- func (_q *ProjectMemberQuery) Clone() *ProjectMemberQuery
- func (_q *ProjectMemberQuery) Count(ctx context.Context) (int, error)
- func (_q *ProjectMemberQuery) CountX(ctx context.Context) int
- func (_q *ProjectMemberQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ProjectMemberQuery) ExistX(ctx context.Context) bool
- func (_q *ProjectMemberQuery) First(ctx context.Context) (*ProjectMember, error)
- func (_q *ProjectMemberQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ProjectMemberQuery) FirstIDX(ctx context.Context) int
- func (_q *ProjectMemberQuery) FirstX(ctx context.Context) *ProjectMember
- func (_q *ProjectMemberQuery) GroupBy(field string, fields ...string) *ProjectMemberGroupBy
- func (_q *ProjectMemberQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ProjectMemberQuery) IDsX(ctx context.Context) []int
- func (_q *ProjectMemberQuery) Limit(limit int) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) Offset(offset int) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) Only(ctx context.Context) (*ProjectMember, error)
- func (_q *ProjectMemberQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ProjectMemberQuery) OnlyIDX(ctx context.Context) int
- func (_q *ProjectMemberQuery) OnlyX(ctx context.Context) *ProjectMember
- func (_q *ProjectMemberQuery) Order(o ...projectmember.OrderOption) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) QueryProject() *ProjectQuery
- func (_q *ProjectMemberQuery) QueryUser() *UserQuery
- func (_q *ProjectMemberQuery) Select(fields ...string) *ProjectMemberSelect
- func (_q *ProjectMemberQuery) Unique(unique bool) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) Where(ps ...predicate.ProjectMember) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) WithProject(opts ...func(*ProjectQuery)) *ProjectMemberQuery
- func (_q *ProjectMemberQuery) WithUser(opts ...func(*UserQuery)) *ProjectMemberQuery
- type ProjectMemberSelect
- func (_s *ProjectMemberSelect) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect
- func (s *ProjectMemberSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectMemberSelect) BoolX(ctx context.Context) bool
- func (s *ProjectMemberSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectMemberSelect) BoolsX(ctx context.Context) []bool
- func (s *ProjectMemberSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectMemberSelect) Float64X(ctx context.Context) float64
- func (s *ProjectMemberSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectMemberSelect) Float64sX(ctx context.Context) []float64
- func (s *ProjectMemberSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectMemberSelect) IntX(ctx context.Context) int
- func (s *ProjectMemberSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectMemberSelect) IntsX(ctx context.Context) []int
- func (_s *ProjectMemberSelect) Scan(ctx context.Context, v any) error
- func (s *ProjectMemberSelect) ScanX(ctx context.Context, v any)
- func (s *ProjectMemberSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProjectMemberSelect) StringX(ctx context.Context) string
- func (s *ProjectMemberSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectMemberSelect) StringsX(ctx context.Context) []string
- type ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) ClearProject() *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) ClearUser() *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) Exec(ctx context.Context) error
- func (_u *ProjectMemberUpdate) ExecX(ctx context.Context)
- func (_u *ProjectMemberUpdate) Mutation() *ProjectMemberMutation
- func (_u *ProjectMemberUpdate) Save(ctx context.Context) (int, error)
- func (_u *ProjectMemberUpdate) SaveX(ctx context.Context) int
- func (_u *ProjectMemberUpdate) SetNillableProjectID(v *int) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetNillableRole(v *string) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetNillableUserID(v *int) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetProject(v *Project) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetProjectID(v int) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetRole(v string) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetUpdatedAt(v time.Time) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetUser(v *User) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) SetUserID(v int) *ProjectMemberUpdate
- func (_u *ProjectMemberUpdate) Where(ps ...predicate.ProjectMember) *ProjectMemberUpdate
- type ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) ClearProject() *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) ClearUser() *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) Exec(ctx context.Context) error
- func (_u *ProjectMemberUpdateOne) ExecX(ctx context.Context)
- func (_u *ProjectMemberUpdateOne) Mutation() *ProjectMemberMutation
- func (_u *ProjectMemberUpdateOne) Save(ctx context.Context) (*ProjectMember, error)
- func (_u *ProjectMemberUpdateOne) SaveX(ctx context.Context) *ProjectMember
- func (_u *ProjectMemberUpdateOne) Select(field string, fields ...string) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetNillableProjectID(v *int) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetNillableRole(v *string) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetNillableUserID(v *int) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetProject(v *Project) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetProjectID(v int) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetRole(v string) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetUpdatedAt(v time.Time) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetUser(v *User) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) SetUserID(v int) *ProjectMemberUpdateOne
- func (_u *ProjectMemberUpdateOne) Where(ps ...predicate.ProjectMember) *ProjectMemberUpdateOne
- type ProjectMembers
- type ProjectMutation
- func (m *ProjectMutation) AddField(name string, value ent.Value) error
- func (m *ProjectMutation) AddMemberIDs(ids ...int)
- func (m *ProjectMutation) AddRetentionPolicyIDs(ids ...int)
- 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) ClearDescription()
- func (m *ProjectMutation) ClearEdge(name string) error
- func (m *ProjectMutation) ClearField(name string) error
- func (m *ProjectMutation) ClearMembers()
- func (m *ProjectMutation) ClearOwner()
- func (m *ProjectMutation) ClearRetentionPolicies()
- func (m *ProjectMutation) ClearedEdges() []string
- func (m *ProjectMutation) ClearedFields() []string
- func (m ProjectMutation) Client() *Client
- func (m *ProjectMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProjectMutation) Description() (r string, exists bool)
- func (m *ProjectMutation) DescriptionCleared() bool
- func (m *ProjectMutation) Dsn() (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 int, exists bool)
- func (m *ProjectMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProjectMutation) MembersCleared() bool
- func (m *ProjectMutation) MembersIDs() (ids []int)
- func (m *ProjectMutation) Name() (r string, exists bool)
- func (m *ProjectMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldDsn(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProjectMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldStatus(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) Op() Op
- func (m *ProjectMutation) OwnerCleared() bool
- func (m *ProjectMutation) OwnerID() (id int, exists bool)
- func (m *ProjectMutation) OwnerIDs() (ids []int)
- func (m *ProjectMutation) RemoveMemberIDs(ids ...int)
- func (m *ProjectMutation) RemoveRetentionPolicyIDs(ids ...int)
- func (m *ProjectMutation) RemovedEdges() []string
- func (m *ProjectMutation) RemovedIDs(name string) []ent.Value
- func (m *ProjectMutation) RemovedMembersIDs() (ids []int)
- func (m *ProjectMutation) RemovedRetentionPoliciesIDs() (ids []int)
- func (m *ProjectMutation) ResetCreatedAt()
- func (m *ProjectMutation) ResetDescription()
- func (m *ProjectMutation) ResetDsn()
- func (m *ProjectMutation) ResetEdge(name string) error
- func (m *ProjectMutation) ResetField(name string) error
- func (m *ProjectMutation) ResetMembers()
- func (m *ProjectMutation) ResetName()
- func (m *ProjectMutation) ResetOwner()
- func (m *ProjectMutation) ResetRetentionPolicies()
- func (m *ProjectMutation) ResetStatus()
- func (m *ProjectMutation) ResetUpdatedAt()
- func (m *ProjectMutation) RetentionPoliciesCleared() bool
- func (m *ProjectMutation) RetentionPoliciesIDs() (ids []int)
- func (m *ProjectMutation) SetCreatedAt(t time.Time)
- func (m *ProjectMutation) SetDescription(s string)
- func (m *ProjectMutation) SetDsn(s string)
- func (m *ProjectMutation) SetField(name string, value ent.Value) error
- func (m *ProjectMutation) SetName(s string)
- func (m *ProjectMutation) SetOp(op Op)
- func (m *ProjectMutation) SetOwnerID(id int)
- func (m *ProjectMutation) SetStatus(s string)
- func (m *ProjectMutation) SetUpdatedAt(t time.Time)
- func (m *ProjectMutation) Status() (r string, exists bool)
- func (m ProjectMutation) Tx() (*Tx, error)
- func (m *ProjectMutation) Type() string
- func (m *ProjectMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProjectMutation) Where(ps ...predicate.Project)
- func (m *ProjectMutation) WhereP(ps ...func(*sql.Selector))
- type ProjectQuery
- func (_q *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
- func (_q *ProjectQuery) All(ctx context.Context) ([]*Project, error)
- func (_q *ProjectQuery) AllX(ctx context.Context) []*Project
- func (_q *ProjectQuery) Clone() *ProjectQuery
- func (_q *ProjectQuery) Count(ctx context.Context) (int, error)
- func (_q *ProjectQuery) CountX(ctx context.Context) int
- func (_q *ProjectQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ProjectQuery) ExistX(ctx context.Context) bool
- func (_q *ProjectQuery) First(ctx context.Context) (*Project, error)
- func (_q *ProjectQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ProjectQuery) FirstIDX(ctx context.Context) int
- func (_q *ProjectQuery) FirstX(ctx context.Context) *Project
- func (_q *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy
- func (_q *ProjectQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ProjectQuery) IDsX(ctx context.Context) []int
- func (_q *ProjectQuery) Limit(limit int) *ProjectQuery
- func (_q *ProjectQuery) Offset(offset int) *ProjectQuery
- func (_q *ProjectQuery) Only(ctx context.Context) (*Project, error)
- func (_q *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ProjectQuery) OnlyIDX(ctx context.Context) int
- func (_q *ProjectQuery) OnlyX(ctx context.Context) *Project
- func (_q *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery
- func (_q *ProjectQuery) QueryMembers() *ProjectMemberQuery
- func (_q *ProjectQuery) QueryOwner() *UserQuery
- func (_q *ProjectQuery) QueryRetentionPolicies() *RetentionPolicyQuery
- func (_q *ProjectQuery) Select(fields ...string) *ProjectSelect
- func (_q *ProjectQuery) Unique(unique bool) *ProjectQuery
- func (_q *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
- func (_q *ProjectQuery) WithMembers(opts ...func(*ProjectMemberQuery)) *ProjectQuery
- func (_q *ProjectQuery) WithOwner(opts ...func(*UserQuery)) *ProjectQuery
- func (_q *ProjectQuery) WithRetentionPolicies(opts ...func(*RetentionPolicyQuery)) *ProjectQuery
- type ProjectSelect
- func (_s *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 (_s *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 (_u *ProjectUpdate) AddMemberIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) AddMembers(v ...*ProjectMember) *ProjectUpdate
- func (_u *ProjectUpdate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
- func (_u *ProjectUpdate) AddRetentionPolicyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) ClearDescription() *ProjectUpdate
- func (_u *ProjectUpdate) ClearMembers() *ProjectUpdate
- func (_u *ProjectUpdate) ClearOwner() *ProjectUpdate
- func (_u *ProjectUpdate) ClearRetentionPolicies() *ProjectUpdate
- func (_u *ProjectUpdate) Exec(ctx context.Context) error
- func (_u *ProjectUpdate) ExecX(ctx context.Context)
- func (_u *ProjectUpdate) Mutation() *ProjectMutation
- func (_u *ProjectUpdate) RemoveMemberIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveMembers(v ...*ProjectMember) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) Save(ctx context.Context) (int, error)
- func (_u *ProjectUpdate) SaveX(ctx context.Context) int
- func (_u *ProjectUpdate) SetDescription(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetDsn(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetName(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableDescription(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableDsn(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableName(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableStatus(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetOwner(v *User) *ProjectUpdate
- func (_u *ProjectUpdate) SetOwnerID(id int) *ProjectUpdate
- func (_u *ProjectUpdate) SetStatus(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetUpdatedAt(v time.Time) *ProjectUpdate
- func (_u *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate
- type ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddMemberIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddMembers(v ...*ProjectMember) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearMembers() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearOwner() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearRetentionPolicies() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Exec(ctx context.Context) error
- func (_u *ProjectUpdateOne) ExecX(ctx context.Context)
- func (_u *ProjectUpdateOne) Mutation() *ProjectMutation
- func (_u *ProjectUpdateOne) RemoveMemberIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveMembers(v ...*ProjectMember) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
- func (_u *ProjectUpdateOne) SaveX(ctx context.Context) *Project
- func (_u *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetDescription(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetDsn(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetName(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableDescription(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableDsn(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableName(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableStatus(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetOwner(v *User) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetOwnerID(id int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetStatus(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetUpdatedAt(v time.Time) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Where(ps ...predicate.Project) *ProjectUpdateOne
- type Projects
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RetentionPolicies
- type RetentionPolicy
- type RetentionPolicyClient
- func (c *RetentionPolicyClient) Create() *RetentionPolicyCreate
- func (c *RetentionPolicyClient) CreateBulk(builders ...*RetentionPolicyCreate) *RetentionPolicyCreateBulk
- func (c *RetentionPolicyClient) Delete() *RetentionPolicyDelete
- func (c *RetentionPolicyClient) DeleteOne(_m *RetentionPolicy) *RetentionPolicyDeleteOne
- func (c *RetentionPolicyClient) DeleteOneID(id int) *RetentionPolicyDeleteOne
- func (c *RetentionPolicyClient) Get(ctx context.Context, id int) (*RetentionPolicy, error)
- func (c *RetentionPolicyClient) GetX(ctx context.Context, id int) *RetentionPolicy
- func (c *RetentionPolicyClient) Hooks() []Hook
- func (c *RetentionPolicyClient) Intercept(interceptors ...Interceptor)
- func (c *RetentionPolicyClient) Interceptors() []Interceptor
- func (c *RetentionPolicyClient) MapCreateBulk(slice any, setFunc func(*RetentionPolicyCreate, int)) *RetentionPolicyCreateBulk
- func (c *RetentionPolicyClient) Query() *RetentionPolicyQuery
- func (c *RetentionPolicyClient) QueryProject(_m *RetentionPolicy) *ProjectQuery
- func (c *RetentionPolicyClient) Update() *RetentionPolicyUpdate
- func (c *RetentionPolicyClient) UpdateOne(_m *RetentionPolicy) *RetentionPolicyUpdateOne
- func (c *RetentionPolicyClient) UpdateOneID(id int) *RetentionPolicyUpdateOne
- func (c *RetentionPolicyClient) Use(hooks ...Hook)
- type RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) Exec(ctx context.Context) error
- func (_c *RetentionPolicyCreate) ExecX(ctx context.Context)
- func (_c *RetentionPolicyCreate) Mutation() *RetentionPolicyMutation
- func (_c *RetentionPolicyCreate) Save(ctx context.Context) (*RetentionPolicy, error)
- func (_c *RetentionPolicyCreate) SaveX(ctx context.Context) *RetentionPolicy
- func (_c *RetentionPolicyCreate) SetCreatedAt(v time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetDescription(v string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetDurationDays(v int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetIsActive(v bool) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetName(v string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableCreatedAt(v *time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableDescription(v *string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableDurationDays(v *int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableIsActive(v *bool) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableUpdatedAt(v *time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetProject(v *Project) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetProjectID(id int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetUpdatedAt(v time.Time) *RetentionPolicyCreate
- type RetentionPolicyCreateBulk
- func (_c *RetentionPolicyCreateBulk) Exec(ctx context.Context) error
- func (_c *RetentionPolicyCreateBulk) ExecX(ctx context.Context)
- func (_c *RetentionPolicyCreateBulk) Save(ctx context.Context) ([]*RetentionPolicy, error)
- func (_c *RetentionPolicyCreateBulk) SaveX(ctx context.Context) []*RetentionPolicy
- type RetentionPolicyDelete
- type RetentionPolicyDeleteOne
- type RetentionPolicyEdges
- type RetentionPolicyGroupBy
- func (_g *RetentionPolicyGroupBy) Aggregate(fns ...AggregateFunc) *RetentionPolicyGroupBy
- func (s *RetentionPolicyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RetentionPolicyGroupBy) BoolX(ctx context.Context) bool
- func (s *RetentionPolicyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RetentionPolicyGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RetentionPolicyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RetentionPolicyGroupBy) Float64X(ctx context.Context) float64
- func (s *RetentionPolicyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RetentionPolicyGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RetentionPolicyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RetentionPolicyGroupBy) IntX(ctx context.Context) int
- func (s *RetentionPolicyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RetentionPolicyGroupBy) IntsX(ctx context.Context) []int
- func (_g *RetentionPolicyGroupBy) Scan(ctx context.Context, v any) error
- func (s *RetentionPolicyGroupBy) ScanX(ctx context.Context, v any)
- func (s *RetentionPolicyGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RetentionPolicyGroupBy) StringX(ctx context.Context) string
- func (s *RetentionPolicyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RetentionPolicyGroupBy) StringsX(ctx context.Context) []string
- type RetentionPolicyMutation
- func (m *RetentionPolicyMutation) AddDurationDays(i int)
- func (m *RetentionPolicyMutation) AddField(name string, value ent.Value) error
- func (m *RetentionPolicyMutation) AddedDurationDays() (r int, exists bool)
- func (m *RetentionPolicyMutation) AddedEdges() []string
- func (m *RetentionPolicyMutation) AddedField(name string) (ent.Value, bool)
- func (m *RetentionPolicyMutation) AddedFields() []string
- func (m *RetentionPolicyMutation) AddedIDs(name string) []ent.Value
- func (m *RetentionPolicyMutation) ClearDescription()
- func (m *RetentionPolicyMutation) ClearEdge(name string) error
- func (m *RetentionPolicyMutation) ClearField(name string) error
- func (m *RetentionPolicyMutation) ClearProject()
- func (m *RetentionPolicyMutation) ClearedEdges() []string
- func (m *RetentionPolicyMutation) ClearedFields() []string
- func (m RetentionPolicyMutation) Client() *Client
- func (m *RetentionPolicyMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RetentionPolicyMutation) Description() (r string, exists bool)
- func (m *RetentionPolicyMutation) DescriptionCleared() bool
- func (m *RetentionPolicyMutation) DurationDays() (r int, exists bool)
- func (m *RetentionPolicyMutation) EdgeCleared(name string) bool
- func (m *RetentionPolicyMutation) Field(name string) (ent.Value, bool)
- func (m *RetentionPolicyMutation) FieldCleared(name string) bool
- func (m *RetentionPolicyMutation) Fields() []string
- func (m *RetentionPolicyMutation) ID() (id int, exists bool)
- func (m *RetentionPolicyMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RetentionPolicyMutation) IsActive() (r bool, exists bool)
- func (m *RetentionPolicyMutation) Name() (r string, exists bool)
- func (m *RetentionPolicyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RetentionPolicyMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *RetentionPolicyMutation) OldDurationDays(ctx context.Context) (v int, err error)
- func (m *RetentionPolicyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RetentionPolicyMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *RetentionPolicyMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RetentionPolicyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RetentionPolicyMutation) Op() Op
- func (m *RetentionPolicyMutation) ProjectCleared() bool
- func (m *RetentionPolicyMutation) ProjectID() (id int, exists bool)
- func (m *RetentionPolicyMutation) ProjectIDs() (ids []int)
- func (m *RetentionPolicyMutation) RemovedEdges() []string
- func (m *RetentionPolicyMutation) RemovedIDs(name string) []ent.Value
- func (m *RetentionPolicyMutation) ResetCreatedAt()
- func (m *RetentionPolicyMutation) ResetDescription()
- func (m *RetentionPolicyMutation) ResetDurationDays()
- func (m *RetentionPolicyMutation) ResetEdge(name string) error
- func (m *RetentionPolicyMutation) ResetField(name string) error
- func (m *RetentionPolicyMutation) ResetIsActive()
- func (m *RetentionPolicyMutation) ResetName()
- func (m *RetentionPolicyMutation) ResetProject()
- func (m *RetentionPolicyMutation) ResetUpdatedAt()
- func (m *RetentionPolicyMutation) SetCreatedAt(t time.Time)
- func (m *RetentionPolicyMutation) SetDescription(s string)
- func (m *RetentionPolicyMutation) SetDurationDays(i int)
- func (m *RetentionPolicyMutation) SetField(name string, value ent.Value) error
- func (m *RetentionPolicyMutation) SetIsActive(b bool)
- func (m *RetentionPolicyMutation) SetName(s string)
- func (m *RetentionPolicyMutation) SetOp(op Op)
- func (m *RetentionPolicyMutation) SetProjectID(id int)
- func (m *RetentionPolicyMutation) SetUpdatedAt(t time.Time)
- func (m RetentionPolicyMutation) Tx() (*Tx, error)
- func (m *RetentionPolicyMutation) Type() string
- func (m *RetentionPolicyMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *RetentionPolicyMutation) Where(ps ...predicate.RetentionPolicy)
- func (m *RetentionPolicyMutation) WhereP(ps ...func(*sql.Selector))
- type RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
- func (_q *RetentionPolicyQuery) All(ctx context.Context) ([]*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) AllX(ctx context.Context) []*RetentionPolicy
- func (_q *RetentionPolicyQuery) Clone() *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Count(ctx context.Context) (int, error)
- func (_q *RetentionPolicyQuery) CountX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) Exist(ctx context.Context) (bool, error)
- func (_q *RetentionPolicyQuery) ExistX(ctx context.Context) bool
- func (_q *RetentionPolicyQuery) First(ctx context.Context) (*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *RetentionPolicyQuery) FirstIDX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) FirstX(ctx context.Context) *RetentionPolicy
- func (_q *RetentionPolicyQuery) GroupBy(field string, fields ...string) *RetentionPolicyGroupBy
- func (_q *RetentionPolicyQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *RetentionPolicyQuery) IDsX(ctx context.Context) []int
- func (_q *RetentionPolicyQuery) Limit(limit int) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Offset(offset int) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Only(ctx context.Context) (*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *RetentionPolicyQuery) OnlyIDX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) OnlyX(ctx context.Context) *RetentionPolicy
- func (_q *RetentionPolicyQuery) Order(o ...retentionpolicy.OrderOption) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) QueryProject() *ProjectQuery
- func (_q *RetentionPolicyQuery) Select(fields ...string) *RetentionPolicySelect
- func (_q *RetentionPolicyQuery) Unique(unique bool) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) WithProject(opts ...func(*ProjectQuery)) *RetentionPolicyQuery
- type RetentionPolicySelect
- func (_s *RetentionPolicySelect) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
- func (s *RetentionPolicySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RetentionPolicySelect) BoolX(ctx context.Context) bool
- func (s *RetentionPolicySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RetentionPolicySelect) BoolsX(ctx context.Context) []bool
- func (s *RetentionPolicySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RetentionPolicySelect) Float64X(ctx context.Context) float64
- func (s *RetentionPolicySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RetentionPolicySelect) Float64sX(ctx context.Context) []float64
- func (s *RetentionPolicySelect) Int(ctx context.Context) (_ int, err error)
- func (s *RetentionPolicySelect) IntX(ctx context.Context) int
- func (s *RetentionPolicySelect) Ints(ctx context.Context) ([]int, error)
- func (s *RetentionPolicySelect) IntsX(ctx context.Context) []int
- func (_s *RetentionPolicySelect) Scan(ctx context.Context, v any) error
- func (s *RetentionPolicySelect) ScanX(ctx context.Context, v any)
- func (s *RetentionPolicySelect) String(ctx context.Context) (_ string, err error)
- func (s *RetentionPolicySelect) StringX(ctx context.Context) string
- func (s *RetentionPolicySelect) Strings(ctx context.Context) ([]string, error)
- func (s *RetentionPolicySelect) StringsX(ctx context.Context) []string
- type RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) AddDurationDays(v int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) ClearDescription() *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) ClearProject() *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) Exec(ctx context.Context) error
- func (_u *RetentionPolicyUpdate) ExecX(ctx context.Context)
- func (_u *RetentionPolicyUpdate) Mutation() *RetentionPolicyMutation
- func (_u *RetentionPolicyUpdate) Save(ctx context.Context) (int, error)
- func (_u *RetentionPolicyUpdate) SaveX(ctx context.Context) int
- func (_u *RetentionPolicyUpdate) SetDescription(v string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetDurationDays(v int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetIsActive(v bool) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetName(v string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableDescription(v *string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableDurationDays(v *int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableIsActive(v *bool) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableName(v *string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetProject(v *Project) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetProjectID(id int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetUpdatedAt(v time.Time) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdate
- type RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) AddDurationDays(v int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) ClearDescription() *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) ClearProject() *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) Exec(ctx context.Context) error
- func (_u *RetentionPolicyUpdateOne) ExecX(ctx context.Context)
- func (_u *RetentionPolicyUpdateOne) Mutation() *RetentionPolicyMutation
- func (_u *RetentionPolicyUpdateOne) Save(ctx context.Context) (*RetentionPolicy, error)
- func (_u *RetentionPolicyUpdateOne) SaveX(ctx context.Context) *RetentionPolicy
- func (_u *RetentionPolicyUpdateOne) Select(field string, fields ...string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetDescription(v string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetDurationDays(v int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetIsActive(v bool) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetName(v string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableDescription(v *string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableDurationDays(v *int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableIsActive(v *bool) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableName(v *string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetProject(v *Project) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetProjectID(id int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetUpdatedAt(v time.Time) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdateOne
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- 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(_m *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) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryMemberships(_m *User) *ProjectMemberQuery
- func (c *UserClient) QueryProjects(_m *User) *ProjectQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (_c *UserCreate) AddMembershipIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddMemberships(v ...*ProjectMember) *UserCreate
- func (_c *UserCreate) AddProjectIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddProjects(v ...*Project) *UserCreate
- func (_c *UserCreate) Exec(ctx context.Context) error
- func (_c *UserCreate) ExecX(ctx context.Context)
- func (_c *UserCreate) Mutation() *UserMutation
- func (_c *UserCreate) Save(ctx context.Context) (*User, error)
- func (_c *UserCreate) SaveX(ctx context.Context) *User
- func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetEmail(v string) *UserCreate
- func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetNillableRole(v *string) *UserCreate
- func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
- func (_c *UserCreate) SetRole(v string) *UserCreate
- func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetUsername(v string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (_g *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddMembershipIDs(ids ...int)
- func (m *UserMutation) AddProjectIDs(ids ...int)
- 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) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearMemberships()
- func (m *UserMutation) ClearProjects()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists 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) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) MembershipsCleared() bool
- func (m *UserMutation) MembershipsIDs() (ids []int)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) PasswordHash() (r string, exists bool)
- func (m *UserMutation) ProjectsCleared() bool
- func (m *UserMutation) ProjectsIDs() (ids []int)
- func (m *UserMutation) RemoveMembershipIDs(ids ...int)
- func (m *UserMutation) RemoveProjectIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedMembershipsIDs() (ids []int)
- func (m *UserMutation) RemovedProjectsIDs() (ids []int)
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetMemberships()
- func (m *UserMutation) ResetPasswordHash()
- func (m *UserMutation) ResetProjects()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) Role() (r string, exists bool)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPasswordHash(s string)
- func (m *UserMutation) SetRole(s string)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Username() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (_q *UserQuery) All(ctx context.Context) ([]*User, error)
- func (_q *UserQuery) AllX(ctx context.Context) []*User
- func (_q *UserQuery) Clone() *UserQuery
- func (_q *UserQuery) Count(ctx context.Context) (int, error)
- func (_q *UserQuery) CountX(ctx context.Context) int
- func (_q *UserQuery) Exist(ctx context.Context) (bool, error)
- func (_q *UserQuery) ExistX(ctx context.Context) bool
- func (_q *UserQuery) First(ctx context.Context) (*User, error)
- func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) FirstIDX(ctx context.Context) int
- func (_q *UserQuery) FirstX(ctx context.Context) *User
- func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *UserQuery) IDsX(ctx context.Context) []int
- func (_q *UserQuery) Limit(limit int) *UserQuery
- func (_q *UserQuery) Offset(offset int) *UserQuery
- func (_q *UserQuery) Only(ctx context.Context) (*User, error)
- func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) OnlyIDX(ctx context.Context) int
- func (_q *UserQuery) OnlyX(ctx context.Context) *User
- func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (_q *UserQuery) QueryMemberships() *ProjectMemberQuery
- func (_q *UserQuery) QueryProjects() *ProjectQuery
- func (_q *UserQuery) Select(fields ...string) *UserSelect
- func (_q *UserQuery) Unique(unique bool) *UserQuery
- func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (_q *UserQuery) WithMemberships(opts ...func(*ProjectMemberQuery)) *UserQuery
- func (_q *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *UserQuery
- type UserSelect
- func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (_s *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (_u *UserUpdate) AddMembershipIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddMemberships(v ...*ProjectMember) *UserUpdate
- func (_u *UserUpdate) AddProjectIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddProjects(v ...*Project) *UserUpdate
- func (_u *UserUpdate) ClearMemberships() *UserUpdate
- func (_u *UserUpdate) ClearProjects() *UserUpdate
- func (_u *UserUpdate) Exec(ctx context.Context) error
- func (_u *UserUpdate) ExecX(ctx context.Context)
- func (_u *UserUpdate) Mutation() *UserMutation
- func (_u *UserUpdate) RemoveMembershipIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemoveMemberships(v ...*ProjectMember) *UserUpdate
- func (_u *UserUpdate) RemoveProjectIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemoveProjects(v ...*Project) *UserUpdate
- func (_u *UserUpdate) Save(ctx context.Context) (int, error)
- func (_u *UserUpdate) SaveX(ctx context.Context) int
- func (_u *UserUpdate) SetEmail(v string) *UserUpdate
- func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableRole(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate
- func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
- func (_u *UserUpdate) SetRole(v string) *UserUpdate
- func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate
- func (_u *UserUpdate) SetUsername(v string) *UserUpdate
- func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (_u *UserUpdateOne) AddMembershipIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddMemberships(v ...*ProjectMember) *UserUpdateOne
- func (_u *UserUpdateOne) AddProjectIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddProjects(v ...*Project) *UserUpdateOne
- func (_u *UserUpdateOne) ClearMemberships() *UserUpdateOne
- func (_u *UserUpdateOne) ClearProjects() *UserUpdateOne
- func (_u *UserUpdateOne) Exec(ctx context.Context) error
- func (_u *UserUpdateOne) ExecX(ctx context.Context)
- func (_u *UserUpdateOne) Mutation() *UserMutation
- func (_u *UserUpdateOne) RemoveMembershipIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveMemberships(v ...*ProjectMember) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveProjectIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveProjects(v ...*Project) *UserUpdateOne
- func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
- func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableRole(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetRole(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne
- func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne
- func (_u *UserUpdateOne) Where(ps ...predicate.User) *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. TypeProject = "Project" TypeProjectMember = "ProjectMember" TypeRetentionPolicy = "RetentionPolicy" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("data: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
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(data.As(data.Sum(field1), "sum_field1"), (data.As(data.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
// Project is the client for interacting with the Project builders.
Project *ProjectClient
// ProjectMember is the client for interacting with the ProjectMember builders.
ProjectMember *ProjectMemberClient
// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
RetentionPolicy *RetentionPolicyClient
// 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 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(). Project. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
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 InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type Project ¶
type Project struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Project name
Name string `json:"name,omitempty"`
// Project description
Description string `json:"description,omitempty"`
// Data Source Name for the project
Dsn string `json:"dsn,omitempty"`
// Project status: active, inactive, archived
Status string `json:"status,omitempty"`
// When the project was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the project was last updated
UpdatedAt time.Time `json:"updated_at,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) QueryMembers ¶
func (_m *Project) QueryMembers() *ProjectMemberQuery
QueryMembers queries the "members" edge of the Project entity.
func (*Project) QueryOwner ¶
QueryOwner queries the "owner" edge of the Project entity.
func (*Project) QueryRetentionPolicies ¶
func (_m *Project) QueryRetentionPolicies() *RetentionPolicyQuery
QueryRetentionPolicies queries the "retention_policies" 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 (_m *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(_m *Project) *ProjectDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProjectClient) DeleteOneID ¶
func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProjectClient) GetX ¶
func (c *ProjectClient) GetX(ctx context.Context, id int) *Project
GetX is like Get, but panics if an error occurs.
func (*ProjectClient) Hooks ¶
func (c *ProjectClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProjectClient) Intercept ¶
func (c *ProjectClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `project.Intercept(f(g(h())))`.
func (*ProjectClient) Interceptors ¶
func (c *ProjectClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProjectClient) MapCreateBulk ¶
func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProjectClient) Query ¶
func (c *ProjectClient) Query() *ProjectQuery
Query returns a query builder for Project.
func (*ProjectClient) QueryMembers ¶
func (c *ProjectClient) QueryMembers(_m *Project) *ProjectMemberQuery
QueryMembers queries the members edge of a Project.
func (*ProjectClient) QueryOwner ¶
func (c *ProjectClient) QueryOwner(_m *Project) *UserQuery
QueryOwner queries the owner edge of a Project.
func (*ProjectClient) QueryRetentionPolicies ¶
func (c *ProjectClient) QueryRetentionPolicies(_m *Project) *RetentionPolicyQuery
QueryRetentionPolicies queries the retention_policies 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(_m *Project) *ProjectUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProjectClient) UpdateOneID ¶
func (c *ProjectClient) UpdateOneID(id int) *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) AddMemberIDs ¶
func (_c *ProjectCreate) AddMemberIDs(ids ...int) *ProjectCreate
AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.
func (*ProjectCreate) AddMembers ¶
func (_c *ProjectCreate) AddMembers(v ...*ProjectMember) *ProjectCreate
AddMembers adds the "members" edges to the ProjectMember entity.
func (*ProjectCreate) AddRetentionPolicies ¶
func (_c *ProjectCreate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectCreate
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectCreate) AddRetentionPolicyIDs ¶
func (_c *ProjectCreate) AddRetentionPolicyIDs(ids ...int) *ProjectCreate
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectCreate) Exec ¶
func (_c *ProjectCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreate) ExecX ¶
func (_c *ProjectCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectCreate) Mutation ¶
func (_c *ProjectCreate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectCreate) Save ¶
func (_c *ProjectCreate) Save(ctx context.Context) (*Project, error)
Save creates the Project in the database.
func (*ProjectCreate) SaveX ¶
func (_c *ProjectCreate) SaveX(ctx context.Context) *Project
SaveX calls Save and panics if Save returns an error.
func (*ProjectCreate) SetCreatedAt ¶
func (_c *ProjectCreate) SetCreatedAt(v time.Time) *ProjectCreate
SetCreatedAt sets the "created_at" field.
func (*ProjectCreate) SetDescription ¶
func (_c *ProjectCreate) SetDescription(v string) *ProjectCreate
SetDescription sets the "description" field.
func (*ProjectCreate) SetDsn ¶
func (_c *ProjectCreate) SetDsn(v string) *ProjectCreate
SetDsn sets the "dsn" field.
func (*ProjectCreate) SetName ¶
func (_c *ProjectCreate) SetName(v string) *ProjectCreate
SetName sets the "name" field.
func (*ProjectCreate) SetNillableCreatedAt ¶
func (_c *ProjectCreate) SetNillableCreatedAt(v *time.Time) *ProjectCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProjectCreate) SetNillableDescription ¶
func (_c *ProjectCreate) SetNillableDescription(v *string) *ProjectCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectCreate) SetNillableStatus ¶
func (_c *ProjectCreate) SetNillableStatus(v *string) *ProjectCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectCreate) SetNillableUpdatedAt ¶
func (_c *ProjectCreate) SetNillableUpdatedAt(v *time.Time) *ProjectCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProjectCreate) SetOwner ¶
func (_c *ProjectCreate) SetOwner(v *User) *ProjectCreate
SetOwner sets the "owner" edge to the User entity.
func (*ProjectCreate) SetOwnerID ¶
func (_c *ProjectCreate) SetOwnerID(id int) *ProjectCreate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectCreate) SetStatus ¶
func (_c *ProjectCreate) SetStatus(v string) *ProjectCreate
SetStatus sets the "status" field.
func (*ProjectCreate) SetUpdatedAt ¶
func (_c *ProjectCreate) SetUpdatedAt(v time.Time) *ProjectCreate
SetUpdatedAt sets the "updated_at" 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 (_c *ProjectCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreateBulk) ExecX ¶
func (_c *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 (_d *ProjectDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProjectDelete) ExecX ¶
func (_d *ProjectDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProjectDelete) Where ¶
func (_d *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 (_d *ProjectDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProjectDeleteOne) ExecX ¶
func (_d *ProjectDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectDeleteOne) Where ¶
func (_d *ProjectDeleteOne) Where(ps ...predicate.Project) *ProjectDeleteOne
Where appends a list predicates to the ProjectDelete builder.
type ProjectEdges ¶
type ProjectEdges struct {
// User who owns this project
Owner *User `json:"owner,omitempty"`
// Retention policies for this project
RetentionPolicies []*RetentionPolicy `json:"retention_policies,omitempty"`
// Members of this project
Members []*ProjectMember `json:"members,omitempty"`
// contains filtered or unexported fields
}
ProjectEdges holds the relations/edges for other nodes in the graph.
func (ProjectEdges) MembersOrErr ¶
func (e ProjectEdges) MembersOrErr() ([]*ProjectMember, error)
MembersOrErr returns the Members value or an error if the edge was not loaded in eager-loading.
func (ProjectEdges) OwnerOrErr ¶
func (e ProjectEdges) OwnerOrErr() (*User, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProjectEdges) RetentionPoliciesOrErr ¶
func (e ProjectEdges) RetentionPoliciesOrErr() ([]*RetentionPolicy, error)
RetentionPoliciesOrErr returns the RetentionPolicies 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 (_g *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 (_g *ProjectGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector 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 ProjectMember ¶
type ProjectMember struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// The project this membership belongs to
ProjectID int `json:"project_id,omitempty"`
// The user this membership belongs to
UserID int `json:"user_id,omitempty"`
// Member role: owner, editor, viewer
Role string `json:"role,omitempty"`
// When the membership was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the membership was last updated
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the ProjectMemberQuery when eager-loading is set.
Edges ProjectMemberEdges `json:"edges"`
// contains filtered or unexported fields
}
ProjectMember is the model entity for the ProjectMember schema.
func (*ProjectMember) QueryProject ¶
func (_m *ProjectMember) QueryProject() *ProjectQuery
QueryProject queries the "project" edge of the ProjectMember entity.
func (*ProjectMember) QueryUser ¶
func (_m *ProjectMember) QueryUser() *UserQuery
QueryUser queries the "user" edge of the ProjectMember entity.
func (*ProjectMember) String ¶
func (_m *ProjectMember) String() string
String implements the fmt.Stringer.
func (*ProjectMember) Unwrap ¶
func (_m *ProjectMember) Unwrap() *ProjectMember
Unwrap unwraps the ProjectMember 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 (*ProjectMember) Update ¶
func (_m *ProjectMember) Update() *ProjectMemberUpdateOne
Update returns a builder for updating this ProjectMember. Note that you need to call ProjectMember.Unwrap() before calling this method if this ProjectMember was returned from a transaction, and the transaction was committed or rolled back.
type ProjectMemberClient ¶
type ProjectMemberClient struct {
// contains filtered or unexported fields
}
ProjectMemberClient is a client for the ProjectMember schema.
func NewProjectMemberClient ¶
func NewProjectMemberClient(c config) *ProjectMemberClient
NewProjectMemberClient returns a client for the ProjectMember from the given config.
func (*ProjectMemberClient) Create ¶
func (c *ProjectMemberClient) Create() *ProjectMemberCreate
Create returns a builder for creating a ProjectMember entity.
func (*ProjectMemberClient) CreateBulk ¶
func (c *ProjectMemberClient) CreateBulk(builders ...*ProjectMemberCreate) *ProjectMemberCreateBulk
CreateBulk returns a builder for creating a bulk of ProjectMember entities.
func (*ProjectMemberClient) Delete ¶
func (c *ProjectMemberClient) Delete() *ProjectMemberDelete
Delete returns a delete builder for ProjectMember.
func (*ProjectMemberClient) DeleteOne ¶
func (c *ProjectMemberClient) DeleteOne(_m *ProjectMember) *ProjectMemberDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProjectMemberClient) DeleteOneID ¶
func (c *ProjectMemberClient) DeleteOneID(id int) *ProjectMemberDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProjectMemberClient) Get ¶
func (c *ProjectMemberClient) Get(ctx context.Context, id int) (*ProjectMember, error)
Get returns a ProjectMember entity by its id.
func (*ProjectMemberClient) GetX ¶
func (c *ProjectMemberClient) GetX(ctx context.Context, id int) *ProjectMember
GetX is like Get, but panics if an error occurs.
func (*ProjectMemberClient) Hooks ¶
func (c *ProjectMemberClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProjectMemberClient) Intercept ¶
func (c *ProjectMemberClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `projectmember.Intercept(f(g(h())))`.
func (*ProjectMemberClient) Interceptors ¶
func (c *ProjectMemberClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProjectMemberClient) MapCreateBulk ¶
func (c *ProjectMemberClient) MapCreateBulk(slice any, setFunc func(*ProjectMemberCreate, int)) *ProjectMemberCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProjectMemberClient) Query ¶
func (c *ProjectMemberClient) Query() *ProjectMemberQuery
Query returns a query builder for ProjectMember.
func (*ProjectMemberClient) QueryProject ¶
func (c *ProjectMemberClient) QueryProject(_m *ProjectMember) *ProjectQuery
QueryProject queries the project edge of a ProjectMember.
func (*ProjectMemberClient) QueryUser ¶
func (c *ProjectMemberClient) QueryUser(_m *ProjectMember) *UserQuery
QueryUser queries the user edge of a ProjectMember.
func (*ProjectMemberClient) Update ¶
func (c *ProjectMemberClient) Update() *ProjectMemberUpdate
Update returns an update builder for ProjectMember.
func (*ProjectMemberClient) UpdateOne ¶
func (c *ProjectMemberClient) UpdateOne(_m *ProjectMember) *ProjectMemberUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProjectMemberClient) UpdateOneID ¶
func (c *ProjectMemberClient) UpdateOneID(id int) *ProjectMemberUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProjectMemberClient) Use ¶
func (c *ProjectMemberClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `projectmember.Hooks(f(g(h())))`.
type ProjectMemberCreate ¶
type ProjectMemberCreate struct {
// contains filtered or unexported fields
}
ProjectMemberCreate is the builder for creating a ProjectMember entity.
func (*ProjectMemberCreate) Exec ¶
func (_c *ProjectMemberCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectMemberCreate) ExecX ¶
func (_c *ProjectMemberCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberCreate) Mutation ¶
func (_c *ProjectMemberCreate) Mutation() *ProjectMemberMutation
Mutation returns the ProjectMemberMutation object of the builder.
func (*ProjectMemberCreate) Save ¶
func (_c *ProjectMemberCreate) Save(ctx context.Context) (*ProjectMember, error)
Save creates the ProjectMember in the database.
func (*ProjectMemberCreate) SaveX ¶
func (_c *ProjectMemberCreate) SaveX(ctx context.Context) *ProjectMember
SaveX calls Save and panics if Save returns an error.
func (*ProjectMemberCreate) SetCreatedAt ¶
func (_c *ProjectMemberCreate) SetCreatedAt(v time.Time) *ProjectMemberCreate
SetCreatedAt sets the "created_at" field.
func (*ProjectMemberCreate) SetNillableCreatedAt ¶
func (_c *ProjectMemberCreate) SetNillableCreatedAt(v *time.Time) *ProjectMemberCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProjectMemberCreate) SetNillableRole ¶
func (_c *ProjectMemberCreate) SetNillableRole(v *string) *ProjectMemberCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*ProjectMemberCreate) SetNillableUpdatedAt ¶
func (_c *ProjectMemberCreate) SetNillableUpdatedAt(v *time.Time) *ProjectMemberCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProjectMemberCreate) SetProject ¶
func (_c *ProjectMemberCreate) SetProject(v *Project) *ProjectMemberCreate
SetProject sets the "project" edge to the Project entity.
func (*ProjectMemberCreate) SetProjectID ¶
func (_c *ProjectMemberCreate) SetProjectID(v int) *ProjectMemberCreate
SetProjectID sets the "project_id" field.
func (*ProjectMemberCreate) SetRole ¶
func (_c *ProjectMemberCreate) SetRole(v string) *ProjectMemberCreate
SetRole sets the "role" field.
func (*ProjectMemberCreate) SetUpdatedAt ¶
func (_c *ProjectMemberCreate) SetUpdatedAt(v time.Time) *ProjectMemberCreate
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMemberCreate) SetUser ¶
func (_c *ProjectMemberCreate) SetUser(v *User) *ProjectMemberCreate
SetUser sets the "user" edge to the User entity.
func (*ProjectMemberCreate) SetUserID ¶
func (_c *ProjectMemberCreate) SetUserID(v int) *ProjectMemberCreate
SetUserID sets the "user_id" field.
type ProjectMemberCreateBulk ¶
type ProjectMemberCreateBulk struct {
// contains filtered or unexported fields
}
ProjectMemberCreateBulk is the builder for creating many ProjectMember entities in bulk.
func (*ProjectMemberCreateBulk) Exec ¶
func (_c *ProjectMemberCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectMemberCreateBulk) ExecX ¶
func (_c *ProjectMemberCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberCreateBulk) Save ¶
func (_c *ProjectMemberCreateBulk) Save(ctx context.Context) ([]*ProjectMember, error)
Save creates the ProjectMember entities in the database.
func (*ProjectMemberCreateBulk) SaveX ¶
func (_c *ProjectMemberCreateBulk) SaveX(ctx context.Context) []*ProjectMember
SaveX is like Save, but panics if an error occurs.
type ProjectMemberDelete ¶
type ProjectMemberDelete struct {
// contains filtered or unexported fields
}
ProjectMemberDelete is the builder for deleting a ProjectMember entity.
func (*ProjectMemberDelete) Exec ¶
func (_d *ProjectMemberDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProjectMemberDelete) ExecX ¶
func (_d *ProjectMemberDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberDelete) Where ¶
func (_d *ProjectMemberDelete) Where(ps ...predicate.ProjectMember) *ProjectMemberDelete
Where appends a list predicates to the ProjectMemberDelete builder.
type ProjectMemberDeleteOne ¶
type ProjectMemberDeleteOne struct {
// contains filtered or unexported fields
}
ProjectMemberDeleteOne is the builder for deleting a single ProjectMember entity.
func (*ProjectMemberDeleteOne) Exec ¶
func (_d *ProjectMemberDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProjectMemberDeleteOne) ExecX ¶
func (_d *ProjectMemberDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberDeleteOne) Where ¶
func (_d *ProjectMemberDeleteOne) Where(ps ...predicate.ProjectMember) *ProjectMemberDeleteOne
Where appends a list predicates to the ProjectMemberDelete builder.
type ProjectMemberEdges ¶
type ProjectMemberEdges struct {
// The project this membership belongs to
Project *Project `json:"project,omitempty"`
// The user this membership belongs to
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
ProjectMemberEdges holds the relations/edges for other nodes in the graph.
func (ProjectMemberEdges) ProjectOrErr ¶
func (e ProjectMemberEdges) ProjectOrErr() (*Project, error)
ProjectOrErr returns the Project value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProjectMemberEdges) UserOrErr ¶
func (e ProjectMemberEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ProjectMemberGroupBy ¶
type ProjectMemberGroupBy struct {
// contains filtered or unexported fields
}
ProjectMemberGroupBy is the group-by builder for ProjectMember entities.
func (*ProjectMemberGroupBy) Aggregate ¶
func (_g *ProjectMemberGroupBy) Aggregate(fns ...AggregateFunc) *ProjectMemberGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProjectMemberGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectMemberGroupBy) Scan ¶
func (_g *ProjectMemberGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProjectMemberGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectMemberMutation ¶
type ProjectMemberMutation struct {
// contains filtered or unexported fields
}
ProjectMemberMutation represents an operation that mutates the ProjectMember nodes in the graph.
func (*ProjectMemberMutation) AddField ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) AddedEdges ¶
func (m *ProjectMemberMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProjectMemberMutation) AddedField ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) AddedFields ¶
func (m *ProjectMemberMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProjectMemberMutation) AddedIDs ¶
func (m *ProjectMemberMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProjectMemberMutation) ClearEdge ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ClearField ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ClearProject ¶
func (m *ProjectMemberMutation) ClearProject()
ClearProject clears the "project" edge to the Project entity.
func (*ProjectMemberMutation) ClearUser ¶
func (m *ProjectMemberMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ProjectMemberMutation) ClearedEdges ¶
func (m *ProjectMemberMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProjectMemberMutation) ClearedFields ¶
func (m *ProjectMemberMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProjectMemberMutation) Client ¶
func (m ProjectMemberMutation) 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 (*ProjectMemberMutation) CreatedAt ¶
func (m *ProjectMemberMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProjectMemberMutation) EdgeCleared ¶
func (m *ProjectMemberMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProjectMemberMutation) Field ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) FieldCleared ¶
func (m *ProjectMemberMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProjectMemberMutation) Fields ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ID ¶
func (m *ProjectMemberMutation) ID() (id int, 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 (*ProjectMemberMutation) IDs ¶
func (m *ProjectMemberMutation) IDs(ctx context.Context) ([]int, error)
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 (*ProjectMemberMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) 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 (*ProjectMemberMutation) OldProjectID ¶
func (m *ProjectMemberMutation) OldProjectID(ctx context.Context) (v int, err error)
OldProjectID returns the old "project_id" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) OldRole ¶
func (m *ProjectMemberMutation) OldRole(ctx context.Context) (v string, err error)
OldRole returns the old "role" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) OldUserID ¶
func (m *ProjectMemberMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) Op ¶
func (m *ProjectMemberMutation) Op() Op
Op returns the operation name.
func (*ProjectMemberMutation) ProjectCleared ¶
func (m *ProjectMemberMutation) ProjectCleared() bool
ProjectCleared reports if the "project" edge to the Project entity was cleared.
func (*ProjectMemberMutation) ProjectID ¶
func (m *ProjectMemberMutation) ProjectID() (r int, exists bool)
ProjectID returns the value of the "project_id" field in the mutation.
func (*ProjectMemberMutation) ProjectIDs ¶
func (m *ProjectMemberMutation) ProjectIDs() (ids []int)
ProjectIDs returns the "project" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProjectID instead. It exists only for internal usage by the builders.
func (*ProjectMemberMutation) RemovedEdges ¶
func (m *ProjectMemberMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProjectMemberMutation) RemovedIDs ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ResetCreatedAt ¶
func (m *ProjectMemberMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProjectMemberMutation) ResetEdge ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ResetField ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ResetProject ¶
func (m *ProjectMemberMutation) ResetProject()
ResetProject resets all changes to the "project" edge.
func (*ProjectMemberMutation) ResetProjectID ¶
func (m *ProjectMemberMutation) ResetProjectID()
ResetProjectID resets all changes to the "project_id" field.
func (*ProjectMemberMutation) ResetRole ¶
func (m *ProjectMemberMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*ProjectMemberMutation) ResetUpdatedAt ¶
func (m *ProjectMemberMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProjectMemberMutation) ResetUser ¶
func (m *ProjectMemberMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ProjectMemberMutation) ResetUserID ¶
func (m *ProjectMemberMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*ProjectMemberMutation) Role ¶
func (m *ProjectMemberMutation) Role() (r string, exists bool)
Role returns the value of the "role" field in the mutation.
func (*ProjectMemberMutation) SetCreatedAt ¶
func (m *ProjectMemberMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProjectMemberMutation) SetField ¶
func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) SetOp ¶
func (m *ProjectMemberMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProjectMemberMutation) SetProjectID ¶
func (m *ProjectMemberMutation) SetProjectID(i int)
SetProjectID sets the "project_id" field.
func (*ProjectMemberMutation) SetRole ¶
func (m *ProjectMemberMutation) SetRole(s string)
SetRole sets the "role" field.
func (*ProjectMemberMutation) SetUpdatedAt ¶
func (m *ProjectMemberMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMemberMutation) SetUserID ¶
func (m *ProjectMemberMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (ProjectMemberMutation) Tx ¶
func (m ProjectMemberMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProjectMemberMutation) Type ¶
func (m *ProjectMemberMutation) Type() string
Type returns the node type of this mutation (ProjectMember).
func (*ProjectMemberMutation) UpdatedAt ¶
func (m *ProjectMemberMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProjectMemberMutation) UserCleared ¶
func (m *ProjectMemberMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ProjectMemberMutation) UserID ¶
func (m *ProjectMemberMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*ProjectMemberMutation) UserIDs ¶
func (m *ProjectMemberMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*ProjectMemberMutation) Where ¶
func (m *ProjectMemberMutation) Where(ps ...predicate.ProjectMember)
Where appends a list predicates to the ProjectMemberMutation builder.
func (*ProjectMemberMutation) WhereP ¶
func (m *ProjectMemberMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProjectMemberMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProjectMemberQuery ¶
type ProjectMemberQuery struct {
// contains filtered or unexported fields
}
ProjectMemberQuery is the builder for querying ProjectMember entities.
func (*ProjectMemberQuery) Aggregate ¶
func (_q *ProjectMemberQuery) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect
Aggregate returns a ProjectMemberSelect configured with the given aggregations.
func (*ProjectMemberQuery) All ¶
func (_q *ProjectMemberQuery) All(ctx context.Context) ([]*ProjectMember, error)
All executes the query and returns a list of ProjectMembers.
func (*ProjectMemberQuery) AllX ¶
func (_q *ProjectMemberQuery) AllX(ctx context.Context) []*ProjectMember
AllX is like All, but panics if an error occurs.
func (*ProjectMemberQuery) Clone ¶
func (_q *ProjectMemberQuery) Clone() *ProjectMemberQuery
Clone returns a duplicate of the ProjectMemberQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProjectMemberQuery) Count ¶
func (_q *ProjectMemberQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProjectMemberQuery) CountX ¶
func (_q *ProjectMemberQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProjectMemberQuery) Exist ¶
func (_q *ProjectMemberQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProjectMemberQuery) ExistX ¶
func (_q *ProjectMemberQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProjectMemberQuery) First ¶
func (_q *ProjectMemberQuery) First(ctx context.Context) (*ProjectMember, error)
First returns the first ProjectMember entity from the query. Returns a *NotFoundError when no ProjectMember was found.
func (*ProjectMemberQuery) FirstID ¶
func (_q *ProjectMemberQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ProjectMember ID from the query. Returns a *NotFoundError when no ProjectMember ID was found.
func (*ProjectMemberQuery) FirstIDX ¶
func (_q *ProjectMemberQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProjectMemberQuery) FirstX ¶
func (_q *ProjectMemberQuery) FirstX(ctx context.Context) *ProjectMember
FirstX is like First, but panics if an error occurs.
func (*ProjectMemberQuery) GroupBy ¶
func (_q *ProjectMemberQuery) GroupBy(field string, fields ...string) *ProjectMemberGroupBy
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 {
ProjectID int `json:"project_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.ProjectMember.Query().
GroupBy(projectmember.FieldProjectID).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*ProjectMemberQuery) IDs ¶
func (_q *ProjectMemberQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ProjectMember IDs.
func (*ProjectMemberQuery) IDsX ¶
func (_q *ProjectMemberQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProjectMemberQuery) Limit ¶
func (_q *ProjectMemberQuery) Limit(limit int) *ProjectMemberQuery
Limit the number of records to be returned by this query.
func (*ProjectMemberQuery) Offset ¶
func (_q *ProjectMemberQuery) Offset(offset int) *ProjectMemberQuery
Offset to start from.
func (*ProjectMemberQuery) Only ¶
func (_q *ProjectMemberQuery) Only(ctx context.Context) (*ProjectMember, error)
Only returns a single ProjectMember entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProjectMember entity is found. Returns a *NotFoundError when no ProjectMember entities are found.
func (*ProjectMemberQuery) OnlyID ¶
func (_q *ProjectMemberQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ProjectMember ID in the query. Returns a *NotSingularError when more than one ProjectMember ID is found. Returns a *NotFoundError when no entities are found.
func (*ProjectMemberQuery) OnlyIDX ¶
func (_q *ProjectMemberQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProjectMemberQuery) OnlyX ¶
func (_q *ProjectMemberQuery) OnlyX(ctx context.Context) *ProjectMember
OnlyX is like Only, but panics if an error occurs.
func (*ProjectMemberQuery) Order ¶
func (_q *ProjectMemberQuery) Order(o ...projectmember.OrderOption) *ProjectMemberQuery
Order specifies how the records should be ordered.
func (*ProjectMemberQuery) QueryProject ¶
func (_q *ProjectMemberQuery) QueryProject() *ProjectQuery
QueryProject chains the current query on the "project" edge.
func (*ProjectMemberQuery) QueryUser ¶
func (_q *ProjectMemberQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ProjectMemberQuery) Select ¶
func (_q *ProjectMemberQuery) Select(fields ...string) *ProjectMemberSelect
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 {
ProjectID int `json:"project_id,omitempty"`
}
client.ProjectMember.Query().
Select(projectmember.FieldProjectID).
Scan(ctx, &v)
func (*ProjectMemberQuery) Unique ¶
func (_q *ProjectMemberQuery) Unique(unique bool) *ProjectMemberQuery
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 (*ProjectMemberQuery) Where ¶
func (_q *ProjectMemberQuery) Where(ps ...predicate.ProjectMember) *ProjectMemberQuery
Where adds a new predicate for the ProjectMemberQuery builder.
func (*ProjectMemberQuery) WithProject ¶
func (_q *ProjectMemberQuery) WithProject(opts ...func(*ProjectQuery)) *ProjectMemberQuery
WithProject tells the query-builder to eager-load the nodes that are connected to the "project" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProjectMemberQuery) WithUser ¶
func (_q *ProjectMemberQuery) WithUser(opts ...func(*UserQuery)) *ProjectMemberQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type ProjectMemberSelect ¶
type ProjectMemberSelect struct {
*ProjectMemberQuery
// contains filtered or unexported fields
}
ProjectMemberSelect is the builder for selecting fields of ProjectMember entities.
func (*ProjectMemberSelect) Aggregate ¶
func (_s *ProjectMemberSelect) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProjectMemberSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectMemberSelect) Scan ¶
func (_s *ProjectMemberSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProjectMemberSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectMemberUpdate ¶
type ProjectMemberUpdate struct {
// contains filtered or unexported fields
}
ProjectMemberUpdate is the builder for updating ProjectMember entities.
func (*ProjectMemberUpdate) ClearProject ¶
func (_u *ProjectMemberUpdate) ClearProject() *ProjectMemberUpdate
ClearProject clears the "project" edge to the Project entity.
func (*ProjectMemberUpdate) ClearUser ¶
func (_u *ProjectMemberUpdate) ClearUser() *ProjectMemberUpdate
ClearUser clears the "user" edge to the User entity.
func (*ProjectMemberUpdate) Exec ¶
func (_u *ProjectMemberUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectMemberUpdate) ExecX ¶
func (_u *ProjectMemberUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberUpdate) Mutation ¶
func (_u *ProjectMemberUpdate) Mutation() *ProjectMemberMutation
Mutation returns the ProjectMemberMutation object of the builder.
func (*ProjectMemberUpdate) Save ¶
func (_u *ProjectMemberUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProjectMemberUpdate) SaveX ¶
func (_u *ProjectMemberUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProjectMemberUpdate) SetNillableProjectID ¶
func (_u *ProjectMemberUpdate) SetNillableProjectID(v *int) *ProjectMemberUpdate
SetNillableProjectID sets the "project_id" field if the given value is not nil.
func (*ProjectMemberUpdate) SetNillableRole ¶
func (_u *ProjectMemberUpdate) SetNillableRole(v *string) *ProjectMemberUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*ProjectMemberUpdate) SetNillableUserID ¶
func (_u *ProjectMemberUpdate) SetNillableUserID(v *int) *ProjectMemberUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ProjectMemberUpdate) SetProject ¶
func (_u *ProjectMemberUpdate) SetProject(v *Project) *ProjectMemberUpdate
SetProject sets the "project" edge to the Project entity.
func (*ProjectMemberUpdate) SetProjectID ¶
func (_u *ProjectMemberUpdate) SetProjectID(v int) *ProjectMemberUpdate
SetProjectID sets the "project_id" field.
func (*ProjectMemberUpdate) SetRole ¶
func (_u *ProjectMemberUpdate) SetRole(v string) *ProjectMemberUpdate
SetRole sets the "role" field.
func (*ProjectMemberUpdate) SetUpdatedAt ¶
func (_u *ProjectMemberUpdate) SetUpdatedAt(v time.Time) *ProjectMemberUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMemberUpdate) SetUser ¶
func (_u *ProjectMemberUpdate) SetUser(v *User) *ProjectMemberUpdate
SetUser sets the "user" edge to the User entity.
func (*ProjectMemberUpdate) SetUserID ¶
func (_u *ProjectMemberUpdate) SetUserID(v int) *ProjectMemberUpdate
SetUserID sets the "user_id" field.
func (*ProjectMemberUpdate) Where ¶
func (_u *ProjectMemberUpdate) Where(ps ...predicate.ProjectMember) *ProjectMemberUpdate
Where appends a list predicates to the ProjectMemberUpdate builder.
type ProjectMemberUpdateOne ¶
type ProjectMemberUpdateOne struct {
// contains filtered or unexported fields
}
ProjectMemberUpdateOne is the builder for updating a single ProjectMember entity.
func (*ProjectMemberUpdateOne) ClearProject ¶
func (_u *ProjectMemberUpdateOne) ClearProject() *ProjectMemberUpdateOne
ClearProject clears the "project" edge to the Project entity.
func (*ProjectMemberUpdateOne) ClearUser ¶
func (_u *ProjectMemberUpdateOne) ClearUser() *ProjectMemberUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ProjectMemberUpdateOne) Exec ¶
func (_u *ProjectMemberUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProjectMemberUpdateOne) ExecX ¶
func (_u *ProjectMemberUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectMemberUpdateOne) Mutation ¶
func (_u *ProjectMemberUpdateOne) Mutation() *ProjectMemberMutation
Mutation returns the ProjectMemberMutation object of the builder.
func (*ProjectMemberUpdateOne) Save ¶
func (_u *ProjectMemberUpdateOne) Save(ctx context.Context) (*ProjectMember, error)
Save executes the query and returns the updated ProjectMember entity.
func (*ProjectMemberUpdateOne) SaveX ¶
func (_u *ProjectMemberUpdateOne) SaveX(ctx context.Context) *ProjectMember
SaveX is like Save, but panics if an error occurs.
func (*ProjectMemberUpdateOne) Select ¶
func (_u *ProjectMemberUpdateOne) Select(field string, fields ...string) *ProjectMemberUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProjectMemberUpdateOne) SetNillableProjectID ¶
func (_u *ProjectMemberUpdateOne) SetNillableProjectID(v *int) *ProjectMemberUpdateOne
SetNillableProjectID sets the "project_id" field if the given value is not nil.
func (*ProjectMemberUpdateOne) SetNillableRole ¶
func (_u *ProjectMemberUpdateOne) SetNillableRole(v *string) *ProjectMemberUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*ProjectMemberUpdateOne) SetNillableUserID ¶
func (_u *ProjectMemberUpdateOne) SetNillableUserID(v *int) *ProjectMemberUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ProjectMemberUpdateOne) SetProject ¶
func (_u *ProjectMemberUpdateOne) SetProject(v *Project) *ProjectMemberUpdateOne
SetProject sets the "project" edge to the Project entity.
func (*ProjectMemberUpdateOne) SetProjectID ¶
func (_u *ProjectMemberUpdateOne) SetProjectID(v int) *ProjectMemberUpdateOne
SetProjectID sets the "project_id" field.
func (*ProjectMemberUpdateOne) SetRole ¶
func (_u *ProjectMemberUpdateOne) SetRole(v string) *ProjectMemberUpdateOne
SetRole sets the "role" field.
func (*ProjectMemberUpdateOne) SetUpdatedAt ¶
func (_u *ProjectMemberUpdateOne) SetUpdatedAt(v time.Time) *ProjectMemberUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMemberUpdateOne) SetUser ¶
func (_u *ProjectMemberUpdateOne) SetUser(v *User) *ProjectMemberUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ProjectMemberUpdateOne) SetUserID ¶
func (_u *ProjectMemberUpdateOne) SetUserID(v int) *ProjectMemberUpdateOne
SetUserID sets the "user_id" field.
func (*ProjectMemberUpdateOne) Where ¶
func (_u *ProjectMemberUpdateOne) Where(ps ...predicate.ProjectMember) *ProjectMemberUpdateOne
Where appends a list predicates to the ProjectMemberUpdate builder.
type ProjectMembers ¶
type ProjectMembers []*ProjectMember
ProjectMembers is a parsable slice of ProjectMember.
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) AddMemberIDs ¶
func (m *ProjectMutation) AddMemberIDs(ids ...int)
AddMemberIDs adds the "members" edge to the ProjectMember entity by ids.
func (*ProjectMutation) AddRetentionPolicyIDs ¶
func (m *ProjectMutation) AddRetentionPolicyIDs(ids ...int)
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy 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) ClearDescription ¶
func (m *ProjectMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
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) ClearMembers ¶
func (m *ProjectMutation) ClearMembers()
ClearMembers clears the "members" edge to the ProjectMember entity.
func (*ProjectMutation) ClearOwner ¶
func (m *ProjectMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectMutation) ClearRetentionPolicies ¶
func (m *ProjectMutation) ClearRetentionPolicies()
ClearRetentionPolicies clears the "retention_policies" edge to the RetentionPolicy 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) CreatedAt ¶
func (m *ProjectMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" 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) DescriptionCleared ¶
func (m *ProjectMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*ProjectMutation) Dsn ¶
func (m *ProjectMutation) Dsn() (r string, exists bool)
Dsn returns the value of the "dsn" 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 int, 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 ¶
func (m *ProjectMutation) IDs(ctx context.Context) ([]int, error)
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) MembersCleared ¶
func (m *ProjectMutation) MembersCleared() bool
MembersCleared reports if the "members" edge to the ProjectMember entity was cleared.
func (*ProjectMutation) MembersIDs ¶
func (m *ProjectMutation) MembersIDs() (ids []int)
MembersIDs returns the "members" edge IDs in the mutation.
func (*ProjectMutation) Name ¶
func (m *ProjectMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProjectMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldDsn ¶
func (m *ProjectMutation) OldDsn(ctx context.Context) (v string, err error)
OldDsn returns the old "dsn" 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) OldName ¶
func (m *ProjectMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" 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) OldStatus ¶
func (m *ProjectMutation) OldStatus(ctx context.Context) (v string, err error)
OldStatus returns the old "status" 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) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" 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) OwnerCleared ¶
func (m *ProjectMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*ProjectMutation) OwnerID ¶
func (m *ProjectMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*ProjectMutation) OwnerIDs ¶
func (m *ProjectMutation) OwnerIDs() (ids []int)
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 (*ProjectMutation) RemoveMemberIDs ¶
func (m *ProjectMutation) RemoveMemberIDs(ids ...int)
RemoveMemberIDs removes the "members" edge to the ProjectMember entity by IDs.
func (*ProjectMutation) RemoveRetentionPolicyIDs ¶
func (m *ProjectMutation) RemoveRetentionPolicyIDs(ids ...int)
RemoveRetentionPolicyIDs removes the "retention_policies" edge to the RetentionPolicy 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) RemovedMembersIDs ¶
func (m *ProjectMutation) RemovedMembersIDs() (ids []int)
RemovedMembers returns the removed IDs of the "members" edge to the ProjectMember entity.
func (*ProjectMutation) RemovedRetentionPoliciesIDs ¶
func (m *ProjectMutation) RemovedRetentionPoliciesIDs() (ids []int)
RemovedRetentionPolicies returns the removed IDs of the "retention_policies" edge to the RetentionPolicy entity.
func (*ProjectMutation) ResetCreatedAt ¶
func (m *ProjectMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProjectMutation) ResetDescription ¶
func (m *ProjectMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ProjectMutation) ResetDsn ¶
func (m *ProjectMutation) ResetDsn()
ResetDsn resets all changes to the "dsn" 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) ResetMembers ¶
func (m *ProjectMutation) ResetMembers()
ResetMembers resets all changes to the "members" edge.
func (*ProjectMutation) ResetName ¶
func (m *ProjectMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProjectMutation) ResetOwner ¶
func (m *ProjectMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*ProjectMutation) ResetRetentionPolicies ¶
func (m *ProjectMutation) ResetRetentionPolicies()
ResetRetentionPolicies resets all changes to the "retention_policies" edge.
func (*ProjectMutation) ResetStatus ¶
func (m *ProjectMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*ProjectMutation) ResetUpdatedAt ¶
func (m *ProjectMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProjectMutation) RetentionPoliciesCleared ¶
func (m *ProjectMutation) RetentionPoliciesCleared() bool
RetentionPoliciesCleared reports if the "retention_policies" edge to the RetentionPolicy entity was cleared.
func (*ProjectMutation) RetentionPoliciesIDs ¶
func (m *ProjectMutation) RetentionPoliciesIDs() (ids []int)
RetentionPoliciesIDs returns the "retention_policies" edge IDs in the mutation.
func (*ProjectMutation) SetCreatedAt ¶
func (m *ProjectMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProjectMutation) SetDescription ¶
func (m *ProjectMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ProjectMutation) SetDsn ¶
func (m *ProjectMutation) SetDsn(s string)
SetDsn sets the "dsn" 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) SetName ¶
func (m *ProjectMutation) SetName(s string)
SetName sets the "name" field.
func (*ProjectMutation) SetOp ¶
func (m *ProjectMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProjectMutation) SetOwnerID ¶
func (m *ProjectMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the User entity by id.
func (*ProjectMutation) SetStatus ¶
func (m *ProjectMutation) SetStatus(s string)
SetStatus sets the "status" field.
func (*ProjectMutation) SetUpdatedAt ¶
func (m *ProjectMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMutation) Status ¶
func (m *ProjectMutation) Status() (r string, exists bool)
Status returns the value of the "status" 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) UpdatedAt ¶
func (m *ProjectMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProjectMutation) Where ¶
func (m *ProjectMutation) Where(ps ...predicate.Project)
Where appends a list predicates to the ProjectMutation builder.
func (*ProjectMutation) WhereP ¶
func (m *ProjectMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProjectMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProjectQuery ¶
type ProjectQuery struct {
// contains filtered or unexported fields
}
ProjectQuery is the builder for querying Project entities.
func (*ProjectQuery) Aggregate ¶
func (_q *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
Aggregate returns a ProjectSelect configured with the given aggregations.
func (*ProjectQuery) All ¶
func (_q *ProjectQuery) All(ctx context.Context) ([]*Project, error)
All executes the query and returns a list of Projects.
func (*ProjectQuery) AllX ¶
func (_q *ProjectQuery) AllX(ctx context.Context) []*Project
AllX is like All, but panics if an error occurs.
func (*ProjectQuery) Clone ¶
func (_q *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 (_q *ProjectQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProjectQuery) CountX ¶
func (_q *ProjectQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProjectQuery) Exist ¶
func (_q *ProjectQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProjectQuery) ExistX ¶
func (_q *ProjectQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProjectQuery) First ¶
func (_q *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 ¶
func (_q *ProjectQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Project ID from the query. Returns a *NotFoundError when no Project ID was found.
func (*ProjectQuery) FirstIDX ¶
func (_q *ProjectQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProjectQuery) FirstX ¶
func (_q *ProjectQuery) FirstX(ctx context.Context) *Project
FirstX is like First, but panics if an error occurs.
func (*ProjectQuery) GroupBy ¶
func (_q *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 {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.Project.Query().
GroupBy(project.FieldName).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*ProjectQuery) IDs ¶
func (_q *ProjectQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Project IDs.
func (*ProjectQuery) IDsX ¶
func (_q *ProjectQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProjectQuery) Limit ¶
func (_q *ProjectQuery) Limit(limit int) *ProjectQuery
Limit the number of records to be returned by this query.
func (*ProjectQuery) Offset ¶
func (_q *ProjectQuery) Offset(offset int) *ProjectQuery
Offset to start from.
func (*ProjectQuery) Only ¶
func (_q *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 ¶
func (_q *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)
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 (_q *ProjectQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProjectQuery) OnlyX ¶
func (_q *ProjectQuery) OnlyX(ctx context.Context) *Project
OnlyX is like Only, but panics if an error occurs.
func (*ProjectQuery) Order ¶
func (_q *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery
Order specifies how the records should be ordered.
func (*ProjectQuery) QueryMembers ¶
func (_q *ProjectQuery) QueryMembers() *ProjectMemberQuery
QueryMembers chains the current query on the "members" edge.
func (*ProjectQuery) QueryOwner ¶
func (_q *ProjectQuery) QueryOwner() *UserQuery
QueryOwner chains the current query on the "owner" edge.
func (*ProjectQuery) QueryRetentionPolicies ¶
func (_q *ProjectQuery) QueryRetentionPolicies() *RetentionPolicyQuery
QueryRetentionPolicies chains the current query on the "retention_policies" edge.
func (*ProjectQuery) Select ¶
func (_q *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 {
Name string `json:"name,omitempty"`
}
client.Project.Query().
Select(project.FieldName).
Scan(ctx, &v)
func (*ProjectQuery) Unique ¶
func (_q *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 (_q *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
Where adds a new predicate for the ProjectQuery builder.
func (*ProjectQuery) WithMembers ¶
func (_q *ProjectQuery) WithMembers(opts ...func(*ProjectMemberQuery)) *ProjectQuery
WithMembers tells the query-builder to eager-load the nodes that are connected to the "members" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProjectQuery) WithOwner ¶
func (_q *ProjectQuery) WithOwner(opts ...func(*UserQuery)) *ProjectQuery
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.
func (*ProjectQuery) WithRetentionPolicies ¶
func (_q *ProjectQuery) WithRetentionPolicies(opts ...func(*RetentionPolicyQuery)) *ProjectQuery
WithRetentionPolicies tells the query-builder to eager-load the nodes that are connected to the "retention_policies" 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 (_s *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 (_s *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) AddMemberIDs ¶
func (_u *ProjectUpdate) AddMemberIDs(ids ...int) *ProjectUpdate
AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.
func (*ProjectUpdate) AddMembers ¶
func (_u *ProjectUpdate) AddMembers(v ...*ProjectMember) *ProjectUpdate
AddMembers adds the "members" edges to the ProjectMember entity.
func (*ProjectUpdate) AddRetentionPolicies ¶
func (_u *ProjectUpdate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdate) AddRetentionPolicyIDs ¶
func (_u *ProjectUpdate) AddRetentionPolicyIDs(ids ...int) *ProjectUpdate
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectUpdate) ClearDescription ¶
func (_u *ProjectUpdate) ClearDescription() *ProjectUpdate
ClearDescription clears the value of the "description" field.
func (*ProjectUpdate) ClearMembers ¶
func (_u *ProjectUpdate) ClearMembers() *ProjectUpdate
ClearMembers clears all "members" edges to the ProjectMember entity.
func (*ProjectUpdate) ClearOwner ¶
func (_u *ProjectUpdate) ClearOwner() *ProjectUpdate
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectUpdate) ClearRetentionPolicies ¶
func (_u *ProjectUpdate) ClearRetentionPolicies() *ProjectUpdate
ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdate) Exec ¶
func (_u *ProjectUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectUpdate) ExecX ¶
func (_u *ProjectUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdate) Mutation ¶
func (_u *ProjectUpdate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdate) RemoveMemberIDs ¶
func (_u *ProjectUpdate) RemoveMemberIDs(ids ...int) *ProjectUpdate
RemoveMemberIDs removes the "members" edge to ProjectMember entities by IDs.
func (*ProjectUpdate) RemoveMembers ¶
func (_u *ProjectUpdate) RemoveMembers(v ...*ProjectMember) *ProjectUpdate
RemoveMembers removes "members" edges to ProjectMember entities.
func (*ProjectUpdate) RemoveRetentionPolicies ¶
func (_u *ProjectUpdate) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.
func (*ProjectUpdate) RemoveRetentionPolicyIDs ¶
func (_u *ProjectUpdate) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdate
RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.
func (*ProjectUpdate) Save ¶
func (_u *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 (_u *ProjectUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdate) SetDescription ¶
func (_u *ProjectUpdate) SetDescription(v string) *ProjectUpdate
SetDescription sets the "description" field.
func (*ProjectUpdate) SetDsn ¶
func (_u *ProjectUpdate) SetDsn(v string) *ProjectUpdate
SetDsn sets the "dsn" field.
func (*ProjectUpdate) SetName ¶
func (_u *ProjectUpdate) SetName(v string) *ProjectUpdate
SetName sets the "name" field.
func (*ProjectUpdate) SetNillableDescription ¶
func (_u *ProjectUpdate) SetNillableDescription(v *string) *ProjectUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectUpdate) SetNillableDsn ¶
func (_u *ProjectUpdate) SetNillableDsn(v *string) *ProjectUpdate
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*ProjectUpdate) SetNillableName ¶
func (_u *ProjectUpdate) SetNillableName(v *string) *ProjectUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProjectUpdate) SetNillableStatus ¶
func (_u *ProjectUpdate) SetNillableStatus(v *string) *ProjectUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectUpdate) SetOwner ¶
func (_u *ProjectUpdate) SetOwner(v *User) *ProjectUpdate
SetOwner sets the "owner" edge to the User entity.
func (*ProjectUpdate) SetOwnerID ¶
func (_u *ProjectUpdate) SetOwnerID(id int) *ProjectUpdate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectUpdate) SetStatus ¶
func (_u *ProjectUpdate) SetStatus(v string) *ProjectUpdate
SetStatus sets the "status" field.
func (*ProjectUpdate) SetUpdatedAt ¶
func (_u *ProjectUpdate) SetUpdatedAt(v time.Time) *ProjectUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProjectUpdate) Where ¶
func (_u *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) AddMemberIDs ¶
func (_u *ProjectUpdateOne) AddMemberIDs(ids ...int) *ProjectUpdateOne
AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.
func (*ProjectUpdateOne) AddMembers ¶
func (_u *ProjectUpdateOne) AddMembers(v ...*ProjectMember) *ProjectUpdateOne
AddMembers adds the "members" edges to the ProjectMember entity.
func (*ProjectUpdateOne) AddRetentionPolicies ¶
func (_u *ProjectUpdateOne) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdateOne) AddRetentionPolicyIDs ¶
func (_u *ProjectUpdateOne) AddRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectUpdateOne) ClearDescription ¶
func (_u *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne
ClearDescription clears the value of the "description" field.
func (*ProjectUpdateOne) ClearMembers ¶
func (_u *ProjectUpdateOne) ClearMembers() *ProjectUpdateOne
ClearMembers clears all "members" edges to the ProjectMember entity.
func (*ProjectUpdateOne) ClearOwner ¶
func (_u *ProjectUpdateOne) ClearOwner() *ProjectUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectUpdateOne) ClearRetentionPolicies ¶
func (_u *ProjectUpdateOne) ClearRetentionPolicies() *ProjectUpdateOne
ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdateOne) Exec ¶
func (_u *ProjectUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProjectUpdateOne) ExecX ¶
func (_u *ProjectUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdateOne) Mutation ¶
func (_u *ProjectUpdateOne) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdateOne) RemoveMemberIDs ¶
func (_u *ProjectUpdateOne) RemoveMemberIDs(ids ...int) *ProjectUpdateOne
RemoveMemberIDs removes the "members" edge to ProjectMember entities by IDs.
func (*ProjectUpdateOne) RemoveMembers ¶
func (_u *ProjectUpdateOne) RemoveMembers(v ...*ProjectMember) *ProjectUpdateOne
RemoveMembers removes "members" edges to ProjectMember entities.
func (*ProjectUpdateOne) RemoveRetentionPolicies ¶
func (_u *ProjectUpdateOne) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.
func (*ProjectUpdateOne) RemoveRetentionPolicyIDs ¶
func (_u *ProjectUpdateOne) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.
func (*ProjectUpdateOne) Save ¶
func (_u *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
Save executes the query and returns the updated Project entity.
func (*ProjectUpdateOne) SaveX ¶
func (_u *ProjectUpdateOne) SaveX(ctx context.Context) *Project
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdateOne) Select ¶
func (_u *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 (_u *ProjectUpdateOne) SetDescription(v string) *ProjectUpdateOne
SetDescription sets the "description" field.
func (*ProjectUpdateOne) SetDsn ¶
func (_u *ProjectUpdateOne) SetDsn(v string) *ProjectUpdateOne
SetDsn sets the "dsn" field.
func (*ProjectUpdateOne) SetName ¶
func (_u *ProjectUpdateOne) SetName(v string) *ProjectUpdateOne
SetName sets the "name" field.
func (*ProjectUpdateOne) SetNillableDescription ¶
func (_u *ProjectUpdateOne) SetNillableDescription(v *string) *ProjectUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableDsn ¶
func (_u *ProjectUpdateOne) SetNillableDsn(v *string) *ProjectUpdateOne
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableName ¶
func (_u *ProjectUpdateOne) SetNillableName(v *string) *ProjectUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableStatus ¶
func (_u *ProjectUpdateOne) SetNillableStatus(v *string) *ProjectUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectUpdateOne) SetOwner ¶
func (_u *ProjectUpdateOne) SetOwner(v *User) *ProjectUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*ProjectUpdateOne) SetOwnerID ¶
func (_u *ProjectUpdateOne) SetOwnerID(id int) *ProjectUpdateOne
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectUpdateOne) SetStatus ¶
func (_u *ProjectUpdateOne) SetStatus(v string) *ProjectUpdateOne
SetStatus sets the "status" field.
func (*ProjectUpdateOne) SetUpdatedAt ¶
func (_u *ProjectUpdateOne) SetUpdatedAt(v time.Time) *ProjectUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProjectUpdateOne) Where ¶
func (_u *ProjectUpdateOne) Where(ps ...predicate.Project) *ProjectUpdateOne
Where appends a list predicates to the ProjectUpdate builder.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RetentionPolicies ¶
type RetentionPolicies []*RetentionPolicy
RetentionPolicies is a parsable slice of RetentionPolicy.
type RetentionPolicy ¶
type RetentionPolicy struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Retention policy name
Name string `json:"name,omitempty"`
// Number of days to retain logs
DurationDays int `json:"duration_days,omitempty"`
// Description of the retention policy
Description string `json:"description,omitempty"`
// Whether the retention policy is active
IsActive bool `json:"is_active,omitempty"`
// When the retention policy was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the retention policy was last updated
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the RetentionPolicyQuery when eager-loading is set.
Edges RetentionPolicyEdges `json:"edges"`
// contains filtered or unexported fields
}
RetentionPolicy is the model entity for the RetentionPolicy schema.
func (*RetentionPolicy) QueryProject ¶
func (_m *RetentionPolicy) QueryProject() *ProjectQuery
QueryProject queries the "project" edge of the RetentionPolicy entity.
func (*RetentionPolicy) String ¶
func (_m *RetentionPolicy) String() string
String implements the fmt.Stringer.
func (*RetentionPolicy) Unwrap ¶
func (_m *RetentionPolicy) Unwrap() *RetentionPolicy
Unwrap unwraps the RetentionPolicy 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 (*RetentionPolicy) Update ¶
func (_m *RetentionPolicy) Update() *RetentionPolicyUpdateOne
Update returns a builder for updating this RetentionPolicy. Note that you need to call RetentionPolicy.Unwrap() before calling this method if this RetentionPolicy was returned from a transaction, and the transaction was committed or rolled back.
type RetentionPolicyClient ¶
type RetentionPolicyClient struct {
// contains filtered or unexported fields
}
RetentionPolicyClient is a client for the RetentionPolicy schema.
func NewRetentionPolicyClient ¶
func NewRetentionPolicyClient(c config) *RetentionPolicyClient
NewRetentionPolicyClient returns a client for the RetentionPolicy from the given config.
func (*RetentionPolicyClient) Create ¶
func (c *RetentionPolicyClient) Create() *RetentionPolicyCreate
Create returns a builder for creating a RetentionPolicy entity.
func (*RetentionPolicyClient) CreateBulk ¶
func (c *RetentionPolicyClient) CreateBulk(builders ...*RetentionPolicyCreate) *RetentionPolicyCreateBulk
CreateBulk returns a builder for creating a bulk of RetentionPolicy entities.
func (*RetentionPolicyClient) Delete ¶
func (c *RetentionPolicyClient) Delete() *RetentionPolicyDelete
Delete returns a delete builder for RetentionPolicy.
func (*RetentionPolicyClient) DeleteOne ¶
func (c *RetentionPolicyClient) DeleteOne(_m *RetentionPolicy) *RetentionPolicyDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RetentionPolicyClient) DeleteOneID ¶
func (c *RetentionPolicyClient) DeleteOneID(id int) *RetentionPolicyDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RetentionPolicyClient) Get ¶
func (c *RetentionPolicyClient) Get(ctx context.Context, id int) (*RetentionPolicy, error)
Get returns a RetentionPolicy entity by its id.
func (*RetentionPolicyClient) GetX ¶
func (c *RetentionPolicyClient) GetX(ctx context.Context, id int) *RetentionPolicy
GetX is like Get, but panics if an error occurs.
func (*RetentionPolicyClient) Hooks ¶
func (c *RetentionPolicyClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RetentionPolicyClient) Intercept ¶
func (c *RetentionPolicyClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `retentionpolicy.Intercept(f(g(h())))`.
func (*RetentionPolicyClient) Interceptors ¶
func (c *RetentionPolicyClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RetentionPolicyClient) MapCreateBulk ¶
func (c *RetentionPolicyClient) MapCreateBulk(slice any, setFunc func(*RetentionPolicyCreate, int)) *RetentionPolicyCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*RetentionPolicyClient) Query ¶
func (c *RetentionPolicyClient) Query() *RetentionPolicyQuery
Query returns a query builder for RetentionPolicy.
func (*RetentionPolicyClient) QueryProject ¶
func (c *RetentionPolicyClient) QueryProject(_m *RetentionPolicy) *ProjectQuery
QueryProject queries the project edge of a RetentionPolicy.
func (*RetentionPolicyClient) Update ¶
func (c *RetentionPolicyClient) Update() *RetentionPolicyUpdate
Update returns an update builder for RetentionPolicy.
func (*RetentionPolicyClient) UpdateOne ¶
func (c *RetentionPolicyClient) UpdateOne(_m *RetentionPolicy) *RetentionPolicyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RetentionPolicyClient) UpdateOneID ¶
func (c *RetentionPolicyClient) UpdateOneID(id int) *RetentionPolicyUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RetentionPolicyClient) Use ¶
func (c *RetentionPolicyClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `retentionpolicy.Hooks(f(g(h())))`.
type RetentionPolicyCreate ¶
type RetentionPolicyCreate struct {
// contains filtered or unexported fields
}
RetentionPolicyCreate is the builder for creating a RetentionPolicy entity.
func (*RetentionPolicyCreate) Exec ¶
func (_c *RetentionPolicyCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyCreate) ExecX ¶
func (_c *RetentionPolicyCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyCreate) Mutation ¶
func (_c *RetentionPolicyCreate) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyCreate) Save ¶
func (_c *RetentionPolicyCreate) Save(ctx context.Context) (*RetentionPolicy, error)
Save creates the RetentionPolicy in the database.
func (*RetentionPolicyCreate) SaveX ¶
func (_c *RetentionPolicyCreate) SaveX(ctx context.Context) *RetentionPolicy
SaveX calls Save and panics if Save returns an error.
func (*RetentionPolicyCreate) SetCreatedAt ¶
func (_c *RetentionPolicyCreate) SetCreatedAt(v time.Time) *RetentionPolicyCreate
SetCreatedAt sets the "created_at" field.
func (*RetentionPolicyCreate) SetDescription ¶
func (_c *RetentionPolicyCreate) SetDescription(v string) *RetentionPolicyCreate
SetDescription sets the "description" field.
func (*RetentionPolicyCreate) SetDurationDays ¶
func (_c *RetentionPolicyCreate) SetDurationDays(v int) *RetentionPolicyCreate
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyCreate) SetIsActive ¶
func (_c *RetentionPolicyCreate) SetIsActive(v bool) *RetentionPolicyCreate
SetIsActive sets the "is_active" field.
func (*RetentionPolicyCreate) SetName ¶
func (_c *RetentionPolicyCreate) SetName(v string) *RetentionPolicyCreate
SetName sets the "name" field.
func (*RetentionPolicyCreate) SetNillableCreatedAt ¶
func (_c *RetentionPolicyCreate) SetNillableCreatedAt(v *time.Time) *RetentionPolicyCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableDescription ¶
func (_c *RetentionPolicyCreate) SetNillableDescription(v *string) *RetentionPolicyCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableDurationDays ¶
func (_c *RetentionPolicyCreate) SetNillableDurationDays(v *int) *RetentionPolicyCreate
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableIsActive ¶
func (_c *RetentionPolicyCreate) SetNillableIsActive(v *bool) *RetentionPolicyCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableUpdatedAt ¶
func (_c *RetentionPolicyCreate) SetNillableUpdatedAt(v *time.Time) *RetentionPolicyCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*RetentionPolicyCreate) SetProject ¶
func (_c *RetentionPolicyCreate) SetProject(v *Project) *RetentionPolicyCreate
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyCreate) SetProjectID ¶
func (_c *RetentionPolicyCreate) SetProjectID(id int) *RetentionPolicyCreate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyCreate) SetUpdatedAt ¶
func (_c *RetentionPolicyCreate) SetUpdatedAt(v time.Time) *RetentionPolicyCreate
SetUpdatedAt sets the "updated_at" field.
type RetentionPolicyCreateBulk ¶
type RetentionPolicyCreateBulk struct {
// contains filtered or unexported fields
}
RetentionPolicyCreateBulk is the builder for creating many RetentionPolicy entities in bulk.
func (*RetentionPolicyCreateBulk) Exec ¶
func (_c *RetentionPolicyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyCreateBulk) ExecX ¶
func (_c *RetentionPolicyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyCreateBulk) Save ¶
func (_c *RetentionPolicyCreateBulk) Save(ctx context.Context) ([]*RetentionPolicy, error)
Save creates the RetentionPolicy entities in the database.
func (*RetentionPolicyCreateBulk) SaveX ¶
func (_c *RetentionPolicyCreateBulk) SaveX(ctx context.Context) []*RetentionPolicy
SaveX is like Save, but panics if an error occurs.
type RetentionPolicyDelete ¶
type RetentionPolicyDelete struct {
// contains filtered or unexported fields
}
RetentionPolicyDelete is the builder for deleting a RetentionPolicy entity.
func (*RetentionPolicyDelete) Exec ¶
func (_d *RetentionPolicyDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RetentionPolicyDelete) ExecX ¶
func (_d *RetentionPolicyDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyDelete) Where ¶
func (_d *RetentionPolicyDelete) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyDelete
Where appends a list predicates to the RetentionPolicyDelete builder.
type RetentionPolicyDeleteOne ¶
type RetentionPolicyDeleteOne struct {
// contains filtered or unexported fields
}
RetentionPolicyDeleteOne is the builder for deleting a single RetentionPolicy entity.
func (*RetentionPolicyDeleteOne) Exec ¶
func (_d *RetentionPolicyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RetentionPolicyDeleteOne) ExecX ¶
func (_d *RetentionPolicyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyDeleteOne) Where ¶
func (_d *RetentionPolicyDeleteOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyDeleteOne
Where appends a list predicates to the RetentionPolicyDelete builder.
type RetentionPolicyEdges ¶
type RetentionPolicyEdges struct {
// Project this retention policy belongs to
Project *Project `json:"project,omitempty"`
// contains filtered or unexported fields
}
RetentionPolicyEdges holds the relations/edges for other nodes in the graph.
func (RetentionPolicyEdges) ProjectOrErr ¶
func (e RetentionPolicyEdges) ProjectOrErr() (*Project, error)
ProjectOrErr returns the Project value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type RetentionPolicyGroupBy ¶
type RetentionPolicyGroupBy struct {
// contains filtered or unexported fields
}
RetentionPolicyGroupBy is the group-by builder for RetentionPolicy entities.
func (*RetentionPolicyGroupBy) Aggregate ¶
func (_g *RetentionPolicyGroupBy) Aggregate(fns ...AggregateFunc) *RetentionPolicyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RetentionPolicyGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RetentionPolicyGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Scan ¶
func (_g *RetentionPolicyGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RetentionPolicyGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RetentionPolicyMutation ¶
type RetentionPolicyMutation struct {
// contains filtered or unexported fields
}
RetentionPolicyMutation represents an operation that mutates the RetentionPolicy nodes in the graph.
func (*RetentionPolicyMutation) AddDurationDays ¶
func (m *RetentionPolicyMutation) AddDurationDays(i int)
AddDurationDays adds i to the "duration_days" field.
func (*RetentionPolicyMutation) AddField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) AddedDurationDays ¶
func (m *RetentionPolicyMutation) AddedDurationDays() (r int, exists bool)
AddedDurationDays returns the value that was added to the "duration_days" field in this mutation.
func (*RetentionPolicyMutation) AddedEdges ¶
func (m *RetentionPolicyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RetentionPolicyMutation) AddedField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) AddedFields ¶
func (m *RetentionPolicyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RetentionPolicyMutation) AddedIDs ¶
func (m *RetentionPolicyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RetentionPolicyMutation) ClearDescription ¶
func (m *RetentionPolicyMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyMutation) ClearEdge ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ClearField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ClearProject ¶
func (m *RetentionPolicyMutation) ClearProject()
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyMutation) ClearedEdges ¶
func (m *RetentionPolicyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RetentionPolicyMutation) ClearedFields ¶
func (m *RetentionPolicyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RetentionPolicyMutation) Client ¶
func (m RetentionPolicyMutation) 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 (*RetentionPolicyMutation) CreatedAt ¶
func (m *RetentionPolicyMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*RetentionPolicyMutation) Description ¶
func (m *RetentionPolicyMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*RetentionPolicyMutation) DescriptionCleared ¶
func (m *RetentionPolicyMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*RetentionPolicyMutation) DurationDays ¶
func (m *RetentionPolicyMutation) DurationDays() (r int, exists bool)
DurationDays returns the value of the "duration_days" field in the mutation.
func (*RetentionPolicyMutation) EdgeCleared ¶
func (m *RetentionPolicyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RetentionPolicyMutation) Field ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) FieldCleared ¶
func (m *RetentionPolicyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RetentionPolicyMutation) Fields ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ID ¶
func (m *RetentionPolicyMutation) ID() (id int, 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 (*RetentionPolicyMutation) IDs ¶
func (m *RetentionPolicyMutation) IDs(ctx context.Context) ([]int, error)
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 (*RetentionPolicyMutation) IsActive ¶
func (m *RetentionPolicyMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*RetentionPolicyMutation) Name ¶
func (m *RetentionPolicyMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RetentionPolicyMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldDescription ¶
func (m *RetentionPolicyMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldDurationDays ¶
func (m *RetentionPolicyMutation) OldDurationDays(ctx context.Context) (v int, err error)
OldDurationDays returns the old "duration_days" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) 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 (*RetentionPolicyMutation) OldIsActive ¶
func (m *RetentionPolicyMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldName ¶
func (m *RetentionPolicyMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) Op ¶
func (m *RetentionPolicyMutation) Op() Op
Op returns the operation name.
func (*RetentionPolicyMutation) ProjectCleared ¶
func (m *RetentionPolicyMutation) ProjectCleared() bool
ProjectCleared reports if the "project" edge to the Project entity was cleared.
func (*RetentionPolicyMutation) ProjectID ¶
func (m *RetentionPolicyMutation) ProjectID() (id int, exists bool)
ProjectID returns the "project" edge ID in the mutation.
func (*RetentionPolicyMutation) ProjectIDs ¶
func (m *RetentionPolicyMutation) ProjectIDs() (ids []int)
ProjectIDs returns the "project" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProjectID instead. It exists only for internal usage by the builders.
func (*RetentionPolicyMutation) RemovedEdges ¶
func (m *RetentionPolicyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RetentionPolicyMutation) RemovedIDs ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetCreatedAt ¶
func (m *RetentionPolicyMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*RetentionPolicyMutation) ResetDescription ¶
func (m *RetentionPolicyMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*RetentionPolicyMutation) ResetDurationDays ¶
func (m *RetentionPolicyMutation) ResetDurationDays()
ResetDurationDays resets all changes to the "duration_days" field.
func (*RetentionPolicyMutation) ResetEdge ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetIsActive ¶
func (m *RetentionPolicyMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*RetentionPolicyMutation) ResetName ¶
func (m *RetentionPolicyMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RetentionPolicyMutation) ResetProject ¶
func (m *RetentionPolicyMutation) ResetProject()
ResetProject resets all changes to the "project" edge.
func (*RetentionPolicyMutation) ResetUpdatedAt ¶
func (m *RetentionPolicyMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*RetentionPolicyMutation) SetCreatedAt ¶
func (m *RetentionPolicyMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*RetentionPolicyMutation) SetDescription ¶
func (m *RetentionPolicyMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*RetentionPolicyMutation) SetDurationDays ¶
func (m *RetentionPolicyMutation) SetDurationDays(i int)
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyMutation) SetField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) SetIsActive ¶
func (m *RetentionPolicyMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*RetentionPolicyMutation) SetName ¶
func (m *RetentionPolicyMutation) SetName(s string)
SetName sets the "name" field.
func (*RetentionPolicyMutation) SetOp ¶
func (m *RetentionPolicyMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RetentionPolicyMutation) SetProjectID ¶
func (m *RetentionPolicyMutation) SetProjectID(id int)
SetProjectID sets the "project" edge to the Project entity by id.
func (*RetentionPolicyMutation) SetUpdatedAt ¶
func (m *RetentionPolicyMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (RetentionPolicyMutation) Tx ¶
func (m RetentionPolicyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RetentionPolicyMutation) Type ¶
func (m *RetentionPolicyMutation) Type() string
Type returns the node type of this mutation (RetentionPolicy).
func (*RetentionPolicyMutation) UpdatedAt ¶
func (m *RetentionPolicyMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*RetentionPolicyMutation) Where ¶
func (m *RetentionPolicyMutation) Where(ps ...predicate.RetentionPolicy)
Where appends a list predicates to the RetentionPolicyMutation builder.
func (*RetentionPolicyMutation) WhereP ¶
func (m *RetentionPolicyMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RetentionPolicyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RetentionPolicyQuery ¶
type RetentionPolicyQuery struct {
// contains filtered or unexported fields
}
RetentionPolicyQuery is the builder for querying RetentionPolicy entities.
func (*RetentionPolicyQuery) Aggregate ¶
func (_q *RetentionPolicyQuery) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
Aggregate returns a RetentionPolicySelect configured with the given aggregations.
func (*RetentionPolicyQuery) All ¶
func (_q *RetentionPolicyQuery) All(ctx context.Context) ([]*RetentionPolicy, error)
All executes the query and returns a list of RetentionPolicies.
func (*RetentionPolicyQuery) AllX ¶
func (_q *RetentionPolicyQuery) AllX(ctx context.Context) []*RetentionPolicy
AllX is like All, but panics if an error occurs.
func (*RetentionPolicyQuery) Clone ¶
func (_q *RetentionPolicyQuery) Clone() *RetentionPolicyQuery
Clone returns a duplicate of the RetentionPolicyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RetentionPolicyQuery) Count ¶
func (_q *RetentionPolicyQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RetentionPolicyQuery) CountX ¶
func (_q *RetentionPolicyQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RetentionPolicyQuery) Exist ¶
func (_q *RetentionPolicyQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RetentionPolicyQuery) ExistX ¶
func (_q *RetentionPolicyQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RetentionPolicyQuery) First ¶
func (_q *RetentionPolicyQuery) First(ctx context.Context) (*RetentionPolicy, error)
First returns the first RetentionPolicy entity from the query. Returns a *NotFoundError when no RetentionPolicy was found.
func (*RetentionPolicyQuery) FirstID ¶
func (_q *RetentionPolicyQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first RetentionPolicy ID from the query. Returns a *NotFoundError when no RetentionPolicy ID was found.
func (*RetentionPolicyQuery) FirstIDX ¶
func (_q *RetentionPolicyQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RetentionPolicyQuery) FirstX ¶
func (_q *RetentionPolicyQuery) FirstX(ctx context.Context) *RetentionPolicy
FirstX is like First, but panics if an error occurs.
func (*RetentionPolicyQuery) GroupBy ¶
func (_q *RetentionPolicyQuery) GroupBy(field string, fields ...string) *RetentionPolicyGroupBy
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 {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.RetentionPolicy.Query().
GroupBy(retentionpolicy.FieldName).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*RetentionPolicyQuery) IDs ¶
func (_q *RetentionPolicyQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of RetentionPolicy IDs.
func (*RetentionPolicyQuery) IDsX ¶
func (_q *RetentionPolicyQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RetentionPolicyQuery) Limit ¶
func (_q *RetentionPolicyQuery) Limit(limit int) *RetentionPolicyQuery
Limit the number of records to be returned by this query.
func (*RetentionPolicyQuery) Offset ¶
func (_q *RetentionPolicyQuery) Offset(offset int) *RetentionPolicyQuery
Offset to start from.
func (*RetentionPolicyQuery) Only ¶
func (_q *RetentionPolicyQuery) Only(ctx context.Context) (*RetentionPolicy, error)
Only returns a single RetentionPolicy entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RetentionPolicy entity is found. Returns a *NotFoundError when no RetentionPolicy entities are found.
func (*RetentionPolicyQuery) OnlyID ¶
func (_q *RetentionPolicyQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only RetentionPolicy ID in the query. Returns a *NotSingularError when more than one RetentionPolicy ID is found. Returns a *NotFoundError when no entities are found.
func (*RetentionPolicyQuery) OnlyIDX ¶
func (_q *RetentionPolicyQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RetentionPolicyQuery) OnlyX ¶
func (_q *RetentionPolicyQuery) OnlyX(ctx context.Context) *RetentionPolicy
OnlyX is like Only, but panics if an error occurs.
func (*RetentionPolicyQuery) Order ¶
func (_q *RetentionPolicyQuery) Order(o ...retentionpolicy.OrderOption) *RetentionPolicyQuery
Order specifies how the records should be ordered.
func (*RetentionPolicyQuery) QueryProject ¶
func (_q *RetentionPolicyQuery) QueryProject() *ProjectQuery
QueryProject chains the current query on the "project" edge.
func (*RetentionPolicyQuery) Select ¶
func (_q *RetentionPolicyQuery) Select(fields ...string) *RetentionPolicySelect
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 {
Name string `json:"name,omitempty"`
}
client.RetentionPolicy.Query().
Select(retentionpolicy.FieldName).
Scan(ctx, &v)
func (*RetentionPolicyQuery) Unique ¶
func (_q *RetentionPolicyQuery) Unique(unique bool) *RetentionPolicyQuery
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 (*RetentionPolicyQuery) Where ¶
func (_q *RetentionPolicyQuery) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyQuery
Where adds a new predicate for the RetentionPolicyQuery builder.
func (*RetentionPolicyQuery) WithProject ¶
func (_q *RetentionPolicyQuery) WithProject(opts ...func(*ProjectQuery)) *RetentionPolicyQuery
WithProject tells the query-builder to eager-load the nodes that are connected to the "project" edge. The optional arguments are used to configure the query builder of the edge.
type RetentionPolicySelect ¶
type RetentionPolicySelect struct {
*RetentionPolicyQuery
// contains filtered or unexported fields
}
RetentionPolicySelect is the builder for selecting fields of RetentionPolicy entities.
func (*RetentionPolicySelect) Aggregate ¶
func (_s *RetentionPolicySelect) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
Aggregate adds the given aggregation functions to the selector query.
func (*RetentionPolicySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RetentionPolicySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Scan ¶
func (_s *RetentionPolicySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RetentionPolicySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RetentionPolicyUpdate ¶
type RetentionPolicyUpdate struct {
// contains filtered or unexported fields
}
RetentionPolicyUpdate is the builder for updating RetentionPolicy entities.
func (*RetentionPolicyUpdate) AddDurationDays ¶
func (_u *RetentionPolicyUpdate) AddDurationDays(v int) *RetentionPolicyUpdate
AddDurationDays adds value to the "duration_days" field.
func (*RetentionPolicyUpdate) ClearDescription ¶
func (_u *RetentionPolicyUpdate) ClearDescription() *RetentionPolicyUpdate
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyUpdate) ClearProject ¶
func (_u *RetentionPolicyUpdate) ClearProject() *RetentionPolicyUpdate
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyUpdate) Exec ¶
func (_u *RetentionPolicyUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyUpdate) ExecX ¶
func (_u *RetentionPolicyUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyUpdate) Mutation ¶
func (_u *RetentionPolicyUpdate) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyUpdate) Save ¶
func (_u *RetentionPolicyUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RetentionPolicyUpdate) SaveX ¶
func (_u *RetentionPolicyUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RetentionPolicyUpdate) SetDescription ¶
func (_u *RetentionPolicyUpdate) SetDescription(v string) *RetentionPolicyUpdate
SetDescription sets the "description" field.
func (*RetentionPolicyUpdate) SetDurationDays ¶
func (_u *RetentionPolicyUpdate) SetDurationDays(v int) *RetentionPolicyUpdate
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyUpdate) SetIsActive ¶
func (_u *RetentionPolicyUpdate) SetIsActive(v bool) *RetentionPolicyUpdate
SetIsActive sets the "is_active" field.
func (*RetentionPolicyUpdate) SetName ¶
func (_u *RetentionPolicyUpdate) SetName(v string) *RetentionPolicyUpdate
SetName sets the "name" field.
func (*RetentionPolicyUpdate) SetNillableDescription ¶
func (_u *RetentionPolicyUpdate) SetNillableDescription(v *string) *RetentionPolicyUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableDurationDays ¶
func (_u *RetentionPolicyUpdate) SetNillableDurationDays(v *int) *RetentionPolicyUpdate
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableIsActive ¶
func (_u *RetentionPolicyUpdate) SetNillableIsActive(v *bool) *RetentionPolicyUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableName ¶
func (_u *RetentionPolicyUpdate) SetNillableName(v *string) *RetentionPolicyUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetProject ¶
func (_u *RetentionPolicyUpdate) SetProject(v *Project) *RetentionPolicyUpdate
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyUpdate) SetProjectID ¶
func (_u *RetentionPolicyUpdate) SetProjectID(id int) *RetentionPolicyUpdate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyUpdate) SetUpdatedAt ¶
func (_u *RetentionPolicyUpdate) SetUpdatedAt(v time.Time) *RetentionPolicyUpdate
SetUpdatedAt sets the "updated_at" field.
func (*RetentionPolicyUpdate) Where ¶
func (_u *RetentionPolicyUpdate) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdate
Where appends a list predicates to the RetentionPolicyUpdate builder.
type RetentionPolicyUpdateOne ¶
type RetentionPolicyUpdateOne struct {
// contains filtered or unexported fields
}
RetentionPolicyUpdateOne is the builder for updating a single RetentionPolicy entity.
func (*RetentionPolicyUpdateOne) AddDurationDays ¶
func (_u *RetentionPolicyUpdateOne) AddDurationDays(v int) *RetentionPolicyUpdateOne
AddDurationDays adds value to the "duration_days" field.
func (*RetentionPolicyUpdateOne) ClearDescription ¶
func (_u *RetentionPolicyUpdateOne) ClearDescription() *RetentionPolicyUpdateOne
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyUpdateOne) ClearProject ¶
func (_u *RetentionPolicyUpdateOne) ClearProject() *RetentionPolicyUpdateOne
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyUpdateOne) Exec ¶
func (_u *RetentionPolicyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RetentionPolicyUpdateOne) ExecX ¶
func (_u *RetentionPolicyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyUpdateOne) Mutation ¶
func (_u *RetentionPolicyUpdateOne) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyUpdateOne) Save ¶
func (_u *RetentionPolicyUpdateOne) Save(ctx context.Context) (*RetentionPolicy, error)
Save executes the query and returns the updated RetentionPolicy entity.
func (*RetentionPolicyUpdateOne) SaveX ¶
func (_u *RetentionPolicyUpdateOne) SaveX(ctx context.Context) *RetentionPolicy
SaveX is like Save, but panics if an error occurs.
func (*RetentionPolicyUpdateOne) Select ¶
func (_u *RetentionPolicyUpdateOne) Select(field string, fields ...string) *RetentionPolicyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RetentionPolicyUpdateOne) SetDescription ¶
func (_u *RetentionPolicyUpdateOne) SetDescription(v string) *RetentionPolicyUpdateOne
SetDescription sets the "description" field.
func (*RetentionPolicyUpdateOne) SetDurationDays ¶
func (_u *RetentionPolicyUpdateOne) SetDurationDays(v int) *RetentionPolicyUpdateOne
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyUpdateOne) SetIsActive ¶
func (_u *RetentionPolicyUpdateOne) SetIsActive(v bool) *RetentionPolicyUpdateOne
SetIsActive sets the "is_active" field.
func (*RetentionPolicyUpdateOne) SetName ¶
func (_u *RetentionPolicyUpdateOne) SetName(v string) *RetentionPolicyUpdateOne
SetName sets the "name" field.
func (*RetentionPolicyUpdateOne) SetNillableDescription ¶
func (_u *RetentionPolicyUpdateOne) SetNillableDescription(v *string) *RetentionPolicyUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableDurationDays ¶
func (_u *RetentionPolicyUpdateOne) SetNillableDurationDays(v *int) *RetentionPolicyUpdateOne
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableIsActive ¶
func (_u *RetentionPolicyUpdateOne) SetNillableIsActive(v *bool) *RetentionPolicyUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableName ¶
func (_u *RetentionPolicyUpdateOne) SetNillableName(v *string) *RetentionPolicyUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetProject ¶
func (_u *RetentionPolicyUpdateOne) SetProject(v *Project) *RetentionPolicyUpdateOne
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyUpdateOne) SetProjectID ¶
func (_u *RetentionPolicyUpdateOne) SetProjectID(id int) *RetentionPolicyUpdateOne
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyUpdateOne) SetUpdatedAt ¶
func (_u *RetentionPolicyUpdateOne) SetUpdatedAt(v time.Time) *RetentionPolicyUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*RetentionPolicyUpdateOne) Where ¶
func (_u *RetentionPolicyUpdateOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdateOne
Where appends a list predicates to the RetentionPolicyUpdate builder.
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// Project is the client for interacting with the Project builders.
Project *ProjectClient
// ProjectMember is the client for interacting with the ProjectMember builders.
ProjectMember *ProjectMemberClient
// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
RetentionPolicy *RetentionPolicyClient
// 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 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 User ¶
type User struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Unique username for the user
Username string `json:"username,omitempty"`
// Email address of the user
Email string `json:"email,omitempty"`
// Hashed password for authentication
PasswordHash string `json:"-"`
// User role: admin, user, etc.
Role string `json:"role,omitempty"`
// When the user was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the user was last updated
UpdatedAt time.Time `json:"updated_at,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) QueryMemberships ¶
func (_m *User) QueryMemberships() *ProjectMemberQuery
QueryMemberships queries the "memberships" edge of the User entity.
func (*User) QueryProjects ¶
func (_m *User) QueryProjects() *ProjectQuery
QueryProjects queries the "projects" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User 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 (*User) Update ¶
func (_m *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 ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryMemberships ¶
func (c *UserClient) QueryMemberships(_m *User) *ProjectMemberQuery
QueryMemberships queries the memberships edge of a User.
func (*UserClient) QueryProjects ¶
func (c *UserClient) QueryProjects(_m *User) *ProjectQuery
QueryProjects queries the projects edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
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 ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddMembershipIDs ¶
func (_c *UserCreate) AddMembershipIDs(ids ...int) *UserCreate
AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.
func (*UserCreate) AddMemberships ¶
func (_c *UserCreate) AddMemberships(v ...*ProjectMember) *UserCreate
AddMemberships adds the "memberships" edges to the ProjectMember entity.
func (*UserCreate) AddProjectIDs ¶
func (_c *UserCreate) AddProjectIDs(ids ...int) *UserCreate
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserCreate) AddProjects ¶
func (_c *UserCreate) AddProjects(v ...*Project) *UserCreate
AddProjects adds the "projects" edges to the Project entity.
func (*UserCreate) Exec ¶
func (_c *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (_c *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (_c *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (_c *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (_c *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCreatedAt ¶
func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (_c *UserCreate) SetEmail(v string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableRole ¶
func (_c *UserCreate) SetNillableRole(v *string) *UserCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetPasswordHash ¶
func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
SetPasswordHash sets the "password_hash" field.
func (*UserCreate) SetRole ¶
func (_c *UserCreate) SetRole(v string) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetUpdatedAt ¶
func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserCreate) SetUsername ¶
func (_c *UserCreate) SetUsername(v string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (_c *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (_c *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (_d *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (_d *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (_d *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (_d *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct {
// Projects owned by this user
Projects []*Project `json:"projects,omitempty"`
// Project memberships for this user
Memberships []*ProjectMember `json:"memberships,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) MembershipsOrErr ¶
func (e UserEdges) MembershipsOrErr() ([]*ProjectMember, error)
MembershipsOrErr returns the Memberships value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ProjectsOrErr ¶
ProjectsOrErr returns the Projects value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (_g *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) 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 (*UserMutation) AddMembershipIDs ¶
func (m *UserMutation) AddMembershipIDs(ids ...int)
AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by ids.
func (*UserMutation) AddProjectIDs ¶
func (m *UserMutation) AddProjectIDs(ids ...int)
AddProjectIDs adds the "projects" edge to the Project entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) 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 (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) 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 (*UserMutation) ClearField ¶
func (m *UserMutation) 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 (*UserMutation) ClearMemberships ¶
func (m *UserMutation) ClearMemberships()
ClearMemberships clears the "memberships" edge to the ProjectMember entity.
func (*UserMutation) ClearProjects ¶
func (m *UserMutation) ClearProjects()
ClearProjects clears the "projects" edge to the Project entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
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) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) 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 (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
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 incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, 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 (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
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 (*UserMutation) MembershipsCleared ¶
func (m *UserMutation) MembershipsCleared() bool
MembershipsCleared reports if the "memberships" edge to the ProjectMember entity was cleared.
func (*UserMutation) MembershipsIDs ¶
func (m *UserMutation) MembershipsIDs() (ids []int)
MembershipsIDs returns the "memberships" edge IDs in the mutation.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. 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 the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. 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 the database query fails.
func (*UserMutation) 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 (*UserMutation) OldPasswordHash ¶
func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)
OldPasswordHash returns the old "password_hash" field's value of the User entity. 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 the database query fails.
func (*UserMutation) OldRole ¶
func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)
OldRole returns the old "role" field's value of the User entity. 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 the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. 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 the database query fails.
func (*UserMutation) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the User entity. 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 the database query fails.
func (*UserMutation) PasswordHash ¶
func (m *UserMutation) PasswordHash() (r string, exists bool)
PasswordHash returns the value of the "password_hash" field in the mutation.
func (*UserMutation) ProjectsCleared ¶
func (m *UserMutation) ProjectsCleared() bool
ProjectsCleared reports if the "projects" edge to the Project entity was cleared.
func (*UserMutation) ProjectsIDs ¶
func (m *UserMutation) ProjectsIDs() (ids []int)
ProjectsIDs returns the "projects" edge IDs in the mutation.
func (*UserMutation) RemoveMembershipIDs ¶
func (m *UserMutation) RemoveMembershipIDs(ids ...int)
RemoveMembershipIDs removes the "memberships" edge to the ProjectMember entity by IDs.
func (*UserMutation) RemoveProjectIDs ¶
func (m *UserMutation) RemoveProjectIDs(ids ...int)
RemoveProjectIDs removes the "projects" edge to the Project entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) 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 (*UserMutation) RemovedMembershipsIDs ¶
func (m *UserMutation) RemovedMembershipsIDs() (ids []int)
RemovedMemberships returns the removed IDs of the "memberships" edge to the ProjectMember entity.
func (*UserMutation) RemovedProjectsIDs ¶
func (m *UserMutation) RemovedProjectsIDs() (ids []int)
RemovedProjects returns the removed IDs of the "projects" edge to the Project entity.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) 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 (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) 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 (*UserMutation) ResetMemberships ¶
func (m *UserMutation) ResetMemberships()
ResetMemberships resets all changes to the "memberships" edge.
func (*UserMutation) ResetPasswordHash ¶
func (m *UserMutation) ResetPasswordHash()
ResetPasswordHash resets all changes to the "password_hash" field.
func (*UserMutation) ResetProjects ¶
func (m *UserMutation) ResetProjects()
ResetProjects resets all changes to the "projects" edge.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r string, exists bool)
Role returns the value of the "role" field in the mutation.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) 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 (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPasswordHash ¶
func (m *UserMutation) SetPasswordHash(s string)
SetPasswordHash sets the "password_hash" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(s string)
SetRole sets the "role" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (UserMutation) Tx ¶
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 ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery 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) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
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 {
Username string `json:"username,omitempty"`
Count int `json:"count,omitempty"`
}
client.User.Query().
GroupBy(user.FieldUsername).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryMemberships ¶
func (_q *UserQuery) QueryMemberships() *ProjectMemberQuery
QueryMemberships chains the current query on the "memberships" edge.
func (*UserQuery) QueryProjects ¶
func (_q *UserQuery) QueryProjects() *ProjectQuery
QueryProjects chains the current query on the "projects" edge.
func (*UserQuery) Select ¶
func (_q *UserQuery) Select(fields ...string) *UserSelect
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 {
Username string `json:"username,omitempty"`
}
client.User.Query().
Select(user.FieldUsername).
Scan(ctx, &v)
func (*UserQuery) Unique ¶
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 (*UserQuery) WithMemberships ¶
func (_q *UserQuery) WithMemberships(opts ...func(*ProjectMemberQuery)) *UserQuery
WithMemberships tells the query-builder to eager-load the nodes that are connected to the "memberships" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithProjects ¶
func (_q *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *UserQuery
WithProjects tells the query-builder to eager-load the nodes that are connected to the "projects" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct {
*UserQuery
// contains filtered or unexported fields
}
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (_s *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddMembershipIDs ¶
func (_u *UserUpdate) AddMembershipIDs(ids ...int) *UserUpdate
AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.
func (*UserUpdate) AddMemberships ¶
func (_u *UserUpdate) AddMemberships(v ...*ProjectMember) *UserUpdate
AddMemberships adds the "memberships" edges to the ProjectMember entity.
func (*UserUpdate) AddProjectIDs ¶
func (_u *UserUpdate) AddProjectIDs(ids ...int) *UserUpdate
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserUpdate) AddProjects ¶
func (_u *UserUpdate) AddProjects(v ...*Project) *UserUpdate
AddProjects adds the "projects" edges to the Project entity.
func (*UserUpdate) ClearMemberships ¶
func (_u *UserUpdate) ClearMemberships() *UserUpdate
ClearMemberships clears all "memberships" edges to the ProjectMember entity.
func (*UserUpdate) ClearProjects ¶
func (_u *UserUpdate) ClearProjects() *UserUpdate
ClearProjects clears all "projects" edges to the Project entity.
func (*UserUpdate) Exec ¶
func (_u *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (_u *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (_u *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveMembershipIDs ¶
func (_u *UserUpdate) RemoveMembershipIDs(ids ...int) *UserUpdate
RemoveMembershipIDs removes the "memberships" edge to ProjectMember entities by IDs.
func (*UserUpdate) RemoveMemberships ¶
func (_u *UserUpdate) RemoveMemberships(v ...*ProjectMember) *UserUpdate
RemoveMemberships removes "memberships" edges to ProjectMember entities.
func (*UserUpdate) RemoveProjectIDs ¶
func (_u *UserUpdate) RemoveProjectIDs(ids ...int) *UserUpdate
RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
func (*UserUpdate) RemoveProjects ¶
func (_u *UserUpdate) RemoveProjects(v ...*Project) *UserUpdate
RemoveProjects removes "projects" edges to Project entities.
func (*UserUpdate) Save ¶
func (_u *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 ¶
func (_u *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetEmail ¶
func (_u *UserUpdate) SetEmail(v string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNillableEmail ¶
func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillablePasswordHash ¶
func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate
SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
func (*UserUpdate) SetNillableRole ¶
func (_u *UserUpdate) SetNillableRole(v *string) *UserUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdate) SetNillableUsername ¶
func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdate) SetPasswordHash ¶
func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
SetPasswordHash sets the "password_hash" field.
func (*UserUpdate) SetRole ¶
func (_u *UserUpdate) SetRole(v string) *UserUpdate
SetRole sets the "role" field.
func (*UserUpdate) SetUpdatedAt ¶
func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) SetUsername ¶
func (_u *UserUpdate) SetUsername(v string) *UserUpdate
SetUsername sets the "username" field.
func (*UserUpdate) Where ¶
func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddMembershipIDs ¶
func (_u *UserUpdateOne) AddMembershipIDs(ids ...int) *UserUpdateOne
AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.
func (*UserUpdateOne) AddMemberships ¶
func (_u *UserUpdateOne) AddMemberships(v ...*ProjectMember) *UserUpdateOne
AddMemberships adds the "memberships" edges to the ProjectMember entity.
func (*UserUpdateOne) AddProjectIDs ¶
func (_u *UserUpdateOne) AddProjectIDs(ids ...int) *UserUpdateOne
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserUpdateOne) AddProjects ¶
func (_u *UserUpdateOne) AddProjects(v ...*Project) *UserUpdateOne
AddProjects adds the "projects" edges to the Project entity.
func (*UserUpdateOne) ClearMemberships ¶
func (_u *UserUpdateOne) ClearMemberships() *UserUpdateOne
ClearMemberships clears all "memberships" edges to the ProjectMember entity.
func (*UserUpdateOne) ClearProjects ¶
func (_u *UserUpdateOne) ClearProjects() *UserUpdateOne
ClearProjects clears all "projects" edges to the Project entity.
func (*UserUpdateOne) Exec ¶
func (_u *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (_u *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (_u *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveMembershipIDs ¶
func (_u *UserUpdateOne) RemoveMembershipIDs(ids ...int) *UserUpdateOne
RemoveMembershipIDs removes the "memberships" edge to ProjectMember entities by IDs.
func (*UserUpdateOne) RemoveMemberships ¶
func (_u *UserUpdateOne) RemoveMemberships(v ...*ProjectMember) *UserUpdateOne
RemoveMemberships removes "memberships" edges to ProjectMember entities.
func (*UserUpdateOne) RemoveProjectIDs ¶
func (_u *UserUpdateOne) RemoveProjectIDs(ids ...int) *UserUpdateOne
RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
func (*UserUpdateOne) RemoveProjects ¶
func (_u *UserUpdateOne) RemoveProjects(v ...*Project) *UserUpdateOne
RemoveProjects removes "projects" edges to Project entities.
func (*UserUpdateOne) Save ¶
func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetEmail ¶
func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePasswordHash ¶
func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne
SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRole ¶
func (_u *UserUpdateOne) SetNillableRole(v *string) *UserUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUsername ¶
func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdateOne) SetPasswordHash ¶
func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
SetPasswordHash sets the "password_hash" field.
func (*UserUpdateOne) SetRole ¶
func (_u *UserUpdateOne) SetRole(v string) *UserUpdateOne
SetRole sets the "role" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) SetUsername ¶
func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne
SetUsername sets the "username" field.
func (*UserUpdateOne) Where ¶
func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
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.
Source Files
¶
- client.go
- ent.go
- mutation.go
- project.go
- project_create.go
- project_delete.go
- project_query.go
- project_update.go
- projectmember.go
- projectmember_create.go
- projectmember_delete.go
- projectmember_query.go
- projectmember_update.go
- retentionpolicy.go
- retentionpolicy_create.go
- retentionpolicy_delete.go
- retentionpolicy_query.go
- retentionpolicy_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go