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 AI
- type AIClient
- func (c *AIClient) Create() *AICreate
- func (c *AIClient) CreateBulk(builders ...*AICreate) *AICreateBulk
- func (c *AIClient) Delete() *AIDelete
- func (c *AIClient) DeleteOne(a *AI) *AIDeleteOne
- func (c *AIClient) DeleteOneID(id int) *AIDeleteOne
- func (c *AIClient) Get(ctx context.Context, id int) (*AI, error)
- func (c *AIClient) GetX(ctx context.Context, id int) *AI
- func (c *AIClient) Hooks() []Hook
- func (c *AIClient) Intercept(interceptors ...Interceptor)
- func (c *AIClient) Interceptors() []Interceptor
- func (c *AIClient) MapCreateBulk(slice any, setFunc func(*AICreate, int)) *AICreateBulk
- func (c *AIClient) Query() *AIQuery
- func (c *AIClient) QueryUser(a *AI) *UserQuery
- func (c *AIClient) Update() *AIUpdate
- func (c *AIClient) UpdateOne(a *AI) *AIUpdateOne
- func (c *AIClient) UpdateOneID(id int) *AIUpdateOne
- func (c *AIClient) Use(hooks ...Hook)
- type AICreate
- func (ac *AICreate) Exec(ctx context.Context) error
- func (ac *AICreate) ExecX(ctx context.Context)
- func (ac *AICreate) Mutation() *AIMutation
- func (ac *AICreate) Save(ctx context.Context) (*AI, error)
- func (ac *AICreate) SaveX(ctx context.Context) *AI
- func (ac *AICreate) SetAiClientName(s string) *AICreate
- func (ac *AICreate) SetCompletedAt(t time.Time) *AICreate
- func (ac *AICreate) SetCreatedAt(t time.Time) *AICreate
- func (ac *AICreate) SetNillableCompletedAt(t *time.Time) *AICreate
- func (ac *AICreate) SetNillableCreatedAt(t *time.Time) *AICreate
- func (ac *AICreate) SetNillableStatus(a *ai.Status) *AICreate
- func (ac *AICreate) SetPrompt(s string) *AICreate
- func (ac *AICreate) SetResult(b []byte) *AICreate
- func (ac *AICreate) SetStatus(a ai.Status) *AICreate
- func (ac *AICreate) SetUser(u *User) *AICreate
- func (ac *AICreate) SetUserID(id int) *AICreate
- type AICreateBulk
- type AIDelete
- type AIDeleteOne
- type AIEdges
- type AIGroupBy
- func (agb *AIGroupBy) Aggregate(fns ...AggregateFunc) *AIGroupBy
- func (s *AIGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AIGroupBy) BoolX(ctx context.Context) bool
- func (s *AIGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AIGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AIGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AIGroupBy) Float64X(ctx context.Context) float64
- func (s *AIGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AIGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AIGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AIGroupBy) IntX(ctx context.Context) int
- func (s *AIGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AIGroupBy) IntsX(ctx context.Context) []int
- func (agb *AIGroupBy) Scan(ctx context.Context, v any) error
- func (s *AIGroupBy) ScanX(ctx context.Context, v any)
- func (s *AIGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AIGroupBy) StringX(ctx context.Context) string
- func (s *AIGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AIGroupBy) StringsX(ctx context.Context) []string
- type AIMutation
- func (m *AIMutation) AddField(name string, value ent.Value) error
- func (m *AIMutation) AddedEdges() []string
- func (m *AIMutation) AddedField(name string) (ent.Value, bool)
- func (m *AIMutation) AddedFields() []string
- func (m *AIMutation) AddedIDs(name string) []ent.Value
- func (m *AIMutation) AiClientName() (r string, exists bool)
- func (m *AIMutation) ClearCompletedAt()
- func (m *AIMutation) ClearEdge(name string) error
- func (m *AIMutation) ClearField(name string) error
- func (m *AIMutation) ClearUser()
- func (m *AIMutation) ClearedEdges() []string
- func (m *AIMutation) ClearedFields() []string
- func (m AIMutation) Client() *Client
- func (m *AIMutation) CompletedAt() (r time.Time, exists bool)
- func (m *AIMutation) CompletedAtCleared() bool
- func (m *AIMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AIMutation) EdgeCleared(name string) bool
- func (m *AIMutation) Field(name string) (ent.Value, bool)
- func (m *AIMutation) FieldCleared(name string) bool
- func (m *AIMutation) Fields() []string
- func (m *AIMutation) ID() (id int, exists bool)
- func (m *AIMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AIMutation) OldAiClientName(ctx context.Context) (v string, err error)
- func (m *AIMutation) OldCompletedAt(ctx context.Context) (v time.Time, err error)
- func (m *AIMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AIMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AIMutation) OldPrompt(ctx context.Context) (v string, err error)
- func (m *AIMutation) OldResult(ctx context.Context) (v []byte, err error)
- func (m *AIMutation) OldStatus(ctx context.Context) (v ai.Status, err error)
- func (m *AIMutation) Op() Op
- func (m *AIMutation) Prompt() (r string, exists bool)
- func (m *AIMutation) RemovedEdges() []string
- func (m *AIMutation) RemovedIDs(name string) []ent.Value
- func (m *AIMutation) ResetAiClientName()
- func (m *AIMutation) ResetCompletedAt()
- func (m *AIMutation) ResetCreatedAt()
- func (m *AIMutation) ResetEdge(name string) error
- func (m *AIMutation) ResetField(name string) error
- func (m *AIMutation) ResetPrompt()
- func (m *AIMutation) ResetResult()
- func (m *AIMutation) ResetStatus()
- func (m *AIMutation) ResetUser()
- func (m *AIMutation) Result() (r []byte, exists bool)
- func (m *AIMutation) SetAiClientName(s string)
- func (m *AIMutation) SetCompletedAt(t time.Time)
- func (m *AIMutation) SetCreatedAt(t time.Time)
- func (m *AIMutation) SetField(name string, value ent.Value) error
- func (m *AIMutation) SetOp(op Op)
- func (m *AIMutation) SetPrompt(s string)
- func (m *AIMutation) SetResult(b []byte)
- func (m *AIMutation) SetStatus(a ai.Status)
- func (m *AIMutation) SetUserID(id int)
- func (m *AIMutation) Status() (r ai.Status, exists bool)
- func (m AIMutation) Tx() (*Tx, error)
- func (m *AIMutation) Type() string
- func (m *AIMutation) UserCleared() bool
- func (m *AIMutation) UserID() (id int, exists bool)
- func (m *AIMutation) UserIDs() (ids []int)
- func (m *AIMutation) Where(ps ...predicate.AI)
- func (m *AIMutation) WhereP(ps ...func(*sql.Selector))
- type AIQuery
- func (aq *AIQuery) Aggregate(fns ...AggregateFunc) *AISelect
- func (aq *AIQuery) All(ctx context.Context) ([]*AI, error)
- func (aq *AIQuery) AllX(ctx context.Context) []*AI
- func (aq *AIQuery) Clone() *AIQuery
- func (aq *AIQuery) Count(ctx context.Context) (int, error)
- func (aq *AIQuery) CountX(ctx context.Context) int
- func (aq *AIQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AIQuery) ExistX(ctx context.Context) bool
- func (aq *AIQuery) First(ctx context.Context) (*AI, error)
- func (aq *AIQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AIQuery) FirstIDX(ctx context.Context) int
- func (aq *AIQuery) FirstX(ctx context.Context) *AI
- func (aq *AIQuery) GroupBy(field string, fields ...string) *AIGroupBy
- func (aq *AIQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AIQuery) IDsX(ctx context.Context) []int
- func (aq *AIQuery) Limit(limit int) *AIQuery
- func (aq *AIQuery) Offset(offset int) *AIQuery
- func (aq *AIQuery) Only(ctx context.Context) (*AI, error)
- func (aq *AIQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AIQuery) OnlyIDX(ctx context.Context) int
- func (aq *AIQuery) OnlyX(ctx context.Context) *AI
- func (aq *AIQuery) Order(o ...ai.OrderOption) *AIQuery
- func (aq *AIQuery) QueryUser() *UserQuery
- func (aq *AIQuery) Select(fields ...string) *AISelect
- func (aq *AIQuery) Unique(unique bool) *AIQuery
- func (aq *AIQuery) Where(ps ...predicate.AI) *AIQuery
- func (aq *AIQuery) WithUser(opts ...func(*UserQuery)) *AIQuery
- type AISelect
- func (as *AISelect) Aggregate(fns ...AggregateFunc) *AISelect
- func (s *AISelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AISelect) BoolX(ctx context.Context) bool
- func (s *AISelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AISelect) BoolsX(ctx context.Context) []bool
- func (s *AISelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AISelect) Float64X(ctx context.Context) float64
- func (s *AISelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AISelect) Float64sX(ctx context.Context) []float64
- func (s *AISelect) Int(ctx context.Context) (_ int, err error)
- func (s *AISelect) IntX(ctx context.Context) int
- func (s *AISelect) Ints(ctx context.Context) ([]int, error)
- func (s *AISelect) IntsX(ctx context.Context) []int
- func (as *AISelect) Scan(ctx context.Context, v any) error
- func (s *AISelect) ScanX(ctx context.Context, v any)
- func (s *AISelect) String(ctx context.Context) (_ string, err error)
- func (s *AISelect) StringX(ctx context.Context) string
- func (s *AISelect) Strings(ctx context.Context) ([]string, error)
- func (s *AISelect) StringsX(ctx context.Context) []string
- type AIUpdate
- func (au *AIUpdate) ClearCompletedAt() *AIUpdate
- func (au *AIUpdate) ClearUser() *AIUpdate
- func (au *AIUpdate) Exec(ctx context.Context) error
- func (au *AIUpdate) ExecX(ctx context.Context)
- func (au *AIUpdate) Mutation() *AIMutation
- func (au *AIUpdate) Save(ctx context.Context) (int, error)
- func (au *AIUpdate) SaveX(ctx context.Context) int
- func (au *AIUpdate) SetAiClientName(s string) *AIUpdate
- func (au *AIUpdate) SetCompletedAt(t time.Time) *AIUpdate
- func (au *AIUpdate) SetNillableAiClientName(s *string) *AIUpdate
- func (au *AIUpdate) SetNillableCompletedAt(t *time.Time) *AIUpdate
- func (au *AIUpdate) SetNillablePrompt(s *string) *AIUpdate
- func (au *AIUpdate) SetNillableStatus(a *ai.Status) *AIUpdate
- func (au *AIUpdate) SetPrompt(s string) *AIUpdate
- func (au *AIUpdate) SetResult(b []byte) *AIUpdate
- func (au *AIUpdate) SetStatus(a ai.Status) *AIUpdate
- func (au *AIUpdate) SetUser(u *User) *AIUpdate
- func (au *AIUpdate) SetUserID(id int) *AIUpdate
- func (au *AIUpdate) Where(ps ...predicate.AI) *AIUpdate
- type AIUpdateOne
- func (auo *AIUpdateOne) ClearCompletedAt() *AIUpdateOne
- func (auo *AIUpdateOne) ClearUser() *AIUpdateOne
- func (auo *AIUpdateOne) Exec(ctx context.Context) error
- func (auo *AIUpdateOne) ExecX(ctx context.Context)
- func (auo *AIUpdateOne) Mutation() *AIMutation
- func (auo *AIUpdateOne) Save(ctx context.Context) (*AI, error)
- func (auo *AIUpdateOne) SaveX(ctx context.Context) *AI
- func (auo *AIUpdateOne) Select(field string, fields ...string) *AIUpdateOne
- func (auo *AIUpdateOne) SetAiClientName(s string) *AIUpdateOne
- func (auo *AIUpdateOne) SetCompletedAt(t time.Time) *AIUpdateOne
- func (auo *AIUpdateOne) SetNillableAiClientName(s *string) *AIUpdateOne
- func (auo *AIUpdateOne) SetNillableCompletedAt(t *time.Time) *AIUpdateOne
- func (auo *AIUpdateOne) SetNillablePrompt(s *string) *AIUpdateOne
- func (auo *AIUpdateOne) SetNillableStatus(a *ai.Status) *AIUpdateOne
- func (auo *AIUpdateOne) SetPrompt(s string) *AIUpdateOne
- func (auo *AIUpdateOne) SetResult(b []byte) *AIUpdateOne
- func (auo *AIUpdateOne) SetStatus(a ai.Status) *AIUpdateOne
- func (auo *AIUpdateOne) SetUser(u *User) *AIUpdateOne
- func (auo *AIUpdateOne) SetUserID(id int) *AIUpdateOne
- func (auo *AIUpdateOne) Where(ps ...predicate.AI) *AIUpdateOne
- type AIs
- 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 ModelName
- type ModelNameClient
- func (c *ModelNameClient) Create() *ModelNameCreate
- func (c *ModelNameClient) CreateBulk(builders ...*ModelNameCreate) *ModelNameCreateBulk
- func (c *ModelNameClient) Delete() *ModelNameDelete
- func (c *ModelNameClient) DeleteOne(mn *ModelName) *ModelNameDeleteOne
- func (c *ModelNameClient) DeleteOneID(id int) *ModelNameDeleteOne
- func (c *ModelNameClient) Get(ctx context.Context, id int) (*ModelName, error)
- func (c *ModelNameClient) GetX(ctx context.Context, id int) *ModelName
- func (c *ModelNameClient) Hooks() []Hook
- func (c *ModelNameClient) Intercept(interceptors ...Interceptor)
- func (c *ModelNameClient) Interceptors() []Interceptor
- func (c *ModelNameClient) MapCreateBulk(slice any, setFunc func(*ModelNameCreate, int)) *ModelNameCreateBulk
- func (c *ModelNameClient) Query() *ModelNameQuery
- func (c *ModelNameClient) QueryUser(mn *ModelName) *UserQuery
- func (c *ModelNameClient) Update() *ModelNameUpdate
- func (c *ModelNameClient) UpdateOne(mn *ModelName) *ModelNameUpdateOne
- func (c *ModelNameClient) UpdateOneID(id int) *ModelNameUpdateOne
- func (c *ModelNameClient) Use(hooks ...Hook)
- type ModelNameCreate
- func (mnc *ModelNameCreate) Exec(ctx context.Context) error
- func (mnc *ModelNameCreate) ExecX(ctx context.Context)
- func (mnc *ModelNameCreate) Mutation() *ModelNameMutation
- func (mnc *ModelNameCreate) Save(ctx context.Context) (*ModelName, error)
- func (mnc *ModelNameCreate) SaveX(ctx context.Context) *ModelName
- func (mnc *ModelNameCreate) SetCreatedAt(t time.Time) *ModelNameCreate
- func (mnc *ModelNameCreate) SetFieldName(s string) *ModelNameCreate
- func (mnc *ModelNameCreate) SetNillableCreatedAt(t *time.Time) *ModelNameCreate
- func (mnc *ModelNameCreate) SetUser(u *User) *ModelNameCreate
- func (mnc *ModelNameCreate) SetUserID(id int) *ModelNameCreate
- type ModelNameCreateBulk
- type ModelNameDelete
- type ModelNameDeleteOne
- type ModelNameEdges
- type ModelNameGroupBy
- func (mngb *ModelNameGroupBy) Aggregate(fns ...AggregateFunc) *ModelNameGroupBy
- func (s *ModelNameGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ModelNameGroupBy) BoolX(ctx context.Context) bool
- func (s *ModelNameGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ModelNameGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ModelNameGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ModelNameGroupBy) Float64X(ctx context.Context) float64
- func (s *ModelNameGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ModelNameGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ModelNameGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ModelNameGroupBy) IntX(ctx context.Context) int
- func (s *ModelNameGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ModelNameGroupBy) IntsX(ctx context.Context) []int
- func (mngb *ModelNameGroupBy) Scan(ctx context.Context, v any) error
- func (s *ModelNameGroupBy) ScanX(ctx context.Context, v any)
- func (s *ModelNameGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ModelNameGroupBy) StringX(ctx context.Context) string
- func (s *ModelNameGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ModelNameGroupBy) StringsX(ctx context.Context) []string
- type ModelNameMutation
- func (m *ModelNameMutation) AddField(name string, value ent.Value) error
- func (m *ModelNameMutation) AddedEdges() []string
- func (m *ModelNameMutation) AddedField(name string) (ent.Value, bool)
- func (m *ModelNameMutation) AddedFields() []string
- func (m *ModelNameMutation) AddedIDs(name string) []ent.Value
- func (m *ModelNameMutation) ClearEdge(name string) error
- func (m *ModelNameMutation) ClearField(name string) error
- func (m *ModelNameMutation) ClearUser()
- func (m *ModelNameMutation) ClearedEdges() []string
- func (m *ModelNameMutation) ClearedFields() []string
- func (m ModelNameMutation) Client() *Client
- func (m *ModelNameMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ModelNameMutation) EdgeCleared(name string) bool
- func (m *ModelNameMutation) Field(name string) (ent.Value, bool)
- func (m *ModelNameMutation) FieldCleared(name string) bool
- func (m *ModelNameMutation) FieldName() (r string, exists bool)
- func (m *ModelNameMutation) Fields() []string
- func (m *ModelNameMutation) ID() (id int, exists bool)
- func (m *ModelNameMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ModelNameMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ModelNameMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ModelNameMutation) OldFieldName(ctx context.Context) (v string, err error)
- func (m *ModelNameMutation) Op() Op
- func (m *ModelNameMutation) RemovedEdges() []string
- func (m *ModelNameMutation) RemovedIDs(name string) []ent.Value
- func (m *ModelNameMutation) ResetCreatedAt()
- func (m *ModelNameMutation) ResetEdge(name string) error
- func (m *ModelNameMutation) ResetField(name string) error
- func (m *ModelNameMutation) ResetFieldName()
- func (m *ModelNameMutation) ResetUser()
- func (m *ModelNameMutation) SetCreatedAt(t time.Time)
- func (m *ModelNameMutation) SetField(name string, value ent.Value) error
- func (m *ModelNameMutation) SetFieldName(s string)
- func (m *ModelNameMutation) SetOp(op Op)
- func (m *ModelNameMutation) SetUserID(id int)
- func (m ModelNameMutation) Tx() (*Tx, error)
- func (m *ModelNameMutation) Type() string
- func (m *ModelNameMutation) UserCleared() bool
- func (m *ModelNameMutation) UserID() (id int, exists bool)
- func (m *ModelNameMutation) UserIDs() (ids []int)
- func (m *ModelNameMutation) Where(ps ...predicate.ModelName)
- func (m *ModelNameMutation) WhereP(ps ...func(*sql.Selector))
- type ModelNameQuery
- func (mnq *ModelNameQuery) Aggregate(fns ...AggregateFunc) *ModelNameSelect
- func (mnq *ModelNameQuery) All(ctx context.Context) ([]*ModelName, error)
- func (mnq *ModelNameQuery) AllX(ctx context.Context) []*ModelName
- func (mnq *ModelNameQuery) Clone() *ModelNameQuery
- func (mnq *ModelNameQuery) Count(ctx context.Context) (int, error)
- func (mnq *ModelNameQuery) CountX(ctx context.Context) int
- func (mnq *ModelNameQuery) Exist(ctx context.Context) (bool, error)
- func (mnq *ModelNameQuery) ExistX(ctx context.Context) bool
- func (mnq *ModelNameQuery) First(ctx context.Context) (*ModelName, error)
- func (mnq *ModelNameQuery) FirstID(ctx context.Context) (id int, err error)
- func (mnq *ModelNameQuery) FirstIDX(ctx context.Context) int
- func (mnq *ModelNameQuery) FirstX(ctx context.Context) *ModelName
- func (mnq *ModelNameQuery) GroupBy(field string, fields ...string) *ModelNameGroupBy
- func (mnq *ModelNameQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mnq *ModelNameQuery) IDsX(ctx context.Context) []int
- func (mnq *ModelNameQuery) Limit(limit int) *ModelNameQuery
- func (mnq *ModelNameQuery) Offset(offset int) *ModelNameQuery
- func (mnq *ModelNameQuery) Only(ctx context.Context) (*ModelName, error)
- func (mnq *ModelNameQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mnq *ModelNameQuery) OnlyIDX(ctx context.Context) int
- func (mnq *ModelNameQuery) OnlyX(ctx context.Context) *ModelName
- func (mnq *ModelNameQuery) Order(o ...modelname.OrderOption) *ModelNameQuery
- func (mnq *ModelNameQuery) QueryUser() *UserQuery
- func (mnq *ModelNameQuery) Select(fields ...string) *ModelNameSelect
- func (mnq *ModelNameQuery) Unique(unique bool) *ModelNameQuery
- func (mnq *ModelNameQuery) Where(ps ...predicate.ModelName) *ModelNameQuery
- func (mnq *ModelNameQuery) WithUser(opts ...func(*UserQuery)) *ModelNameQuery
- type ModelNameSelect
- func (mns *ModelNameSelect) Aggregate(fns ...AggregateFunc) *ModelNameSelect
- func (s *ModelNameSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ModelNameSelect) BoolX(ctx context.Context) bool
- func (s *ModelNameSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ModelNameSelect) BoolsX(ctx context.Context) []bool
- func (s *ModelNameSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ModelNameSelect) Float64X(ctx context.Context) float64
- func (s *ModelNameSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ModelNameSelect) Float64sX(ctx context.Context) []float64
- func (s *ModelNameSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ModelNameSelect) IntX(ctx context.Context) int
- func (s *ModelNameSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ModelNameSelect) IntsX(ctx context.Context) []int
- func (mns *ModelNameSelect) Scan(ctx context.Context, v any) error
- func (s *ModelNameSelect) ScanX(ctx context.Context, v any)
- func (s *ModelNameSelect) String(ctx context.Context) (_ string, err error)
- func (s *ModelNameSelect) StringX(ctx context.Context) string
- func (s *ModelNameSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ModelNameSelect) StringsX(ctx context.Context) []string
- type ModelNameUpdate
- func (mnu *ModelNameUpdate) ClearUser() *ModelNameUpdate
- func (mnu *ModelNameUpdate) Exec(ctx context.Context) error
- func (mnu *ModelNameUpdate) ExecX(ctx context.Context)
- func (mnu *ModelNameUpdate) Mutation() *ModelNameMutation
- func (mnu *ModelNameUpdate) Save(ctx context.Context) (int, error)
- func (mnu *ModelNameUpdate) SaveX(ctx context.Context) int
- func (mnu *ModelNameUpdate) SetFieldName(s string) *ModelNameUpdate
- func (mnu *ModelNameUpdate) SetNillableFieldName(s *string) *ModelNameUpdate
- func (mnu *ModelNameUpdate) SetUser(u *User) *ModelNameUpdate
- func (mnu *ModelNameUpdate) SetUserID(id int) *ModelNameUpdate
- func (mnu *ModelNameUpdate) Where(ps ...predicate.ModelName) *ModelNameUpdate
- type ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) ClearUser() *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) Exec(ctx context.Context) error
- func (mnuo *ModelNameUpdateOne) ExecX(ctx context.Context)
- func (mnuo *ModelNameUpdateOne) Mutation() *ModelNameMutation
- func (mnuo *ModelNameUpdateOne) Save(ctx context.Context) (*ModelName, error)
- func (mnuo *ModelNameUpdateOne) SaveX(ctx context.Context) *ModelName
- func (mnuo *ModelNameUpdateOne) Select(field string, fields ...string) *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) SetFieldName(s string) *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) SetNillableFieldName(s *string) *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) SetUser(u *User) *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) SetUserID(id int) *ModelNameUpdateOne
- func (mnuo *ModelNameUpdateOne) Where(ps ...predicate.ModelName) *ModelNameUpdateOne
- type ModelNames
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type PasswordToken
- type PasswordTokenClient
- func (c *PasswordTokenClient) Create() *PasswordTokenCreate
- func (c *PasswordTokenClient) CreateBulk(builders ...*PasswordTokenCreate) *PasswordTokenCreateBulk
- func (c *PasswordTokenClient) Delete() *PasswordTokenDelete
- func (c *PasswordTokenClient) DeleteOne(pt *PasswordToken) *PasswordTokenDeleteOne
- func (c *PasswordTokenClient) DeleteOneID(id int) *PasswordTokenDeleteOne
- func (c *PasswordTokenClient) Get(ctx context.Context, id int) (*PasswordToken, error)
- func (c *PasswordTokenClient) GetX(ctx context.Context, id int) *PasswordToken
- func (c *PasswordTokenClient) Hooks() []Hook
- func (c *PasswordTokenClient) Intercept(interceptors ...Interceptor)
- func (c *PasswordTokenClient) Interceptors() []Interceptor
- func (c *PasswordTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordTokenCreate, int)) *PasswordTokenCreateBulk
- func (c *PasswordTokenClient) Query() *PasswordTokenQuery
- func (c *PasswordTokenClient) QueryUser(pt *PasswordToken) *UserQuery
- func (c *PasswordTokenClient) Update() *PasswordTokenUpdate
- func (c *PasswordTokenClient) UpdateOne(pt *PasswordToken) *PasswordTokenUpdateOne
- func (c *PasswordTokenClient) UpdateOneID(id int) *PasswordTokenUpdateOne
- func (c *PasswordTokenClient) Use(hooks ...Hook)
- type PasswordTokenCreate
- func (ptc *PasswordTokenCreate) Exec(ctx context.Context) error
- func (ptc *PasswordTokenCreate) ExecX(ctx context.Context)
- func (ptc *PasswordTokenCreate) Mutation() *PasswordTokenMutation
- func (ptc *PasswordTokenCreate) Save(ctx context.Context) (*PasswordToken, error)
- func (ptc *PasswordTokenCreate) SaveX(ctx context.Context) *PasswordToken
- func (ptc *PasswordTokenCreate) SetCreatedAt(t time.Time) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetHash(s string) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetNillableCreatedAt(t *time.Time) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetUser(u *User) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetUserID(id int) *PasswordTokenCreate
- type PasswordTokenCreateBulk
- func (ptcb *PasswordTokenCreateBulk) Exec(ctx context.Context) error
- func (ptcb *PasswordTokenCreateBulk) ExecX(ctx context.Context)
- func (ptcb *PasswordTokenCreateBulk) Save(ctx context.Context) ([]*PasswordToken, error)
- func (ptcb *PasswordTokenCreateBulk) SaveX(ctx context.Context) []*PasswordToken
- type PasswordTokenDelete
- type PasswordTokenDeleteOne
- type PasswordTokenEdges
- type PasswordTokenGroupBy
- func (ptgb *PasswordTokenGroupBy) Aggregate(fns ...AggregateFunc) *PasswordTokenGroupBy
- func (s *PasswordTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PasswordTokenGroupBy) BoolX(ctx context.Context) bool
- func (s *PasswordTokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PasswordTokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PasswordTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PasswordTokenGroupBy) Float64X(ctx context.Context) float64
- func (s *PasswordTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PasswordTokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PasswordTokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PasswordTokenGroupBy) IntX(ctx context.Context) int
- func (s *PasswordTokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PasswordTokenGroupBy) IntsX(ctx context.Context) []int
- func (ptgb *PasswordTokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *PasswordTokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *PasswordTokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PasswordTokenGroupBy) StringX(ctx context.Context) string
- func (s *PasswordTokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PasswordTokenGroupBy) StringsX(ctx context.Context) []string
- type PasswordTokenMutation
- func (m *PasswordTokenMutation) AddField(name string, value ent.Value) error
- func (m *PasswordTokenMutation) AddedEdges() []string
- func (m *PasswordTokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *PasswordTokenMutation) AddedFields() []string
- func (m *PasswordTokenMutation) AddedIDs(name string) []ent.Value
- func (m *PasswordTokenMutation) ClearEdge(name string) error
- func (m *PasswordTokenMutation) ClearField(name string) error
- func (m *PasswordTokenMutation) ClearUser()
- func (m *PasswordTokenMutation) ClearedEdges() []string
- func (m *PasswordTokenMutation) ClearedFields() []string
- func (m PasswordTokenMutation) Client() *Client
- func (m *PasswordTokenMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PasswordTokenMutation) EdgeCleared(name string) bool
- func (m *PasswordTokenMutation) Field(name string) (ent.Value, bool)
- func (m *PasswordTokenMutation) FieldCleared(name string) bool
- func (m *PasswordTokenMutation) Fields() []string
- func (m *PasswordTokenMutation) Hash() (r string, exists bool)
- func (m *PasswordTokenMutation) ID() (id int, exists bool)
- func (m *PasswordTokenMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PasswordTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PasswordTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PasswordTokenMutation) OldHash(ctx context.Context) (v string, err error)
- func (m *PasswordTokenMutation) Op() Op
- func (m *PasswordTokenMutation) RemovedEdges() []string
- func (m *PasswordTokenMutation) RemovedIDs(name string) []ent.Value
- func (m *PasswordTokenMutation) ResetCreatedAt()
- func (m *PasswordTokenMutation) ResetEdge(name string) error
- func (m *PasswordTokenMutation) ResetField(name string) error
- func (m *PasswordTokenMutation) ResetHash()
- func (m *PasswordTokenMutation) ResetUser()
- func (m *PasswordTokenMutation) SetCreatedAt(t time.Time)
- func (m *PasswordTokenMutation) SetField(name string, value ent.Value) error
- func (m *PasswordTokenMutation) SetHash(s string)
- func (m *PasswordTokenMutation) SetOp(op Op)
- func (m *PasswordTokenMutation) SetUserID(id int)
- func (m PasswordTokenMutation) Tx() (*Tx, error)
- func (m *PasswordTokenMutation) Type() string
- func (m *PasswordTokenMutation) UserCleared() bool
- func (m *PasswordTokenMutation) UserID() (id int, exists bool)
- func (m *PasswordTokenMutation) UserIDs() (ids []int)
- func (m *PasswordTokenMutation) Where(ps ...predicate.PasswordToken)
- func (m *PasswordTokenMutation) WhereP(ps ...func(*sql.Selector))
- type PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
- func (ptq *PasswordTokenQuery) All(ctx context.Context) ([]*PasswordToken, error)
- func (ptq *PasswordTokenQuery) AllX(ctx context.Context) []*PasswordToken
- func (ptq *PasswordTokenQuery) Clone() *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Count(ctx context.Context) (int, error)
- func (ptq *PasswordTokenQuery) CountX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) Exist(ctx context.Context) (bool, error)
- func (ptq *PasswordTokenQuery) ExistX(ctx context.Context) bool
- func (ptq *PasswordTokenQuery) First(ctx context.Context) (*PasswordToken, error)
- func (ptq *PasswordTokenQuery) FirstID(ctx context.Context) (id int, err error)
- func (ptq *PasswordTokenQuery) FirstIDX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) FirstX(ctx context.Context) *PasswordToken
- func (ptq *PasswordTokenQuery) GroupBy(field string, fields ...string) *PasswordTokenGroupBy
- func (ptq *PasswordTokenQuery) IDs(ctx context.Context) (ids []int, err error)
- func (ptq *PasswordTokenQuery) IDsX(ctx context.Context) []int
- func (ptq *PasswordTokenQuery) Limit(limit int) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Offset(offset int) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Only(ctx context.Context) (*PasswordToken, error)
- func (ptq *PasswordTokenQuery) OnlyID(ctx context.Context) (id int, err error)
- func (ptq *PasswordTokenQuery) OnlyIDX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) OnlyX(ctx context.Context) *PasswordToken
- func (ptq *PasswordTokenQuery) Order(o ...passwordtoken.OrderOption) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) QueryUser() *UserQuery
- func (ptq *PasswordTokenQuery) Select(fields ...string) *PasswordTokenSelect
- func (ptq *PasswordTokenQuery) Unique(unique bool) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Where(ps ...predicate.PasswordToken) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) WithUser(opts ...func(*UserQuery)) *PasswordTokenQuery
- type PasswordTokenSelect
- func (pts *PasswordTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
- func (s *PasswordTokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PasswordTokenSelect) BoolX(ctx context.Context) bool
- func (s *PasswordTokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PasswordTokenSelect) BoolsX(ctx context.Context) []bool
- func (s *PasswordTokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PasswordTokenSelect) Float64X(ctx context.Context) float64
- func (s *PasswordTokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PasswordTokenSelect) Float64sX(ctx context.Context) []float64
- func (s *PasswordTokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PasswordTokenSelect) IntX(ctx context.Context) int
- func (s *PasswordTokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PasswordTokenSelect) IntsX(ctx context.Context) []int
- func (pts *PasswordTokenSelect) Scan(ctx context.Context, v any) error
- func (s *PasswordTokenSelect) ScanX(ctx context.Context, v any)
- func (s *PasswordTokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *PasswordTokenSelect) StringX(ctx context.Context) string
- func (s *PasswordTokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PasswordTokenSelect) StringsX(ctx context.Context) []string
- type PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) ClearUser() *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) Exec(ctx context.Context) error
- func (ptu *PasswordTokenUpdate) ExecX(ctx context.Context)
- func (ptu *PasswordTokenUpdate) Mutation() *PasswordTokenMutation
- func (ptu *PasswordTokenUpdate) Save(ctx context.Context) (int, error)
- func (ptu *PasswordTokenUpdate) SaveX(ctx context.Context) int
- func (ptu *PasswordTokenUpdate) SetCreatedAt(t time.Time) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetHash(s string) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetNillableHash(s *string) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetUser(u *User) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetUserID(id int) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdate
- type PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) ClearUser() *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) Exec(ctx context.Context) error
- func (ptuo *PasswordTokenUpdateOne) ExecX(ctx context.Context)
- func (ptuo *PasswordTokenUpdateOne) Mutation() *PasswordTokenMutation
- func (ptuo *PasswordTokenUpdateOne) Save(ctx context.Context) (*PasswordToken, error)
- func (ptuo *PasswordTokenUpdateOne) SaveX(ctx context.Context) *PasswordToken
- func (ptuo *PasswordTokenUpdateOne) Select(field string, fields ...string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetCreatedAt(t time.Time) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetHash(s string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetNillableHash(s *string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetUser(u *User) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetUserID(id int) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdateOne
- type PasswordTokens
- type Policy
- type Price
- type PriceClient
- func (c *PriceClient) Create() *PriceCreate
- func (c *PriceClient) CreateBulk(builders ...*PriceCreate) *PriceCreateBulk
- func (c *PriceClient) Delete() *PriceDelete
- func (c *PriceClient) DeleteOne(pr *Price) *PriceDeleteOne
- func (c *PriceClient) DeleteOneID(id int) *PriceDeleteOne
- func (c *PriceClient) Get(ctx context.Context, id int) (*Price, error)
- func (c *PriceClient) GetX(ctx context.Context, id int) *Price
- func (c *PriceClient) Hooks() []Hook
- func (c *PriceClient) Intercept(interceptors ...Interceptor)
- func (c *PriceClient) Interceptors() []Interceptor
- func (c *PriceClient) MapCreateBulk(slice any, setFunc func(*PriceCreate, int)) *PriceCreateBulk
- func (c *PriceClient) Query() *PriceQuery
- func (c *PriceClient) QueryProduct(pr *Price) *ProductQuery
- func (c *PriceClient) QueryUser(pr *Price) *UserQuery
- func (c *PriceClient) Update() *PriceUpdate
- func (c *PriceClient) UpdateOne(pr *Price) *PriceUpdateOne
- func (c *PriceClient) UpdateOneID(id int) *PriceUpdateOne
- func (c *PriceClient) Use(hooks ...Hook)
- type PriceCreate
- func (pc *PriceCreate) Exec(ctx context.Context) error
- func (pc *PriceCreate) ExecX(ctx context.Context)
- func (pc *PriceCreate) Mutation() *PriceMutation
- func (pc *PriceCreate) Save(ctx context.Context) (*Price, error)
- func (pc *PriceCreate) SaveX(ctx context.Context) *Price
- func (pc *PriceCreate) SetAmount(i int) *PriceCreate
- func (pc *PriceCreate) SetCreatedAt(t time.Time) *PriceCreate
- func (pc *PriceCreate) SetNillableCreatedAt(t *time.Time) *PriceCreate
- func (pc *PriceCreate) SetNillableType(pr *price.Type) *PriceCreate
- func (pc *PriceCreate) SetProduct(p *Product) *PriceCreate
- func (pc *PriceCreate) SetProductID(id int) *PriceCreate
- func (pc *PriceCreate) SetQuantity(i int) *PriceCreate
- func (pc *PriceCreate) SetStripeID(s string) *PriceCreate
- func (pc *PriceCreate) SetType(pr price.Type) *PriceCreate
- func (pc *PriceCreate) SetUser(u *User) *PriceCreate
- func (pc *PriceCreate) SetUserID(id int) *PriceCreate
- type PriceCreateBulk
- type PriceDelete
- type PriceDeleteOne
- type PriceEdges
- type PriceGroupBy
- func (pgb *PriceGroupBy) Aggregate(fns ...AggregateFunc) *PriceGroupBy
- func (s *PriceGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PriceGroupBy) BoolX(ctx context.Context) bool
- func (s *PriceGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PriceGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PriceGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PriceGroupBy) Float64X(ctx context.Context) float64
- func (s *PriceGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PriceGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PriceGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PriceGroupBy) IntX(ctx context.Context) int
- func (s *PriceGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PriceGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PriceGroupBy) Scan(ctx context.Context, v any) error
- func (s *PriceGroupBy) ScanX(ctx context.Context, v any)
- func (s *PriceGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PriceGroupBy) StringX(ctx context.Context) string
- func (s *PriceGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PriceGroupBy) StringsX(ctx context.Context) []string
- type PriceMutation
- func (m *PriceMutation) AddAmount(i int)
- func (m *PriceMutation) AddField(name string, value ent.Value) error
- func (m *PriceMutation) AddQuantity(i int)
- func (m *PriceMutation) AddedAmount() (r int, exists bool)
- func (m *PriceMutation) AddedEdges() []string
- func (m *PriceMutation) AddedField(name string) (ent.Value, bool)
- func (m *PriceMutation) AddedFields() []string
- func (m *PriceMutation) AddedIDs(name string) []ent.Value
- func (m *PriceMutation) AddedQuantity() (r int, exists bool)
- func (m *PriceMutation) Amount() (r int, exists bool)
- func (m *PriceMutation) ClearEdge(name string) error
- func (m *PriceMutation) ClearField(name string) error
- func (m *PriceMutation) ClearProduct()
- func (m *PriceMutation) ClearUser()
- func (m *PriceMutation) ClearedEdges() []string
- func (m *PriceMutation) ClearedFields() []string
- func (m PriceMutation) Client() *Client
- func (m *PriceMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PriceMutation) EdgeCleared(name string) bool
- func (m *PriceMutation) Field(name string) (ent.Value, bool)
- func (m *PriceMutation) FieldCleared(name string) bool
- func (m *PriceMutation) Fields() []string
- func (m *PriceMutation) GetType() (r price.Type, exists bool)
- func (m *PriceMutation) ID() (id int, exists bool)
- func (m *PriceMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PriceMutation) OldAmount(ctx context.Context) (v int, err error)
- func (m *PriceMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PriceMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PriceMutation) OldQuantity(ctx context.Context) (v int, err error)
- func (m *PriceMutation) OldStripeID(ctx context.Context) (v string, err error)
- func (m *PriceMutation) OldType(ctx context.Context) (v price.Type, err error)
- func (m *PriceMutation) Op() Op
- func (m *PriceMutation) ProductCleared() bool
- func (m *PriceMutation) ProductID() (id int, exists bool)
- func (m *PriceMutation) ProductIDs() (ids []int)
- func (m *PriceMutation) Quantity() (r int, exists bool)
- func (m *PriceMutation) RemovedEdges() []string
- func (m *PriceMutation) RemovedIDs(name string) []ent.Value
- func (m *PriceMutation) ResetAmount()
- func (m *PriceMutation) ResetCreatedAt()
- func (m *PriceMutation) ResetEdge(name string) error
- func (m *PriceMutation) ResetField(name string) error
- func (m *PriceMutation) ResetProduct()
- func (m *PriceMutation) ResetQuantity()
- func (m *PriceMutation) ResetStripeID()
- func (m *PriceMutation) ResetType()
- func (m *PriceMutation) ResetUser()
- func (m *PriceMutation) SetAmount(i int)
- func (m *PriceMutation) SetCreatedAt(t time.Time)
- func (m *PriceMutation) SetField(name string, value ent.Value) error
- func (m *PriceMutation) SetOp(op Op)
- func (m *PriceMutation) SetProductID(id int)
- func (m *PriceMutation) SetQuantity(i int)
- func (m *PriceMutation) SetStripeID(s string)
- func (m *PriceMutation) SetType(pr price.Type)
- func (m *PriceMutation) SetUserID(id int)
- func (m *PriceMutation) StripeID() (r string, exists bool)
- func (m PriceMutation) Tx() (*Tx, error)
- func (m *PriceMutation) Type() string
- func (m *PriceMutation) UserCleared() bool
- func (m *PriceMutation) UserID() (id int, exists bool)
- func (m *PriceMutation) UserIDs() (ids []int)
- func (m *PriceMutation) Where(ps ...predicate.Price)
- func (m *PriceMutation) WhereP(ps ...func(*sql.Selector))
- type PriceQuery
- func (pq *PriceQuery) Aggregate(fns ...AggregateFunc) *PriceSelect
- func (pq *PriceQuery) All(ctx context.Context) ([]*Price, error)
- func (pq *PriceQuery) AllX(ctx context.Context) []*Price
- func (pq *PriceQuery) Clone() *PriceQuery
- func (pq *PriceQuery) Count(ctx context.Context) (int, error)
- func (pq *PriceQuery) CountX(ctx context.Context) int
- func (pq *PriceQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PriceQuery) ExistX(ctx context.Context) bool
- func (pq *PriceQuery) First(ctx context.Context) (*Price, error)
- func (pq *PriceQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PriceQuery) FirstIDX(ctx context.Context) int
- func (pq *PriceQuery) FirstX(ctx context.Context) *Price
- func (pq *PriceQuery) GroupBy(field string, fields ...string) *PriceGroupBy
- func (pq *PriceQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *PriceQuery) IDsX(ctx context.Context) []int
- func (pq *PriceQuery) Limit(limit int) *PriceQuery
- func (pq *PriceQuery) Offset(offset int) *PriceQuery
- func (pq *PriceQuery) Only(ctx context.Context) (*Price, error)
- func (pq *PriceQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PriceQuery) OnlyIDX(ctx context.Context) int
- func (pq *PriceQuery) OnlyX(ctx context.Context) *Price
- func (pq *PriceQuery) Order(o ...price.OrderOption) *PriceQuery
- func (pq *PriceQuery) QueryProduct() *ProductQuery
- func (pq *PriceQuery) QueryUser() *UserQuery
- func (pq *PriceQuery) Select(fields ...string) *PriceSelect
- func (pq *PriceQuery) Unique(unique bool) *PriceQuery
- func (pq *PriceQuery) Where(ps ...predicate.Price) *PriceQuery
- func (pq *PriceQuery) WithProduct(opts ...func(*ProductQuery)) *PriceQuery
- func (pq *PriceQuery) WithUser(opts ...func(*UserQuery)) *PriceQuery
- type PriceSelect
- func (ps *PriceSelect) Aggregate(fns ...AggregateFunc) *PriceSelect
- func (s *PriceSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PriceSelect) BoolX(ctx context.Context) bool
- func (s *PriceSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PriceSelect) BoolsX(ctx context.Context) []bool
- func (s *PriceSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PriceSelect) Float64X(ctx context.Context) float64
- func (s *PriceSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PriceSelect) Float64sX(ctx context.Context) []float64
- func (s *PriceSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PriceSelect) IntX(ctx context.Context) int
- func (s *PriceSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PriceSelect) IntsX(ctx context.Context) []int
- func (ps *PriceSelect) Scan(ctx context.Context, v any) error
- func (s *PriceSelect) ScanX(ctx context.Context, v any)
- func (s *PriceSelect) String(ctx context.Context) (_ string, err error)
- func (s *PriceSelect) StringX(ctx context.Context) string
- func (s *PriceSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PriceSelect) StringsX(ctx context.Context) []string
- type PriceUpdate
- func (pu *PriceUpdate) AddAmount(i int) *PriceUpdate
- func (pu *PriceUpdate) AddQuantity(i int) *PriceUpdate
- func (pu *PriceUpdate) ClearProduct() *PriceUpdate
- func (pu *PriceUpdate) ClearUser() *PriceUpdate
- func (pu *PriceUpdate) Exec(ctx context.Context) error
- func (pu *PriceUpdate) ExecX(ctx context.Context)
- func (pu *PriceUpdate) Mutation() *PriceMutation
- func (pu *PriceUpdate) Save(ctx context.Context) (int, error)
- func (pu *PriceUpdate) SaveX(ctx context.Context) int
- func (pu *PriceUpdate) SetAmount(i int) *PriceUpdate
- func (pu *PriceUpdate) SetNillableAmount(i *int) *PriceUpdate
- func (pu *PriceUpdate) SetNillableQuantity(i *int) *PriceUpdate
- func (pu *PriceUpdate) SetNillableStripeID(s *string) *PriceUpdate
- func (pu *PriceUpdate) SetNillableType(pr *price.Type) *PriceUpdate
- func (pu *PriceUpdate) SetProduct(p *Product) *PriceUpdate
- func (pu *PriceUpdate) SetProductID(id int) *PriceUpdate
- func (pu *PriceUpdate) SetQuantity(i int) *PriceUpdate
- func (pu *PriceUpdate) SetStripeID(s string) *PriceUpdate
- func (pu *PriceUpdate) SetType(pr price.Type) *PriceUpdate
- func (pu *PriceUpdate) SetUser(u *User) *PriceUpdate
- func (pu *PriceUpdate) SetUserID(id int) *PriceUpdate
- func (pu *PriceUpdate) Where(ps ...predicate.Price) *PriceUpdate
- type PriceUpdateOne
- func (puo *PriceUpdateOne) AddAmount(i int) *PriceUpdateOne
- func (puo *PriceUpdateOne) AddQuantity(i int) *PriceUpdateOne
- func (puo *PriceUpdateOne) ClearProduct() *PriceUpdateOne
- func (puo *PriceUpdateOne) ClearUser() *PriceUpdateOne
- func (puo *PriceUpdateOne) Exec(ctx context.Context) error
- func (puo *PriceUpdateOne) ExecX(ctx context.Context)
- func (puo *PriceUpdateOne) Mutation() *PriceMutation
- func (puo *PriceUpdateOne) Save(ctx context.Context) (*Price, error)
- func (puo *PriceUpdateOne) SaveX(ctx context.Context) *Price
- func (puo *PriceUpdateOne) Select(field string, fields ...string) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetAmount(i int) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetNillableAmount(i *int) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetNillableQuantity(i *int) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetNillableStripeID(s *string) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetNillableType(pr *price.Type) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetProduct(p *Product) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetProductID(id int) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetQuantity(i int) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetStripeID(s string) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetType(pr price.Type) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetUser(u *User) *PriceUpdateOne
- func (puo *PriceUpdateOne) SetUserID(id int) *PriceUpdateOne
- func (puo *PriceUpdateOne) Where(ps ...predicate.Price) *PriceUpdateOne
- type Prices
- type Product
- type ProductClient
- func (c *ProductClient) Create() *ProductCreate
- func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk
- func (c *ProductClient) Delete() *ProductDelete
- func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne
- func (c *ProductClient) DeleteOneID(id int) *ProductDeleteOne
- func (c *ProductClient) Get(ctx context.Context, id int) (*Product, error)
- func (c *ProductClient) GetX(ctx context.Context, id int) *Product
- func (c *ProductClient) Hooks() []Hook
- func (c *ProductClient) Intercept(interceptors ...Interceptor)
- func (c *ProductClient) Interceptors() []Interceptor
- func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk
- func (c *ProductClient) Query() *ProductQuery
- func (c *ProductClient) QueryPrices(pr *Product) *PriceQuery
- func (c *ProductClient) QueryUser(pr *Product) *UserQuery
- func (c *ProductClient) Update() *ProductUpdate
- func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne
- func (c *ProductClient) UpdateOneID(id int) *ProductUpdateOne
- func (c *ProductClient) Use(hooks ...Hook)
- type ProductCreate
- func (pc *ProductCreate) AddPriceIDs(ids ...int) *ProductCreate
- func (pc *ProductCreate) AddPrices(p ...*Price) *ProductCreate
- func (pc *ProductCreate) Exec(ctx context.Context) error
- func (pc *ProductCreate) ExecX(ctx context.Context)
- func (pc *ProductCreate) Mutation() *ProductMutation
- func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)
- func (pc *ProductCreate) SaveX(ctx context.Context) *Product
- func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate
- func (pc *ProductCreate) SetName(s string) *ProductCreate
- func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate
- func (pc *ProductCreate) SetStripeID(s string) *ProductCreate
- func (pc *ProductCreate) SetUser(u *User) *ProductCreate
- func (pc *ProductCreate) SetUserID(id int) *ProductCreate
- type ProductCreateBulk
- type ProductDelete
- type ProductDeleteOne
- type ProductEdges
- type ProductGroupBy
- func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy
- func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductGroupBy) BoolX(ctx context.Context) bool
- func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductGroupBy) Float64X(ctx context.Context) float64
- func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProductGroupBy) IntX(ctx context.Context) int
- func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProductGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProductGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProductGroupBy) StringX(ctx context.Context) string
- func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProductGroupBy) StringsX(ctx context.Context) []string
- type ProductMutation
- func (m *ProductMutation) AddField(name string, value ent.Value) error
- func (m *ProductMutation) AddPriceIDs(ids ...int)
- func (m *ProductMutation) AddedEdges() []string
- func (m *ProductMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProductMutation) AddedFields() []string
- func (m *ProductMutation) AddedIDs(name string) []ent.Value
- func (m *ProductMutation) ClearEdge(name string) error
- func (m *ProductMutation) ClearField(name string) error
- func (m *ProductMutation) ClearPrices()
- func (m *ProductMutation) ClearUser()
- func (m *ProductMutation) ClearedEdges() []string
- func (m *ProductMutation) ClearedFields() []string
- func (m ProductMutation) Client() *Client
- func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProductMutation) EdgeCleared(name string) bool
- func (m *ProductMutation) Field(name string) (ent.Value, bool)
- func (m *ProductMutation) FieldCleared(name string) bool
- func (m *ProductMutation) Fields() []string
- func (m *ProductMutation) ID() (id int, exists bool)
- func (m *ProductMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProductMutation) Name() (r string, exists bool)
- func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProductMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProductMutation) OldStripeID(ctx context.Context) (v string, err error)
- func (m *ProductMutation) Op() Op
- func (m *ProductMutation) PricesCleared() bool
- func (m *ProductMutation) PricesIDs() (ids []int)
- func (m *ProductMutation) RemovePriceIDs(ids ...int)
- func (m *ProductMutation) RemovedEdges() []string
- func (m *ProductMutation) RemovedIDs(name string) []ent.Value
- func (m *ProductMutation) RemovedPricesIDs() (ids []int)
- func (m *ProductMutation) ResetCreatedAt()
- func (m *ProductMutation) ResetEdge(name string) error
- func (m *ProductMutation) ResetField(name string) error
- func (m *ProductMutation) ResetName()
- func (m *ProductMutation) ResetPrices()
- func (m *ProductMutation) ResetStripeID()
- func (m *ProductMutation) ResetUser()
- func (m *ProductMutation) SetCreatedAt(t time.Time)
- func (m *ProductMutation) SetField(name string, value ent.Value) error
- func (m *ProductMutation) SetName(s string)
- func (m *ProductMutation) SetOp(op Op)
- func (m *ProductMutation) SetStripeID(s string)
- func (m *ProductMutation) SetUserID(id int)
- func (m *ProductMutation) StripeID() (r string, exists bool)
- func (m ProductMutation) Tx() (*Tx, error)
- func (m *ProductMutation) Type() string
- func (m *ProductMutation) UserCleared() bool
- func (m *ProductMutation) UserID() (id int, exists bool)
- func (m *ProductMutation) UserIDs() (ids []int)
- func (m *ProductMutation) Where(ps ...predicate.Product)
- func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))
- type ProductQuery
- func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect
- func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)
- func (pq *ProductQuery) AllX(ctx context.Context) []*Product
- func (pq *ProductQuery) Clone() *ProductQuery
- func (pq *ProductQuery) Count(ctx context.Context) (int, error)
- func (pq *ProductQuery) CountX(ctx context.Context) int
- func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProductQuery) ExistX(ctx context.Context) bool
- func (pq *ProductQuery) First(ctx context.Context) (*Product, error)
- func (pq *ProductQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *ProductQuery) FirstIDX(ctx context.Context) int
- func (pq *ProductQuery) FirstX(ctx context.Context) *Product
- func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy
- func (pq *ProductQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *ProductQuery) IDsX(ctx context.Context) []int
- func (pq *ProductQuery) Limit(limit int) *ProductQuery
- func (pq *ProductQuery) Offset(offset int) *ProductQuery
- func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)
- func (pq *ProductQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *ProductQuery) OnlyIDX(ctx context.Context) int
- func (pq *ProductQuery) OnlyX(ctx context.Context) *Product
- func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery
- func (pq *ProductQuery) QueryPrices() *PriceQuery
- func (pq *ProductQuery) QueryUser() *UserQuery
- func (pq *ProductQuery) Select(fields ...string) *ProductSelect
- func (pq *ProductQuery) Unique(unique bool) *ProductQuery
- func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery
- func (pq *ProductQuery) WithPrices(opts ...func(*PriceQuery)) *ProductQuery
- func (pq *ProductQuery) WithUser(opts ...func(*UserQuery)) *ProductQuery
- type ProductSelect
- func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect
- func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductSelect) BoolX(ctx context.Context) bool
- func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductSelect) BoolsX(ctx context.Context) []bool
- func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductSelect) Float64X(ctx context.Context) float64
- func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductSelect) Float64sX(ctx context.Context) []float64
- func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProductSelect) IntX(ctx context.Context) int
- func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProductSelect) IntsX(ctx context.Context) []int
- func (ps *ProductSelect) Scan(ctx context.Context, v any) error
- func (s *ProductSelect) ScanX(ctx context.Context, v any)
- func (s *ProductSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProductSelect) StringX(ctx context.Context) string
- func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProductSelect) StringsX(ctx context.Context) []string
- type ProductUpdate
- func (pu *ProductUpdate) AddPriceIDs(ids ...int) *ProductUpdate
- func (pu *ProductUpdate) AddPrices(p ...*Price) *ProductUpdate
- func (pu *ProductUpdate) ClearPrices() *ProductUpdate
- func (pu *ProductUpdate) ClearUser() *ProductUpdate
- func (pu *ProductUpdate) Exec(ctx context.Context) error
- func (pu *ProductUpdate) ExecX(ctx context.Context)
- func (pu *ProductUpdate) Mutation() *ProductMutation
- func (pu *ProductUpdate) RemovePriceIDs(ids ...int) *ProductUpdate
- func (pu *ProductUpdate) RemovePrices(p ...*Price) *ProductUpdate
- func (pu *ProductUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProductUpdate) SaveX(ctx context.Context) int
- func (pu *ProductUpdate) SetName(s string) *ProductUpdate
- func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate
- func (pu *ProductUpdate) SetNillableStripeID(s *string) *ProductUpdate
- func (pu *ProductUpdate) SetStripeID(s string) *ProductUpdate
- func (pu *ProductUpdate) SetUser(u *User) *ProductUpdate
- func (pu *ProductUpdate) SetUserID(id int) *ProductUpdate
- func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate
- type ProductUpdateOne
- func (puo *ProductUpdateOne) AddPriceIDs(ids ...int) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddPrices(p ...*Price) *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearPrices() *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearUser() *ProductUpdateOne
- func (puo *ProductUpdateOne) Exec(ctx context.Context) error
- func (puo *ProductUpdateOne) ExecX(ctx context.Context)
- func (puo *ProductUpdateOne) Mutation() *ProductMutation
- func (puo *ProductUpdateOne) RemovePriceIDs(ids ...int) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemovePrices(p ...*Price) *ProductUpdateOne
- func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)
- func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product
- func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableStripeID(s *string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetStripeID(s string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetUser(u *User) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetUserID(id int) *ProductUpdateOne
- func (puo *ProductUpdateOne) Where(ps ...predicate.Product) *ProductUpdateOne
- type Products
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryAIs() *AIQuery
- func (u *User) QueryModelNames() *ModelNameQuery
- func (u *User) QueryOwner() *PasswordTokenQuery
- func (u *User) QueryPrices() *PriceQuery
- func (u *User) QueryProducts() *ProductQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) 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) QueryAIs(u *User) *AIQuery
- func (c *UserClient) QueryModelNames(u *User) *ModelNameQuery
- func (c *UserClient) QueryOwner(u *User) *PasswordTokenQuery
- func (c *UserClient) QueryPrices(u *User) *PriceQuery
- func (c *UserClient) QueryProducts(u *User) *ProductQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddAIIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddAIs(a ...*AI) *UserCreate
- func (uc *UserCreate) AddModelNameIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddModelNames(m ...*ModelName) *UserCreate
- func (uc *UserCreate) AddOwner(p ...*PasswordToken) *UserCreate
- func (uc *UserCreate) AddOwnerIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddPriceIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddPrices(p ...*Price) *UserCreate
- func (uc *UserCreate) AddProductIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddProducts(p ...*Product) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableRole(u *user.Role) *UserCreate
- func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetRole(u user.Role) *UserCreate
- func (uc *UserCreate) SetVerified(b bool) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *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 (ugb *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) AIsCleared() bool
- func (m *UserMutation) AIsIDs() (ids []int)
- func (m *UserMutation) AddAIIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddModelNameIDs(ids ...int)
- func (m *UserMutation) AddOwnerIDs(ids ...int)
- func (m *UserMutation) AddPriceIDs(ids ...int)
- func (m *UserMutation) AddProductIDs(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) ClearAIs()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearModelNames()
- func (m *UserMutation) ClearOwner()
- func (m *UserMutation) ClearPrices()
- func (m *UserMutation) ClearProducts()
- 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) ModelNamesCleared() bool
- func (m *UserMutation) ModelNamesIDs() (ids []int)
- func (m *UserMutation) Name() (r string, exists bool)
- 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) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)
- func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OwnerCleared() bool
- func (m *UserMutation) OwnerIDs() (ids []int)
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) PricesCleared() bool
- func (m *UserMutation) PricesIDs() (ids []int)
- func (m *UserMutation) ProductsCleared() bool
- func (m *UserMutation) ProductsIDs() (ids []int)
- func (m *UserMutation) RemoveAIIDs(ids ...int)
- func (m *UserMutation) RemoveModelNameIDs(ids ...int)
- func (m *UserMutation) RemoveOwnerIDs(ids ...int)
- func (m *UserMutation) RemovePriceIDs(ids ...int)
- func (m *UserMutation) RemoveProductIDs(ids ...int)
- func (m *UserMutation) RemovedAIsIDs() (ids []int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedModelNamesIDs() (ids []int)
- func (m *UserMutation) RemovedOwnerIDs() (ids []int)
- func (m *UserMutation) RemovedPricesIDs() (ids []int)
- func (m *UserMutation) RemovedProductsIDs() (ids []int)
- func (m *UserMutation) ResetAIs()
- 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) ResetModelNames()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetOwner()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetPrices()
- func (m *UserMutation) ResetProducts()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetVerified()
- func (m *UserMutation) Role() (r user.Role, 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) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetRole(u user.Role)
- func (m *UserMutation) SetVerified(b bool)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Verified() (r bool, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryAIs() *AIQuery
- func (uq *UserQuery) QueryModelNames() *ModelNameQuery
- func (uq *UserQuery) QueryOwner() *PasswordTokenQuery
- func (uq *UserQuery) QueryPrices() *PriceQuery
- func (uq *UserQuery) QueryProducts() *ProductQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAIs(opts ...func(*AIQuery)) *UserQuery
- func (uq *UserQuery) WithModelNames(opts ...func(*ModelNameQuery)) *UserQuery
- func (uq *UserQuery) WithOwner(opts ...func(*PasswordTokenQuery)) *UserQuery
- func (uq *UserQuery) WithPrices(opts ...func(*PriceQuery)) *UserQuery
- func (uq *UserQuery) WithProducts(opts ...func(*ProductQuery)) *UserQuery
- type UserSelect
- func (us *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 (us *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 (uu *UserUpdate) AddAIIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddAIs(a ...*AI) *UserUpdate
- func (uu *UserUpdate) AddModelNameIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddModelNames(m ...*ModelName) *UserUpdate
- func (uu *UserUpdate) AddOwner(p ...*PasswordToken) *UserUpdate
- func (uu *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddPriceIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddPrices(p ...*Price) *UserUpdate
- func (uu *UserUpdate) AddProductIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddProducts(p ...*Product) *UserUpdate
- func (uu *UserUpdate) ClearAIs() *UserUpdate
- func (uu *UserUpdate) ClearModelNames() *UserUpdate
- func (uu *UserUpdate) ClearOwner() *UserUpdate
- func (uu *UserUpdate) ClearPrices() *UserUpdate
- func (uu *UserUpdate) ClearProducts() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveAIIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveAIs(a ...*AI) *UserUpdate
- func (uu *UserUpdate) RemoveModelNameIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveModelNames(m ...*ModelName) *UserUpdate
- func (uu *UserUpdate) RemoveOwner(p ...*PasswordToken) *UserUpdate
- func (uu *UserUpdate) RemoveOwnerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemovePriceIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemovePrices(p ...*Price) *UserUpdate
- func (uu *UserUpdate) RemoveProductIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveProducts(p ...*Product) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate
- func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate
- func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAIIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAIs(a ...*AI) *UserUpdateOne
- func (uuo *UserUpdateOne) AddModelNameIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddModelNames(m ...*ModelName) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOwner(p ...*PasswordToken) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPriceIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPrices(p ...*Price) *UserUpdateOne
- func (uuo *UserUpdateOne) AddProductIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddProducts(p ...*Product) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAIs() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearModelNames() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearOwner() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPrices() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearProducts() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveAIIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveAIs(a ...*AI) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveModelNameIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveModelNames(m ...*ModelName) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOwner(p ...*PasswordToken) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOwnerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePriceIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePrices(p ...*Price) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveProductIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveProducts(p ...*Product) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne
- func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
- func (uuo *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. TypeAI = "AI" TypeModelName = "ModelName" TypePasswordToken = "PasswordToken" TypePrice = "Price" TypeProduct = "Product" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: 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 AI ¶
type AI struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// AiClientName holds the value of the "ai_client_name" field.
AiClientName string `json:"ai_client_name,omitempty"`
// Prompt holds the value of the "prompt" field.
Prompt string `json:"prompt,omitempty"`
// Status holds the value of the "status" field.
Status ai.Status `json:"status,omitempty"`
// Result holds the value of the "result" field.
Result []byte `json:"result,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// CompletedAt holds the value of the "completed_at" field.
CompletedAt time.Time `json:"completed_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the AIQuery when eager-loading is set.
Edges AIEdges `json:"edges"`
// contains filtered or unexported fields
}
AI is the model entity for the AI schema.
func (*AI) Unwrap ¶
Unwrap unwraps the AI 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 (*AI) Update ¶
func (a *AI) Update() *AIUpdateOne
Update returns a builder for updating this AI. Note that you need to call AI.Unwrap() before calling this method if this AI was returned from a transaction, and the transaction was committed or rolled back.
type AIClient ¶
type AIClient struct {
// contains filtered or unexported fields
}
AIClient is a client for the AI schema.
func NewAIClient ¶
func NewAIClient(c config) *AIClient
NewAIClient returns a client for the AI from the given config.
func (*AIClient) CreateBulk ¶
func (c *AIClient) CreateBulk(builders ...*AICreate) *AICreateBulk
CreateBulk returns a builder for creating a bulk of AI entities.
func (*AIClient) DeleteOne ¶
func (c *AIClient) DeleteOne(a *AI) *AIDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AIClient) DeleteOneID ¶
func (c *AIClient) DeleteOneID(id int) *AIDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AIClient) Intercept ¶
func (c *AIClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ai.Intercept(f(g(h())))`.
func (*AIClient) Interceptors ¶
func (c *AIClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AIClient) MapCreateBulk ¶
func (c *AIClient) MapCreateBulk(slice any, setFunc func(*AICreate, int)) *AICreateBulk
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 (*AIClient) UpdateOne ¶
func (c *AIClient) UpdateOne(a *AI) *AIUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AIClient) UpdateOneID ¶
func (c *AIClient) UpdateOneID(id int) *AIUpdateOne
UpdateOneID returns an update builder for the given id.
type AICreate ¶
type AICreate struct {
// contains filtered or unexported fields
}
AICreate is the builder for creating a AI entity.
func (*AICreate) Mutation ¶
func (ac *AICreate) Mutation() *AIMutation
Mutation returns the AIMutation object of the builder.
func (*AICreate) SetAiClientName ¶
SetAiClientName sets the "ai_client_name" field.
func (*AICreate) SetCompletedAt ¶
SetCompletedAt sets the "completed_at" field.
func (*AICreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*AICreate) SetNillableCompletedAt ¶
SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.
func (*AICreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AICreate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
type AICreateBulk ¶
type AICreateBulk struct {
// contains filtered or unexported fields
}
AICreateBulk is the builder for creating many AI entities in bulk.
func (*AICreateBulk) Exec ¶
func (acb *AICreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AICreateBulk) ExecX ¶
func (acb *AICreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AIDelete ¶
type AIDelete struct {
// contains filtered or unexported fields
}
AIDelete is the builder for deleting a AI entity.
func (*AIDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type AIDeleteOne ¶
type AIDeleteOne struct {
// contains filtered or unexported fields
}
AIDeleteOne is the builder for deleting a single AI entity.
func (*AIDeleteOne) Exec ¶
func (ado *AIDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AIDeleteOne) ExecX ¶
func (ado *AIDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AIDeleteOne) Where ¶
func (ado *AIDeleteOne) Where(ps ...predicate.AI) *AIDeleteOne
Where appends a list predicates to the AIDelete builder.
type AIEdges ¶
type AIEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
AIEdges holds the relations/edges for other nodes in the graph.
type AIGroupBy ¶
type AIGroupBy struct {
// contains filtered or unexported fields
}
AIGroupBy is the group-by builder for AI entities.
func (*AIGroupBy) Aggregate ¶
func (agb *AIGroupBy) Aggregate(fns ...AggregateFunc) *AIGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AIGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AIGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AIMutation ¶
type AIMutation struct {
// contains filtered or unexported fields
}
AIMutation represents an operation that mutates the AI nodes in the graph.
func (*AIMutation) AddField ¶
func (m *AIMutation) 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 (*AIMutation) AddedEdges ¶
func (m *AIMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AIMutation) AddedField ¶
func (m *AIMutation) 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 (*AIMutation) AddedFields ¶
func (m *AIMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AIMutation) AddedIDs ¶
func (m *AIMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AIMutation) AiClientName ¶
func (m *AIMutation) AiClientName() (r string, exists bool)
AiClientName returns the value of the "ai_client_name" field in the mutation.
func (*AIMutation) ClearCompletedAt ¶
func (m *AIMutation) ClearCompletedAt()
ClearCompletedAt clears the value of the "completed_at" field.
func (*AIMutation) ClearEdge ¶
func (m *AIMutation) 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 (*AIMutation) ClearField ¶
func (m *AIMutation) 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 (*AIMutation) ClearUser ¶
func (m *AIMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*AIMutation) ClearedEdges ¶
func (m *AIMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AIMutation) ClearedFields ¶
func (m *AIMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AIMutation) Client ¶
func (m AIMutation) 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 (*AIMutation) CompletedAt ¶
func (m *AIMutation) CompletedAt() (r time.Time, exists bool)
CompletedAt returns the value of the "completed_at" field in the mutation.
func (*AIMutation) CompletedAtCleared ¶
func (m *AIMutation) CompletedAtCleared() bool
CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.
func (*AIMutation) CreatedAt ¶
func (m *AIMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AIMutation) EdgeCleared ¶
func (m *AIMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AIMutation) Field ¶
func (m *AIMutation) 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 (*AIMutation) FieldCleared ¶
func (m *AIMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AIMutation) Fields ¶
func (m *AIMutation) 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 (*AIMutation) ID ¶
func (m *AIMutation) 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 (*AIMutation) IDs ¶
func (m *AIMutation) 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 (*AIMutation) OldAiClientName ¶
func (m *AIMutation) OldAiClientName(ctx context.Context) (v string, err error)
OldAiClientName returns the old "ai_client_name" field's value of the AI entity. If the AI 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 (*AIMutation) OldCompletedAt ¶
OldCompletedAt returns the old "completed_at" field's value of the AI entity. If the AI 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 (*AIMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the AI entity. If the AI 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 (*AIMutation) 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 (*AIMutation) OldPrompt ¶
func (m *AIMutation) OldPrompt(ctx context.Context) (v string, err error)
OldPrompt returns the old "prompt" field's value of the AI entity. If the AI 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 (*AIMutation) OldResult ¶
func (m *AIMutation) OldResult(ctx context.Context) (v []byte, err error)
OldResult returns the old "result" field's value of the AI entity. If the AI 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 (*AIMutation) OldStatus ¶
OldStatus returns the old "status" field's value of the AI entity. If the AI 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 (*AIMutation) Prompt ¶
func (m *AIMutation) Prompt() (r string, exists bool)
Prompt returns the value of the "prompt" field in the mutation.
func (*AIMutation) RemovedEdges ¶
func (m *AIMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AIMutation) RemovedIDs ¶
func (m *AIMutation) 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 (*AIMutation) ResetAiClientName ¶
func (m *AIMutation) ResetAiClientName()
ResetAiClientName resets all changes to the "ai_client_name" field.
func (*AIMutation) ResetCompletedAt ¶
func (m *AIMutation) ResetCompletedAt()
ResetCompletedAt resets all changes to the "completed_at" field.
func (*AIMutation) ResetCreatedAt ¶
func (m *AIMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AIMutation) ResetEdge ¶
func (m *AIMutation) 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 (*AIMutation) ResetField ¶
func (m *AIMutation) 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 (*AIMutation) ResetPrompt ¶
func (m *AIMutation) ResetPrompt()
ResetPrompt resets all changes to the "prompt" field.
func (*AIMutation) ResetResult ¶
func (m *AIMutation) ResetResult()
ResetResult resets all changes to the "result" field.
func (*AIMutation) ResetStatus ¶
func (m *AIMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*AIMutation) ResetUser ¶
func (m *AIMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*AIMutation) Result ¶
func (m *AIMutation) Result() (r []byte, exists bool)
Result returns the value of the "result" field in the mutation.
func (*AIMutation) SetAiClientName ¶
func (m *AIMutation) SetAiClientName(s string)
SetAiClientName sets the "ai_client_name" field.
func (*AIMutation) SetCompletedAt ¶
func (m *AIMutation) SetCompletedAt(t time.Time)
SetCompletedAt sets the "completed_at" field.
func (*AIMutation) SetCreatedAt ¶
func (m *AIMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AIMutation) SetField ¶
func (m *AIMutation) 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 (*AIMutation) SetOp ¶
func (m *AIMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AIMutation) SetPrompt ¶
func (m *AIMutation) SetPrompt(s string)
SetPrompt sets the "prompt" field.
func (*AIMutation) SetResult ¶
func (m *AIMutation) SetResult(b []byte)
SetResult sets the "result" field.
func (*AIMutation) SetStatus ¶
func (m *AIMutation) SetStatus(a ai.Status)
SetStatus sets the "status" field.
func (*AIMutation) SetUserID ¶
func (m *AIMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*AIMutation) Status ¶
func (m *AIMutation) Status() (r ai.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (AIMutation) Tx ¶
func (m AIMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AIMutation) Type ¶
func (m *AIMutation) Type() string
Type returns the node type of this mutation (AI).
func (*AIMutation) UserCleared ¶
func (m *AIMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*AIMutation) UserID ¶
func (m *AIMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*AIMutation) UserIDs ¶
func (m *AIMutation) 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 (*AIMutation) Where ¶
func (m *AIMutation) Where(ps ...predicate.AI)
Where appends a list predicates to the AIMutation builder.
func (*AIMutation) WhereP ¶
func (m *AIMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AIMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AIQuery ¶
type AIQuery struct {
// contains filtered or unexported fields
}
AIQuery is the builder for querying AI entities.
func (*AIQuery) Aggregate ¶
func (aq *AIQuery) Aggregate(fns ...AggregateFunc) *AISelect
Aggregate returns a AISelect configured with the given aggregations.
func (*AIQuery) Clone ¶
Clone returns a duplicate of the AIQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AIQuery) First ¶
First returns the first AI entity from the query. Returns a *NotFoundError when no AI was found.
func (*AIQuery) FirstID ¶
FirstID returns the first AI ID from the query. Returns a *NotFoundError when no AI ID was found.
func (*AIQuery) GroupBy ¶
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 {
AiClientName string `json:"ai_client_name,omitempty"`
Count int `json:"count,omitempty"`
}
client.AI.Query().
GroupBy(ai.FieldAiClientName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*AIQuery) Only ¶
Only returns a single AI entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one AI entity is found. Returns a *NotFoundError when no AI entities are found.
func (*AIQuery) OnlyID ¶
OnlyID is like Only, but returns the only AI ID in the query. Returns a *NotSingularError when more than one AI ID is found. Returns a *NotFoundError when no entities are found.
func (*AIQuery) Order ¶
func (aq *AIQuery) Order(o ...ai.OrderOption) *AIQuery
Order specifies how the records should be ordered.
func (*AIQuery) Select ¶
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 {
AiClientName string `json:"ai_client_name,omitempty"`
}
client.AI.Query().
Select(ai.FieldAiClientName).
Scan(ctx, &v)
func (*AIQuery) 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.
type AISelect ¶
type AISelect struct {
*AIQuery
// contains filtered or unexported fields
}
AISelect is the builder for selecting fields of AI entities.
func (*AISelect) Aggregate ¶
func (as *AISelect) Aggregate(fns ...AggregateFunc) *AISelect
Aggregate adds the given aggregation functions to the selector query.
func (*AISelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AISelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AISelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AISelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AISelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AISelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AISelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AIUpdate ¶
type AIUpdate struct {
// contains filtered or unexported fields
}
AIUpdate is the builder for updating AI entities.
func (*AIUpdate) ClearCompletedAt ¶
ClearCompletedAt clears the value of the "completed_at" field.
func (*AIUpdate) Mutation ¶
func (au *AIUpdate) Mutation() *AIMutation
Mutation returns the AIMutation object of the builder.
func (*AIUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*AIUpdate) SetAiClientName ¶
SetAiClientName sets the "ai_client_name" field.
func (*AIUpdate) SetCompletedAt ¶
SetCompletedAt sets the "completed_at" field.
func (*AIUpdate) SetNillableAiClientName ¶
SetNillableAiClientName sets the "ai_client_name" field if the given value is not nil.
func (*AIUpdate) SetNillableCompletedAt ¶
SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.
func (*AIUpdate) SetNillablePrompt ¶
SetNillablePrompt sets the "prompt" field if the given value is not nil.
func (*AIUpdate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
type AIUpdateOne ¶
type AIUpdateOne struct {
// contains filtered or unexported fields
}
AIUpdateOne is the builder for updating a single AI entity.
func (*AIUpdateOne) ClearCompletedAt ¶
func (auo *AIUpdateOne) ClearCompletedAt() *AIUpdateOne
ClearCompletedAt clears the value of the "completed_at" field.
func (*AIUpdateOne) ClearUser ¶
func (auo *AIUpdateOne) ClearUser() *AIUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*AIUpdateOne) Exec ¶
func (auo *AIUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AIUpdateOne) ExecX ¶
func (auo *AIUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AIUpdateOne) Mutation ¶
func (auo *AIUpdateOne) Mutation() *AIMutation
Mutation returns the AIMutation object of the builder.
func (*AIUpdateOne) Save ¶
func (auo *AIUpdateOne) Save(ctx context.Context) (*AI, error)
Save executes the query and returns the updated AI entity.
func (*AIUpdateOne) SaveX ¶
func (auo *AIUpdateOne) SaveX(ctx context.Context) *AI
SaveX is like Save, but panics if an error occurs.
func (*AIUpdateOne) Select ¶
func (auo *AIUpdateOne) Select(field string, fields ...string) *AIUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AIUpdateOne) SetAiClientName ¶
func (auo *AIUpdateOne) SetAiClientName(s string) *AIUpdateOne
SetAiClientName sets the "ai_client_name" field.
func (*AIUpdateOne) SetCompletedAt ¶
func (auo *AIUpdateOne) SetCompletedAt(t time.Time) *AIUpdateOne
SetCompletedAt sets the "completed_at" field.
func (*AIUpdateOne) SetNillableAiClientName ¶
func (auo *AIUpdateOne) SetNillableAiClientName(s *string) *AIUpdateOne
SetNillableAiClientName sets the "ai_client_name" field if the given value is not nil.
func (*AIUpdateOne) SetNillableCompletedAt ¶
func (auo *AIUpdateOne) SetNillableCompletedAt(t *time.Time) *AIUpdateOne
SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.
func (*AIUpdateOne) SetNillablePrompt ¶
func (auo *AIUpdateOne) SetNillablePrompt(s *string) *AIUpdateOne
SetNillablePrompt sets the "prompt" field if the given value is not nil.
func (*AIUpdateOne) SetNillableStatus ¶
func (auo *AIUpdateOne) SetNillableStatus(a *ai.Status) *AIUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*AIUpdateOne) SetPrompt ¶
func (auo *AIUpdateOne) SetPrompt(s string) *AIUpdateOne
SetPrompt sets the "prompt" field.
func (*AIUpdateOne) SetResult ¶
func (auo *AIUpdateOne) SetResult(b []byte) *AIUpdateOne
SetResult sets the "result" field.
func (*AIUpdateOne) SetStatus ¶
func (auo *AIUpdateOne) SetStatus(a ai.Status) *AIUpdateOne
SetStatus sets the "status" field.
func (*AIUpdateOne) SetUser ¶
func (auo *AIUpdateOne) SetUser(u *User) *AIUpdateOne
SetUser sets the "user" edge to the User entity.
func (*AIUpdateOne) SetUserID ¶
func (auo *AIUpdateOne) SetUserID(id int) *AIUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*AIUpdateOne) Where ¶
func (auo *AIUpdateOne) Where(ps ...predicate.AI) *AIUpdateOne
Where appends a list predicates to the AIUpdate builder.
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// AI is the client for interacting with the AI builders.
AI *AIClient
// ModelName is the client for interacting with the ModelName builders.
ModelName *ModelNameClient
// PasswordToken is the client for interacting with the PasswordToken builders.
PasswordToken *PasswordTokenClient
// Price is the client for interacting with the Price builders.
Price *PriceClient
// Product is the client for interacting with the Product builders.
Product *ProductClient
// 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(). AI. 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 ModelName ¶
type ModelName struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// FieldName holds the value of the "field_name" field.
FieldName string `json:"field_name,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the ModelNameQuery when eager-loading is set.
Edges ModelNameEdges `json:"edges"`
// contains filtered or unexported fields
}
ModelName is the model entity for the ModelName schema.
func (*ModelName) Unwrap ¶
Unwrap unwraps the ModelName 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 (*ModelName) Update ¶
func (mn *ModelName) Update() *ModelNameUpdateOne
Update returns a builder for updating this ModelName. Note that you need to call ModelName.Unwrap() before calling this method if this ModelName was returned from a transaction, and the transaction was committed or rolled back.
type ModelNameClient ¶
type ModelNameClient struct {
// contains filtered or unexported fields
}
ModelNameClient is a client for the ModelName schema.
func NewModelNameClient ¶
func NewModelNameClient(c config) *ModelNameClient
NewModelNameClient returns a client for the ModelName from the given config.
func (*ModelNameClient) Create ¶
func (c *ModelNameClient) Create() *ModelNameCreate
Create returns a builder for creating a ModelName entity.
func (*ModelNameClient) CreateBulk ¶
func (c *ModelNameClient) CreateBulk(builders ...*ModelNameCreate) *ModelNameCreateBulk
CreateBulk returns a builder for creating a bulk of ModelName entities.
func (*ModelNameClient) Delete ¶
func (c *ModelNameClient) Delete() *ModelNameDelete
Delete returns a delete builder for ModelName.
func (*ModelNameClient) DeleteOne ¶
func (c *ModelNameClient) DeleteOne(mn *ModelName) *ModelNameDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ModelNameClient) DeleteOneID ¶
func (c *ModelNameClient) DeleteOneID(id int) *ModelNameDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ModelNameClient) GetX ¶
func (c *ModelNameClient) GetX(ctx context.Context, id int) *ModelName
GetX is like Get, but panics if an error occurs.
func (*ModelNameClient) Hooks ¶
func (c *ModelNameClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ModelNameClient) Intercept ¶
func (c *ModelNameClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `modelname.Intercept(f(g(h())))`.
func (*ModelNameClient) Interceptors ¶
func (c *ModelNameClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ModelNameClient) MapCreateBulk ¶
func (c *ModelNameClient) MapCreateBulk(slice any, setFunc func(*ModelNameCreate, int)) *ModelNameCreateBulk
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 (*ModelNameClient) Query ¶
func (c *ModelNameClient) Query() *ModelNameQuery
Query returns a query builder for ModelName.
func (*ModelNameClient) QueryUser ¶
func (c *ModelNameClient) QueryUser(mn *ModelName) *UserQuery
QueryUser queries the user edge of a ModelName.
func (*ModelNameClient) Update ¶
func (c *ModelNameClient) Update() *ModelNameUpdate
Update returns an update builder for ModelName.
func (*ModelNameClient) UpdateOne ¶
func (c *ModelNameClient) UpdateOne(mn *ModelName) *ModelNameUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ModelNameClient) UpdateOneID ¶
func (c *ModelNameClient) UpdateOneID(id int) *ModelNameUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ModelNameClient) Use ¶
func (c *ModelNameClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `modelname.Hooks(f(g(h())))`.
type ModelNameCreate ¶
type ModelNameCreate struct {
// contains filtered or unexported fields
}
ModelNameCreate is the builder for creating a ModelName entity.
func (*ModelNameCreate) Exec ¶
func (mnc *ModelNameCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ModelNameCreate) ExecX ¶
func (mnc *ModelNameCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModelNameCreate) Mutation ¶
func (mnc *ModelNameCreate) Mutation() *ModelNameMutation
Mutation returns the ModelNameMutation object of the builder.
func (*ModelNameCreate) Save ¶
func (mnc *ModelNameCreate) Save(ctx context.Context) (*ModelName, error)
Save creates the ModelName in the database.
func (*ModelNameCreate) SaveX ¶
func (mnc *ModelNameCreate) SaveX(ctx context.Context) *ModelName
SaveX calls Save and panics if Save returns an error.
func (*ModelNameCreate) SetCreatedAt ¶
func (mnc *ModelNameCreate) SetCreatedAt(t time.Time) *ModelNameCreate
SetCreatedAt sets the "created_at" field.
func (*ModelNameCreate) SetFieldName ¶
func (mnc *ModelNameCreate) SetFieldName(s string) *ModelNameCreate
SetFieldName sets the "field_name" field.
func (*ModelNameCreate) SetNillableCreatedAt ¶
func (mnc *ModelNameCreate) SetNillableCreatedAt(t *time.Time) *ModelNameCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ModelNameCreate) SetUser ¶
func (mnc *ModelNameCreate) SetUser(u *User) *ModelNameCreate
SetUser sets the "user" edge to the User entity.
func (*ModelNameCreate) SetUserID ¶
func (mnc *ModelNameCreate) SetUserID(id int) *ModelNameCreate
SetUserID sets the "user" edge to the User entity by ID.
type ModelNameCreateBulk ¶
type ModelNameCreateBulk struct {
// contains filtered or unexported fields
}
ModelNameCreateBulk is the builder for creating many ModelName entities in bulk.
func (*ModelNameCreateBulk) Exec ¶
func (mncb *ModelNameCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ModelNameCreateBulk) ExecX ¶
func (mncb *ModelNameCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ModelNameDelete ¶
type ModelNameDelete struct {
// contains filtered or unexported fields
}
ModelNameDelete is the builder for deleting a ModelName entity.
func (*ModelNameDelete) Exec ¶
func (mnd *ModelNameDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ModelNameDelete) ExecX ¶
func (mnd *ModelNameDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ModelNameDelete) Where ¶
func (mnd *ModelNameDelete) Where(ps ...predicate.ModelName) *ModelNameDelete
Where appends a list predicates to the ModelNameDelete builder.
type ModelNameDeleteOne ¶
type ModelNameDeleteOne struct {
// contains filtered or unexported fields
}
ModelNameDeleteOne is the builder for deleting a single ModelName entity.
func (*ModelNameDeleteOne) Exec ¶
func (mndo *ModelNameDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ModelNameDeleteOne) ExecX ¶
func (mndo *ModelNameDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModelNameDeleteOne) Where ¶
func (mndo *ModelNameDeleteOne) Where(ps ...predicate.ModelName) *ModelNameDeleteOne
Where appends a list predicates to the ModelNameDelete builder.
type ModelNameEdges ¶
type ModelNameEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
ModelNameEdges holds the relations/edges for other nodes in the graph.
func (ModelNameEdges) UserOrErr ¶
func (e ModelNameEdges) 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 ModelNameGroupBy ¶
type ModelNameGroupBy struct {
// contains filtered or unexported fields
}
ModelNameGroupBy is the group-by builder for ModelName entities.
func (*ModelNameGroupBy) Aggregate ¶
func (mngb *ModelNameGroupBy) Aggregate(fns ...AggregateFunc) *ModelNameGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ModelNameGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ModelNameGroupBy) Scan ¶
func (mngb *ModelNameGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ModelNameGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ModelNameMutation ¶
type ModelNameMutation struct {
// contains filtered or unexported fields
}
ModelNameMutation represents an operation that mutates the ModelName nodes in the graph.
func (*ModelNameMutation) AddField ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) AddedEdges ¶
func (m *ModelNameMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ModelNameMutation) AddedField ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) AddedFields ¶
func (m *ModelNameMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ModelNameMutation) AddedIDs ¶
func (m *ModelNameMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ModelNameMutation) ClearEdge ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ClearField ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ClearUser ¶
func (m *ModelNameMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ModelNameMutation) ClearedEdges ¶
func (m *ModelNameMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ModelNameMutation) ClearedFields ¶
func (m *ModelNameMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ModelNameMutation) Client ¶
func (m ModelNameMutation) 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 (*ModelNameMutation) CreatedAt ¶
func (m *ModelNameMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ModelNameMutation) EdgeCleared ¶
func (m *ModelNameMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ModelNameMutation) Field ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) FieldCleared ¶
func (m *ModelNameMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ModelNameMutation) FieldName ¶
func (m *ModelNameMutation) FieldName() (r string, exists bool)
FieldName returns the value of the "field_name" field in the mutation.
func (*ModelNameMutation) Fields ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ID ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) IDs ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the ModelName entity. If the ModelName 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 (*ModelNameMutation) 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 (*ModelNameMutation) OldFieldName ¶
func (m *ModelNameMutation) OldFieldName(ctx context.Context) (v string, err error)
OldFieldName returns the old "field_name" field's value of the ModelName entity. If the ModelName 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 (*ModelNameMutation) RemovedEdges ¶
func (m *ModelNameMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ModelNameMutation) RemovedIDs ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ResetCreatedAt ¶
func (m *ModelNameMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ModelNameMutation) ResetEdge ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ResetField ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) ResetFieldName ¶
func (m *ModelNameMutation) ResetFieldName()
ResetFieldName resets all changes to the "field_name" field.
func (*ModelNameMutation) ResetUser ¶
func (m *ModelNameMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ModelNameMutation) SetCreatedAt ¶
func (m *ModelNameMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ModelNameMutation) SetField ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) SetFieldName ¶
func (m *ModelNameMutation) SetFieldName(s string)
SetFieldName sets the "field_name" field.
func (*ModelNameMutation) SetOp ¶
func (m *ModelNameMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ModelNameMutation) SetUserID ¶
func (m *ModelNameMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (ModelNameMutation) Tx ¶
func (m ModelNameMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ModelNameMutation) Type ¶
func (m *ModelNameMutation) Type() string
Type returns the node type of this mutation (ModelName).
func (*ModelNameMutation) UserCleared ¶
func (m *ModelNameMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ModelNameMutation) UserID ¶
func (m *ModelNameMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*ModelNameMutation) UserIDs ¶
func (m *ModelNameMutation) 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 (*ModelNameMutation) Where ¶
func (m *ModelNameMutation) Where(ps ...predicate.ModelName)
Where appends a list predicates to the ModelNameMutation builder.
func (*ModelNameMutation) WhereP ¶
func (m *ModelNameMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ModelNameMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ModelNameQuery ¶
type ModelNameQuery struct {
// contains filtered or unexported fields
}
ModelNameQuery is the builder for querying ModelName entities.
func (*ModelNameQuery) Aggregate ¶
func (mnq *ModelNameQuery) Aggregate(fns ...AggregateFunc) *ModelNameSelect
Aggregate returns a ModelNameSelect configured with the given aggregations.
func (*ModelNameQuery) All ¶
func (mnq *ModelNameQuery) All(ctx context.Context) ([]*ModelName, error)
All executes the query and returns a list of ModelNames.
func (*ModelNameQuery) AllX ¶
func (mnq *ModelNameQuery) AllX(ctx context.Context) []*ModelName
AllX is like All, but panics if an error occurs.
func (*ModelNameQuery) Clone ¶
func (mnq *ModelNameQuery) Clone() *ModelNameQuery
Clone returns a duplicate of the ModelNameQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ModelNameQuery) Count ¶
func (mnq *ModelNameQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ModelNameQuery) CountX ¶
func (mnq *ModelNameQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ModelNameQuery) Exist ¶
func (mnq *ModelNameQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ModelNameQuery) ExistX ¶
func (mnq *ModelNameQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ModelNameQuery) First ¶
func (mnq *ModelNameQuery) First(ctx context.Context) (*ModelName, error)
First returns the first ModelName entity from the query. Returns a *NotFoundError when no ModelName was found.
func (*ModelNameQuery) FirstID ¶
func (mnq *ModelNameQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ModelName ID from the query. Returns a *NotFoundError when no ModelName ID was found.
func (*ModelNameQuery) FirstIDX ¶
func (mnq *ModelNameQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ModelNameQuery) FirstX ¶
func (mnq *ModelNameQuery) FirstX(ctx context.Context) *ModelName
FirstX is like First, but panics if an error occurs.
func (*ModelNameQuery) GroupBy ¶
func (mnq *ModelNameQuery) GroupBy(field string, fields ...string) *ModelNameGroupBy
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 {
FieldName string `json:"field_name,omitempty"`
Count int `json:"count,omitempty"`
}
client.ModelName.Query().
GroupBy(modelname.FieldFieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*ModelNameQuery) IDs ¶
func (mnq *ModelNameQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ModelName IDs.
func (*ModelNameQuery) IDsX ¶
func (mnq *ModelNameQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ModelNameQuery) Limit ¶
func (mnq *ModelNameQuery) Limit(limit int) *ModelNameQuery
Limit the number of records to be returned by this query.
func (*ModelNameQuery) Offset ¶
func (mnq *ModelNameQuery) Offset(offset int) *ModelNameQuery
Offset to start from.
func (*ModelNameQuery) Only ¶
func (mnq *ModelNameQuery) Only(ctx context.Context) (*ModelName, error)
Only returns a single ModelName entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ModelName entity is found. Returns a *NotFoundError when no ModelName entities are found.
func (*ModelNameQuery) OnlyID ¶
func (mnq *ModelNameQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ModelName ID in the query. Returns a *NotSingularError when more than one ModelName ID is found. Returns a *NotFoundError when no entities are found.
func (*ModelNameQuery) OnlyIDX ¶
func (mnq *ModelNameQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ModelNameQuery) OnlyX ¶
func (mnq *ModelNameQuery) OnlyX(ctx context.Context) *ModelName
OnlyX is like Only, but panics if an error occurs.
func (*ModelNameQuery) Order ¶
func (mnq *ModelNameQuery) Order(o ...modelname.OrderOption) *ModelNameQuery
Order specifies how the records should be ordered.
func (*ModelNameQuery) QueryUser ¶
func (mnq *ModelNameQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ModelNameQuery) Select ¶
func (mnq *ModelNameQuery) Select(fields ...string) *ModelNameSelect
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 {
FieldName string `json:"field_name,omitempty"`
}
client.ModelName.Query().
Select(modelname.FieldFieldName).
Scan(ctx, &v)
func (*ModelNameQuery) Unique ¶
func (mnq *ModelNameQuery) Unique(unique bool) *ModelNameQuery
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 (*ModelNameQuery) Where ¶
func (mnq *ModelNameQuery) Where(ps ...predicate.ModelName) *ModelNameQuery
Where adds a new predicate for the ModelNameQuery builder.
func (*ModelNameQuery) WithUser ¶
func (mnq *ModelNameQuery) WithUser(opts ...func(*UserQuery)) *ModelNameQuery
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 ModelNameSelect ¶
type ModelNameSelect struct {
*ModelNameQuery
// contains filtered or unexported fields
}
ModelNameSelect is the builder for selecting fields of ModelName entities.
func (*ModelNameSelect) Aggregate ¶
func (mns *ModelNameSelect) Aggregate(fns ...AggregateFunc) *ModelNameSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ModelNameSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ModelNameSelect) Scan ¶
func (mns *ModelNameSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ModelNameSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ModelNameUpdate ¶
type ModelNameUpdate struct {
// contains filtered or unexported fields
}
ModelNameUpdate is the builder for updating ModelName entities.
func (*ModelNameUpdate) ClearUser ¶
func (mnu *ModelNameUpdate) ClearUser() *ModelNameUpdate
ClearUser clears the "user" edge to the User entity.
func (*ModelNameUpdate) Exec ¶
func (mnu *ModelNameUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ModelNameUpdate) ExecX ¶
func (mnu *ModelNameUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModelNameUpdate) Mutation ¶
func (mnu *ModelNameUpdate) Mutation() *ModelNameMutation
Mutation returns the ModelNameMutation object of the builder.
func (*ModelNameUpdate) Save ¶
func (mnu *ModelNameUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ModelNameUpdate) SaveX ¶
func (mnu *ModelNameUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ModelNameUpdate) SetFieldName ¶
func (mnu *ModelNameUpdate) SetFieldName(s string) *ModelNameUpdate
SetFieldName sets the "field_name" field.
func (*ModelNameUpdate) SetNillableFieldName ¶
func (mnu *ModelNameUpdate) SetNillableFieldName(s *string) *ModelNameUpdate
SetNillableFieldName sets the "field_name" field if the given value is not nil.
func (*ModelNameUpdate) SetUser ¶
func (mnu *ModelNameUpdate) SetUser(u *User) *ModelNameUpdate
SetUser sets the "user" edge to the User entity.
func (*ModelNameUpdate) SetUserID ¶
func (mnu *ModelNameUpdate) SetUserID(id int) *ModelNameUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*ModelNameUpdate) Where ¶
func (mnu *ModelNameUpdate) Where(ps ...predicate.ModelName) *ModelNameUpdate
Where appends a list predicates to the ModelNameUpdate builder.
type ModelNameUpdateOne ¶
type ModelNameUpdateOne struct {
// contains filtered or unexported fields
}
ModelNameUpdateOne is the builder for updating a single ModelName entity.
func (*ModelNameUpdateOne) ClearUser ¶
func (mnuo *ModelNameUpdateOne) ClearUser() *ModelNameUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ModelNameUpdateOne) Exec ¶
func (mnuo *ModelNameUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ModelNameUpdateOne) ExecX ¶
func (mnuo *ModelNameUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModelNameUpdateOne) Mutation ¶
func (mnuo *ModelNameUpdateOne) Mutation() *ModelNameMutation
Mutation returns the ModelNameMutation object of the builder.
func (*ModelNameUpdateOne) Save ¶
func (mnuo *ModelNameUpdateOne) Save(ctx context.Context) (*ModelName, error)
Save executes the query and returns the updated ModelName entity.
func (*ModelNameUpdateOne) SaveX ¶
func (mnuo *ModelNameUpdateOne) SaveX(ctx context.Context) *ModelName
SaveX is like Save, but panics if an error occurs.
func (*ModelNameUpdateOne) Select ¶
func (mnuo *ModelNameUpdateOne) Select(field string, fields ...string) *ModelNameUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ModelNameUpdateOne) SetFieldName ¶
func (mnuo *ModelNameUpdateOne) SetFieldName(s string) *ModelNameUpdateOne
SetFieldName sets the "field_name" field.
func (*ModelNameUpdateOne) SetNillableFieldName ¶
func (mnuo *ModelNameUpdateOne) SetNillableFieldName(s *string) *ModelNameUpdateOne
SetNillableFieldName sets the "field_name" field if the given value is not nil.
func (*ModelNameUpdateOne) SetUser ¶
func (mnuo *ModelNameUpdateOne) SetUser(u *User) *ModelNameUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ModelNameUpdateOne) SetUserID ¶
func (mnuo *ModelNameUpdateOne) SetUserID(id int) *ModelNameUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*ModelNameUpdateOne) Where ¶
func (mnuo *ModelNameUpdateOne) Where(ps ...predicate.ModelName) *ModelNameUpdateOne
Where appends a list predicates to the ModelNameUpdate builder.
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 PasswordToken ¶
type PasswordToken struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Hash holds the value of the "hash" field.
Hash string `json:"-"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PasswordTokenQuery when eager-loading is set.
Edges PasswordTokenEdges `json:"edges"`
// contains filtered or unexported fields
}
PasswordToken is the model entity for the PasswordToken schema.
func (*PasswordToken) QueryUser ¶
func (pt *PasswordToken) QueryUser() *UserQuery
QueryUser queries the "user" edge of the PasswordToken entity.
func (*PasswordToken) String ¶
func (pt *PasswordToken) String() string
String implements the fmt.Stringer.
func (*PasswordToken) Unwrap ¶
func (pt *PasswordToken) Unwrap() *PasswordToken
Unwrap unwraps the PasswordToken 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 (*PasswordToken) Update ¶
func (pt *PasswordToken) Update() *PasswordTokenUpdateOne
Update returns a builder for updating this PasswordToken. Note that you need to call PasswordToken.Unwrap() before calling this method if this PasswordToken was returned from a transaction, and the transaction was committed or rolled back.
type PasswordTokenClient ¶
type PasswordTokenClient struct {
// contains filtered or unexported fields
}
PasswordTokenClient is a client for the PasswordToken schema.
func NewPasswordTokenClient ¶
func NewPasswordTokenClient(c config) *PasswordTokenClient
NewPasswordTokenClient returns a client for the PasswordToken from the given config.
func (*PasswordTokenClient) Create ¶
func (c *PasswordTokenClient) Create() *PasswordTokenCreate
Create returns a builder for creating a PasswordToken entity.
func (*PasswordTokenClient) CreateBulk ¶
func (c *PasswordTokenClient) CreateBulk(builders ...*PasswordTokenCreate) *PasswordTokenCreateBulk
CreateBulk returns a builder for creating a bulk of PasswordToken entities.
func (*PasswordTokenClient) Delete ¶
func (c *PasswordTokenClient) Delete() *PasswordTokenDelete
Delete returns a delete builder for PasswordToken.
func (*PasswordTokenClient) DeleteOne ¶
func (c *PasswordTokenClient) DeleteOne(pt *PasswordToken) *PasswordTokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PasswordTokenClient) DeleteOneID ¶
func (c *PasswordTokenClient) DeleteOneID(id int) *PasswordTokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PasswordTokenClient) Get ¶
func (c *PasswordTokenClient) Get(ctx context.Context, id int) (*PasswordToken, error)
Get returns a PasswordToken entity by its id.
func (*PasswordTokenClient) GetX ¶
func (c *PasswordTokenClient) GetX(ctx context.Context, id int) *PasswordToken
GetX is like Get, but panics if an error occurs.
func (*PasswordTokenClient) Hooks ¶
func (c *PasswordTokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PasswordTokenClient) Intercept ¶
func (c *PasswordTokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `passwordtoken.Intercept(f(g(h())))`.
func (*PasswordTokenClient) Interceptors ¶
func (c *PasswordTokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PasswordTokenClient) MapCreateBulk ¶
func (c *PasswordTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordTokenCreate, int)) *PasswordTokenCreateBulk
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 (*PasswordTokenClient) Query ¶
func (c *PasswordTokenClient) Query() *PasswordTokenQuery
Query returns a query builder for PasswordToken.
func (*PasswordTokenClient) QueryUser ¶
func (c *PasswordTokenClient) QueryUser(pt *PasswordToken) *UserQuery
QueryUser queries the user edge of a PasswordToken.
func (*PasswordTokenClient) Update ¶
func (c *PasswordTokenClient) Update() *PasswordTokenUpdate
Update returns an update builder for PasswordToken.
func (*PasswordTokenClient) UpdateOne ¶
func (c *PasswordTokenClient) UpdateOne(pt *PasswordToken) *PasswordTokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PasswordTokenClient) UpdateOneID ¶
func (c *PasswordTokenClient) UpdateOneID(id int) *PasswordTokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PasswordTokenClient) Use ¶
func (c *PasswordTokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `passwordtoken.Hooks(f(g(h())))`.
type PasswordTokenCreate ¶
type PasswordTokenCreate struct {
// contains filtered or unexported fields
}
PasswordTokenCreate is the builder for creating a PasswordToken entity.
func (*PasswordTokenCreate) Exec ¶
func (ptc *PasswordTokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenCreate) ExecX ¶
func (ptc *PasswordTokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenCreate) Mutation ¶
func (ptc *PasswordTokenCreate) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenCreate) Save ¶
func (ptc *PasswordTokenCreate) Save(ctx context.Context) (*PasswordToken, error)
Save creates the PasswordToken in the database.
func (*PasswordTokenCreate) SaveX ¶
func (ptc *PasswordTokenCreate) SaveX(ctx context.Context) *PasswordToken
SaveX calls Save and panics if Save returns an error.
func (*PasswordTokenCreate) SetCreatedAt ¶
func (ptc *PasswordTokenCreate) SetCreatedAt(t time.Time) *PasswordTokenCreate
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenCreate) SetHash ¶
func (ptc *PasswordTokenCreate) SetHash(s string) *PasswordTokenCreate
SetHash sets the "hash" field.
func (*PasswordTokenCreate) SetNillableCreatedAt ¶
func (ptc *PasswordTokenCreate) SetNillableCreatedAt(t *time.Time) *PasswordTokenCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenCreate) SetUser ¶
func (ptc *PasswordTokenCreate) SetUser(u *User) *PasswordTokenCreate
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenCreate) SetUserID ¶
func (ptc *PasswordTokenCreate) SetUserID(id int) *PasswordTokenCreate
SetUserID sets the "user" edge to the User entity by ID.
type PasswordTokenCreateBulk ¶
type PasswordTokenCreateBulk struct {
// contains filtered or unexported fields
}
PasswordTokenCreateBulk is the builder for creating many PasswordToken entities in bulk.
func (*PasswordTokenCreateBulk) Exec ¶
func (ptcb *PasswordTokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenCreateBulk) ExecX ¶
func (ptcb *PasswordTokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenCreateBulk) Save ¶
func (ptcb *PasswordTokenCreateBulk) Save(ctx context.Context) ([]*PasswordToken, error)
Save creates the PasswordToken entities in the database.
func (*PasswordTokenCreateBulk) SaveX ¶
func (ptcb *PasswordTokenCreateBulk) SaveX(ctx context.Context) []*PasswordToken
SaveX is like Save, but panics if an error occurs.
type PasswordTokenDelete ¶
type PasswordTokenDelete struct {
// contains filtered or unexported fields
}
PasswordTokenDelete is the builder for deleting a PasswordToken entity.
func (*PasswordTokenDelete) Exec ¶
func (ptd *PasswordTokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PasswordTokenDelete) ExecX ¶
func (ptd *PasswordTokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenDelete) Where ¶
func (ptd *PasswordTokenDelete) Where(ps ...predicate.PasswordToken) *PasswordTokenDelete
Where appends a list predicates to the PasswordTokenDelete builder.
type PasswordTokenDeleteOne ¶
type PasswordTokenDeleteOne struct {
// contains filtered or unexported fields
}
PasswordTokenDeleteOne is the builder for deleting a single PasswordToken entity.
func (*PasswordTokenDeleteOne) Exec ¶
func (ptdo *PasswordTokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PasswordTokenDeleteOne) ExecX ¶
func (ptdo *PasswordTokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenDeleteOne) Where ¶
func (ptdo *PasswordTokenDeleteOne) Where(ps ...predicate.PasswordToken) *PasswordTokenDeleteOne
Where appends a list predicates to the PasswordTokenDelete builder.
type PasswordTokenEdges ¶
type PasswordTokenEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
PasswordTokenEdges holds the relations/edges for other nodes in the graph.
func (PasswordTokenEdges) UserOrErr ¶
func (e PasswordTokenEdges) 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 PasswordTokenGroupBy ¶
type PasswordTokenGroupBy struct {
// contains filtered or unexported fields
}
PasswordTokenGroupBy is the group-by builder for PasswordToken entities.
func (*PasswordTokenGroupBy) Aggregate ¶
func (ptgb *PasswordTokenGroupBy) Aggregate(fns ...AggregateFunc) *PasswordTokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PasswordTokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Scan ¶
func (ptgb *PasswordTokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PasswordTokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PasswordTokenMutation ¶
type PasswordTokenMutation struct {
// contains filtered or unexported fields
}
PasswordTokenMutation represents an operation that mutates the PasswordToken nodes in the graph.
func (*PasswordTokenMutation) AddField ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) AddedEdges ¶
func (m *PasswordTokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PasswordTokenMutation) AddedField ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) AddedFields ¶
func (m *PasswordTokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PasswordTokenMutation) AddedIDs ¶
func (m *PasswordTokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PasswordTokenMutation) ClearEdge ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) ClearField ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) ClearUser ¶
func (m *PasswordTokenMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenMutation) ClearedEdges ¶
func (m *PasswordTokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PasswordTokenMutation) ClearedFields ¶
func (m *PasswordTokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PasswordTokenMutation) Client ¶
func (m PasswordTokenMutation) 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 (*PasswordTokenMutation) CreatedAt ¶
func (m *PasswordTokenMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PasswordTokenMutation) EdgeCleared ¶
func (m *PasswordTokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PasswordTokenMutation) Field ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) FieldCleared ¶
func (m *PasswordTokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PasswordTokenMutation) Fields ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) Hash ¶
func (m *PasswordTokenMutation) Hash() (r string, exists bool)
Hash returns the value of the "hash" field in the mutation.
func (*PasswordTokenMutation) ID ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) IDs ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the PasswordToken entity. If the PasswordToken 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 (*PasswordTokenMutation) 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 (*PasswordTokenMutation) OldHash ¶
func (m *PasswordTokenMutation) OldHash(ctx context.Context) (v string, err error)
OldHash returns the old "hash" field's value of the PasswordToken entity. If the PasswordToken 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 (*PasswordTokenMutation) Op ¶
func (m *PasswordTokenMutation) Op() Op
Op returns the operation name.
func (*PasswordTokenMutation) RemovedEdges ¶
func (m *PasswordTokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PasswordTokenMutation) RemovedIDs ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) ResetCreatedAt ¶
func (m *PasswordTokenMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PasswordTokenMutation) ResetEdge ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) ResetField ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) ResetHash ¶
func (m *PasswordTokenMutation) ResetHash()
ResetHash resets all changes to the "hash" field.
func (*PasswordTokenMutation) ResetUser ¶
func (m *PasswordTokenMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*PasswordTokenMutation) SetCreatedAt ¶
func (m *PasswordTokenMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenMutation) SetField ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) SetHash ¶
func (m *PasswordTokenMutation) SetHash(s string)
SetHash sets the "hash" field.
func (*PasswordTokenMutation) SetOp ¶
func (m *PasswordTokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PasswordTokenMutation) SetUserID ¶
func (m *PasswordTokenMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (PasswordTokenMutation) Tx ¶
func (m PasswordTokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PasswordTokenMutation) Type ¶
func (m *PasswordTokenMutation) Type() string
Type returns the node type of this mutation (PasswordToken).
func (*PasswordTokenMutation) UserCleared ¶
func (m *PasswordTokenMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*PasswordTokenMutation) UserID ¶
func (m *PasswordTokenMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*PasswordTokenMutation) UserIDs ¶
func (m *PasswordTokenMutation) 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 (*PasswordTokenMutation) Where ¶
func (m *PasswordTokenMutation) Where(ps ...predicate.PasswordToken)
Where appends a list predicates to the PasswordTokenMutation builder.
func (*PasswordTokenMutation) WhereP ¶
func (m *PasswordTokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PasswordTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PasswordTokenQuery ¶
type PasswordTokenQuery struct {
// contains filtered or unexported fields
}
PasswordTokenQuery is the builder for querying PasswordToken entities.
func (*PasswordTokenQuery) Aggregate ¶
func (ptq *PasswordTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
Aggregate returns a PasswordTokenSelect configured with the given aggregations.
func (*PasswordTokenQuery) All ¶
func (ptq *PasswordTokenQuery) All(ctx context.Context) ([]*PasswordToken, error)
All executes the query and returns a list of PasswordTokens.
func (*PasswordTokenQuery) AllX ¶
func (ptq *PasswordTokenQuery) AllX(ctx context.Context) []*PasswordToken
AllX is like All, but panics if an error occurs.
func (*PasswordTokenQuery) Clone ¶
func (ptq *PasswordTokenQuery) Clone() *PasswordTokenQuery
Clone returns a duplicate of the PasswordTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PasswordTokenQuery) Count ¶
func (ptq *PasswordTokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PasswordTokenQuery) CountX ¶
func (ptq *PasswordTokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PasswordTokenQuery) Exist ¶
func (ptq *PasswordTokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PasswordTokenQuery) ExistX ¶
func (ptq *PasswordTokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PasswordTokenQuery) First ¶
func (ptq *PasswordTokenQuery) First(ctx context.Context) (*PasswordToken, error)
First returns the first PasswordToken entity from the query. Returns a *NotFoundError when no PasswordToken was found.
func (*PasswordTokenQuery) FirstID ¶
func (ptq *PasswordTokenQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PasswordToken ID from the query. Returns a *NotFoundError when no PasswordToken ID was found.
func (*PasswordTokenQuery) FirstIDX ¶
func (ptq *PasswordTokenQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PasswordTokenQuery) FirstX ¶
func (ptq *PasswordTokenQuery) FirstX(ctx context.Context) *PasswordToken
FirstX is like First, but panics if an error occurs.
func (*PasswordTokenQuery) GroupBy ¶
func (ptq *PasswordTokenQuery) GroupBy(field string, fields ...string) *PasswordTokenGroupBy
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 {
Hash string `json:"hash,omitempty"`
Count int `json:"count,omitempty"`
}
client.PasswordToken.Query().
GroupBy(passwordtoken.FieldHash).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*PasswordTokenQuery) IDs ¶
func (ptq *PasswordTokenQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of PasswordToken IDs.
func (*PasswordTokenQuery) IDsX ¶
func (ptq *PasswordTokenQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PasswordTokenQuery) Limit ¶
func (ptq *PasswordTokenQuery) Limit(limit int) *PasswordTokenQuery
Limit the number of records to be returned by this query.
func (*PasswordTokenQuery) Offset ¶
func (ptq *PasswordTokenQuery) Offset(offset int) *PasswordTokenQuery
Offset to start from.
func (*PasswordTokenQuery) Only ¶
func (ptq *PasswordTokenQuery) Only(ctx context.Context) (*PasswordToken, error)
Only returns a single PasswordToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PasswordToken entity is found. Returns a *NotFoundError when no PasswordToken entities are found.
func (*PasswordTokenQuery) OnlyID ¶
func (ptq *PasswordTokenQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PasswordToken ID in the query. Returns a *NotSingularError when more than one PasswordToken ID is found. Returns a *NotFoundError when no entities are found.
func (*PasswordTokenQuery) OnlyIDX ¶
func (ptq *PasswordTokenQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PasswordTokenQuery) OnlyX ¶
func (ptq *PasswordTokenQuery) OnlyX(ctx context.Context) *PasswordToken
OnlyX is like Only, but panics if an error occurs.
func (*PasswordTokenQuery) Order ¶
func (ptq *PasswordTokenQuery) Order(o ...passwordtoken.OrderOption) *PasswordTokenQuery
Order specifies how the records should be ordered.
func (*PasswordTokenQuery) QueryUser ¶
func (ptq *PasswordTokenQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*PasswordTokenQuery) Select ¶
func (ptq *PasswordTokenQuery) Select(fields ...string) *PasswordTokenSelect
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 {
Hash string `json:"hash,omitempty"`
}
client.PasswordToken.Query().
Select(passwordtoken.FieldHash).
Scan(ctx, &v)
func (*PasswordTokenQuery) Unique ¶
func (ptq *PasswordTokenQuery) Unique(unique bool) *PasswordTokenQuery
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 (*PasswordTokenQuery) Where ¶
func (ptq *PasswordTokenQuery) Where(ps ...predicate.PasswordToken) *PasswordTokenQuery
Where adds a new predicate for the PasswordTokenQuery builder.
func (*PasswordTokenQuery) WithUser ¶
func (ptq *PasswordTokenQuery) WithUser(opts ...func(*UserQuery)) *PasswordTokenQuery
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 PasswordTokenSelect ¶
type PasswordTokenSelect struct {
*PasswordTokenQuery
// contains filtered or unexported fields
}
PasswordTokenSelect is the builder for selecting fields of PasswordToken entities.
func (*PasswordTokenSelect) Aggregate ¶
func (pts *PasswordTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PasswordTokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Scan ¶
func (pts *PasswordTokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PasswordTokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PasswordTokenUpdate ¶
type PasswordTokenUpdate struct {
// contains filtered or unexported fields
}
PasswordTokenUpdate is the builder for updating PasswordToken entities.
func (*PasswordTokenUpdate) ClearUser ¶
func (ptu *PasswordTokenUpdate) ClearUser() *PasswordTokenUpdate
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenUpdate) Exec ¶
func (ptu *PasswordTokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenUpdate) ExecX ¶
func (ptu *PasswordTokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenUpdate) Mutation ¶
func (ptu *PasswordTokenUpdate) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenUpdate) Save ¶
func (ptu *PasswordTokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PasswordTokenUpdate) SaveX ¶
func (ptu *PasswordTokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PasswordTokenUpdate) SetCreatedAt ¶
func (ptu *PasswordTokenUpdate) SetCreatedAt(t time.Time) *PasswordTokenUpdate
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenUpdate) SetHash ¶
func (ptu *PasswordTokenUpdate) SetHash(s string) *PasswordTokenUpdate
SetHash sets the "hash" field.
func (*PasswordTokenUpdate) SetNillableCreatedAt ¶
func (ptu *PasswordTokenUpdate) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenUpdate) SetNillableHash ¶
func (ptu *PasswordTokenUpdate) SetNillableHash(s *string) *PasswordTokenUpdate
SetNillableHash sets the "hash" field if the given value is not nil.
func (*PasswordTokenUpdate) SetUser ¶
func (ptu *PasswordTokenUpdate) SetUser(u *User) *PasswordTokenUpdate
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenUpdate) SetUserID ¶
func (ptu *PasswordTokenUpdate) SetUserID(id int) *PasswordTokenUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*PasswordTokenUpdate) Where ¶
func (ptu *PasswordTokenUpdate) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdate
Where appends a list predicates to the PasswordTokenUpdate builder.
type PasswordTokenUpdateOne ¶
type PasswordTokenUpdateOne struct {
// contains filtered or unexported fields
}
PasswordTokenUpdateOne is the builder for updating a single PasswordToken entity.
func (*PasswordTokenUpdateOne) ClearUser ¶
func (ptuo *PasswordTokenUpdateOne) ClearUser() *PasswordTokenUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenUpdateOne) Exec ¶
func (ptuo *PasswordTokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PasswordTokenUpdateOne) ExecX ¶
func (ptuo *PasswordTokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenUpdateOne) Mutation ¶
func (ptuo *PasswordTokenUpdateOne) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenUpdateOne) Save ¶
func (ptuo *PasswordTokenUpdateOne) Save(ctx context.Context) (*PasswordToken, error)
Save executes the query and returns the updated PasswordToken entity.
func (*PasswordTokenUpdateOne) SaveX ¶
func (ptuo *PasswordTokenUpdateOne) SaveX(ctx context.Context) *PasswordToken
SaveX is like Save, but panics if an error occurs.
func (*PasswordTokenUpdateOne) Select ¶
func (ptuo *PasswordTokenUpdateOne) Select(field string, fields ...string) *PasswordTokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PasswordTokenUpdateOne) SetCreatedAt ¶
func (ptuo *PasswordTokenUpdateOne) SetCreatedAt(t time.Time) *PasswordTokenUpdateOne
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenUpdateOne) SetHash ¶
func (ptuo *PasswordTokenUpdateOne) SetHash(s string) *PasswordTokenUpdateOne
SetHash sets the "hash" field.
func (*PasswordTokenUpdateOne) SetNillableCreatedAt ¶
func (ptuo *PasswordTokenUpdateOne) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenUpdateOne) SetNillableHash ¶
func (ptuo *PasswordTokenUpdateOne) SetNillableHash(s *string) *PasswordTokenUpdateOne
SetNillableHash sets the "hash" field if the given value is not nil.
func (*PasswordTokenUpdateOne) SetUser ¶
func (ptuo *PasswordTokenUpdateOne) SetUser(u *User) *PasswordTokenUpdateOne
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenUpdateOne) SetUserID ¶
func (ptuo *PasswordTokenUpdateOne) SetUserID(id int) *PasswordTokenUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*PasswordTokenUpdateOne) Where ¶
func (ptuo *PasswordTokenUpdateOne) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdateOne
Where appends a list predicates to the PasswordTokenUpdate builder.
type PasswordTokens ¶
type PasswordTokens []*PasswordToken
PasswordTokens is a parsable slice of PasswordToken.
type Price ¶
type Price struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// StripeID holds the value of the "stripe_id" field.
StripeID string `json:"stripe_id,omitempty"`
// Amount holds the value of the "amount" field.
Amount int `json:"amount,omitempty"`
// Quantity holds the value of the "quantity" field.
Quantity int `json:"quantity,omitempty"`
// Type holds the value of the "type" field.
Type price.Type `json:"type,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PriceQuery when eager-loading is set.
Edges PriceEdges `json:"edges"`
// contains filtered or unexported fields
}
Price is the model entity for the Price schema.
func (*Price) QueryProduct ¶
func (pr *Price) QueryProduct() *ProductQuery
QueryProduct queries the "product" edge of the Price entity.
func (*Price) Unwrap ¶
Unwrap unwraps the Price 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 (*Price) Update ¶
func (pr *Price) Update() *PriceUpdateOne
Update returns a builder for updating this Price. Note that you need to call Price.Unwrap() before calling this method if this Price was returned from a transaction, and the transaction was committed or rolled back.
type PriceClient ¶
type PriceClient struct {
// contains filtered or unexported fields
}
PriceClient is a client for the Price schema.
func NewPriceClient ¶
func NewPriceClient(c config) *PriceClient
NewPriceClient returns a client for the Price from the given config.
func (*PriceClient) Create ¶
func (c *PriceClient) Create() *PriceCreate
Create returns a builder for creating a Price entity.
func (*PriceClient) CreateBulk ¶
func (c *PriceClient) CreateBulk(builders ...*PriceCreate) *PriceCreateBulk
CreateBulk returns a builder for creating a bulk of Price entities.
func (*PriceClient) Delete ¶
func (c *PriceClient) Delete() *PriceDelete
Delete returns a delete builder for Price.
func (*PriceClient) DeleteOne ¶
func (c *PriceClient) DeleteOne(pr *Price) *PriceDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PriceClient) DeleteOneID ¶
func (c *PriceClient) DeleteOneID(id int) *PriceDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PriceClient) GetX ¶
func (c *PriceClient) GetX(ctx context.Context, id int) *Price
GetX is like Get, but panics if an error occurs.
func (*PriceClient) Intercept ¶
func (c *PriceClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `price.Intercept(f(g(h())))`.
func (*PriceClient) Interceptors ¶
func (c *PriceClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PriceClient) MapCreateBulk ¶
func (c *PriceClient) MapCreateBulk(slice any, setFunc func(*PriceCreate, int)) *PriceCreateBulk
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 (*PriceClient) Query ¶
func (c *PriceClient) Query() *PriceQuery
Query returns a query builder for Price.
func (*PriceClient) QueryProduct ¶
func (c *PriceClient) QueryProduct(pr *Price) *ProductQuery
QueryProduct queries the product edge of a Price.
func (*PriceClient) QueryUser ¶
func (c *PriceClient) QueryUser(pr *Price) *UserQuery
QueryUser queries the user edge of a Price.
func (*PriceClient) Update ¶
func (c *PriceClient) Update() *PriceUpdate
Update returns an update builder for Price.
func (*PriceClient) UpdateOne ¶
func (c *PriceClient) UpdateOne(pr *Price) *PriceUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PriceClient) UpdateOneID ¶
func (c *PriceClient) UpdateOneID(id int) *PriceUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PriceClient) Use ¶
func (c *PriceClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `price.Hooks(f(g(h())))`.
type PriceCreate ¶
type PriceCreate struct {
// contains filtered or unexported fields
}
PriceCreate is the builder for creating a Price entity.
func (*PriceCreate) Exec ¶
func (pc *PriceCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PriceCreate) ExecX ¶
func (pc *PriceCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PriceCreate) Mutation ¶
func (pc *PriceCreate) Mutation() *PriceMutation
Mutation returns the PriceMutation object of the builder.
func (*PriceCreate) Save ¶
func (pc *PriceCreate) Save(ctx context.Context) (*Price, error)
Save creates the Price in the database.
func (*PriceCreate) SaveX ¶
func (pc *PriceCreate) SaveX(ctx context.Context) *Price
SaveX calls Save and panics if Save returns an error.
func (*PriceCreate) SetAmount ¶
func (pc *PriceCreate) SetAmount(i int) *PriceCreate
SetAmount sets the "amount" field.
func (*PriceCreate) SetCreatedAt ¶
func (pc *PriceCreate) SetCreatedAt(t time.Time) *PriceCreate
SetCreatedAt sets the "created_at" field.
func (*PriceCreate) SetNillableCreatedAt ¶
func (pc *PriceCreate) SetNillableCreatedAt(t *time.Time) *PriceCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PriceCreate) SetNillableType ¶
func (pc *PriceCreate) SetNillableType(pr *price.Type) *PriceCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*PriceCreate) SetProduct ¶
func (pc *PriceCreate) SetProduct(p *Product) *PriceCreate
SetProduct sets the "product" edge to the Product entity.
func (*PriceCreate) SetProductID ¶
func (pc *PriceCreate) SetProductID(id int) *PriceCreate
SetProductID sets the "product" edge to the Product entity by ID.
func (*PriceCreate) SetQuantity ¶
func (pc *PriceCreate) SetQuantity(i int) *PriceCreate
SetQuantity sets the "quantity" field.
func (*PriceCreate) SetStripeID ¶
func (pc *PriceCreate) SetStripeID(s string) *PriceCreate
SetStripeID sets the "stripe_id" field.
func (*PriceCreate) SetType ¶
func (pc *PriceCreate) SetType(pr price.Type) *PriceCreate
SetType sets the "type" field.
func (*PriceCreate) SetUser ¶
func (pc *PriceCreate) SetUser(u *User) *PriceCreate
SetUser sets the "user" edge to the User entity.
func (*PriceCreate) SetUserID ¶
func (pc *PriceCreate) SetUserID(id int) *PriceCreate
SetUserID sets the "user" edge to the User entity by ID.
type PriceCreateBulk ¶
type PriceCreateBulk struct {
// contains filtered or unexported fields
}
PriceCreateBulk is the builder for creating many Price entities in bulk.
func (*PriceCreateBulk) Exec ¶
func (pcb *PriceCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PriceCreateBulk) ExecX ¶
func (pcb *PriceCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PriceDelete ¶
type PriceDelete struct {
// contains filtered or unexported fields
}
PriceDelete is the builder for deleting a Price entity.
func (*PriceDelete) Exec ¶
func (pd *PriceDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PriceDelete) ExecX ¶
func (pd *PriceDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PriceDelete) Where ¶
func (pd *PriceDelete) Where(ps ...predicate.Price) *PriceDelete
Where appends a list predicates to the PriceDelete builder.
type PriceDeleteOne ¶
type PriceDeleteOne struct {
// contains filtered or unexported fields
}
PriceDeleteOne is the builder for deleting a single Price entity.
func (*PriceDeleteOne) Exec ¶
func (pdo *PriceDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PriceDeleteOne) ExecX ¶
func (pdo *PriceDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PriceDeleteOne) Where ¶
func (pdo *PriceDeleteOne) Where(ps ...predicate.Price) *PriceDeleteOne
Where appends a list predicates to the PriceDelete builder.
type PriceEdges ¶
type PriceEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// Product holds the value of the product edge.
Product *Product `json:"product,omitempty"`
// contains filtered or unexported fields
}
PriceEdges holds the relations/edges for other nodes in the graph.
func (PriceEdges) ProductOrErr ¶
func (e PriceEdges) ProductOrErr() (*Product, error)
ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (PriceEdges) UserOrErr ¶
func (e PriceEdges) 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 PriceGroupBy ¶
type PriceGroupBy struct {
// contains filtered or unexported fields
}
PriceGroupBy is the group-by builder for Price entities.
func (*PriceGroupBy) Aggregate ¶
func (pgb *PriceGroupBy) Aggregate(fns ...AggregateFunc) *PriceGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PriceGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PriceGroupBy) Scan ¶
func (pgb *PriceGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PriceGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PriceMutation ¶
type PriceMutation struct {
// contains filtered or unexported fields
}
PriceMutation represents an operation that mutates the Price nodes in the graph.
func (*PriceMutation) AddAmount ¶
func (m *PriceMutation) AddAmount(i int)
AddAmount adds i to the "amount" field.
func (*PriceMutation) AddField ¶
func (m *PriceMutation) 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 (*PriceMutation) AddQuantity ¶
func (m *PriceMutation) AddQuantity(i int)
AddQuantity adds i to the "quantity" field.
func (*PriceMutation) AddedAmount ¶
func (m *PriceMutation) AddedAmount() (r int, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
func (*PriceMutation) AddedEdges ¶
func (m *PriceMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PriceMutation) AddedField ¶
func (m *PriceMutation) 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 (*PriceMutation) AddedFields ¶
func (m *PriceMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PriceMutation) AddedIDs ¶
func (m *PriceMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PriceMutation) AddedQuantity ¶
func (m *PriceMutation) AddedQuantity() (r int, exists bool)
AddedQuantity returns the value that was added to the "quantity" field in this mutation.
func (*PriceMutation) Amount ¶
func (m *PriceMutation) Amount() (r int, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*PriceMutation) ClearEdge ¶
func (m *PriceMutation) 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 (*PriceMutation) ClearField ¶
func (m *PriceMutation) 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 (*PriceMutation) ClearProduct ¶
func (m *PriceMutation) ClearProduct()
ClearProduct clears the "product" edge to the Product entity.
func (*PriceMutation) ClearUser ¶
func (m *PriceMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*PriceMutation) ClearedEdges ¶
func (m *PriceMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PriceMutation) ClearedFields ¶
func (m *PriceMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PriceMutation) Client ¶
func (m PriceMutation) 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 (*PriceMutation) CreatedAt ¶
func (m *PriceMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PriceMutation) EdgeCleared ¶
func (m *PriceMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PriceMutation) Field ¶
func (m *PriceMutation) 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 (*PriceMutation) FieldCleared ¶
func (m *PriceMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PriceMutation) Fields ¶
func (m *PriceMutation) 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 (*PriceMutation) GetType ¶
func (m *PriceMutation) GetType() (r price.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*PriceMutation) ID ¶
func (m *PriceMutation) 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 (*PriceMutation) IDs ¶
func (m *PriceMutation) 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 (*PriceMutation) OldAmount ¶
func (m *PriceMutation) OldAmount(ctx context.Context) (v int, err error)
OldAmount returns the old "amount" field's value of the Price entity. If the Price 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 (*PriceMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Price entity. If the Price 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 (*PriceMutation) 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 (*PriceMutation) OldQuantity ¶
func (m *PriceMutation) OldQuantity(ctx context.Context) (v int, err error)
OldQuantity returns the old "quantity" field's value of the Price entity. If the Price 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 (*PriceMutation) OldStripeID ¶
func (m *PriceMutation) OldStripeID(ctx context.Context) (v string, err error)
OldStripeID returns the old "stripe_id" field's value of the Price entity. If the Price 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 (*PriceMutation) OldType ¶
OldType returns the old "type" field's value of the Price entity. If the Price 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 (*PriceMutation) ProductCleared ¶
func (m *PriceMutation) ProductCleared() bool
ProductCleared reports if the "product" edge to the Product entity was cleared.
func (*PriceMutation) ProductID ¶
func (m *PriceMutation) ProductID() (id int, exists bool)
ProductID returns the "product" edge ID in the mutation.
func (*PriceMutation) ProductIDs ¶
func (m *PriceMutation) ProductIDs() (ids []int)
ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.
func (*PriceMutation) Quantity ¶
func (m *PriceMutation) Quantity() (r int, exists bool)
Quantity returns the value of the "quantity" field in the mutation.
func (*PriceMutation) RemovedEdges ¶
func (m *PriceMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PriceMutation) RemovedIDs ¶
func (m *PriceMutation) 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 (*PriceMutation) ResetAmount ¶
func (m *PriceMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*PriceMutation) ResetCreatedAt ¶
func (m *PriceMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PriceMutation) ResetEdge ¶
func (m *PriceMutation) 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 (*PriceMutation) ResetField ¶
func (m *PriceMutation) 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 (*PriceMutation) ResetProduct ¶
func (m *PriceMutation) ResetProduct()
ResetProduct resets all changes to the "product" edge.
func (*PriceMutation) ResetQuantity ¶
func (m *PriceMutation) ResetQuantity()
ResetQuantity resets all changes to the "quantity" field.
func (*PriceMutation) ResetStripeID ¶
func (m *PriceMutation) ResetStripeID()
ResetStripeID resets all changes to the "stripe_id" field.
func (*PriceMutation) ResetType ¶
func (m *PriceMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*PriceMutation) ResetUser ¶
func (m *PriceMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*PriceMutation) SetAmount ¶
func (m *PriceMutation) SetAmount(i int)
SetAmount sets the "amount" field.
func (*PriceMutation) SetCreatedAt ¶
func (m *PriceMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PriceMutation) SetField ¶
func (m *PriceMutation) 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 (*PriceMutation) SetOp ¶
func (m *PriceMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PriceMutation) SetProductID ¶
func (m *PriceMutation) SetProductID(id int)
SetProductID sets the "product" edge to the Product entity by id.
func (*PriceMutation) SetQuantity ¶
func (m *PriceMutation) SetQuantity(i int)
SetQuantity sets the "quantity" field.
func (*PriceMutation) SetStripeID ¶
func (m *PriceMutation) SetStripeID(s string)
SetStripeID sets the "stripe_id" field.
func (*PriceMutation) SetType ¶
func (m *PriceMutation) SetType(pr price.Type)
SetType sets the "type" field.
func (*PriceMutation) SetUserID ¶
func (m *PriceMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*PriceMutation) StripeID ¶
func (m *PriceMutation) StripeID() (r string, exists bool)
StripeID returns the value of the "stripe_id" field in the mutation.
func (PriceMutation) Tx ¶
func (m PriceMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PriceMutation) Type ¶
func (m *PriceMutation) Type() string
Type returns the node type of this mutation (Price).
func (*PriceMutation) UserCleared ¶
func (m *PriceMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*PriceMutation) UserID ¶
func (m *PriceMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*PriceMutation) UserIDs ¶
func (m *PriceMutation) 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 (*PriceMutation) Where ¶
func (m *PriceMutation) Where(ps ...predicate.Price)
Where appends a list predicates to the PriceMutation builder.
func (*PriceMutation) WhereP ¶
func (m *PriceMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PriceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PriceQuery ¶
type PriceQuery struct {
// contains filtered or unexported fields
}
PriceQuery is the builder for querying Price entities.
func (*PriceQuery) Aggregate ¶
func (pq *PriceQuery) Aggregate(fns ...AggregateFunc) *PriceSelect
Aggregate returns a PriceSelect configured with the given aggregations.
func (*PriceQuery) All ¶
func (pq *PriceQuery) All(ctx context.Context) ([]*Price, error)
All executes the query and returns a list of Prices.
func (*PriceQuery) AllX ¶
func (pq *PriceQuery) AllX(ctx context.Context) []*Price
AllX is like All, but panics if an error occurs.
func (*PriceQuery) Clone ¶
func (pq *PriceQuery) Clone() *PriceQuery
Clone returns a duplicate of the PriceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PriceQuery) Count ¶
func (pq *PriceQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PriceQuery) CountX ¶
func (pq *PriceQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PriceQuery) Exist ¶
func (pq *PriceQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PriceQuery) ExistX ¶
func (pq *PriceQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PriceQuery) First ¶
func (pq *PriceQuery) First(ctx context.Context) (*Price, error)
First returns the first Price entity from the query. Returns a *NotFoundError when no Price was found.
func (*PriceQuery) FirstID ¶
func (pq *PriceQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Price ID from the query. Returns a *NotFoundError when no Price ID was found.
func (*PriceQuery) FirstIDX ¶
func (pq *PriceQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PriceQuery) FirstX ¶
func (pq *PriceQuery) FirstX(ctx context.Context) *Price
FirstX is like First, but panics if an error occurs.
func (*PriceQuery) GroupBy ¶
func (pq *PriceQuery) GroupBy(field string, fields ...string) *PriceGroupBy
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 {
StripeID string `json:"stripe_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Price.Query().
GroupBy(price.FieldStripeID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*PriceQuery) IDs ¶
func (pq *PriceQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Price IDs.
func (*PriceQuery) IDsX ¶
func (pq *PriceQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PriceQuery) Limit ¶
func (pq *PriceQuery) Limit(limit int) *PriceQuery
Limit the number of records to be returned by this query.
func (*PriceQuery) Offset ¶
func (pq *PriceQuery) Offset(offset int) *PriceQuery
Offset to start from.
func (*PriceQuery) Only ¶
func (pq *PriceQuery) Only(ctx context.Context) (*Price, error)
Only returns a single Price entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Price entity is found. Returns a *NotFoundError when no Price entities are found.
func (*PriceQuery) OnlyID ¶
func (pq *PriceQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Price ID in the query. Returns a *NotSingularError when more than one Price ID is found. Returns a *NotFoundError when no entities are found.
func (*PriceQuery) OnlyIDX ¶
func (pq *PriceQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PriceQuery) OnlyX ¶
func (pq *PriceQuery) OnlyX(ctx context.Context) *Price
OnlyX is like Only, but panics if an error occurs.
func (*PriceQuery) Order ¶
func (pq *PriceQuery) Order(o ...price.OrderOption) *PriceQuery
Order specifies how the records should be ordered.
func (*PriceQuery) QueryProduct ¶
func (pq *PriceQuery) QueryProduct() *ProductQuery
QueryProduct chains the current query on the "product" edge.
func (*PriceQuery) QueryUser ¶
func (pq *PriceQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*PriceQuery) Select ¶
func (pq *PriceQuery) Select(fields ...string) *PriceSelect
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 {
StripeID string `json:"stripe_id,omitempty"`
}
client.Price.Query().
Select(price.FieldStripeID).
Scan(ctx, &v)
func (*PriceQuery) Unique ¶
func (pq *PriceQuery) Unique(unique bool) *PriceQuery
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 (*PriceQuery) Where ¶
func (pq *PriceQuery) Where(ps ...predicate.Price) *PriceQuery
Where adds a new predicate for the PriceQuery builder.
func (*PriceQuery) WithProduct ¶
func (pq *PriceQuery) WithProduct(opts ...func(*ProductQuery)) *PriceQuery
WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.
func (*PriceQuery) WithUser ¶
func (pq *PriceQuery) WithUser(opts ...func(*UserQuery)) *PriceQuery
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 PriceSelect ¶
type PriceSelect struct {
*PriceQuery
// contains filtered or unexported fields
}
PriceSelect is the builder for selecting fields of Price entities.
func (*PriceSelect) Aggregate ¶
func (ps *PriceSelect) Aggregate(fns ...AggregateFunc) *PriceSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PriceSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PriceSelect) Scan ¶
func (ps *PriceSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PriceSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PriceUpdate ¶
type PriceUpdate struct {
// contains filtered or unexported fields
}
PriceUpdate is the builder for updating Price entities.
func (*PriceUpdate) AddAmount ¶
func (pu *PriceUpdate) AddAmount(i int) *PriceUpdate
AddAmount adds i to the "amount" field.
func (*PriceUpdate) AddQuantity ¶
func (pu *PriceUpdate) AddQuantity(i int) *PriceUpdate
AddQuantity adds i to the "quantity" field.
func (*PriceUpdate) ClearProduct ¶
func (pu *PriceUpdate) ClearProduct() *PriceUpdate
ClearProduct clears the "product" edge to the Product entity.
func (*PriceUpdate) ClearUser ¶
func (pu *PriceUpdate) ClearUser() *PriceUpdate
ClearUser clears the "user" edge to the User entity.
func (*PriceUpdate) Exec ¶
func (pu *PriceUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PriceUpdate) ExecX ¶
func (pu *PriceUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PriceUpdate) Mutation ¶
func (pu *PriceUpdate) Mutation() *PriceMutation
Mutation returns the PriceMutation object of the builder.
func (*PriceUpdate) Save ¶
func (pu *PriceUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PriceUpdate) SaveX ¶
func (pu *PriceUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PriceUpdate) SetAmount ¶
func (pu *PriceUpdate) SetAmount(i int) *PriceUpdate
SetAmount sets the "amount" field.
func (*PriceUpdate) SetNillableAmount ¶
func (pu *PriceUpdate) SetNillableAmount(i *int) *PriceUpdate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*PriceUpdate) SetNillableQuantity ¶
func (pu *PriceUpdate) SetNillableQuantity(i *int) *PriceUpdate
SetNillableQuantity sets the "quantity" field if the given value is not nil.
func (*PriceUpdate) SetNillableStripeID ¶
func (pu *PriceUpdate) SetNillableStripeID(s *string) *PriceUpdate
SetNillableStripeID sets the "stripe_id" field if the given value is not nil.
func (*PriceUpdate) SetNillableType ¶
func (pu *PriceUpdate) SetNillableType(pr *price.Type) *PriceUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*PriceUpdate) SetProduct ¶
func (pu *PriceUpdate) SetProduct(p *Product) *PriceUpdate
SetProduct sets the "product" edge to the Product entity.
func (*PriceUpdate) SetProductID ¶
func (pu *PriceUpdate) SetProductID(id int) *PriceUpdate
SetProductID sets the "product" edge to the Product entity by ID.
func (*PriceUpdate) SetQuantity ¶
func (pu *PriceUpdate) SetQuantity(i int) *PriceUpdate
SetQuantity sets the "quantity" field.
func (*PriceUpdate) SetStripeID ¶
func (pu *PriceUpdate) SetStripeID(s string) *PriceUpdate
SetStripeID sets the "stripe_id" field.
func (*PriceUpdate) SetType ¶
func (pu *PriceUpdate) SetType(pr price.Type) *PriceUpdate
SetType sets the "type" field.
func (*PriceUpdate) SetUser ¶
func (pu *PriceUpdate) SetUser(u *User) *PriceUpdate
SetUser sets the "user" edge to the User entity.
func (*PriceUpdate) SetUserID ¶
func (pu *PriceUpdate) SetUserID(id int) *PriceUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*PriceUpdate) Where ¶
func (pu *PriceUpdate) Where(ps ...predicate.Price) *PriceUpdate
Where appends a list predicates to the PriceUpdate builder.
type PriceUpdateOne ¶
type PriceUpdateOne struct {
// contains filtered or unexported fields
}
PriceUpdateOne is the builder for updating a single Price entity.
func (*PriceUpdateOne) AddAmount ¶
func (puo *PriceUpdateOne) AddAmount(i int) *PriceUpdateOne
AddAmount adds i to the "amount" field.
func (*PriceUpdateOne) AddQuantity ¶
func (puo *PriceUpdateOne) AddQuantity(i int) *PriceUpdateOne
AddQuantity adds i to the "quantity" field.
func (*PriceUpdateOne) ClearProduct ¶
func (puo *PriceUpdateOne) ClearProduct() *PriceUpdateOne
ClearProduct clears the "product" edge to the Product entity.
func (*PriceUpdateOne) ClearUser ¶
func (puo *PriceUpdateOne) ClearUser() *PriceUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*PriceUpdateOne) Exec ¶
func (puo *PriceUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PriceUpdateOne) ExecX ¶
func (puo *PriceUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PriceUpdateOne) Mutation ¶
func (puo *PriceUpdateOne) Mutation() *PriceMutation
Mutation returns the PriceMutation object of the builder.
func (*PriceUpdateOne) Save ¶
func (puo *PriceUpdateOne) Save(ctx context.Context) (*Price, error)
Save executes the query and returns the updated Price entity.
func (*PriceUpdateOne) SaveX ¶
func (puo *PriceUpdateOne) SaveX(ctx context.Context) *Price
SaveX is like Save, but panics if an error occurs.
func (*PriceUpdateOne) Select ¶
func (puo *PriceUpdateOne) Select(field string, fields ...string) *PriceUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PriceUpdateOne) SetAmount ¶
func (puo *PriceUpdateOne) SetAmount(i int) *PriceUpdateOne
SetAmount sets the "amount" field.
func (*PriceUpdateOne) SetNillableAmount ¶
func (puo *PriceUpdateOne) SetNillableAmount(i *int) *PriceUpdateOne
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*PriceUpdateOne) SetNillableQuantity ¶
func (puo *PriceUpdateOne) SetNillableQuantity(i *int) *PriceUpdateOne
SetNillableQuantity sets the "quantity" field if the given value is not nil.
func (*PriceUpdateOne) SetNillableStripeID ¶
func (puo *PriceUpdateOne) SetNillableStripeID(s *string) *PriceUpdateOne
SetNillableStripeID sets the "stripe_id" field if the given value is not nil.
func (*PriceUpdateOne) SetNillableType ¶
func (puo *PriceUpdateOne) SetNillableType(pr *price.Type) *PriceUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*PriceUpdateOne) SetProduct ¶
func (puo *PriceUpdateOne) SetProduct(p *Product) *PriceUpdateOne
SetProduct sets the "product" edge to the Product entity.
func (*PriceUpdateOne) SetProductID ¶
func (puo *PriceUpdateOne) SetProductID(id int) *PriceUpdateOne
SetProductID sets the "product" edge to the Product entity by ID.
func (*PriceUpdateOne) SetQuantity ¶
func (puo *PriceUpdateOne) SetQuantity(i int) *PriceUpdateOne
SetQuantity sets the "quantity" field.
func (*PriceUpdateOne) SetStripeID ¶
func (puo *PriceUpdateOne) SetStripeID(s string) *PriceUpdateOne
SetStripeID sets the "stripe_id" field.
func (*PriceUpdateOne) SetType ¶
func (puo *PriceUpdateOne) SetType(pr price.Type) *PriceUpdateOne
SetType sets the "type" field.
func (*PriceUpdateOne) SetUser ¶
func (puo *PriceUpdateOne) SetUser(u *User) *PriceUpdateOne
SetUser sets the "user" edge to the User entity.
func (*PriceUpdateOne) SetUserID ¶
func (puo *PriceUpdateOne) SetUserID(id int) *PriceUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*PriceUpdateOne) Where ¶
func (puo *PriceUpdateOne) Where(ps ...predicate.Price) *PriceUpdateOne
Where appends a list predicates to the PriceUpdate builder.
type Product ¶
type Product struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// StripeID holds the value of the "stripe_id" field.
StripeID string `json:"stripe_id,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the ProductQuery when eager-loading is set.
Edges ProductEdges `json:"edges"`
// contains filtered or unexported fields
}
Product is the model entity for the Product schema.
func (*Product) QueryPrices ¶
func (pr *Product) QueryPrices() *PriceQuery
QueryPrices queries the "prices" edge of the Product entity.
func (*Product) Unwrap ¶
Unwrap unwraps the Product 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 (*Product) Update ¶
func (pr *Product) Update() *ProductUpdateOne
Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.
type ProductClient ¶
type ProductClient struct {
// contains filtered or unexported fields
}
ProductClient is a client for the Product schema.
func NewProductClient ¶
func NewProductClient(c config) *ProductClient
NewProductClient returns a client for the Product from the given config.
func (*ProductClient) Create ¶
func (c *ProductClient) Create() *ProductCreate
Create returns a builder for creating a Product entity.
func (*ProductClient) CreateBulk ¶
func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk
CreateBulk returns a builder for creating a bulk of Product entities.
func (*ProductClient) Delete ¶
func (c *ProductClient) Delete() *ProductDelete
Delete returns a delete builder for Product.
func (*ProductClient) DeleteOne ¶
func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProductClient) DeleteOneID ¶
func (c *ProductClient) DeleteOneID(id int) *ProductDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProductClient) GetX ¶
func (c *ProductClient) GetX(ctx context.Context, id int) *Product
GetX is like Get, but panics if an error occurs.
func (*ProductClient) Hooks ¶
func (c *ProductClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProductClient) Intercept ¶
func (c *ProductClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.
func (*ProductClient) Interceptors ¶
func (c *ProductClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProductClient) MapCreateBulk ¶
func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk
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 (*ProductClient) Query ¶
func (c *ProductClient) Query() *ProductQuery
Query returns a query builder for Product.
func (*ProductClient) QueryPrices ¶
func (c *ProductClient) QueryPrices(pr *Product) *PriceQuery
QueryPrices queries the prices edge of a Product.
func (*ProductClient) QueryUser ¶
func (c *ProductClient) QueryUser(pr *Product) *UserQuery
QueryUser queries the user edge of a Product.
func (*ProductClient) Update ¶
func (c *ProductClient) Update() *ProductUpdate
Update returns an update builder for Product.
func (*ProductClient) UpdateOne ¶
func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProductClient) UpdateOneID ¶
func (c *ProductClient) UpdateOneID(id int) *ProductUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProductClient) Use ¶
func (c *ProductClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.
type ProductCreate ¶
type ProductCreate struct {
// contains filtered or unexported fields
}
ProductCreate is the builder for creating a Product entity.
func (*ProductCreate) AddPriceIDs ¶
func (pc *ProductCreate) AddPriceIDs(ids ...int) *ProductCreate
AddPriceIDs adds the "prices" edge to the Price entity by IDs.
func (*ProductCreate) AddPrices ¶
func (pc *ProductCreate) AddPrices(p ...*Price) *ProductCreate
AddPrices adds the "prices" edges to the Price entity.
func (*ProductCreate) Exec ¶
func (pc *ProductCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductCreate) ExecX ¶
func (pc *ProductCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductCreate) Mutation ¶
func (pc *ProductCreate) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductCreate) Save ¶
func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)
Save creates the Product in the database.
func (*ProductCreate) SaveX ¶
func (pc *ProductCreate) SaveX(ctx context.Context) *Product
SaveX calls Save and panics if Save returns an error.
func (*ProductCreate) SetCreatedAt ¶
func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate
SetCreatedAt sets the "created_at" field.
func (*ProductCreate) SetName ¶
func (pc *ProductCreate) SetName(s string) *ProductCreate
SetName sets the "name" field.
func (*ProductCreate) SetNillableCreatedAt ¶
func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProductCreate) SetStripeID ¶
func (pc *ProductCreate) SetStripeID(s string) *ProductCreate
SetStripeID sets the "stripe_id" field.
func (*ProductCreate) SetUser ¶
func (pc *ProductCreate) SetUser(u *User) *ProductCreate
SetUser sets the "user" edge to the User entity.
func (*ProductCreate) SetUserID ¶
func (pc *ProductCreate) SetUserID(id int) *ProductCreate
SetUserID sets the "user" edge to the User entity by ID.
type ProductCreateBulk ¶
type ProductCreateBulk struct {
// contains filtered or unexported fields
}
ProductCreateBulk is the builder for creating many Product entities in bulk.
func (*ProductCreateBulk) Exec ¶
func (pcb *ProductCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductCreateBulk) ExecX ¶
func (pcb *ProductCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProductDelete ¶
type ProductDelete struct {
// contains filtered or unexported fields
}
ProductDelete is the builder for deleting a Product entity.
func (*ProductDelete) Exec ¶
func (pd *ProductDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProductDelete) ExecX ¶
func (pd *ProductDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProductDelete) Where ¶
func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete
Where appends a list predicates to the ProductDelete builder.
type ProductDeleteOne ¶
type ProductDeleteOne struct {
// contains filtered or unexported fields
}
ProductDeleteOne is the builder for deleting a single Product entity.
func (*ProductDeleteOne) Exec ¶
func (pdo *ProductDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProductDeleteOne) ExecX ¶
func (pdo *ProductDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductDeleteOne) Where ¶
func (pdo *ProductDeleteOne) Where(ps ...predicate.Product) *ProductDeleteOne
Where appends a list predicates to the ProductDelete builder.
type ProductEdges ¶
type ProductEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// Prices holds the value of the prices edge.
Prices []*Price `json:"prices,omitempty"`
// contains filtered or unexported fields
}
ProductEdges holds the relations/edges for other nodes in the graph.
func (ProductEdges) PricesOrErr ¶
func (e ProductEdges) PricesOrErr() ([]*Price, error)
PricesOrErr returns the Prices value or an error if the edge was not loaded in eager-loading.
func (ProductEdges) UserOrErr ¶
func (e ProductEdges) 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 ProductGroupBy ¶
type ProductGroupBy struct {
// contains filtered or unexported fields
}
ProductGroupBy is the group-by builder for Product entities.
func (*ProductGroupBy) Aggregate ¶
func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProductGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Scan ¶
func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductMutation ¶
type ProductMutation struct {
// contains filtered or unexported fields
}
ProductMutation represents an operation that mutates the Product nodes in the graph.
func (*ProductMutation) AddField ¶
func (m *ProductMutation) 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 (*ProductMutation) AddPriceIDs ¶
func (m *ProductMutation) AddPriceIDs(ids ...int)
AddPriceIDs adds the "prices" edge to the Price entity by ids.
func (*ProductMutation) AddedEdges ¶
func (m *ProductMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProductMutation) AddedField ¶
func (m *ProductMutation) 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 (*ProductMutation) AddedFields ¶
func (m *ProductMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProductMutation) AddedIDs ¶
func (m *ProductMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProductMutation) ClearEdge ¶
func (m *ProductMutation) 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 (*ProductMutation) ClearField ¶
func (m *ProductMutation) 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 (*ProductMutation) ClearPrices ¶
func (m *ProductMutation) ClearPrices()
ClearPrices clears the "prices" edge to the Price entity.
func (*ProductMutation) ClearUser ¶
func (m *ProductMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ProductMutation) ClearedEdges ¶
func (m *ProductMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProductMutation) ClearedFields ¶
func (m *ProductMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProductMutation) Client ¶
func (m ProductMutation) 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 (*ProductMutation) CreatedAt ¶
func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProductMutation) EdgeCleared ¶
func (m *ProductMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProductMutation) Field ¶
func (m *ProductMutation) 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 (*ProductMutation) FieldCleared ¶
func (m *ProductMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProductMutation) Fields ¶
func (m *ProductMutation) 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 (*ProductMutation) ID ¶
func (m *ProductMutation) 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 (*ProductMutation) IDs ¶
func (m *ProductMutation) 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 (*ProductMutation) Name ¶
func (m *ProductMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProductMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Product entity. If the Product 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 (*ProductMutation) 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 (*ProductMutation) OldName ¶
func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Product entity. If the Product 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 (*ProductMutation) OldStripeID ¶
func (m *ProductMutation) OldStripeID(ctx context.Context) (v string, err error)
OldStripeID returns the old "stripe_id" field's value of the Product entity. If the Product 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 (*ProductMutation) PricesCleared ¶
func (m *ProductMutation) PricesCleared() bool
PricesCleared reports if the "prices" edge to the Price entity was cleared.
func (*ProductMutation) PricesIDs ¶
func (m *ProductMutation) PricesIDs() (ids []int)
PricesIDs returns the "prices" edge IDs in the mutation.
func (*ProductMutation) RemovePriceIDs ¶
func (m *ProductMutation) RemovePriceIDs(ids ...int)
RemovePriceIDs removes the "prices" edge to the Price entity by IDs.
func (*ProductMutation) RemovedEdges ¶
func (m *ProductMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProductMutation) RemovedIDs ¶
func (m *ProductMutation) 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 (*ProductMutation) RemovedPricesIDs ¶
func (m *ProductMutation) RemovedPricesIDs() (ids []int)
RemovedPrices returns the removed IDs of the "prices" edge to the Price entity.
func (*ProductMutation) ResetCreatedAt ¶
func (m *ProductMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProductMutation) ResetEdge ¶
func (m *ProductMutation) 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 (*ProductMutation) ResetField ¶
func (m *ProductMutation) 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 (*ProductMutation) ResetName ¶
func (m *ProductMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProductMutation) ResetPrices ¶
func (m *ProductMutation) ResetPrices()
ResetPrices resets all changes to the "prices" edge.
func (*ProductMutation) ResetStripeID ¶
func (m *ProductMutation) ResetStripeID()
ResetStripeID resets all changes to the "stripe_id" field.
func (*ProductMutation) ResetUser ¶
func (m *ProductMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ProductMutation) SetCreatedAt ¶
func (m *ProductMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProductMutation) SetField ¶
func (m *ProductMutation) 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 (*ProductMutation) SetName ¶
func (m *ProductMutation) SetName(s string)
SetName sets the "name" field.
func (*ProductMutation) SetOp ¶
func (m *ProductMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProductMutation) SetStripeID ¶
func (m *ProductMutation) SetStripeID(s string)
SetStripeID sets the "stripe_id" field.
func (*ProductMutation) SetUserID ¶
func (m *ProductMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*ProductMutation) StripeID ¶
func (m *ProductMutation) StripeID() (r string, exists bool)
StripeID returns the value of the "stripe_id" field in the mutation.
func (ProductMutation) Tx ¶
func (m ProductMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProductMutation) Type ¶
func (m *ProductMutation) Type() string
Type returns the node type of this mutation (Product).
func (*ProductMutation) UserCleared ¶
func (m *ProductMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ProductMutation) UserID ¶
func (m *ProductMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*ProductMutation) UserIDs ¶
func (m *ProductMutation) 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 (*ProductMutation) Where ¶
func (m *ProductMutation) Where(ps ...predicate.Product)
Where appends a list predicates to the ProductMutation builder.
func (*ProductMutation) WhereP ¶
func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProductQuery ¶
type ProductQuery struct {
// contains filtered or unexported fields
}
ProductQuery is the builder for querying Product entities.
func (*ProductQuery) Aggregate ¶
func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect
Aggregate returns a ProductSelect configured with the given aggregations.
func (*ProductQuery) All ¶
func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)
All executes the query and returns a list of Products.
func (*ProductQuery) AllX ¶
func (pq *ProductQuery) AllX(ctx context.Context) []*Product
AllX is like All, but panics if an error occurs.
func (*ProductQuery) Clone ¶
func (pq *ProductQuery) Clone() *ProductQuery
Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProductQuery) Count ¶
func (pq *ProductQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProductQuery) CountX ¶
func (pq *ProductQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProductQuery) Exist ¶
func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProductQuery) ExistX ¶
func (pq *ProductQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProductQuery) First ¶
func (pq *ProductQuery) First(ctx context.Context) (*Product, error)
First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.
func (*ProductQuery) FirstID ¶
func (pq *ProductQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.
func (*ProductQuery) FirstIDX ¶
func (pq *ProductQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProductQuery) FirstX ¶
func (pq *ProductQuery) FirstX(ctx context.Context) *Product
FirstX is like First, but panics if an error occurs.
func (*ProductQuery) GroupBy ¶
func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy
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 {
StripeID string `json:"stripe_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Product.Query().
GroupBy(product.FieldStripeID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*ProductQuery) IDs ¶
func (pq *ProductQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Product IDs.
func (*ProductQuery) IDsX ¶
func (pq *ProductQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProductQuery) Limit ¶
func (pq *ProductQuery) Limit(limit int) *ProductQuery
Limit the number of records to be returned by this query.
func (*ProductQuery) Offset ¶
func (pq *ProductQuery) Offset(offset int) *ProductQuery
Offset to start from.
func (*ProductQuery) Only ¶
func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)
Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.
func (*ProductQuery) OnlyID ¶
func (pq *ProductQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.
func (*ProductQuery) OnlyIDX ¶
func (pq *ProductQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProductQuery) OnlyX ¶
func (pq *ProductQuery) OnlyX(ctx context.Context) *Product
OnlyX is like Only, but panics if an error occurs.
func (*ProductQuery) Order ¶
func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery
Order specifies how the records should be ordered.
func (*ProductQuery) QueryPrices ¶
func (pq *ProductQuery) QueryPrices() *PriceQuery
QueryPrices chains the current query on the "prices" edge.
func (*ProductQuery) QueryUser ¶
func (pq *ProductQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ProductQuery) Select ¶
func (pq *ProductQuery) Select(fields ...string) *ProductSelect
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 {
StripeID string `json:"stripe_id,omitempty"`
}
client.Product.Query().
Select(product.FieldStripeID).
Scan(ctx, &v)
func (*ProductQuery) Unique ¶
func (pq *ProductQuery) Unique(unique bool) *ProductQuery
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 (*ProductQuery) Where ¶
func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery
Where adds a new predicate for the ProductQuery builder.
func (*ProductQuery) WithPrices ¶
func (pq *ProductQuery) WithPrices(opts ...func(*PriceQuery)) *ProductQuery
WithPrices tells the query-builder to eager-load the nodes that are connected to the "prices" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProductQuery) WithUser ¶
func (pq *ProductQuery) WithUser(opts ...func(*UserQuery)) *ProductQuery
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 ProductSelect ¶
type ProductSelect struct {
*ProductQuery
// contains filtered or unexported fields
}
ProductSelect is the builder for selecting fields of Product entities.
func (*ProductSelect) Aggregate ¶
func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProductSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Scan ¶
func (ps *ProductSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductUpdate ¶
type ProductUpdate struct {
// contains filtered or unexported fields
}
ProductUpdate is the builder for updating Product entities.
func (*ProductUpdate) AddPriceIDs ¶
func (pu *ProductUpdate) AddPriceIDs(ids ...int) *ProductUpdate
AddPriceIDs adds the "prices" edge to the Price entity by IDs.
func (*ProductUpdate) AddPrices ¶
func (pu *ProductUpdate) AddPrices(p ...*Price) *ProductUpdate
AddPrices adds the "prices" edges to the Price entity.
func (*ProductUpdate) ClearPrices ¶
func (pu *ProductUpdate) ClearPrices() *ProductUpdate
ClearPrices clears all "prices" edges to the Price entity.
func (*ProductUpdate) ClearUser ¶
func (pu *ProductUpdate) ClearUser() *ProductUpdate
ClearUser clears the "user" edge to the User entity.
func (*ProductUpdate) Exec ¶
func (pu *ProductUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductUpdate) ExecX ¶
func (pu *ProductUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpdate) Mutation ¶
func (pu *ProductUpdate) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductUpdate) RemovePriceIDs ¶
func (pu *ProductUpdate) RemovePriceIDs(ids ...int) *ProductUpdate
RemovePriceIDs removes the "prices" edge to Price entities by IDs.
func (*ProductUpdate) RemovePrices ¶
func (pu *ProductUpdate) RemovePrices(p ...*Price) *ProductUpdate
RemovePrices removes "prices" edges to Price entities.
func (*ProductUpdate) Save ¶
func (pu *ProductUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProductUpdate) SaveX ¶
func (pu *ProductUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProductUpdate) SetName ¶
func (pu *ProductUpdate) SetName(s string) *ProductUpdate
SetName sets the "name" field.
func (*ProductUpdate) SetNillableName ¶
func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductUpdate) SetNillableStripeID ¶
func (pu *ProductUpdate) SetNillableStripeID(s *string) *ProductUpdate
SetNillableStripeID sets the "stripe_id" field if the given value is not nil.
func (*ProductUpdate) SetStripeID ¶
func (pu *ProductUpdate) SetStripeID(s string) *ProductUpdate
SetStripeID sets the "stripe_id" field.
func (*ProductUpdate) SetUser ¶
func (pu *ProductUpdate) SetUser(u *User) *ProductUpdate
SetUser sets the "user" edge to the User entity.
func (*ProductUpdate) SetUserID ¶
func (pu *ProductUpdate) SetUserID(id int) *ProductUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*ProductUpdate) Where ¶
func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate
Where appends a list predicates to the ProductUpdate builder.
type ProductUpdateOne ¶
type ProductUpdateOne struct {
// contains filtered or unexported fields
}
ProductUpdateOne is the builder for updating a single Product entity.
func (*ProductUpdateOne) AddPriceIDs ¶
func (puo *ProductUpdateOne) AddPriceIDs(ids ...int) *ProductUpdateOne
AddPriceIDs adds the "prices" edge to the Price entity by IDs.
func (*ProductUpdateOne) AddPrices ¶
func (puo *ProductUpdateOne) AddPrices(p ...*Price) *ProductUpdateOne
AddPrices adds the "prices" edges to the Price entity.
func (*ProductUpdateOne) ClearPrices ¶
func (puo *ProductUpdateOne) ClearPrices() *ProductUpdateOne
ClearPrices clears all "prices" edges to the Price entity.
func (*ProductUpdateOne) ClearUser ¶
func (puo *ProductUpdateOne) ClearUser() *ProductUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ProductUpdateOne) Exec ¶
func (puo *ProductUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProductUpdateOne) ExecX ¶
func (puo *ProductUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpdateOne) Mutation ¶
func (puo *ProductUpdateOne) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductUpdateOne) RemovePriceIDs ¶
func (puo *ProductUpdateOne) RemovePriceIDs(ids ...int) *ProductUpdateOne
RemovePriceIDs removes the "prices" edge to Price entities by IDs.
func (*ProductUpdateOne) RemovePrices ¶
func (puo *ProductUpdateOne) RemovePrices(p ...*Price) *ProductUpdateOne
RemovePrices removes "prices" edges to Price entities.
func (*ProductUpdateOne) Save ¶
func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)
Save executes the query and returns the updated Product entity.
func (*ProductUpdateOne) SaveX ¶
func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product
SaveX is like Save, but panics if an error occurs.
func (*ProductUpdateOne) Select ¶
func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProductUpdateOne) SetName ¶
func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne
SetName sets the "name" field.
func (*ProductUpdateOne) SetNillableName ¶
func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductUpdateOne) SetNillableStripeID ¶
func (puo *ProductUpdateOne) SetNillableStripeID(s *string) *ProductUpdateOne
SetNillableStripeID sets the "stripe_id" field if the given value is not nil.
func (*ProductUpdateOne) SetStripeID ¶
func (puo *ProductUpdateOne) SetStripeID(s string) *ProductUpdateOne
SetStripeID sets the "stripe_id" field.
func (*ProductUpdateOne) SetUser ¶
func (puo *ProductUpdateOne) SetUser(u *User) *ProductUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ProductUpdateOne) SetUserID ¶
func (puo *ProductUpdateOne) SetUserID(id int) *ProductUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*ProductUpdateOne) Where ¶
func (puo *ProductUpdateOne) Where(ps ...predicate.Product) *ProductUpdateOne
Where appends a list predicates to the ProductUpdate 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 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 {
// AI is the client for interacting with the AI builders.
AI *AIClient
// ModelName is the client for interacting with the ModelName builders.
ModelName *ModelNameClient
// PasswordToken is the client for interacting with the PasswordToken builders.
PasswordToken *PasswordTokenClient
// Price is the client for interacting with the Price builders.
Price *PriceClient
// Product is the client for interacting with the Product builders.
Product *ProductClient
// 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"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// Email holds the value of the "email" field.
Email string `json:"email,omitempty"`
// Password holds the value of the "password" field.
Password string `json:"-"`
// Verified holds the value of the "verified" field.
Verified bool `json:"verified,omitempty"`
// Role holds the value of the "role" field.
Role user.Role `json:"role,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_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) QueryModelNames ¶
func (u *User) QueryModelNames() *ModelNameQuery
QueryModelNames queries the "ModelNames" edge of the User entity.
func (*User) QueryOwner ¶
func (u *User) QueryOwner() *PasswordTokenQuery
QueryOwner queries the "owner" edge of the User entity.
func (*User) QueryPrices ¶
func (u *User) QueryPrices() *PriceQuery
QueryPrices queries the "Prices" edge of the User entity.
func (*User) QueryProducts ¶
func (u *User) QueryProducts() *ProductQuery
QueryProducts queries the "Products" 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 (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
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(u *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) QueryAIs ¶
func (c *UserClient) QueryAIs(u *User) *AIQuery
QueryAIs queries the AIs edge of a User.
func (*UserClient) QueryModelNames ¶
func (c *UserClient) QueryModelNames(u *User) *ModelNameQuery
QueryModelNames queries the ModelNames edge of a User.
func (*UserClient) QueryOwner ¶
func (c *UserClient) QueryOwner(u *User) *PasswordTokenQuery
QueryOwner queries the owner edge of a User.
func (*UserClient) QueryPrices ¶
func (c *UserClient) QueryPrices(u *User) *PriceQuery
QueryPrices queries the Prices edge of a User.
func (*UserClient) QueryProducts ¶
func (c *UserClient) QueryProducts(u *User) *ProductQuery
QueryProducts queries the Products 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(u *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) AddAIIDs ¶
func (uc *UserCreate) AddAIIDs(ids ...int) *UserCreate
AddAIIDs adds the "AIs" edge to the AI entity by IDs.
func (*UserCreate) AddAIs ¶
func (uc *UserCreate) AddAIs(a ...*AI) *UserCreate
AddAIs adds the "AIs" edges to the AI entity.
func (*UserCreate) AddModelNameIDs ¶
func (uc *UserCreate) AddModelNameIDs(ids ...int) *UserCreate
AddModelNameIDs adds the "ModelNames" edge to the ModelName entity by IDs.
func (*UserCreate) AddModelNames ¶
func (uc *UserCreate) AddModelNames(m ...*ModelName) *UserCreate
AddModelNames adds the "ModelNames" edges to the ModelName entity.
func (*UserCreate) AddOwner ¶
func (uc *UserCreate) AddOwner(p ...*PasswordToken) *UserCreate
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserCreate) AddOwnerIDs ¶
func (uc *UserCreate) AddOwnerIDs(ids ...int) *UserCreate
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserCreate) AddPriceIDs ¶
func (uc *UserCreate) AddPriceIDs(ids ...int) *UserCreate
AddPriceIDs adds the "Prices" edge to the Price entity by IDs.
func (*UserCreate) AddPrices ¶
func (uc *UserCreate) AddPrices(p ...*Price) *UserCreate
AddPrices adds the "Prices" edges to the Price entity.
func (*UserCreate) AddProductIDs ¶
func (uc *UserCreate) AddProductIDs(ids ...int) *UserCreate
AddProductIDs adds the "Products" edge to the Product entity by IDs.
func (*UserCreate) AddProducts ¶
func (uc *UserCreate) AddProducts(p ...*Product) *UserCreate
AddProducts adds the "Products" edges to the Product entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableRole ¶
func (uc *UserCreate) SetNillableRole(u *user.Role) *UserCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserCreate) SetNillableVerified ¶
func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetRole ¶
func (uc *UserCreate) SetRole(u user.Role) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetVerified ¶
func (uc *UserCreate) SetVerified(b bool) *UserCreate
SetVerified sets the "verified" 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 (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *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 (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *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 (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct {
// Prices holds the value of the Prices edge.
Prices []*Price `json:"Prices,omitempty"`
// Products holds the value of the Products edge.
Products []*Product `json:"Products,omitempty"`
// ModelNames holds the value of the ModelNames edge.
ModelNames []*ModelName `json:"ModelNames,omitempty"`
// AIs holds the value of the AIs edge.
AIs []*AI `json:"AIs,omitempty"`
// Owner holds the value of the owner edge.
Owner []*PasswordToken `json:"owner,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AIsOrErr ¶
AIsOrErr returns the AIs value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ModelNamesOrErr ¶
ModelNamesOrErr returns the ModelNames value or an error if the edge was not loaded in eager-loading.
func (UserEdges) OwnerOrErr ¶
func (e UserEdges) OwnerOrErr() ([]*PasswordToken, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading.
func (UserEdges) PricesOrErr ¶
PricesOrErr returns the Prices value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ProductsOrErr ¶
ProductsOrErr returns the Products 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 (ugb *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 (ugb *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) AIsCleared ¶
func (m *UserMutation) AIsCleared() bool
AIsCleared reports if the "AIs" edge to the AI entity was cleared.
func (*UserMutation) AIsIDs ¶
func (m *UserMutation) AIsIDs() (ids []int)
AIsIDs returns the "AIs" edge IDs in the mutation.
func (*UserMutation) AddAIIDs ¶
func (m *UserMutation) AddAIIDs(ids ...int)
AddAIIDs adds the "AIs" edge to the AI entity by ids.
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) AddModelNameIDs ¶
func (m *UserMutation) AddModelNameIDs(ids ...int)
AddModelNameIDs adds the "ModelNames" edge to the ModelName entity by ids.
func (*UserMutation) AddOwnerIDs ¶
func (m *UserMutation) AddOwnerIDs(ids ...int)
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by ids.
func (*UserMutation) AddPriceIDs ¶
func (m *UserMutation) AddPriceIDs(ids ...int)
AddPriceIDs adds the "Prices" edge to the Price entity by ids.
func (*UserMutation) AddProductIDs ¶
func (m *UserMutation) AddProductIDs(ids ...int)
AddProductIDs adds the "Products" edge to the Product 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) ClearAIs ¶
func (m *UserMutation) ClearAIs()
ClearAIs clears the "AIs" edge to the AI entity.
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) ClearModelNames ¶
func (m *UserMutation) ClearModelNames()
ClearModelNames clears the "ModelNames" edge to the ModelName entity.
func (*UserMutation) ClearOwner ¶
func (m *UserMutation) ClearOwner()
ClearOwner clears the "owner" edge to the PasswordToken entity.
func (*UserMutation) ClearPrices ¶
func (m *UserMutation) ClearPrices()
ClearPrices clears the "Prices" edge to the Price entity.
func (*UserMutation) ClearProducts ¶
func (m *UserMutation) ClearProducts()
ClearProducts clears the "Products" edge to the Product 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) ModelNamesCleared ¶
func (m *UserMutation) ModelNamesCleared() bool
ModelNamesCleared reports if the "ModelNames" edge to the ModelName entity was cleared.
func (*UserMutation) ModelNamesIDs ¶
func (m *UserMutation) ModelNamesIDs() (ids []int)
ModelNamesIDs returns the "ModelNames" edge IDs in the mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field 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) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" 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) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" 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 ¶
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) OldVerified ¶
func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
OldVerified returns the old "verified" 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) OwnerCleared ¶
func (m *UserMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the PasswordToken entity was cleared.
func (*UserMutation) OwnerIDs ¶
func (m *UserMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) PricesCleared ¶
func (m *UserMutation) PricesCleared() bool
PricesCleared reports if the "Prices" edge to the Price entity was cleared.
func (*UserMutation) PricesIDs ¶
func (m *UserMutation) PricesIDs() (ids []int)
PricesIDs returns the "Prices" edge IDs in the mutation.
func (*UserMutation) ProductsCleared ¶
func (m *UserMutation) ProductsCleared() bool
ProductsCleared reports if the "Products" edge to the Product entity was cleared.
func (*UserMutation) ProductsIDs ¶
func (m *UserMutation) ProductsIDs() (ids []int)
ProductsIDs returns the "Products" edge IDs in the mutation.
func (*UserMutation) RemoveAIIDs ¶
func (m *UserMutation) RemoveAIIDs(ids ...int)
RemoveAIIDs removes the "AIs" edge to the AI entity by IDs.
func (*UserMutation) RemoveModelNameIDs ¶
func (m *UserMutation) RemoveModelNameIDs(ids ...int)
RemoveModelNameIDs removes the "ModelNames" edge to the ModelName entity by IDs.
func (*UserMutation) RemoveOwnerIDs ¶
func (m *UserMutation) RemoveOwnerIDs(ids ...int)
RemoveOwnerIDs removes the "owner" edge to the PasswordToken entity by IDs.
func (*UserMutation) RemovePriceIDs ¶
func (m *UserMutation) RemovePriceIDs(ids ...int)
RemovePriceIDs removes the "Prices" edge to the Price entity by IDs.
func (*UserMutation) RemoveProductIDs ¶
func (m *UserMutation) RemoveProductIDs(ids ...int)
RemoveProductIDs removes the "Products" edge to the Product entity by IDs.
func (*UserMutation) RemovedAIsIDs ¶
func (m *UserMutation) RemovedAIsIDs() (ids []int)
RemovedAIs returns the removed IDs of the "AIs" edge to the AI entity.
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) RemovedModelNamesIDs ¶
func (m *UserMutation) RemovedModelNamesIDs() (ids []int)
RemovedModelNames returns the removed IDs of the "ModelNames" edge to the ModelName entity.
func (*UserMutation) RemovedOwnerIDs ¶
func (m *UserMutation) RemovedOwnerIDs() (ids []int)
RemovedOwner returns the removed IDs of the "owner" edge to the PasswordToken entity.
func (*UserMutation) RemovedPricesIDs ¶
func (m *UserMutation) RemovedPricesIDs() (ids []int)
RemovedPrices returns the removed IDs of the "Prices" edge to the Price entity.
func (*UserMutation) RemovedProductsIDs ¶
func (m *UserMutation) RemovedProductsIDs() (ids []int)
RemovedProducts returns the removed IDs of the "Products" edge to the Product entity.
func (*UserMutation) ResetAIs ¶
func (m *UserMutation) ResetAIs()
ResetAIs resets all changes to the "AIs" edge.
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) ResetModelNames ¶
func (m *UserMutation) ResetModelNames()
ResetModelNames resets all changes to the "ModelNames" edge.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetOwner ¶
func (m *UserMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetPrices ¶
func (m *UserMutation) ResetPrices()
ResetPrices resets all changes to the "Prices" edge.
func (*UserMutation) ResetProducts ¶
func (m *UserMutation) ResetProducts()
ResetProducts resets all changes to the "Products" edge.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetVerified ¶
func (m *UserMutation) ResetVerified()
ResetVerified resets all changes to the "verified" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r user.Role, 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) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(u user.Role)
SetRole sets the "role" field.
func (*UserMutation) SetVerified ¶
func (m *UserMutation) SetVerified(b bool)
SetVerified sets the "verified" 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) Verified ¶
func (m *UserMutation) Verified() (r bool, exists bool)
Verified returns the value of the "verified" 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 (uq *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 (uq *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 {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.User.Query().
GroupBy(user.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*UserQuery) Only ¶
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 (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryModelNames ¶
func (uq *UserQuery) QueryModelNames() *ModelNameQuery
QueryModelNames chains the current query on the "ModelNames" edge.
func (*UserQuery) QueryOwner ¶
func (uq *UserQuery) QueryOwner() *PasswordTokenQuery
QueryOwner chains the current query on the "owner" edge.
func (*UserQuery) QueryPrices ¶
func (uq *UserQuery) QueryPrices() *PriceQuery
QueryPrices chains the current query on the "Prices" edge.
func (*UserQuery) QueryProducts ¶
func (uq *UserQuery) QueryProducts() *ProductQuery
QueryProducts chains the current query on the "Products" edge.
func (*UserQuery) Select ¶
func (uq *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 {
Name string `json:"name,omitempty"`
}
client.User.Query().
Select(user.FieldName).
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) WithAIs ¶
WithAIs tells the query-builder to eager-load the nodes that are connected to the "AIs" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithModelNames ¶
func (uq *UserQuery) WithModelNames(opts ...func(*ModelNameQuery)) *UserQuery
WithModelNames tells the query-builder to eager-load the nodes that are connected to the "ModelNames" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithOwner ¶
func (uq *UserQuery) WithOwner(opts ...func(*PasswordTokenQuery)) *UserQuery
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 (*UserQuery) WithPrices ¶
func (uq *UserQuery) WithPrices(opts ...func(*PriceQuery)) *UserQuery
WithPrices tells the query-builder to eager-load the nodes that are connected to the "Prices" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithProducts ¶
func (uq *UserQuery) WithProducts(opts ...func(*ProductQuery)) *UserQuery
WithProducts tells the query-builder to eager-load the nodes that are connected to the "Products" 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 (us *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 (us *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) AddAIIDs ¶
func (uu *UserUpdate) AddAIIDs(ids ...int) *UserUpdate
AddAIIDs adds the "AIs" edge to the AI entity by IDs.
func (*UserUpdate) AddAIs ¶
func (uu *UserUpdate) AddAIs(a ...*AI) *UserUpdate
AddAIs adds the "AIs" edges to the AI entity.
func (*UserUpdate) AddModelNameIDs ¶
func (uu *UserUpdate) AddModelNameIDs(ids ...int) *UserUpdate
AddModelNameIDs adds the "ModelNames" edge to the ModelName entity by IDs.
func (*UserUpdate) AddModelNames ¶
func (uu *UserUpdate) AddModelNames(m ...*ModelName) *UserUpdate
AddModelNames adds the "ModelNames" edges to the ModelName entity.
func (*UserUpdate) AddOwner ¶
func (uu *UserUpdate) AddOwner(p ...*PasswordToken) *UserUpdate
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserUpdate) AddOwnerIDs ¶
func (uu *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserUpdate) AddPriceIDs ¶
func (uu *UserUpdate) AddPriceIDs(ids ...int) *UserUpdate
AddPriceIDs adds the "Prices" edge to the Price entity by IDs.
func (*UserUpdate) AddPrices ¶
func (uu *UserUpdate) AddPrices(p ...*Price) *UserUpdate
AddPrices adds the "Prices" edges to the Price entity.
func (*UserUpdate) AddProductIDs ¶
func (uu *UserUpdate) AddProductIDs(ids ...int) *UserUpdate
AddProductIDs adds the "Products" edge to the Product entity by IDs.
func (*UserUpdate) AddProducts ¶
func (uu *UserUpdate) AddProducts(p ...*Product) *UserUpdate
AddProducts adds the "Products" edges to the Product entity.
func (*UserUpdate) ClearAIs ¶
func (uu *UserUpdate) ClearAIs() *UserUpdate
ClearAIs clears all "AIs" edges to the AI entity.
func (*UserUpdate) ClearModelNames ¶
func (uu *UserUpdate) ClearModelNames() *UserUpdate
ClearModelNames clears all "ModelNames" edges to the ModelName entity.
func (*UserUpdate) ClearOwner ¶
func (uu *UserUpdate) ClearOwner() *UserUpdate
ClearOwner clears all "owner" edges to the PasswordToken entity.
func (*UserUpdate) ClearPrices ¶
func (uu *UserUpdate) ClearPrices() *UserUpdate
ClearPrices clears all "Prices" edges to the Price entity.
func (*UserUpdate) ClearProducts ¶
func (uu *UserUpdate) ClearProducts() *UserUpdate
ClearProducts clears all "Products" edges to the Product entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveAIIDs ¶
func (uu *UserUpdate) RemoveAIIDs(ids ...int) *UserUpdate
RemoveAIIDs removes the "AIs" edge to AI entities by IDs.
func (*UserUpdate) RemoveAIs ¶
func (uu *UserUpdate) RemoveAIs(a ...*AI) *UserUpdate
RemoveAIs removes "AIs" edges to AI entities.
func (*UserUpdate) RemoveModelNameIDs ¶
func (uu *UserUpdate) RemoveModelNameIDs(ids ...int) *UserUpdate
RemoveModelNameIDs removes the "ModelNames" edge to ModelName entities by IDs.
func (*UserUpdate) RemoveModelNames ¶
func (uu *UserUpdate) RemoveModelNames(m ...*ModelName) *UserUpdate
RemoveModelNames removes "ModelNames" edges to ModelName entities.
func (*UserUpdate) RemoveOwner ¶
func (uu *UserUpdate) RemoveOwner(p ...*PasswordToken) *UserUpdate
RemoveOwner removes "owner" edges to PasswordToken entities.
func (*UserUpdate) RemoveOwnerIDs ¶
func (uu *UserUpdate) RemoveOwnerIDs(ids ...int) *UserUpdate
RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.
func (*UserUpdate) RemovePriceIDs ¶
func (uu *UserUpdate) RemovePriceIDs(ids ...int) *UserUpdate
RemovePriceIDs removes the "Prices" edge to Price entities by IDs.
func (*UserUpdate) RemovePrices ¶
func (uu *UserUpdate) RemovePrices(p ...*Price) *UserUpdate
RemovePrices removes "Prices" edges to Price entities.
func (*UserUpdate) RemoveProductIDs ¶
func (uu *UserUpdate) RemoveProductIDs(ids ...int) *UserUpdate
RemoveProductIDs removes the "Products" edge to Product entities by IDs.
func (*UserUpdate) RemoveProducts ¶
func (uu *UserUpdate) RemoveProducts(p ...*Product) *UserUpdate
RemoveProducts removes "Products" edges to Product entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillablePassword ¶
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdate) SetNillableRole ¶
func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdate) SetNillableVerified ¶
func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetRole ¶
func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate
SetRole sets the "role" field.
func (*UserUpdate) SetVerified ¶
func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
SetVerified sets the "verified" field.
func (*UserUpdate) Where ¶
func (uu *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) AddAIIDs ¶
func (uuo *UserUpdateOne) AddAIIDs(ids ...int) *UserUpdateOne
AddAIIDs adds the "AIs" edge to the AI entity by IDs.
func (*UserUpdateOne) AddAIs ¶
func (uuo *UserUpdateOne) AddAIs(a ...*AI) *UserUpdateOne
AddAIs adds the "AIs" edges to the AI entity.
func (*UserUpdateOne) AddModelNameIDs ¶
func (uuo *UserUpdateOne) AddModelNameIDs(ids ...int) *UserUpdateOne
AddModelNameIDs adds the "ModelNames" edge to the ModelName entity by IDs.
func (*UserUpdateOne) AddModelNames ¶
func (uuo *UserUpdateOne) AddModelNames(m ...*ModelName) *UserUpdateOne
AddModelNames adds the "ModelNames" edges to the ModelName entity.
func (*UserUpdateOne) AddOwner ¶
func (uuo *UserUpdateOne) AddOwner(p ...*PasswordToken) *UserUpdateOne
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserUpdateOne) AddOwnerIDs ¶
func (uuo *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserUpdateOne) AddPriceIDs ¶
func (uuo *UserUpdateOne) AddPriceIDs(ids ...int) *UserUpdateOne
AddPriceIDs adds the "Prices" edge to the Price entity by IDs.
func (*UserUpdateOne) AddPrices ¶
func (uuo *UserUpdateOne) AddPrices(p ...*Price) *UserUpdateOne
AddPrices adds the "Prices" edges to the Price entity.
func (*UserUpdateOne) AddProductIDs ¶
func (uuo *UserUpdateOne) AddProductIDs(ids ...int) *UserUpdateOne
AddProductIDs adds the "Products" edge to the Product entity by IDs.
func (*UserUpdateOne) AddProducts ¶
func (uuo *UserUpdateOne) AddProducts(p ...*Product) *UserUpdateOne
AddProducts adds the "Products" edges to the Product entity.
func (*UserUpdateOne) ClearAIs ¶
func (uuo *UserUpdateOne) ClearAIs() *UserUpdateOne
ClearAIs clears all "AIs" edges to the AI entity.
func (*UserUpdateOne) ClearModelNames ¶
func (uuo *UserUpdateOne) ClearModelNames() *UserUpdateOne
ClearModelNames clears all "ModelNames" edges to the ModelName entity.
func (*UserUpdateOne) ClearOwner ¶
func (uuo *UserUpdateOne) ClearOwner() *UserUpdateOne
ClearOwner clears all "owner" edges to the PasswordToken entity.
func (*UserUpdateOne) ClearPrices ¶
func (uuo *UserUpdateOne) ClearPrices() *UserUpdateOne
ClearPrices clears all "Prices" edges to the Price entity.
func (*UserUpdateOne) ClearProducts ¶
func (uuo *UserUpdateOne) ClearProducts() *UserUpdateOne
ClearProducts clears all "Products" edges to the Product entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveAIIDs ¶
func (uuo *UserUpdateOne) RemoveAIIDs(ids ...int) *UserUpdateOne
RemoveAIIDs removes the "AIs" edge to AI entities by IDs.
func (*UserUpdateOne) RemoveAIs ¶
func (uuo *UserUpdateOne) RemoveAIs(a ...*AI) *UserUpdateOne
RemoveAIs removes "AIs" edges to AI entities.
func (*UserUpdateOne) RemoveModelNameIDs ¶
func (uuo *UserUpdateOne) RemoveModelNameIDs(ids ...int) *UserUpdateOne
RemoveModelNameIDs removes the "ModelNames" edge to ModelName entities by IDs.
func (*UserUpdateOne) RemoveModelNames ¶
func (uuo *UserUpdateOne) RemoveModelNames(m ...*ModelName) *UserUpdateOne
RemoveModelNames removes "ModelNames" edges to ModelName entities.
func (*UserUpdateOne) RemoveOwner ¶
func (uuo *UserUpdateOne) RemoveOwner(p ...*PasswordToken) *UserUpdateOne
RemoveOwner removes "owner" edges to PasswordToken entities.
func (*UserUpdateOne) RemoveOwnerIDs ¶
func (uuo *UserUpdateOne) RemoveOwnerIDs(ids ...int) *UserUpdateOne
RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.
func (*UserUpdateOne) RemovePriceIDs ¶
func (uuo *UserUpdateOne) RemovePriceIDs(ids ...int) *UserUpdateOne
RemovePriceIDs removes the "Prices" edge to Price entities by IDs.
func (*UserUpdateOne) RemovePrices ¶
func (uuo *UserUpdateOne) RemovePrices(p ...*Price) *UserUpdateOne
RemovePrices removes "Prices" edges to Price entities.
func (*UserUpdateOne) RemoveProductIDs ¶
func (uuo *UserUpdateOne) RemoveProductIDs(ids ...int) *UserUpdateOne
RemoveProductIDs removes the "Products" edge to Product entities by IDs.
func (*UserUpdateOne) RemoveProducts ¶
func (uuo *UserUpdateOne) RemoveProducts(p ...*Product) *UserUpdateOne
RemoveProducts removes "Products" edges to Product entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *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 (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePassword ¶
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRole ¶
func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdateOne) SetNillableVerified ¶
func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetRole ¶
func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne
SetRole sets the "role" field.
func (*UserUpdateOne) SetVerified ¶
func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
SetVerified sets the "verified" field.
func (*UserUpdateOne) Where ¶
func (uuo *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
¶
- ai.go
- ai_create.go
- ai_delete.go
- ai_query.go
- ai_update.go
- client.go
- ent.go
- generate.go
- modelname.go
- modelname_create.go
- modelname_delete.go
- modelname_query.go
- modelname_update.go
- mutation.go
- passwordtoken.go
- passwordtoken_create.go
- passwordtoken_delete.go
- passwordtoken_query.go
- passwordtoken_update.go
- price.go
- price_create.go
- price_delete.go
- price_query.go
- price_update.go
- product.go
- product_create.go
- product_delete.go
- product_query.go
- product_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go