Documentation ¶
Index ¶
- Constants
- 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 KeyboardSliceToOpenAPI(s []*Keyboard) (_ []openapi.Keyboard, err error)
- func KeycapModelSliceToOpenAPI(s []*KeycapModel) (_ []openapi.Keycaps, err error)
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func SwitchModelSliceToOpenAPI(s []*SwitchModel) (_ []openapi.Switches, err error)
- 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 Keyboard
- func (k *Keyboard) QueryKeycaps() *KeycapModelQuery
- func (k *Keyboard) QuerySwitches() *SwitchModelQuery
- func (k *Keyboard) String() string
- func (e *Keyboard) ToOpenAPI() (*openapi.Keyboard, error)
- func (k *Keyboard) Unwrap() *Keyboard
- func (k *Keyboard) Update() *KeyboardUpdateOne
- func (k *Keyboard) Value(name string) (ent.Value, error)
- type KeyboardClient
- func (c *KeyboardClient) Create() *KeyboardCreate
- func (c *KeyboardClient) CreateBulk(builders ...*KeyboardCreate) *KeyboardCreateBulk
- func (c *KeyboardClient) Delete() *KeyboardDelete
- func (c *KeyboardClient) DeleteOne(k *Keyboard) *KeyboardDeleteOne
- func (c *KeyboardClient) DeleteOneID(id int64) *KeyboardDeleteOne
- func (c *KeyboardClient) Get(ctx context.Context, id int64) (*Keyboard, error)
- func (c *KeyboardClient) GetX(ctx context.Context, id int64) *Keyboard
- func (c *KeyboardClient) Hooks() []Hook
- func (c *KeyboardClient) Intercept(interceptors ...Interceptor)
- func (c *KeyboardClient) Interceptors() []Interceptor
- func (c *KeyboardClient) Query() *KeyboardQuery
- func (c *KeyboardClient) QueryKeycaps(k *Keyboard) *KeycapModelQuery
- func (c *KeyboardClient) QuerySwitches(k *Keyboard) *SwitchModelQuery
- func (c *KeyboardClient) Update() *KeyboardUpdate
- func (c *KeyboardClient) UpdateOne(k *Keyboard) *KeyboardUpdateOne
- func (c *KeyboardClient) UpdateOneID(id int64) *KeyboardUpdateOne
- func (c *KeyboardClient) Use(hooks ...Hook)
- type KeyboardCreate
- func (kc *KeyboardCreate) Exec(ctx context.Context) error
- func (kc *KeyboardCreate) ExecX(ctx context.Context)
- func (kc *KeyboardCreate) Mutation() *KeyboardMutation
- func (kc *KeyboardCreate) Save(ctx context.Context) (*Keyboard, error)
- func (kc *KeyboardCreate) SaveX(ctx context.Context) *Keyboard
- func (kc *KeyboardCreate) SetDiscount(i int64) *KeyboardCreate
- func (kc *KeyboardCreate) SetID(i int64) *KeyboardCreate
- func (kc *KeyboardCreate) SetKeycaps(k *KeycapModel) *KeyboardCreate
- func (kc *KeyboardCreate) SetKeycapsID(id int64) *KeyboardCreate
- func (kc *KeyboardCreate) SetName(s string) *KeyboardCreate
- func (kc *KeyboardCreate) SetNillableDiscount(i *int64) *KeyboardCreate
- func (kc *KeyboardCreate) SetPrice(i int64) *KeyboardCreate
- func (kc *KeyboardCreate) SetSwitches(s *SwitchModel) *KeyboardCreate
- func (kc *KeyboardCreate) SetSwitchesID(id int64) *KeyboardCreate
- type KeyboardCreateBulk
- type KeyboardDelete
- type KeyboardDeleteOne
- type KeyboardEdges
- type KeyboardGroupBy
- func (kgb *KeyboardGroupBy) Aggregate(fns ...AggregateFunc) *KeyboardGroupBy
- func (s *KeyboardGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *KeyboardGroupBy) BoolX(ctx context.Context) bool
- func (s *KeyboardGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *KeyboardGroupBy) BoolsX(ctx context.Context) []bool
- func (s *KeyboardGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *KeyboardGroupBy) Float64X(ctx context.Context) float64
- func (s *KeyboardGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *KeyboardGroupBy) Float64sX(ctx context.Context) []float64
- func (s *KeyboardGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *KeyboardGroupBy) IntX(ctx context.Context) int
- func (s *KeyboardGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *KeyboardGroupBy) IntsX(ctx context.Context) []int
- func (kgb *KeyboardGroupBy) Scan(ctx context.Context, v any) error
- func (s *KeyboardGroupBy) ScanX(ctx context.Context, v any)
- func (s *KeyboardGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *KeyboardGroupBy) StringX(ctx context.Context) string
- func (s *KeyboardGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *KeyboardGroupBy) StringsX(ctx context.Context) []string
- type KeyboardMutation
- func (m *KeyboardMutation) AddDiscount(i int64)
- func (m *KeyboardMutation) AddField(name string, value ent.Value) error
- func (m *KeyboardMutation) AddPrice(i int64)
- func (m *KeyboardMutation) AddedDiscount() (r int64, exists bool)
- func (m *KeyboardMutation) AddedEdges() []string
- func (m *KeyboardMutation) AddedField(name string) (ent.Value, bool)
- func (m *KeyboardMutation) AddedFields() []string
- func (m *KeyboardMutation) AddedIDs(name string) []ent.Value
- func (m *KeyboardMutation) AddedPrice() (r int64, exists bool)
- func (m *KeyboardMutation) ClearDiscount()
- func (m *KeyboardMutation) ClearEdge(name string) error
- func (m *KeyboardMutation) ClearField(name string) error
- func (m *KeyboardMutation) ClearKeycaps()
- func (m *KeyboardMutation) ClearSwitches()
- func (m *KeyboardMutation) ClearedEdges() []string
- func (m *KeyboardMutation) ClearedFields() []string
- func (m KeyboardMutation) Client() *Client
- func (m *KeyboardMutation) Discount() (r int64, exists bool)
- func (m *KeyboardMutation) DiscountCleared() bool
- func (m *KeyboardMutation) EdgeCleared(name string) bool
- func (m *KeyboardMutation) Field(name string) (ent.Value, bool)
- func (m *KeyboardMutation) FieldCleared(name string) bool
- func (m *KeyboardMutation) Fields() []string
- func (m *KeyboardMutation) ID() (id int64, exists bool)
- func (m *KeyboardMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *KeyboardMutation) KeycapsCleared() bool
- func (m *KeyboardMutation) KeycapsID() (id int64, exists bool)
- func (m *KeyboardMutation) KeycapsIDs() (ids []int64)
- func (m *KeyboardMutation) Name() (r string, exists bool)
- func (m *KeyboardMutation) OldDiscount(ctx context.Context) (v *int64, err error)
- func (m *KeyboardMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *KeyboardMutation) OldName(ctx context.Context) (v string, err error)
- func (m *KeyboardMutation) OldPrice(ctx context.Context) (v int64, err error)
- func (m *KeyboardMutation) Op() Op
- func (m *KeyboardMutation) Price() (r int64, exists bool)
- func (m *KeyboardMutation) RemovedEdges() []string
- func (m *KeyboardMutation) RemovedIDs(name string) []ent.Value
- func (m *KeyboardMutation) ResetDiscount()
- func (m *KeyboardMutation) ResetEdge(name string) error
- func (m *KeyboardMutation) ResetField(name string) error
- func (m *KeyboardMutation) ResetKeycaps()
- func (m *KeyboardMutation) ResetName()
- func (m *KeyboardMutation) ResetPrice()
- func (m *KeyboardMutation) ResetSwitches()
- func (m *KeyboardMutation) SetDiscount(i int64)
- func (m *KeyboardMutation) SetField(name string, value ent.Value) error
- func (m *KeyboardMutation) SetID(id int64)
- func (m *KeyboardMutation) SetKeycapsID(id int64)
- func (m *KeyboardMutation) SetName(s string)
- func (m *KeyboardMutation) SetOp(op Op)
- func (m *KeyboardMutation) SetPrice(i int64)
- func (m *KeyboardMutation) SetSwitchesID(id int64)
- func (m *KeyboardMutation) SwitchesCleared() bool
- func (m *KeyboardMutation) SwitchesID() (id int64, exists bool)
- func (m *KeyboardMutation) SwitchesIDs() (ids []int64)
- func (m KeyboardMutation) Tx() (*Tx, error)
- func (m *KeyboardMutation) Type() string
- func (m *KeyboardMutation) Where(ps ...predicate.Keyboard)
- func (m *KeyboardMutation) WhereP(ps ...func(*sql.Selector))
- type KeyboardQuery
- func (kq *KeyboardQuery) Aggregate(fns ...AggregateFunc) *KeyboardSelect
- func (kq *KeyboardQuery) All(ctx context.Context) ([]*Keyboard, error)
- func (kq *KeyboardQuery) AllX(ctx context.Context) []*Keyboard
- func (kq *KeyboardQuery) Clone() *KeyboardQuery
- func (kq *KeyboardQuery) Count(ctx context.Context) (int, error)
- func (kq *KeyboardQuery) CountX(ctx context.Context) int
- func (kq *KeyboardQuery) Exist(ctx context.Context) (bool, error)
- func (kq *KeyboardQuery) ExistX(ctx context.Context) bool
- func (kq *KeyboardQuery) First(ctx context.Context) (*Keyboard, error)
- func (kq *KeyboardQuery) FirstID(ctx context.Context) (id int64, err error)
- func (kq *KeyboardQuery) FirstIDX(ctx context.Context) int64
- func (kq *KeyboardQuery) FirstX(ctx context.Context) *Keyboard
- func (kq *KeyboardQuery) GroupBy(field string, fields ...string) *KeyboardGroupBy
- func (kq *KeyboardQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (kq *KeyboardQuery) IDsX(ctx context.Context) []int64
- func (kq *KeyboardQuery) Limit(limit int) *KeyboardQuery
- func (kq *KeyboardQuery) Offset(offset int) *KeyboardQuery
- func (kq *KeyboardQuery) Only(ctx context.Context) (*Keyboard, error)
- func (kq *KeyboardQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (kq *KeyboardQuery) OnlyIDX(ctx context.Context) int64
- func (kq *KeyboardQuery) OnlyX(ctx context.Context) *Keyboard
- func (kq *KeyboardQuery) Order(o ...keyboard.OrderOption) *KeyboardQuery
- func (kq *KeyboardQuery) QueryKeycaps() *KeycapModelQuery
- func (kq *KeyboardQuery) QuerySwitches() *SwitchModelQuery
- func (kq *KeyboardQuery) Select(fields ...string) *KeyboardSelect
- func (kq *KeyboardQuery) Unique(unique bool) *KeyboardQuery
- func (kq *KeyboardQuery) Where(ps ...predicate.Keyboard) *KeyboardQuery
- func (kq *KeyboardQuery) WithKeycaps(opts ...func(*KeycapModelQuery)) *KeyboardQuery
- func (kq *KeyboardQuery) WithSwitches(opts ...func(*SwitchModelQuery)) *KeyboardQuery
- type KeyboardSelect
- func (ks *KeyboardSelect) Aggregate(fns ...AggregateFunc) *KeyboardSelect
- func (s *KeyboardSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *KeyboardSelect) BoolX(ctx context.Context) bool
- func (s *KeyboardSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *KeyboardSelect) BoolsX(ctx context.Context) []bool
- func (s *KeyboardSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *KeyboardSelect) Float64X(ctx context.Context) float64
- func (s *KeyboardSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *KeyboardSelect) Float64sX(ctx context.Context) []float64
- func (s *KeyboardSelect) Int(ctx context.Context) (_ int, err error)
- func (s *KeyboardSelect) IntX(ctx context.Context) int
- func (s *KeyboardSelect) Ints(ctx context.Context) ([]int, error)
- func (s *KeyboardSelect) IntsX(ctx context.Context) []int
- func (ks *KeyboardSelect) Scan(ctx context.Context, v any) error
- func (s *KeyboardSelect) ScanX(ctx context.Context, v any)
- func (s *KeyboardSelect) String(ctx context.Context) (_ string, err error)
- func (s *KeyboardSelect) StringX(ctx context.Context) string
- func (s *KeyboardSelect) Strings(ctx context.Context) ([]string, error)
- func (s *KeyboardSelect) StringsX(ctx context.Context) []string
- type KeyboardUpdate
- func (ku *KeyboardUpdate) AddDiscount(i int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) AddPrice(i int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) ClearDiscount() *KeyboardUpdate
- func (ku *KeyboardUpdate) ClearKeycaps() *KeyboardUpdate
- func (ku *KeyboardUpdate) ClearSwitches() *KeyboardUpdate
- func (ku *KeyboardUpdate) Exec(ctx context.Context) error
- func (ku *KeyboardUpdate) ExecX(ctx context.Context)
- func (ku *KeyboardUpdate) Mutation() *KeyboardMutation
- func (ku *KeyboardUpdate) Save(ctx context.Context) (int, error)
- func (ku *KeyboardUpdate) SaveX(ctx context.Context) int
- func (ku *KeyboardUpdate) SetDiscount(i int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetKeycaps(k *KeycapModel) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetKeycapsID(id int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetName(s string) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetNillableDiscount(i *int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetPrice(i int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetSwitches(s *SwitchModel) *KeyboardUpdate
- func (ku *KeyboardUpdate) SetSwitchesID(id int64) *KeyboardUpdate
- func (ku *KeyboardUpdate) Where(ps ...predicate.Keyboard) *KeyboardUpdate
- type KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) AddDiscount(i int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) AddPrice(i int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) ClearDiscount() *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) ClearKeycaps() *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) ClearSwitches() *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) Exec(ctx context.Context) error
- func (kuo *KeyboardUpdateOne) ExecX(ctx context.Context)
- func (kuo *KeyboardUpdateOne) Mutation() *KeyboardMutation
- func (kuo *KeyboardUpdateOne) Save(ctx context.Context) (*Keyboard, error)
- func (kuo *KeyboardUpdateOne) SaveX(ctx context.Context) *Keyboard
- func (kuo *KeyboardUpdateOne) Select(field string, fields ...string) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetDiscount(i int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetKeycaps(k *KeycapModel) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetKeycapsID(id int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetName(s string) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetNillableDiscount(i *int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetPrice(i int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetSwitches(s *SwitchModel) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) SetSwitchesID(id int64) *KeyboardUpdateOne
- func (kuo *KeyboardUpdateOne) Where(ps ...predicate.Keyboard) *KeyboardUpdateOne
- type Keyboards
- type KeycapModel
- type KeycapModelClient
- func (c *KeycapModelClient) Create() *KeycapModelCreate
- func (c *KeycapModelClient) CreateBulk(builders ...*KeycapModelCreate) *KeycapModelCreateBulk
- func (c *KeycapModelClient) Delete() *KeycapModelDelete
- func (c *KeycapModelClient) DeleteOne(km *KeycapModel) *KeycapModelDeleteOne
- func (c *KeycapModelClient) DeleteOneID(id int64) *KeycapModelDeleteOne
- func (c *KeycapModelClient) Get(ctx context.Context, id int64) (*KeycapModel, error)
- func (c *KeycapModelClient) GetX(ctx context.Context, id int64) *KeycapModel
- func (c *KeycapModelClient) Hooks() []Hook
- func (c *KeycapModelClient) Intercept(interceptors ...Interceptor)
- func (c *KeycapModelClient) Interceptors() []Interceptor
- func (c *KeycapModelClient) Query() *KeycapModelQuery
- func (c *KeycapModelClient) Update() *KeycapModelUpdate
- func (c *KeycapModelClient) UpdateOne(km *KeycapModel) *KeycapModelUpdateOne
- func (c *KeycapModelClient) UpdateOneID(id int64) *KeycapModelUpdateOne
- func (c *KeycapModelClient) Use(hooks ...Hook)
- type KeycapModelCreate
- func (kmc *KeycapModelCreate) Exec(ctx context.Context) error
- func (kmc *KeycapModelCreate) ExecX(ctx context.Context)
- func (kmc *KeycapModelCreate) Mutation() *KeycapModelMutation
- func (kmc *KeycapModelCreate) Save(ctx context.Context) (*KeycapModel, error)
- func (kmc *KeycapModelCreate) SaveX(ctx context.Context) *KeycapModel
- func (kmc *KeycapModelCreate) SetID(i int64) *KeycapModelCreate
- func (kmc *KeycapModelCreate) SetMaterial(k keycapmodel.Material) *KeycapModelCreate
- func (kmc *KeycapModelCreate) SetName(s string) *KeycapModelCreate
- func (kmc *KeycapModelCreate) SetProfile(s string) *KeycapModelCreate
- type KeycapModelCreateBulk
- type KeycapModelDelete
- type KeycapModelDeleteOne
- type KeycapModelGroupBy
- func (kmgb *KeycapModelGroupBy) Aggregate(fns ...AggregateFunc) *KeycapModelGroupBy
- func (s *KeycapModelGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *KeycapModelGroupBy) BoolX(ctx context.Context) bool
- func (s *KeycapModelGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *KeycapModelGroupBy) BoolsX(ctx context.Context) []bool
- func (s *KeycapModelGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *KeycapModelGroupBy) Float64X(ctx context.Context) float64
- func (s *KeycapModelGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *KeycapModelGroupBy) Float64sX(ctx context.Context) []float64
- func (s *KeycapModelGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *KeycapModelGroupBy) IntX(ctx context.Context) int
- func (s *KeycapModelGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *KeycapModelGroupBy) IntsX(ctx context.Context) []int
- func (kmgb *KeycapModelGroupBy) Scan(ctx context.Context, v any) error
- func (s *KeycapModelGroupBy) ScanX(ctx context.Context, v any)
- func (s *KeycapModelGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *KeycapModelGroupBy) StringX(ctx context.Context) string
- func (s *KeycapModelGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *KeycapModelGroupBy) StringsX(ctx context.Context) []string
- type KeycapModelMutation
- func (m *KeycapModelMutation) AddField(name string, value ent.Value) error
- func (m *KeycapModelMutation) AddedEdges() []string
- func (m *KeycapModelMutation) AddedField(name string) (ent.Value, bool)
- func (m *KeycapModelMutation) AddedFields() []string
- func (m *KeycapModelMutation) AddedIDs(name string) []ent.Value
- func (m *KeycapModelMutation) ClearEdge(name string) error
- func (m *KeycapModelMutation) ClearField(name string) error
- func (m *KeycapModelMutation) ClearedEdges() []string
- func (m *KeycapModelMutation) ClearedFields() []string
- func (m KeycapModelMutation) Client() *Client
- func (m *KeycapModelMutation) EdgeCleared(name string) bool
- func (m *KeycapModelMutation) Field(name string) (ent.Value, bool)
- func (m *KeycapModelMutation) FieldCleared(name string) bool
- func (m *KeycapModelMutation) Fields() []string
- func (m *KeycapModelMutation) ID() (id int64, exists bool)
- func (m *KeycapModelMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *KeycapModelMutation) Material() (r keycapmodel.Material, exists bool)
- func (m *KeycapModelMutation) Name() (r string, exists bool)
- func (m *KeycapModelMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *KeycapModelMutation) OldMaterial(ctx context.Context) (v keycapmodel.Material, err error)
- func (m *KeycapModelMutation) OldName(ctx context.Context) (v string, err error)
- func (m *KeycapModelMutation) OldProfile(ctx context.Context) (v string, err error)
- func (m *KeycapModelMutation) Op() Op
- func (m *KeycapModelMutation) Profile() (r string, exists bool)
- func (m *KeycapModelMutation) RemovedEdges() []string
- func (m *KeycapModelMutation) RemovedIDs(name string) []ent.Value
- func (m *KeycapModelMutation) ResetEdge(name string) error
- func (m *KeycapModelMutation) ResetField(name string) error
- func (m *KeycapModelMutation) ResetMaterial()
- func (m *KeycapModelMutation) ResetName()
- func (m *KeycapModelMutation) ResetProfile()
- func (m *KeycapModelMutation) SetField(name string, value ent.Value) error
- func (m *KeycapModelMutation) SetID(id int64)
- func (m *KeycapModelMutation) SetMaterial(k keycapmodel.Material)
- func (m *KeycapModelMutation) SetName(s string)
- func (m *KeycapModelMutation) SetOp(op Op)
- func (m *KeycapModelMutation) SetProfile(s string)
- func (m KeycapModelMutation) Tx() (*Tx, error)
- func (m *KeycapModelMutation) Type() string
- func (m *KeycapModelMutation) Where(ps ...predicate.KeycapModel)
- func (m *KeycapModelMutation) WhereP(ps ...func(*sql.Selector))
- type KeycapModelQuery
- func (kmq *KeycapModelQuery) Aggregate(fns ...AggregateFunc) *KeycapModelSelect
- func (kmq *KeycapModelQuery) All(ctx context.Context) ([]*KeycapModel, error)
- func (kmq *KeycapModelQuery) AllX(ctx context.Context) []*KeycapModel
- func (kmq *KeycapModelQuery) Clone() *KeycapModelQuery
- func (kmq *KeycapModelQuery) Count(ctx context.Context) (int, error)
- func (kmq *KeycapModelQuery) CountX(ctx context.Context) int
- func (kmq *KeycapModelQuery) Exist(ctx context.Context) (bool, error)
- func (kmq *KeycapModelQuery) ExistX(ctx context.Context) bool
- func (kmq *KeycapModelQuery) First(ctx context.Context) (*KeycapModel, error)
- func (kmq *KeycapModelQuery) FirstID(ctx context.Context) (id int64, err error)
- func (kmq *KeycapModelQuery) FirstIDX(ctx context.Context) int64
- func (kmq *KeycapModelQuery) FirstX(ctx context.Context) *KeycapModel
- func (kmq *KeycapModelQuery) GroupBy(field string, fields ...string) *KeycapModelGroupBy
- func (kmq *KeycapModelQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (kmq *KeycapModelQuery) IDsX(ctx context.Context) []int64
- func (kmq *KeycapModelQuery) Limit(limit int) *KeycapModelQuery
- func (kmq *KeycapModelQuery) Offset(offset int) *KeycapModelQuery
- func (kmq *KeycapModelQuery) Only(ctx context.Context) (*KeycapModel, error)
- func (kmq *KeycapModelQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (kmq *KeycapModelQuery) OnlyIDX(ctx context.Context) int64
- func (kmq *KeycapModelQuery) OnlyX(ctx context.Context) *KeycapModel
- func (kmq *KeycapModelQuery) Order(o ...keycapmodel.OrderOption) *KeycapModelQuery
- func (kmq *KeycapModelQuery) Select(fields ...string) *KeycapModelSelect
- func (kmq *KeycapModelQuery) Unique(unique bool) *KeycapModelQuery
- func (kmq *KeycapModelQuery) Where(ps ...predicate.KeycapModel) *KeycapModelQuery
- type KeycapModelSelect
- func (kms *KeycapModelSelect) Aggregate(fns ...AggregateFunc) *KeycapModelSelect
- func (s *KeycapModelSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *KeycapModelSelect) BoolX(ctx context.Context) bool
- func (s *KeycapModelSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *KeycapModelSelect) BoolsX(ctx context.Context) []bool
- func (s *KeycapModelSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *KeycapModelSelect) Float64X(ctx context.Context) float64
- func (s *KeycapModelSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *KeycapModelSelect) Float64sX(ctx context.Context) []float64
- func (s *KeycapModelSelect) Int(ctx context.Context) (_ int, err error)
- func (s *KeycapModelSelect) IntX(ctx context.Context) int
- func (s *KeycapModelSelect) Ints(ctx context.Context) ([]int, error)
- func (s *KeycapModelSelect) IntsX(ctx context.Context) []int
- func (kms *KeycapModelSelect) Scan(ctx context.Context, v any) error
- func (s *KeycapModelSelect) ScanX(ctx context.Context, v any)
- func (s *KeycapModelSelect) String(ctx context.Context) (_ string, err error)
- func (s *KeycapModelSelect) StringX(ctx context.Context) string
- func (s *KeycapModelSelect) Strings(ctx context.Context) ([]string, error)
- func (s *KeycapModelSelect) StringsX(ctx context.Context) []string
- type KeycapModelUpdate
- func (kmu *KeycapModelUpdate) Exec(ctx context.Context) error
- func (kmu *KeycapModelUpdate) ExecX(ctx context.Context)
- func (kmu *KeycapModelUpdate) Mutation() *KeycapModelMutation
- func (kmu *KeycapModelUpdate) Save(ctx context.Context) (int, error)
- func (kmu *KeycapModelUpdate) SaveX(ctx context.Context) int
- func (kmu *KeycapModelUpdate) SetMaterial(k keycapmodel.Material) *KeycapModelUpdate
- func (kmu *KeycapModelUpdate) SetName(s string) *KeycapModelUpdate
- func (kmu *KeycapModelUpdate) SetProfile(s string) *KeycapModelUpdate
- func (kmu *KeycapModelUpdate) Where(ps ...predicate.KeycapModel) *KeycapModelUpdate
- type KeycapModelUpdateOne
- func (kmuo *KeycapModelUpdateOne) Exec(ctx context.Context) error
- func (kmuo *KeycapModelUpdateOne) ExecX(ctx context.Context)
- func (kmuo *KeycapModelUpdateOne) Mutation() *KeycapModelMutation
- func (kmuo *KeycapModelUpdateOne) Save(ctx context.Context) (*KeycapModel, error)
- func (kmuo *KeycapModelUpdateOne) SaveX(ctx context.Context) *KeycapModel
- func (kmuo *KeycapModelUpdateOne) Select(field string, fields ...string) *KeycapModelUpdateOne
- func (kmuo *KeycapModelUpdateOne) SetMaterial(k keycapmodel.Material) *KeycapModelUpdateOne
- func (kmuo *KeycapModelUpdateOne) SetName(s string) *KeycapModelUpdateOne
- func (kmuo *KeycapModelUpdateOne) SetProfile(s string) *KeycapModelUpdateOne
- func (kmuo *KeycapModelUpdateOne) Where(ps ...predicate.KeycapModel) *KeycapModelUpdateOne
- type KeycapModels
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type SwitchModel
- type SwitchModelClient
- func (c *SwitchModelClient) Create() *SwitchModelCreate
- func (c *SwitchModelClient) CreateBulk(builders ...*SwitchModelCreate) *SwitchModelCreateBulk
- func (c *SwitchModelClient) Delete() *SwitchModelDelete
- func (c *SwitchModelClient) DeleteOne(sm *SwitchModel) *SwitchModelDeleteOne
- func (c *SwitchModelClient) DeleteOneID(id int64) *SwitchModelDeleteOne
- func (c *SwitchModelClient) Get(ctx context.Context, id int64) (*SwitchModel, error)
- func (c *SwitchModelClient) GetX(ctx context.Context, id int64) *SwitchModel
- func (c *SwitchModelClient) Hooks() []Hook
- func (c *SwitchModelClient) Intercept(interceptors ...Interceptor)
- func (c *SwitchModelClient) Interceptors() []Interceptor
- func (c *SwitchModelClient) Query() *SwitchModelQuery
- func (c *SwitchModelClient) Update() *SwitchModelUpdate
- func (c *SwitchModelClient) UpdateOne(sm *SwitchModel) *SwitchModelUpdateOne
- func (c *SwitchModelClient) UpdateOneID(id int64) *SwitchModelUpdateOne
- func (c *SwitchModelClient) Use(hooks ...Hook)
- type SwitchModelCreate
- func (smc *SwitchModelCreate) Exec(ctx context.Context) error
- func (smc *SwitchModelCreate) ExecX(ctx context.Context)
- func (smc *SwitchModelCreate) Mutation() *SwitchModelMutation
- func (smc *SwitchModelCreate) Save(ctx context.Context) (*SwitchModel, error)
- func (smc *SwitchModelCreate) SaveX(ctx context.Context) *SwitchModel
- func (smc *SwitchModelCreate) SetID(i int64) *SwitchModelCreate
- func (smc *SwitchModelCreate) SetName(s string) *SwitchModelCreate
- func (smc *SwitchModelCreate) SetSwitchType(st switchmodel.SwitchType) *SwitchModelCreate
- type SwitchModelCreateBulk
- type SwitchModelDelete
- type SwitchModelDeleteOne
- type SwitchModelGroupBy
- func (smgb *SwitchModelGroupBy) Aggregate(fns ...AggregateFunc) *SwitchModelGroupBy
- func (s *SwitchModelGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SwitchModelGroupBy) BoolX(ctx context.Context) bool
- func (s *SwitchModelGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SwitchModelGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SwitchModelGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SwitchModelGroupBy) Float64X(ctx context.Context) float64
- func (s *SwitchModelGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SwitchModelGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SwitchModelGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SwitchModelGroupBy) IntX(ctx context.Context) int
- func (s *SwitchModelGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SwitchModelGroupBy) IntsX(ctx context.Context) []int
- func (smgb *SwitchModelGroupBy) Scan(ctx context.Context, v any) error
- func (s *SwitchModelGroupBy) ScanX(ctx context.Context, v any)
- func (s *SwitchModelGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SwitchModelGroupBy) StringX(ctx context.Context) string
- func (s *SwitchModelGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SwitchModelGroupBy) StringsX(ctx context.Context) []string
- type SwitchModelMutation
- func (m *SwitchModelMutation) AddField(name string, value ent.Value) error
- func (m *SwitchModelMutation) AddedEdges() []string
- func (m *SwitchModelMutation) AddedField(name string) (ent.Value, bool)
- func (m *SwitchModelMutation) AddedFields() []string
- func (m *SwitchModelMutation) AddedIDs(name string) []ent.Value
- func (m *SwitchModelMutation) ClearEdge(name string) error
- func (m *SwitchModelMutation) ClearField(name string) error
- func (m *SwitchModelMutation) ClearedEdges() []string
- func (m *SwitchModelMutation) ClearedFields() []string
- func (m SwitchModelMutation) Client() *Client
- func (m *SwitchModelMutation) EdgeCleared(name string) bool
- func (m *SwitchModelMutation) Field(name string) (ent.Value, bool)
- func (m *SwitchModelMutation) FieldCleared(name string) bool
- func (m *SwitchModelMutation) Fields() []string
- func (m *SwitchModelMutation) ID() (id int64, exists bool)
- func (m *SwitchModelMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *SwitchModelMutation) Name() (r string, exists bool)
- func (m *SwitchModelMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SwitchModelMutation) OldName(ctx context.Context) (v string, err error)
- func (m *SwitchModelMutation) OldSwitchType(ctx context.Context) (v switchmodel.SwitchType, err error)
- func (m *SwitchModelMutation) Op() Op
- func (m *SwitchModelMutation) RemovedEdges() []string
- func (m *SwitchModelMutation) RemovedIDs(name string) []ent.Value
- func (m *SwitchModelMutation) ResetEdge(name string) error
- func (m *SwitchModelMutation) ResetField(name string) error
- func (m *SwitchModelMutation) ResetName()
- func (m *SwitchModelMutation) ResetSwitchType()
- func (m *SwitchModelMutation) SetField(name string, value ent.Value) error
- func (m *SwitchModelMutation) SetID(id int64)
- func (m *SwitchModelMutation) SetName(s string)
- func (m *SwitchModelMutation) SetOp(op Op)
- func (m *SwitchModelMutation) SetSwitchType(st switchmodel.SwitchType)
- func (m *SwitchModelMutation) SwitchType() (r switchmodel.SwitchType, exists bool)
- func (m SwitchModelMutation) Tx() (*Tx, error)
- func (m *SwitchModelMutation) Type() string
- func (m *SwitchModelMutation) Where(ps ...predicate.SwitchModel)
- func (m *SwitchModelMutation) WhereP(ps ...func(*sql.Selector))
- type SwitchModelQuery
- func (smq *SwitchModelQuery) Aggregate(fns ...AggregateFunc) *SwitchModelSelect
- func (smq *SwitchModelQuery) All(ctx context.Context) ([]*SwitchModel, error)
- func (smq *SwitchModelQuery) AllX(ctx context.Context) []*SwitchModel
- func (smq *SwitchModelQuery) Clone() *SwitchModelQuery
- func (smq *SwitchModelQuery) Count(ctx context.Context) (int, error)
- func (smq *SwitchModelQuery) CountX(ctx context.Context) int
- func (smq *SwitchModelQuery) Exist(ctx context.Context) (bool, error)
- func (smq *SwitchModelQuery) ExistX(ctx context.Context) bool
- func (smq *SwitchModelQuery) First(ctx context.Context) (*SwitchModel, error)
- func (smq *SwitchModelQuery) FirstID(ctx context.Context) (id int64, err error)
- func (smq *SwitchModelQuery) FirstIDX(ctx context.Context) int64
- func (smq *SwitchModelQuery) FirstX(ctx context.Context) *SwitchModel
- func (smq *SwitchModelQuery) GroupBy(field string, fields ...string) *SwitchModelGroupBy
- func (smq *SwitchModelQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (smq *SwitchModelQuery) IDsX(ctx context.Context) []int64
- func (smq *SwitchModelQuery) Limit(limit int) *SwitchModelQuery
- func (smq *SwitchModelQuery) Offset(offset int) *SwitchModelQuery
- func (smq *SwitchModelQuery) Only(ctx context.Context) (*SwitchModel, error)
- func (smq *SwitchModelQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (smq *SwitchModelQuery) OnlyIDX(ctx context.Context) int64
- func (smq *SwitchModelQuery) OnlyX(ctx context.Context) *SwitchModel
- func (smq *SwitchModelQuery) Order(o ...switchmodel.OrderOption) *SwitchModelQuery
- func (smq *SwitchModelQuery) Select(fields ...string) *SwitchModelSelect
- func (smq *SwitchModelQuery) Unique(unique bool) *SwitchModelQuery
- func (smq *SwitchModelQuery) Where(ps ...predicate.SwitchModel) *SwitchModelQuery
- type SwitchModelSelect
- func (sms *SwitchModelSelect) Aggregate(fns ...AggregateFunc) *SwitchModelSelect
- func (s *SwitchModelSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SwitchModelSelect) BoolX(ctx context.Context) bool
- func (s *SwitchModelSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SwitchModelSelect) BoolsX(ctx context.Context) []bool
- func (s *SwitchModelSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SwitchModelSelect) Float64X(ctx context.Context) float64
- func (s *SwitchModelSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SwitchModelSelect) Float64sX(ctx context.Context) []float64
- func (s *SwitchModelSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SwitchModelSelect) IntX(ctx context.Context) int
- func (s *SwitchModelSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SwitchModelSelect) IntsX(ctx context.Context) []int
- func (sms *SwitchModelSelect) Scan(ctx context.Context, v any) error
- func (s *SwitchModelSelect) ScanX(ctx context.Context, v any)
- func (s *SwitchModelSelect) String(ctx context.Context) (_ string, err error)
- func (s *SwitchModelSelect) StringX(ctx context.Context) string
- func (s *SwitchModelSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SwitchModelSelect) StringsX(ctx context.Context) []string
- type SwitchModelUpdate
- func (smu *SwitchModelUpdate) Exec(ctx context.Context) error
- func (smu *SwitchModelUpdate) ExecX(ctx context.Context)
- func (smu *SwitchModelUpdate) Mutation() *SwitchModelMutation
- func (smu *SwitchModelUpdate) Save(ctx context.Context) (int, error)
- func (smu *SwitchModelUpdate) SaveX(ctx context.Context) int
- func (smu *SwitchModelUpdate) SetName(s string) *SwitchModelUpdate
- func (smu *SwitchModelUpdate) SetSwitchType(st switchmodel.SwitchType) *SwitchModelUpdate
- func (smu *SwitchModelUpdate) Where(ps ...predicate.SwitchModel) *SwitchModelUpdate
- type SwitchModelUpdateOne
- func (smuo *SwitchModelUpdateOne) Exec(ctx context.Context) error
- func (smuo *SwitchModelUpdateOne) ExecX(ctx context.Context)
- func (smuo *SwitchModelUpdateOne) Mutation() *SwitchModelMutation
- func (smuo *SwitchModelUpdateOne) Save(ctx context.Context) (*SwitchModel, error)
- func (smuo *SwitchModelUpdateOne) SaveX(ctx context.Context) *SwitchModel
- func (smuo *SwitchModelUpdateOne) Select(field string, fields ...string) *SwitchModelUpdateOne
- func (smuo *SwitchModelUpdateOne) SetName(s string) *SwitchModelUpdateOne
- func (smuo *SwitchModelUpdateOne) SetSwitchType(st switchmodel.SwitchType) *SwitchModelUpdateOne
- func (smuo *SwitchModelUpdateOne) Where(ps ...predicate.SwitchModel) *SwitchModelUpdateOne
- type SwitchModels
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeKeyboard = "Keyboard" TypeKeycapModel = "KeycapModel" TypeSwitchModel = "SwitchModel" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func KeycapModelSliceToOpenAPI ¶
func KeycapModelSliceToOpenAPI(s []*KeycapModel) (_ []openapi.Keycaps, err error)
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
func SwitchModelSliceToOpenAPI ¶
func SwitchModelSliceToOpenAPI(s []*SwitchModel) (_ []openapi.Switches, err error)
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Keyboard is the client for interacting with the Keyboard builders. Keyboard *KeyboardClient // KeycapModel is the client for interacting with the KeycapModel builders. KeycapModel *KeycapModelClient // SwitchModel is the client for interacting with the SwitchModel builders. SwitchModel *SwitchModelClient // 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(). Keyboard. 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 Keyboard ¶
type Keyboard struct { // ID of the ent. ID int64 `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Price holds the value of the "price" field. Price int64 `json:"price,omitempty"` // Discount holds the value of the "discount" field. Discount *int64 `json:"discount,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the KeyboardQuery when eager-loading is set. Edges KeyboardEdges `json:"edges"` // contains filtered or unexported fields }
Keyboard is the model entity for the Keyboard schema.
func (*Keyboard) QueryKeycaps ¶
func (k *Keyboard) QueryKeycaps() *KeycapModelQuery
QueryKeycaps queries the "keycaps" edge of the Keyboard entity.
func (*Keyboard) QuerySwitches ¶
func (k *Keyboard) QuerySwitches() *SwitchModelQuery
QuerySwitches queries the "switches" edge of the Keyboard entity.
func (*Keyboard) Unwrap ¶
Unwrap unwraps the Keyboard 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 (*Keyboard) Update ¶
func (k *Keyboard) Update() *KeyboardUpdateOne
Update returns a builder for updating this Keyboard. Note that you need to call Keyboard.Unwrap() before calling this method if this Keyboard was returned from a transaction, and the transaction was committed or rolled back.
type KeyboardClient ¶
type KeyboardClient struct {
// contains filtered or unexported fields
}
KeyboardClient is a client for the Keyboard schema.
func NewKeyboardClient ¶
func NewKeyboardClient(c config) *KeyboardClient
NewKeyboardClient returns a client for the Keyboard from the given config.
func (*KeyboardClient) Create ¶
func (c *KeyboardClient) Create() *KeyboardCreate
Create returns a builder for creating a Keyboard entity.
func (*KeyboardClient) CreateBulk ¶
func (c *KeyboardClient) CreateBulk(builders ...*KeyboardCreate) *KeyboardCreateBulk
CreateBulk returns a builder for creating a bulk of Keyboard entities.
func (*KeyboardClient) Delete ¶
func (c *KeyboardClient) Delete() *KeyboardDelete
Delete returns a delete builder for Keyboard.
func (*KeyboardClient) DeleteOne ¶
func (c *KeyboardClient) DeleteOne(k *Keyboard) *KeyboardDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*KeyboardClient) DeleteOneID ¶
func (c *KeyboardClient) DeleteOneID(id int64) *KeyboardDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*KeyboardClient) GetX ¶
func (c *KeyboardClient) GetX(ctx context.Context, id int64) *Keyboard
GetX is like Get, but panics if an error occurs.
func (*KeyboardClient) Hooks ¶
func (c *KeyboardClient) Hooks() []Hook
Hooks returns the client hooks.
func (*KeyboardClient) Intercept ¶
func (c *KeyboardClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `keyboard.Intercept(f(g(h())))`.
func (*KeyboardClient) Interceptors ¶
func (c *KeyboardClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*KeyboardClient) Query ¶
func (c *KeyboardClient) Query() *KeyboardQuery
Query returns a query builder for Keyboard.
func (*KeyboardClient) QueryKeycaps ¶
func (c *KeyboardClient) QueryKeycaps(k *Keyboard) *KeycapModelQuery
QueryKeycaps queries the keycaps edge of a Keyboard.
func (*KeyboardClient) QuerySwitches ¶
func (c *KeyboardClient) QuerySwitches(k *Keyboard) *SwitchModelQuery
QuerySwitches queries the switches edge of a Keyboard.
func (*KeyboardClient) Update ¶
func (c *KeyboardClient) Update() *KeyboardUpdate
Update returns an update builder for Keyboard.
func (*KeyboardClient) UpdateOne ¶
func (c *KeyboardClient) UpdateOne(k *Keyboard) *KeyboardUpdateOne
UpdateOne returns an update builder for the given entity.
func (*KeyboardClient) UpdateOneID ¶
func (c *KeyboardClient) UpdateOneID(id int64) *KeyboardUpdateOne
UpdateOneID returns an update builder for the given id.
func (*KeyboardClient) Use ¶
func (c *KeyboardClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `keyboard.Hooks(f(g(h())))`.
type KeyboardCreate ¶
type KeyboardCreate struct {
// contains filtered or unexported fields
}
KeyboardCreate is the builder for creating a Keyboard entity.
func (*KeyboardCreate) Exec ¶
func (kc *KeyboardCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*KeyboardCreate) ExecX ¶
func (kc *KeyboardCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeyboardCreate) Mutation ¶
func (kc *KeyboardCreate) Mutation() *KeyboardMutation
Mutation returns the KeyboardMutation object of the builder.
func (*KeyboardCreate) Save ¶
func (kc *KeyboardCreate) Save(ctx context.Context) (*Keyboard, error)
Save creates the Keyboard in the database.
func (*KeyboardCreate) SaveX ¶
func (kc *KeyboardCreate) SaveX(ctx context.Context) *Keyboard
SaveX calls Save and panics if Save returns an error.
func (*KeyboardCreate) SetDiscount ¶
func (kc *KeyboardCreate) SetDiscount(i int64) *KeyboardCreate
SetDiscount sets the "discount" field.
func (*KeyboardCreate) SetID ¶
func (kc *KeyboardCreate) SetID(i int64) *KeyboardCreate
SetID sets the "id" field.
func (*KeyboardCreate) SetKeycaps ¶
func (kc *KeyboardCreate) SetKeycaps(k *KeycapModel) *KeyboardCreate
SetKeycaps sets the "keycaps" edge to the KeycapModel entity.
func (*KeyboardCreate) SetKeycapsID ¶
func (kc *KeyboardCreate) SetKeycapsID(id int64) *KeyboardCreate
SetKeycapsID sets the "keycaps" edge to the KeycapModel entity by ID.
func (*KeyboardCreate) SetName ¶
func (kc *KeyboardCreate) SetName(s string) *KeyboardCreate
SetName sets the "name" field.
func (*KeyboardCreate) SetNillableDiscount ¶
func (kc *KeyboardCreate) SetNillableDiscount(i *int64) *KeyboardCreate
SetNillableDiscount sets the "discount" field if the given value is not nil.
func (*KeyboardCreate) SetPrice ¶
func (kc *KeyboardCreate) SetPrice(i int64) *KeyboardCreate
SetPrice sets the "price" field.
func (*KeyboardCreate) SetSwitches ¶
func (kc *KeyboardCreate) SetSwitches(s *SwitchModel) *KeyboardCreate
SetSwitches sets the "switches" edge to the SwitchModel entity.
func (*KeyboardCreate) SetSwitchesID ¶
func (kc *KeyboardCreate) SetSwitchesID(id int64) *KeyboardCreate
SetSwitchesID sets the "switches" edge to the SwitchModel entity by ID.
type KeyboardCreateBulk ¶
type KeyboardCreateBulk struct {
// contains filtered or unexported fields
}
KeyboardCreateBulk is the builder for creating many Keyboard entities in bulk.
func (*KeyboardCreateBulk) Exec ¶
func (kcb *KeyboardCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*KeyboardCreateBulk) ExecX ¶
func (kcb *KeyboardCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type KeyboardDelete ¶
type KeyboardDelete struct {
// contains filtered or unexported fields
}
KeyboardDelete is the builder for deleting a Keyboard entity.
func (*KeyboardDelete) Exec ¶
func (kd *KeyboardDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*KeyboardDelete) ExecX ¶
func (kd *KeyboardDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*KeyboardDelete) Where ¶
func (kd *KeyboardDelete) Where(ps ...predicate.Keyboard) *KeyboardDelete
Where appends a list predicates to the KeyboardDelete builder.
type KeyboardDeleteOne ¶
type KeyboardDeleteOne struct {
// contains filtered or unexported fields
}
KeyboardDeleteOne is the builder for deleting a single Keyboard entity.
func (*KeyboardDeleteOne) Exec ¶
func (kdo *KeyboardDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*KeyboardDeleteOne) ExecX ¶
func (kdo *KeyboardDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeyboardDeleteOne) Where ¶
func (kdo *KeyboardDeleteOne) Where(ps ...predicate.Keyboard) *KeyboardDeleteOne
Where appends a list predicates to the KeyboardDelete builder.
type KeyboardEdges ¶
type KeyboardEdges struct { // Switches holds the value of the switches edge. Switches *SwitchModel `json:"switches,omitempty"` // Keycaps holds the value of the keycaps edge. Keycaps *KeycapModel `json:"keycaps,omitempty"` // contains filtered or unexported fields }
KeyboardEdges holds the relations/edges for other nodes in the graph.
func (KeyboardEdges) KeycapsOrErr ¶
func (e KeyboardEdges) KeycapsOrErr() (*KeycapModel, error)
KeycapsOrErr returns the Keycaps value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (KeyboardEdges) SwitchesOrErr ¶
func (e KeyboardEdges) SwitchesOrErr() (*SwitchModel, error)
SwitchesOrErr returns the Switches value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type KeyboardGroupBy ¶
type KeyboardGroupBy struct {
// contains filtered or unexported fields
}
KeyboardGroupBy is the group-by builder for Keyboard entities.
func (*KeyboardGroupBy) Aggregate ¶
func (kgb *KeyboardGroupBy) Aggregate(fns ...AggregateFunc) *KeyboardGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*KeyboardGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KeyboardGroupBy) Scan ¶
func (kgb *KeyboardGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KeyboardGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KeyboardMutation ¶
type KeyboardMutation struct {
// contains filtered or unexported fields
}
KeyboardMutation represents an operation that mutates the Keyboard nodes in the graph.
func (*KeyboardMutation) AddDiscount ¶
func (m *KeyboardMutation) AddDiscount(i int64)
AddDiscount adds i to the "discount" field.
func (*KeyboardMutation) AddField ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) AddPrice ¶
func (m *KeyboardMutation) AddPrice(i int64)
AddPrice adds i to the "price" field.
func (*KeyboardMutation) AddedDiscount ¶
func (m *KeyboardMutation) AddedDiscount() (r int64, exists bool)
AddedDiscount returns the value that was added to the "discount" field in this mutation.
func (*KeyboardMutation) AddedEdges ¶
func (m *KeyboardMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*KeyboardMutation) AddedField ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) AddedFields ¶
func (m *KeyboardMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*KeyboardMutation) AddedIDs ¶
func (m *KeyboardMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*KeyboardMutation) AddedPrice ¶
func (m *KeyboardMutation) AddedPrice() (r int64, exists bool)
AddedPrice returns the value that was added to the "price" field in this mutation.
func (*KeyboardMutation) ClearDiscount ¶
func (m *KeyboardMutation) ClearDiscount()
ClearDiscount clears the value of the "discount" field.
func (*KeyboardMutation) ClearEdge ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ClearField ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ClearKeycaps ¶
func (m *KeyboardMutation) ClearKeycaps()
ClearKeycaps clears the "keycaps" edge to the KeycapModel entity.
func (*KeyboardMutation) ClearSwitches ¶
func (m *KeyboardMutation) ClearSwitches()
ClearSwitches clears the "switches" edge to the SwitchModel entity.
func (*KeyboardMutation) ClearedEdges ¶
func (m *KeyboardMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*KeyboardMutation) ClearedFields ¶
func (m *KeyboardMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (KeyboardMutation) Client ¶
func (m KeyboardMutation) 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 (*KeyboardMutation) Discount ¶
func (m *KeyboardMutation) Discount() (r int64, exists bool)
Discount returns the value of the "discount" field in the mutation.
func (*KeyboardMutation) DiscountCleared ¶
func (m *KeyboardMutation) DiscountCleared() bool
DiscountCleared returns if the "discount" field was cleared in this mutation.
func (*KeyboardMutation) EdgeCleared ¶
func (m *KeyboardMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*KeyboardMutation) Field ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) FieldCleared ¶
func (m *KeyboardMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*KeyboardMutation) Fields ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ID ¶
func (m *KeyboardMutation) ID() (id int64, 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 (*KeyboardMutation) IDs ¶
func (m *KeyboardMutation) IDs(ctx context.Context) ([]int64, 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 (*KeyboardMutation) KeycapsCleared ¶
func (m *KeyboardMutation) KeycapsCleared() bool
KeycapsCleared reports if the "keycaps" edge to the KeycapModel entity was cleared.
func (*KeyboardMutation) KeycapsID ¶
func (m *KeyboardMutation) KeycapsID() (id int64, exists bool)
KeycapsID returns the "keycaps" edge ID in the mutation.
func (*KeyboardMutation) KeycapsIDs ¶
func (m *KeyboardMutation) KeycapsIDs() (ids []int64)
KeycapsIDs returns the "keycaps" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use KeycapsID instead. It exists only for internal usage by the builders.
func (*KeyboardMutation) Name ¶
func (m *KeyboardMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*KeyboardMutation) OldDiscount ¶
func (m *KeyboardMutation) OldDiscount(ctx context.Context) (v *int64, err error)
OldDiscount returns the old "discount" field's value of the Keyboard entity. If the Keyboard 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 (*KeyboardMutation) 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 (*KeyboardMutation) OldName ¶
func (m *KeyboardMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Keyboard entity. If the Keyboard 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 (*KeyboardMutation) OldPrice ¶
func (m *KeyboardMutation) OldPrice(ctx context.Context) (v int64, err error)
OldPrice returns the old "price" field's value of the Keyboard entity. If the Keyboard 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 (*KeyboardMutation) Price ¶
func (m *KeyboardMutation) Price() (r int64, exists bool)
Price returns the value of the "price" field in the mutation.
func (*KeyboardMutation) RemovedEdges ¶
func (m *KeyboardMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*KeyboardMutation) RemovedIDs ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ResetDiscount ¶
func (m *KeyboardMutation) ResetDiscount()
ResetDiscount resets all changes to the "discount" field.
func (*KeyboardMutation) ResetEdge ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ResetField ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) ResetKeycaps ¶
func (m *KeyboardMutation) ResetKeycaps()
ResetKeycaps resets all changes to the "keycaps" edge.
func (*KeyboardMutation) ResetName ¶
func (m *KeyboardMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*KeyboardMutation) ResetPrice ¶
func (m *KeyboardMutation) ResetPrice()
ResetPrice resets all changes to the "price" field.
func (*KeyboardMutation) ResetSwitches ¶
func (m *KeyboardMutation) ResetSwitches()
ResetSwitches resets all changes to the "switches" edge.
func (*KeyboardMutation) SetDiscount ¶
func (m *KeyboardMutation) SetDiscount(i int64)
SetDiscount sets the "discount" field.
func (*KeyboardMutation) SetField ¶
func (m *KeyboardMutation) 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 (*KeyboardMutation) SetID ¶
func (m *KeyboardMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Keyboard entities.
func (*KeyboardMutation) SetKeycapsID ¶
func (m *KeyboardMutation) SetKeycapsID(id int64)
SetKeycapsID sets the "keycaps" edge to the KeycapModel entity by id.
func (*KeyboardMutation) SetName ¶
func (m *KeyboardMutation) SetName(s string)
SetName sets the "name" field.
func (*KeyboardMutation) SetOp ¶
func (m *KeyboardMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*KeyboardMutation) SetPrice ¶
func (m *KeyboardMutation) SetPrice(i int64)
SetPrice sets the "price" field.
func (*KeyboardMutation) SetSwitchesID ¶
func (m *KeyboardMutation) SetSwitchesID(id int64)
SetSwitchesID sets the "switches" edge to the SwitchModel entity by id.
func (*KeyboardMutation) SwitchesCleared ¶
func (m *KeyboardMutation) SwitchesCleared() bool
SwitchesCleared reports if the "switches" edge to the SwitchModel entity was cleared.
func (*KeyboardMutation) SwitchesID ¶
func (m *KeyboardMutation) SwitchesID() (id int64, exists bool)
SwitchesID returns the "switches" edge ID in the mutation.
func (*KeyboardMutation) SwitchesIDs ¶
func (m *KeyboardMutation) SwitchesIDs() (ids []int64)
SwitchesIDs returns the "switches" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SwitchesID instead. It exists only for internal usage by the builders.
func (KeyboardMutation) Tx ¶
func (m KeyboardMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*KeyboardMutation) Type ¶
func (m *KeyboardMutation) Type() string
Type returns the node type of this mutation (Keyboard).
func (*KeyboardMutation) Where ¶
func (m *KeyboardMutation) Where(ps ...predicate.Keyboard)
Where appends a list predicates to the KeyboardMutation builder.
func (*KeyboardMutation) WhereP ¶
func (m *KeyboardMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the KeyboardMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type KeyboardQuery ¶
type KeyboardQuery struct {
// contains filtered or unexported fields
}
KeyboardQuery is the builder for querying Keyboard entities.
func (*KeyboardQuery) Aggregate ¶
func (kq *KeyboardQuery) Aggregate(fns ...AggregateFunc) *KeyboardSelect
Aggregate returns a KeyboardSelect configured with the given aggregations.
func (*KeyboardQuery) All ¶
func (kq *KeyboardQuery) All(ctx context.Context) ([]*Keyboard, error)
All executes the query and returns a list of Keyboards.
func (*KeyboardQuery) AllX ¶
func (kq *KeyboardQuery) AllX(ctx context.Context) []*Keyboard
AllX is like All, but panics if an error occurs.
func (*KeyboardQuery) Clone ¶
func (kq *KeyboardQuery) Clone() *KeyboardQuery
Clone returns a duplicate of the KeyboardQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*KeyboardQuery) Count ¶
func (kq *KeyboardQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*KeyboardQuery) CountX ¶
func (kq *KeyboardQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*KeyboardQuery) Exist ¶
func (kq *KeyboardQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*KeyboardQuery) ExistX ¶
func (kq *KeyboardQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*KeyboardQuery) First ¶
func (kq *KeyboardQuery) First(ctx context.Context) (*Keyboard, error)
First returns the first Keyboard entity from the query. Returns a *NotFoundError when no Keyboard was found.
func (*KeyboardQuery) FirstID ¶
func (kq *KeyboardQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Keyboard ID from the query. Returns a *NotFoundError when no Keyboard ID was found.
func (*KeyboardQuery) FirstIDX ¶
func (kq *KeyboardQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*KeyboardQuery) FirstX ¶
func (kq *KeyboardQuery) FirstX(ctx context.Context) *Keyboard
FirstX is like First, but panics if an error occurs.
func (*KeyboardQuery) GroupBy ¶
func (kq *KeyboardQuery) GroupBy(field string, fields ...string) *KeyboardGroupBy
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.Keyboard.Query(). GroupBy(keyboard.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*KeyboardQuery) IDs ¶
func (kq *KeyboardQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Keyboard IDs.
func (*KeyboardQuery) IDsX ¶
func (kq *KeyboardQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*KeyboardQuery) Limit ¶
func (kq *KeyboardQuery) Limit(limit int) *KeyboardQuery
Limit the number of records to be returned by this query.
func (*KeyboardQuery) Offset ¶
func (kq *KeyboardQuery) Offset(offset int) *KeyboardQuery
Offset to start from.
func (*KeyboardQuery) Only ¶
func (kq *KeyboardQuery) Only(ctx context.Context) (*Keyboard, error)
Only returns a single Keyboard entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Keyboard entity is found. Returns a *NotFoundError when no Keyboard entities are found.
func (*KeyboardQuery) OnlyID ¶
func (kq *KeyboardQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Keyboard ID in the query. Returns a *NotSingularError when more than one Keyboard ID is found. Returns a *NotFoundError when no entities are found.
func (*KeyboardQuery) OnlyIDX ¶
func (kq *KeyboardQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*KeyboardQuery) OnlyX ¶
func (kq *KeyboardQuery) OnlyX(ctx context.Context) *Keyboard
OnlyX is like Only, but panics if an error occurs.
func (*KeyboardQuery) Order ¶
func (kq *KeyboardQuery) Order(o ...keyboard.OrderOption) *KeyboardQuery
Order specifies how the records should be ordered.
func (*KeyboardQuery) QueryKeycaps ¶
func (kq *KeyboardQuery) QueryKeycaps() *KeycapModelQuery
QueryKeycaps chains the current query on the "keycaps" edge.
func (*KeyboardQuery) QuerySwitches ¶
func (kq *KeyboardQuery) QuerySwitches() *SwitchModelQuery
QuerySwitches chains the current query on the "switches" edge.
func (*KeyboardQuery) Select ¶
func (kq *KeyboardQuery) Select(fields ...string) *KeyboardSelect
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.Keyboard.Query(). Select(keyboard.FieldName). Scan(ctx, &v)
func (*KeyboardQuery) Unique ¶
func (kq *KeyboardQuery) Unique(unique bool) *KeyboardQuery
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 (*KeyboardQuery) Where ¶
func (kq *KeyboardQuery) Where(ps ...predicate.Keyboard) *KeyboardQuery
Where adds a new predicate for the KeyboardQuery builder.
func (*KeyboardQuery) WithKeycaps ¶
func (kq *KeyboardQuery) WithKeycaps(opts ...func(*KeycapModelQuery)) *KeyboardQuery
WithKeycaps tells the query-builder to eager-load the nodes that are connected to the "keycaps" edge. The optional arguments are used to configure the query builder of the edge.
func (*KeyboardQuery) WithSwitches ¶
func (kq *KeyboardQuery) WithSwitches(opts ...func(*SwitchModelQuery)) *KeyboardQuery
WithSwitches tells the query-builder to eager-load the nodes that are connected to the "switches" edge. The optional arguments are used to configure the query builder of the edge.
type KeyboardSelect ¶
type KeyboardSelect struct { *KeyboardQuery // contains filtered or unexported fields }
KeyboardSelect is the builder for selecting fields of Keyboard entities.
func (*KeyboardSelect) Aggregate ¶
func (ks *KeyboardSelect) Aggregate(fns ...AggregateFunc) *KeyboardSelect
Aggregate adds the given aggregation functions to the selector query.
func (*KeyboardSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KeyboardSelect) Scan ¶
func (ks *KeyboardSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KeyboardSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KeyboardUpdate ¶
type KeyboardUpdate struct {
// contains filtered or unexported fields
}
KeyboardUpdate is the builder for updating Keyboard entities.
func (*KeyboardUpdate) AddDiscount ¶
func (ku *KeyboardUpdate) AddDiscount(i int64) *KeyboardUpdate
AddDiscount adds i to the "discount" field.
func (*KeyboardUpdate) AddPrice ¶
func (ku *KeyboardUpdate) AddPrice(i int64) *KeyboardUpdate
AddPrice adds i to the "price" field.
func (*KeyboardUpdate) ClearDiscount ¶
func (ku *KeyboardUpdate) ClearDiscount() *KeyboardUpdate
ClearDiscount clears the value of the "discount" field.
func (*KeyboardUpdate) ClearKeycaps ¶
func (ku *KeyboardUpdate) ClearKeycaps() *KeyboardUpdate
ClearKeycaps clears the "keycaps" edge to the KeycapModel entity.
func (*KeyboardUpdate) ClearSwitches ¶
func (ku *KeyboardUpdate) ClearSwitches() *KeyboardUpdate
ClearSwitches clears the "switches" edge to the SwitchModel entity.
func (*KeyboardUpdate) Exec ¶
func (ku *KeyboardUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*KeyboardUpdate) ExecX ¶
func (ku *KeyboardUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeyboardUpdate) Mutation ¶
func (ku *KeyboardUpdate) Mutation() *KeyboardMutation
Mutation returns the KeyboardMutation object of the builder.
func (*KeyboardUpdate) Save ¶
func (ku *KeyboardUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*KeyboardUpdate) SaveX ¶
func (ku *KeyboardUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*KeyboardUpdate) SetDiscount ¶
func (ku *KeyboardUpdate) SetDiscount(i int64) *KeyboardUpdate
SetDiscount sets the "discount" field.
func (*KeyboardUpdate) SetKeycaps ¶
func (ku *KeyboardUpdate) SetKeycaps(k *KeycapModel) *KeyboardUpdate
SetKeycaps sets the "keycaps" edge to the KeycapModel entity.
func (*KeyboardUpdate) SetKeycapsID ¶
func (ku *KeyboardUpdate) SetKeycapsID(id int64) *KeyboardUpdate
SetKeycapsID sets the "keycaps" edge to the KeycapModel entity by ID.
func (*KeyboardUpdate) SetName ¶
func (ku *KeyboardUpdate) SetName(s string) *KeyboardUpdate
SetName sets the "name" field.
func (*KeyboardUpdate) SetNillableDiscount ¶
func (ku *KeyboardUpdate) SetNillableDiscount(i *int64) *KeyboardUpdate
SetNillableDiscount sets the "discount" field if the given value is not nil.
func (*KeyboardUpdate) SetPrice ¶
func (ku *KeyboardUpdate) SetPrice(i int64) *KeyboardUpdate
SetPrice sets the "price" field.
func (*KeyboardUpdate) SetSwitches ¶
func (ku *KeyboardUpdate) SetSwitches(s *SwitchModel) *KeyboardUpdate
SetSwitches sets the "switches" edge to the SwitchModel entity.
func (*KeyboardUpdate) SetSwitchesID ¶
func (ku *KeyboardUpdate) SetSwitchesID(id int64) *KeyboardUpdate
SetSwitchesID sets the "switches" edge to the SwitchModel entity by ID.
func (*KeyboardUpdate) Where ¶
func (ku *KeyboardUpdate) Where(ps ...predicate.Keyboard) *KeyboardUpdate
Where appends a list predicates to the KeyboardUpdate builder.
type KeyboardUpdateOne ¶
type KeyboardUpdateOne struct {
// contains filtered or unexported fields
}
KeyboardUpdateOne is the builder for updating a single Keyboard entity.
func (*KeyboardUpdateOne) AddDiscount ¶
func (kuo *KeyboardUpdateOne) AddDiscount(i int64) *KeyboardUpdateOne
AddDiscount adds i to the "discount" field.
func (*KeyboardUpdateOne) AddPrice ¶
func (kuo *KeyboardUpdateOne) AddPrice(i int64) *KeyboardUpdateOne
AddPrice adds i to the "price" field.
func (*KeyboardUpdateOne) ClearDiscount ¶
func (kuo *KeyboardUpdateOne) ClearDiscount() *KeyboardUpdateOne
ClearDiscount clears the value of the "discount" field.
func (*KeyboardUpdateOne) ClearKeycaps ¶
func (kuo *KeyboardUpdateOne) ClearKeycaps() *KeyboardUpdateOne
ClearKeycaps clears the "keycaps" edge to the KeycapModel entity.
func (*KeyboardUpdateOne) ClearSwitches ¶
func (kuo *KeyboardUpdateOne) ClearSwitches() *KeyboardUpdateOne
ClearSwitches clears the "switches" edge to the SwitchModel entity.
func (*KeyboardUpdateOne) Exec ¶
func (kuo *KeyboardUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*KeyboardUpdateOne) ExecX ¶
func (kuo *KeyboardUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeyboardUpdateOne) Mutation ¶
func (kuo *KeyboardUpdateOne) Mutation() *KeyboardMutation
Mutation returns the KeyboardMutation object of the builder.
func (*KeyboardUpdateOne) Save ¶
func (kuo *KeyboardUpdateOne) Save(ctx context.Context) (*Keyboard, error)
Save executes the query and returns the updated Keyboard entity.
func (*KeyboardUpdateOne) SaveX ¶
func (kuo *KeyboardUpdateOne) SaveX(ctx context.Context) *Keyboard
SaveX is like Save, but panics if an error occurs.
func (*KeyboardUpdateOne) Select ¶
func (kuo *KeyboardUpdateOne) Select(field string, fields ...string) *KeyboardUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*KeyboardUpdateOne) SetDiscount ¶
func (kuo *KeyboardUpdateOne) SetDiscount(i int64) *KeyboardUpdateOne
SetDiscount sets the "discount" field.
func (*KeyboardUpdateOne) SetKeycaps ¶
func (kuo *KeyboardUpdateOne) SetKeycaps(k *KeycapModel) *KeyboardUpdateOne
SetKeycaps sets the "keycaps" edge to the KeycapModel entity.
func (*KeyboardUpdateOne) SetKeycapsID ¶
func (kuo *KeyboardUpdateOne) SetKeycapsID(id int64) *KeyboardUpdateOne
SetKeycapsID sets the "keycaps" edge to the KeycapModel entity by ID.
func (*KeyboardUpdateOne) SetName ¶
func (kuo *KeyboardUpdateOne) SetName(s string) *KeyboardUpdateOne
SetName sets the "name" field.
func (*KeyboardUpdateOne) SetNillableDiscount ¶
func (kuo *KeyboardUpdateOne) SetNillableDiscount(i *int64) *KeyboardUpdateOne
SetNillableDiscount sets the "discount" field if the given value is not nil.
func (*KeyboardUpdateOne) SetPrice ¶
func (kuo *KeyboardUpdateOne) SetPrice(i int64) *KeyboardUpdateOne
SetPrice sets the "price" field.
func (*KeyboardUpdateOne) SetSwitches ¶
func (kuo *KeyboardUpdateOne) SetSwitches(s *SwitchModel) *KeyboardUpdateOne
SetSwitches sets the "switches" edge to the SwitchModel entity.
func (*KeyboardUpdateOne) SetSwitchesID ¶
func (kuo *KeyboardUpdateOne) SetSwitchesID(id int64) *KeyboardUpdateOne
SetSwitchesID sets the "switches" edge to the SwitchModel entity by ID.
func (*KeyboardUpdateOne) Where ¶
func (kuo *KeyboardUpdateOne) Where(ps ...predicate.Keyboard) *KeyboardUpdateOne
Where appends a list predicates to the KeyboardUpdate builder.
type KeycapModel ¶
type KeycapModel struct { // ID of the ent. ID int64 `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Profile holds the value of the "profile" field. Profile string `json:"profile,omitempty"` // Material holds the value of the "material" field. Material keycapmodel.Material `json:"material,omitempty"` // contains filtered or unexported fields }
KeycapModel is the model entity for the KeycapModel schema.
func (*KeycapModel) String ¶
func (km *KeycapModel) String() string
String implements the fmt.Stringer.
func (*KeycapModel) Unwrap ¶
func (km *KeycapModel) Unwrap() *KeycapModel
Unwrap unwraps the KeycapModel 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 (*KeycapModel) Update ¶
func (km *KeycapModel) Update() *KeycapModelUpdateOne
Update returns a builder for updating this KeycapModel. Note that you need to call KeycapModel.Unwrap() before calling this method if this KeycapModel was returned from a transaction, and the transaction was committed or rolled back.
type KeycapModelClient ¶
type KeycapModelClient struct {
// contains filtered or unexported fields
}
KeycapModelClient is a client for the KeycapModel schema.
func NewKeycapModelClient ¶
func NewKeycapModelClient(c config) *KeycapModelClient
NewKeycapModelClient returns a client for the KeycapModel from the given config.
func (*KeycapModelClient) Create ¶
func (c *KeycapModelClient) Create() *KeycapModelCreate
Create returns a builder for creating a KeycapModel entity.
func (*KeycapModelClient) CreateBulk ¶
func (c *KeycapModelClient) CreateBulk(builders ...*KeycapModelCreate) *KeycapModelCreateBulk
CreateBulk returns a builder for creating a bulk of KeycapModel entities.
func (*KeycapModelClient) Delete ¶
func (c *KeycapModelClient) Delete() *KeycapModelDelete
Delete returns a delete builder for KeycapModel.
func (*KeycapModelClient) DeleteOne ¶
func (c *KeycapModelClient) DeleteOne(km *KeycapModel) *KeycapModelDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*KeycapModelClient) DeleteOneID ¶
func (c *KeycapModelClient) DeleteOneID(id int64) *KeycapModelDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*KeycapModelClient) Get ¶
func (c *KeycapModelClient) Get(ctx context.Context, id int64) (*KeycapModel, error)
Get returns a KeycapModel entity by its id.
func (*KeycapModelClient) GetX ¶
func (c *KeycapModelClient) GetX(ctx context.Context, id int64) *KeycapModel
GetX is like Get, but panics if an error occurs.
func (*KeycapModelClient) Hooks ¶
func (c *KeycapModelClient) Hooks() []Hook
Hooks returns the client hooks.
func (*KeycapModelClient) Intercept ¶
func (c *KeycapModelClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `keycapmodel.Intercept(f(g(h())))`.
func (*KeycapModelClient) Interceptors ¶
func (c *KeycapModelClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*KeycapModelClient) Query ¶
func (c *KeycapModelClient) Query() *KeycapModelQuery
Query returns a query builder for KeycapModel.
func (*KeycapModelClient) Update ¶
func (c *KeycapModelClient) Update() *KeycapModelUpdate
Update returns an update builder for KeycapModel.
func (*KeycapModelClient) UpdateOne ¶
func (c *KeycapModelClient) UpdateOne(km *KeycapModel) *KeycapModelUpdateOne
UpdateOne returns an update builder for the given entity.
func (*KeycapModelClient) UpdateOneID ¶
func (c *KeycapModelClient) UpdateOneID(id int64) *KeycapModelUpdateOne
UpdateOneID returns an update builder for the given id.
func (*KeycapModelClient) Use ¶
func (c *KeycapModelClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `keycapmodel.Hooks(f(g(h())))`.
type KeycapModelCreate ¶
type KeycapModelCreate struct {
// contains filtered or unexported fields
}
KeycapModelCreate is the builder for creating a KeycapModel entity.
func (*KeycapModelCreate) Exec ¶
func (kmc *KeycapModelCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*KeycapModelCreate) ExecX ¶
func (kmc *KeycapModelCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelCreate) Mutation ¶
func (kmc *KeycapModelCreate) Mutation() *KeycapModelMutation
Mutation returns the KeycapModelMutation object of the builder.
func (*KeycapModelCreate) Save ¶
func (kmc *KeycapModelCreate) Save(ctx context.Context) (*KeycapModel, error)
Save creates the KeycapModel in the database.
func (*KeycapModelCreate) SaveX ¶
func (kmc *KeycapModelCreate) SaveX(ctx context.Context) *KeycapModel
SaveX calls Save and panics if Save returns an error.
func (*KeycapModelCreate) SetID ¶
func (kmc *KeycapModelCreate) SetID(i int64) *KeycapModelCreate
SetID sets the "id" field.
func (*KeycapModelCreate) SetMaterial ¶
func (kmc *KeycapModelCreate) SetMaterial(k keycapmodel.Material) *KeycapModelCreate
SetMaterial sets the "material" field.
func (*KeycapModelCreate) SetName ¶
func (kmc *KeycapModelCreate) SetName(s string) *KeycapModelCreate
SetName sets the "name" field.
func (*KeycapModelCreate) SetProfile ¶
func (kmc *KeycapModelCreate) SetProfile(s string) *KeycapModelCreate
SetProfile sets the "profile" field.
type KeycapModelCreateBulk ¶
type KeycapModelCreateBulk struct {
// contains filtered or unexported fields
}
KeycapModelCreateBulk is the builder for creating many KeycapModel entities in bulk.
func (*KeycapModelCreateBulk) Exec ¶
func (kmcb *KeycapModelCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*KeycapModelCreateBulk) ExecX ¶
func (kmcb *KeycapModelCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelCreateBulk) Save ¶
func (kmcb *KeycapModelCreateBulk) Save(ctx context.Context) ([]*KeycapModel, error)
Save creates the KeycapModel entities in the database.
func (*KeycapModelCreateBulk) SaveX ¶
func (kmcb *KeycapModelCreateBulk) SaveX(ctx context.Context) []*KeycapModel
SaveX is like Save, but panics if an error occurs.
type KeycapModelDelete ¶
type KeycapModelDelete struct {
// contains filtered or unexported fields
}
KeycapModelDelete is the builder for deleting a KeycapModel entity.
func (*KeycapModelDelete) Exec ¶
func (kmd *KeycapModelDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*KeycapModelDelete) ExecX ¶
func (kmd *KeycapModelDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelDelete) Where ¶
func (kmd *KeycapModelDelete) Where(ps ...predicate.KeycapModel) *KeycapModelDelete
Where appends a list predicates to the KeycapModelDelete builder.
type KeycapModelDeleteOne ¶
type KeycapModelDeleteOne struct {
// contains filtered or unexported fields
}
KeycapModelDeleteOne is the builder for deleting a single KeycapModel entity.
func (*KeycapModelDeleteOne) Exec ¶
func (kmdo *KeycapModelDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*KeycapModelDeleteOne) ExecX ¶
func (kmdo *KeycapModelDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelDeleteOne) Where ¶
func (kmdo *KeycapModelDeleteOne) Where(ps ...predicate.KeycapModel) *KeycapModelDeleteOne
Where appends a list predicates to the KeycapModelDelete builder.
type KeycapModelGroupBy ¶
type KeycapModelGroupBy struct {
// contains filtered or unexported fields
}
KeycapModelGroupBy is the group-by builder for KeycapModel entities.
func (*KeycapModelGroupBy) Aggregate ¶
func (kmgb *KeycapModelGroupBy) Aggregate(fns ...AggregateFunc) *KeycapModelGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*KeycapModelGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KeycapModelGroupBy) Scan ¶
func (kmgb *KeycapModelGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KeycapModelGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KeycapModelMutation ¶
type KeycapModelMutation struct {
// contains filtered or unexported fields
}
KeycapModelMutation represents an operation that mutates the KeycapModel nodes in the graph.
func (*KeycapModelMutation) AddField ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) AddedEdges ¶
func (m *KeycapModelMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*KeycapModelMutation) AddedField ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) AddedFields ¶
func (m *KeycapModelMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*KeycapModelMutation) AddedIDs ¶
func (m *KeycapModelMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*KeycapModelMutation) ClearEdge ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ClearField ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ClearedEdges ¶
func (m *KeycapModelMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*KeycapModelMutation) ClearedFields ¶
func (m *KeycapModelMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (KeycapModelMutation) Client ¶
func (m KeycapModelMutation) 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 (*KeycapModelMutation) EdgeCleared ¶
func (m *KeycapModelMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*KeycapModelMutation) Field ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) FieldCleared ¶
func (m *KeycapModelMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*KeycapModelMutation) Fields ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ID ¶
func (m *KeycapModelMutation) ID() (id int64, 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 (*KeycapModelMutation) IDs ¶
func (m *KeycapModelMutation) IDs(ctx context.Context) ([]int64, 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 (*KeycapModelMutation) Material ¶
func (m *KeycapModelMutation) Material() (r keycapmodel.Material, exists bool)
Material returns the value of the "material" field in the mutation.
func (*KeycapModelMutation) Name ¶
func (m *KeycapModelMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*KeycapModelMutation) 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 (*KeycapModelMutation) OldMaterial ¶
func (m *KeycapModelMutation) OldMaterial(ctx context.Context) (v keycapmodel.Material, err error)
OldMaterial returns the old "material" field's value of the KeycapModel entity. If the KeycapModel 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 (*KeycapModelMutation) OldName ¶
func (m *KeycapModelMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the KeycapModel entity. If the KeycapModel 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 (*KeycapModelMutation) OldProfile ¶
func (m *KeycapModelMutation) OldProfile(ctx context.Context) (v string, err error)
OldProfile returns the old "profile" field's value of the KeycapModel entity. If the KeycapModel 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 (*KeycapModelMutation) Op ¶
func (m *KeycapModelMutation) Op() Op
Op returns the operation name.
func (*KeycapModelMutation) Profile ¶
func (m *KeycapModelMutation) Profile() (r string, exists bool)
Profile returns the value of the "profile" field in the mutation.
func (*KeycapModelMutation) RemovedEdges ¶
func (m *KeycapModelMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*KeycapModelMutation) RemovedIDs ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ResetEdge ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ResetField ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) ResetMaterial ¶
func (m *KeycapModelMutation) ResetMaterial()
ResetMaterial resets all changes to the "material" field.
func (*KeycapModelMutation) ResetName ¶
func (m *KeycapModelMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*KeycapModelMutation) ResetProfile ¶
func (m *KeycapModelMutation) ResetProfile()
ResetProfile resets all changes to the "profile" field.
func (*KeycapModelMutation) SetField ¶
func (m *KeycapModelMutation) 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 (*KeycapModelMutation) SetID ¶
func (m *KeycapModelMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of KeycapModel entities.
func (*KeycapModelMutation) SetMaterial ¶
func (m *KeycapModelMutation) SetMaterial(k keycapmodel.Material)
SetMaterial sets the "material" field.
func (*KeycapModelMutation) SetName ¶
func (m *KeycapModelMutation) SetName(s string)
SetName sets the "name" field.
func (*KeycapModelMutation) SetOp ¶
func (m *KeycapModelMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*KeycapModelMutation) SetProfile ¶
func (m *KeycapModelMutation) SetProfile(s string)
SetProfile sets the "profile" field.
func (KeycapModelMutation) Tx ¶
func (m KeycapModelMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*KeycapModelMutation) Type ¶
func (m *KeycapModelMutation) Type() string
Type returns the node type of this mutation (KeycapModel).
func (*KeycapModelMutation) Where ¶
func (m *KeycapModelMutation) Where(ps ...predicate.KeycapModel)
Where appends a list predicates to the KeycapModelMutation builder.
func (*KeycapModelMutation) WhereP ¶
func (m *KeycapModelMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the KeycapModelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type KeycapModelQuery ¶
type KeycapModelQuery struct {
// contains filtered or unexported fields
}
KeycapModelQuery is the builder for querying KeycapModel entities.
func (*KeycapModelQuery) Aggregate ¶
func (kmq *KeycapModelQuery) Aggregate(fns ...AggregateFunc) *KeycapModelSelect
Aggregate returns a KeycapModelSelect configured with the given aggregations.
func (*KeycapModelQuery) All ¶
func (kmq *KeycapModelQuery) All(ctx context.Context) ([]*KeycapModel, error)
All executes the query and returns a list of KeycapModels.
func (*KeycapModelQuery) AllX ¶
func (kmq *KeycapModelQuery) AllX(ctx context.Context) []*KeycapModel
AllX is like All, but panics if an error occurs.
func (*KeycapModelQuery) Clone ¶
func (kmq *KeycapModelQuery) Clone() *KeycapModelQuery
Clone returns a duplicate of the KeycapModelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*KeycapModelQuery) Count ¶
func (kmq *KeycapModelQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*KeycapModelQuery) CountX ¶
func (kmq *KeycapModelQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*KeycapModelQuery) Exist ¶
func (kmq *KeycapModelQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*KeycapModelQuery) ExistX ¶
func (kmq *KeycapModelQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*KeycapModelQuery) First ¶
func (kmq *KeycapModelQuery) First(ctx context.Context) (*KeycapModel, error)
First returns the first KeycapModel entity from the query. Returns a *NotFoundError when no KeycapModel was found.
func (*KeycapModelQuery) FirstID ¶
func (kmq *KeycapModelQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first KeycapModel ID from the query. Returns a *NotFoundError when no KeycapModel ID was found.
func (*KeycapModelQuery) FirstIDX ¶
func (kmq *KeycapModelQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*KeycapModelQuery) FirstX ¶
func (kmq *KeycapModelQuery) FirstX(ctx context.Context) *KeycapModel
FirstX is like First, but panics if an error occurs.
func (*KeycapModelQuery) GroupBy ¶
func (kmq *KeycapModelQuery) GroupBy(field string, fields ...string) *KeycapModelGroupBy
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.KeycapModel.Query(). GroupBy(keycapmodel.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*KeycapModelQuery) IDs ¶
func (kmq *KeycapModelQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of KeycapModel IDs.
func (*KeycapModelQuery) IDsX ¶
func (kmq *KeycapModelQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*KeycapModelQuery) Limit ¶
func (kmq *KeycapModelQuery) Limit(limit int) *KeycapModelQuery
Limit the number of records to be returned by this query.
func (*KeycapModelQuery) Offset ¶
func (kmq *KeycapModelQuery) Offset(offset int) *KeycapModelQuery
Offset to start from.
func (*KeycapModelQuery) Only ¶
func (kmq *KeycapModelQuery) Only(ctx context.Context) (*KeycapModel, error)
Only returns a single KeycapModel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one KeycapModel entity is found. Returns a *NotFoundError when no KeycapModel entities are found.
func (*KeycapModelQuery) OnlyID ¶
func (kmq *KeycapModelQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only KeycapModel ID in the query. Returns a *NotSingularError when more than one KeycapModel ID is found. Returns a *NotFoundError when no entities are found.
func (*KeycapModelQuery) OnlyIDX ¶
func (kmq *KeycapModelQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*KeycapModelQuery) OnlyX ¶
func (kmq *KeycapModelQuery) OnlyX(ctx context.Context) *KeycapModel
OnlyX is like Only, but panics if an error occurs.
func (*KeycapModelQuery) Order ¶
func (kmq *KeycapModelQuery) Order(o ...keycapmodel.OrderOption) *KeycapModelQuery
Order specifies how the records should be ordered.
func (*KeycapModelQuery) Select ¶
func (kmq *KeycapModelQuery) Select(fields ...string) *KeycapModelSelect
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.KeycapModel.Query(). Select(keycapmodel.FieldName). Scan(ctx, &v)
func (*KeycapModelQuery) Unique ¶
func (kmq *KeycapModelQuery) Unique(unique bool) *KeycapModelQuery
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 (*KeycapModelQuery) Where ¶
func (kmq *KeycapModelQuery) Where(ps ...predicate.KeycapModel) *KeycapModelQuery
Where adds a new predicate for the KeycapModelQuery builder.
type KeycapModelSelect ¶
type KeycapModelSelect struct { *KeycapModelQuery // contains filtered or unexported fields }
KeycapModelSelect is the builder for selecting fields of KeycapModel entities.
func (*KeycapModelSelect) Aggregate ¶
func (kms *KeycapModelSelect) Aggregate(fns ...AggregateFunc) *KeycapModelSelect
Aggregate adds the given aggregation functions to the selector query.
func (*KeycapModelSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*KeycapModelSelect) Scan ¶
func (kms *KeycapModelSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*KeycapModelSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type KeycapModelUpdate ¶
type KeycapModelUpdate struct {
// contains filtered or unexported fields
}
KeycapModelUpdate is the builder for updating KeycapModel entities.
func (*KeycapModelUpdate) Exec ¶
func (kmu *KeycapModelUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*KeycapModelUpdate) ExecX ¶
func (kmu *KeycapModelUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelUpdate) Mutation ¶
func (kmu *KeycapModelUpdate) Mutation() *KeycapModelMutation
Mutation returns the KeycapModelMutation object of the builder.
func (*KeycapModelUpdate) Save ¶
func (kmu *KeycapModelUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*KeycapModelUpdate) SaveX ¶
func (kmu *KeycapModelUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*KeycapModelUpdate) SetMaterial ¶
func (kmu *KeycapModelUpdate) SetMaterial(k keycapmodel.Material) *KeycapModelUpdate
SetMaterial sets the "material" field.
func (*KeycapModelUpdate) SetName ¶
func (kmu *KeycapModelUpdate) SetName(s string) *KeycapModelUpdate
SetName sets the "name" field.
func (*KeycapModelUpdate) SetProfile ¶
func (kmu *KeycapModelUpdate) SetProfile(s string) *KeycapModelUpdate
SetProfile sets the "profile" field.
func (*KeycapModelUpdate) Where ¶
func (kmu *KeycapModelUpdate) Where(ps ...predicate.KeycapModel) *KeycapModelUpdate
Where appends a list predicates to the KeycapModelUpdate builder.
type KeycapModelUpdateOne ¶
type KeycapModelUpdateOne struct {
// contains filtered or unexported fields
}
KeycapModelUpdateOne is the builder for updating a single KeycapModel entity.
func (*KeycapModelUpdateOne) Exec ¶
func (kmuo *KeycapModelUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*KeycapModelUpdateOne) ExecX ¶
func (kmuo *KeycapModelUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*KeycapModelUpdateOne) Mutation ¶
func (kmuo *KeycapModelUpdateOne) Mutation() *KeycapModelMutation
Mutation returns the KeycapModelMutation object of the builder.
func (*KeycapModelUpdateOne) Save ¶
func (kmuo *KeycapModelUpdateOne) Save(ctx context.Context) (*KeycapModel, error)
Save executes the query and returns the updated KeycapModel entity.
func (*KeycapModelUpdateOne) SaveX ¶
func (kmuo *KeycapModelUpdateOne) SaveX(ctx context.Context) *KeycapModel
SaveX is like Save, but panics if an error occurs.
func (*KeycapModelUpdateOne) Select ¶
func (kmuo *KeycapModelUpdateOne) Select(field string, fields ...string) *KeycapModelUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*KeycapModelUpdateOne) SetMaterial ¶
func (kmuo *KeycapModelUpdateOne) SetMaterial(k keycapmodel.Material) *KeycapModelUpdateOne
SetMaterial sets the "material" field.
func (*KeycapModelUpdateOne) SetName ¶
func (kmuo *KeycapModelUpdateOne) SetName(s string) *KeycapModelUpdateOne
SetName sets the "name" field.
func (*KeycapModelUpdateOne) SetProfile ¶
func (kmuo *KeycapModelUpdateOne) SetProfile(s string) *KeycapModelUpdateOne
SetProfile sets the "profile" field.
func (*KeycapModelUpdateOne) Where ¶
func (kmuo *KeycapModelUpdateOne) Where(ps ...predicate.KeycapModel) *KeycapModelUpdateOne
Where appends a list predicates to the KeycapModelUpdate builder.
type KeycapModels ¶
type KeycapModels []*KeycapModel
KeycapModels is a parsable slice of KeycapModel.
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 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 SwitchModel ¶
type SwitchModel struct { // ID of the ent. ID int64 `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // SwitchType holds the value of the "switch_type" field. SwitchType switchmodel.SwitchType `json:"switch_type,omitempty"` // contains filtered or unexported fields }
SwitchModel is the model entity for the SwitchModel schema.
func (*SwitchModel) String ¶
func (sm *SwitchModel) String() string
String implements the fmt.Stringer.
func (*SwitchModel) Unwrap ¶
func (sm *SwitchModel) Unwrap() *SwitchModel
Unwrap unwraps the SwitchModel 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 (*SwitchModel) Update ¶
func (sm *SwitchModel) Update() *SwitchModelUpdateOne
Update returns a builder for updating this SwitchModel. Note that you need to call SwitchModel.Unwrap() before calling this method if this SwitchModel was returned from a transaction, and the transaction was committed or rolled back.
type SwitchModelClient ¶
type SwitchModelClient struct {
// contains filtered or unexported fields
}
SwitchModelClient is a client for the SwitchModel schema.
func NewSwitchModelClient ¶
func NewSwitchModelClient(c config) *SwitchModelClient
NewSwitchModelClient returns a client for the SwitchModel from the given config.
func (*SwitchModelClient) Create ¶
func (c *SwitchModelClient) Create() *SwitchModelCreate
Create returns a builder for creating a SwitchModel entity.
func (*SwitchModelClient) CreateBulk ¶
func (c *SwitchModelClient) CreateBulk(builders ...*SwitchModelCreate) *SwitchModelCreateBulk
CreateBulk returns a builder for creating a bulk of SwitchModel entities.
func (*SwitchModelClient) Delete ¶
func (c *SwitchModelClient) Delete() *SwitchModelDelete
Delete returns a delete builder for SwitchModel.
func (*SwitchModelClient) DeleteOne ¶
func (c *SwitchModelClient) DeleteOne(sm *SwitchModel) *SwitchModelDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SwitchModelClient) DeleteOneID ¶
func (c *SwitchModelClient) DeleteOneID(id int64) *SwitchModelDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SwitchModelClient) Get ¶
func (c *SwitchModelClient) Get(ctx context.Context, id int64) (*SwitchModel, error)
Get returns a SwitchModel entity by its id.
func (*SwitchModelClient) GetX ¶
func (c *SwitchModelClient) GetX(ctx context.Context, id int64) *SwitchModel
GetX is like Get, but panics if an error occurs.
func (*SwitchModelClient) Hooks ¶
func (c *SwitchModelClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SwitchModelClient) Intercept ¶
func (c *SwitchModelClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `switchmodel.Intercept(f(g(h())))`.
func (*SwitchModelClient) Interceptors ¶
func (c *SwitchModelClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SwitchModelClient) Query ¶
func (c *SwitchModelClient) Query() *SwitchModelQuery
Query returns a query builder for SwitchModel.
func (*SwitchModelClient) Update ¶
func (c *SwitchModelClient) Update() *SwitchModelUpdate
Update returns an update builder for SwitchModel.
func (*SwitchModelClient) UpdateOne ¶
func (c *SwitchModelClient) UpdateOne(sm *SwitchModel) *SwitchModelUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SwitchModelClient) UpdateOneID ¶
func (c *SwitchModelClient) UpdateOneID(id int64) *SwitchModelUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SwitchModelClient) Use ¶
func (c *SwitchModelClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `switchmodel.Hooks(f(g(h())))`.
type SwitchModelCreate ¶
type SwitchModelCreate struct {
// contains filtered or unexported fields
}
SwitchModelCreate is the builder for creating a SwitchModel entity.
func (*SwitchModelCreate) Exec ¶
func (smc *SwitchModelCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SwitchModelCreate) ExecX ¶
func (smc *SwitchModelCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelCreate) Mutation ¶
func (smc *SwitchModelCreate) Mutation() *SwitchModelMutation
Mutation returns the SwitchModelMutation object of the builder.
func (*SwitchModelCreate) Save ¶
func (smc *SwitchModelCreate) Save(ctx context.Context) (*SwitchModel, error)
Save creates the SwitchModel in the database.
func (*SwitchModelCreate) SaveX ¶
func (smc *SwitchModelCreate) SaveX(ctx context.Context) *SwitchModel
SaveX calls Save and panics if Save returns an error.
func (*SwitchModelCreate) SetID ¶
func (smc *SwitchModelCreate) SetID(i int64) *SwitchModelCreate
SetID sets the "id" field.
func (*SwitchModelCreate) SetName ¶
func (smc *SwitchModelCreate) SetName(s string) *SwitchModelCreate
SetName sets the "name" field.
func (*SwitchModelCreate) SetSwitchType ¶
func (smc *SwitchModelCreate) SetSwitchType(st switchmodel.SwitchType) *SwitchModelCreate
SetSwitchType sets the "switch_type" field.
type SwitchModelCreateBulk ¶
type SwitchModelCreateBulk struct {
// contains filtered or unexported fields
}
SwitchModelCreateBulk is the builder for creating many SwitchModel entities in bulk.
func (*SwitchModelCreateBulk) Exec ¶
func (smcb *SwitchModelCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SwitchModelCreateBulk) ExecX ¶
func (smcb *SwitchModelCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelCreateBulk) Save ¶
func (smcb *SwitchModelCreateBulk) Save(ctx context.Context) ([]*SwitchModel, error)
Save creates the SwitchModel entities in the database.
func (*SwitchModelCreateBulk) SaveX ¶
func (smcb *SwitchModelCreateBulk) SaveX(ctx context.Context) []*SwitchModel
SaveX is like Save, but panics if an error occurs.
type SwitchModelDelete ¶
type SwitchModelDelete struct {
// contains filtered or unexported fields
}
SwitchModelDelete is the builder for deleting a SwitchModel entity.
func (*SwitchModelDelete) Exec ¶
func (smd *SwitchModelDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SwitchModelDelete) ExecX ¶
func (smd *SwitchModelDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelDelete) Where ¶
func (smd *SwitchModelDelete) Where(ps ...predicate.SwitchModel) *SwitchModelDelete
Where appends a list predicates to the SwitchModelDelete builder.
type SwitchModelDeleteOne ¶
type SwitchModelDeleteOne struct {
// contains filtered or unexported fields
}
SwitchModelDeleteOne is the builder for deleting a single SwitchModel entity.
func (*SwitchModelDeleteOne) Exec ¶
func (smdo *SwitchModelDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SwitchModelDeleteOne) ExecX ¶
func (smdo *SwitchModelDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelDeleteOne) Where ¶
func (smdo *SwitchModelDeleteOne) Where(ps ...predicate.SwitchModel) *SwitchModelDeleteOne
Where appends a list predicates to the SwitchModelDelete builder.
type SwitchModelGroupBy ¶
type SwitchModelGroupBy struct {
// contains filtered or unexported fields
}
SwitchModelGroupBy is the group-by builder for SwitchModel entities.
func (*SwitchModelGroupBy) Aggregate ¶
func (smgb *SwitchModelGroupBy) Aggregate(fns ...AggregateFunc) *SwitchModelGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SwitchModelGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SwitchModelGroupBy) Scan ¶
func (smgb *SwitchModelGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SwitchModelGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SwitchModelMutation ¶
type SwitchModelMutation struct {
// contains filtered or unexported fields
}
SwitchModelMutation represents an operation that mutates the SwitchModel nodes in the graph.
func (*SwitchModelMutation) AddField ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) AddedEdges ¶
func (m *SwitchModelMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SwitchModelMutation) AddedField ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) AddedFields ¶
func (m *SwitchModelMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SwitchModelMutation) AddedIDs ¶
func (m *SwitchModelMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SwitchModelMutation) ClearEdge ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ClearField ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ClearedEdges ¶
func (m *SwitchModelMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SwitchModelMutation) ClearedFields ¶
func (m *SwitchModelMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SwitchModelMutation) Client ¶
func (m SwitchModelMutation) 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 (*SwitchModelMutation) EdgeCleared ¶
func (m *SwitchModelMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SwitchModelMutation) Field ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) FieldCleared ¶
func (m *SwitchModelMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SwitchModelMutation) Fields ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ID ¶
func (m *SwitchModelMutation) ID() (id int64, 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 (*SwitchModelMutation) IDs ¶
func (m *SwitchModelMutation) IDs(ctx context.Context) ([]int64, 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 (*SwitchModelMutation) Name ¶
func (m *SwitchModelMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*SwitchModelMutation) 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 (*SwitchModelMutation) OldName ¶
func (m *SwitchModelMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the SwitchModel entity. If the SwitchModel 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 (*SwitchModelMutation) OldSwitchType ¶
func (m *SwitchModelMutation) OldSwitchType(ctx context.Context) (v switchmodel.SwitchType, err error)
OldSwitchType returns the old "switch_type" field's value of the SwitchModel entity. If the SwitchModel 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 (*SwitchModelMutation) Op ¶
func (m *SwitchModelMutation) Op() Op
Op returns the operation name.
func (*SwitchModelMutation) RemovedEdges ¶
func (m *SwitchModelMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SwitchModelMutation) RemovedIDs ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ResetEdge ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ResetField ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) ResetName ¶
func (m *SwitchModelMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*SwitchModelMutation) ResetSwitchType ¶
func (m *SwitchModelMutation) ResetSwitchType()
ResetSwitchType resets all changes to the "switch_type" field.
func (*SwitchModelMutation) SetField ¶
func (m *SwitchModelMutation) 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 (*SwitchModelMutation) SetID ¶
func (m *SwitchModelMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of SwitchModel entities.
func (*SwitchModelMutation) SetName ¶
func (m *SwitchModelMutation) SetName(s string)
SetName sets the "name" field.
func (*SwitchModelMutation) SetOp ¶
func (m *SwitchModelMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SwitchModelMutation) SetSwitchType ¶
func (m *SwitchModelMutation) SetSwitchType(st switchmodel.SwitchType)
SetSwitchType sets the "switch_type" field.
func (*SwitchModelMutation) SwitchType ¶
func (m *SwitchModelMutation) SwitchType() (r switchmodel.SwitchType, exists bool)
SwitchType returns the value of the "switch_type" field in the mutation.
func (SwitchModelMutation) Tx ¶
func (m SwitchModelMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SwitchModelMutation) Type ¶
func (m *SwitchModelMutation) Type() string
Type returns the node type of this mutation (SwitchModel).
func (*SwitchModelMutation) Where ¶
func (m *SwitchModelMutation) Where(ps ...predicate.SwitchModel)
Where appends a list predicates to the SwitchModelMutation builder.
func (*SwitchModelMutation) WhereP ¶
func (m *SwitchModelMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SwitchModelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SwitchModelQuery ¶
type SwitchModelQuery struct {
// contains filtered or unexported fields
}
SwitchModelQuery is the builder for querying SwitchModel entities.
func (*SwitchModelQuery) Aggregate ¶
func (smq *SwitchModelQuery) Aggregate(fns ...AggregateFunc) *SwitchModelSelect
Aggregate returns a SwitchModelSelect configured with the given aggregations.
func (*SwitchModelQuery) All ¶
func (smq *SwitchModelQuery) All(ctx context.Context) ([]*SwitchModel, error)
All executes the query and returns a list of SwitchModels.
func (*SwitchModelQuery) AllX ¶
func (smq *SwitchModelQuery) AllX(ctx context.Context) []*SwitchModel
AllX is like All, but panics if an error occurs.
func (*SwitchModelQuery) Clone ¶
func (smq *SwitchModelQuery) Clone() *SwitchModelQuery
Clone returns a duplicate of the SwitchModelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SwitchModelQuery) Count ¶
func (smq *SwitchModelQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SwitchModelQuery) CountX ¶
func (smq *SwitchModelQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SwitchModelQuery) Exist ¶
func (smq *SwitchModelQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SwitchModelQuery) ExistX ¶
func (smq *SwitchModelQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SwitchModelQuery) First ¶
func (smq *SwitchModelQuery) First(ctx context.Context) (*SwitchModel, error)
First returns the first SwitchModel entity from the query. Returns a *NotFoundError when no SwitchModel was found.
func (*SwitchModelQuery) FirstID ¶
func (smq *SwitchModelQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first SwitchModel ID from the query. Returns a *NotFoundError when no SwitchModel ID was found.
func (*SwitchModelQuery) FirstIDX ¶
func (smq *SwitchModelQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*SwitchModelQuery) FirstX ¶
func (smq *SwitchModelQuery) FirstX(ctx context.Context) *SwitchModel
FirstX is like First, but panics if an error occurs.
func (*SwitchModelQuery) GroupBy ¶
func (smq *SwitchModelQuery) GroupBy(field string, fields ...string) *SwitchModelGroupBy
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.SwitchModel.Query(). GroupBy(switchmodel.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SwitchModelQuery) IDs ¶
func (smq *SwitchModelQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of SwitchModel IDs.
func (*SwitchModelQuery) IDsX ¶
func (smq *SwitchModelQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*SwitchModelQuery) Limit ¶
func (smq *SwitchModelQuery) Limit(limit int) *SwitchModelQuery
Limit the number of records to be returned by this query.
func (*SwitchModelQuery) Offset ¶
func (smq *SwitchModelQuery) Offset(offset int) *SwitchModelQuery
Offset to start from.
func (*SwitchModelQuery) Only ¶
func (smq *SwitchModelQuery) Only(ctx context.Context) (*SwitchModel, error)
Only returns a single SwitchModel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SwitchModel entity is found. Returns a *NotFoundError when no SwitchModel entities are found.
func (*SwitchModelQuery) OnlyID ¶
func (smq *SwitchModelQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only SwitchModel ID in the query. Returns a *NotSingularError when more than one SwitchModel ID is found. Returns a *NotFoundError when no entities are found.
func (*SwitchModelQuery) OnlyIDX ¶
func (smq *SwitchModelQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SwitchModelQuery) OnlyX ¶
func (smq *SwitchModelQuery) OnlyX(ctx context.Context) *SwitchModel
OnlyX is like Only, but panics if an error occurs.
func (*SwitchModelQuery) Order ¶
func (smq *SwitchModelQuery) Order(o ...switchmodel.OrderOption) *SwitchModelQuery
Order specifies how the records should be ordered.
func (*SwitchModelQuery) Select ¶
func (smq *SwitchModelQuery) Select(fields ...string) *SwitchModelSelect
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.SwitchModel.Query(). Select(switchmodel.FieldName). Scan(ctx, &v)
func (*SwitchModelQuery) Unique ¶
func (smq *SwitchModelQuery) Unique(unique bool) *SwitchModelQuery
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 (*SwitchModelQuery) Where ¶
func (smq *SwitchModelQuery) Where(ps ...predicate.SwitchModel) *SwitchModelQuery
Where adds a new predicate for the SwitchModelQuery builder.
type SwitchModelSelect ¶
type SwitchModelSelect struct { *SwitchModelQuery // contains filtered or unexported fields }
SwitchModelSelect is the builder for selecting fields of SwitchModel entities.
func (*SwitchModelSelect) Aggregate ¶
func (sms *SwitchModelSelect) Aggregate(fns ...AggregateFunc) *SwitchModelSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SwitchModelSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SwitchModelSelect) Scan ¶
func (sms *SwitchModelSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SwitchModelSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SwitchModelUpdate ¶
type SwitchModelUpdate struct {
// contains filtered or unexported fields
}
SwitchModelUpdate is the builder for updating SwitchModel entities.
func (*SwitchModelUpdate) Exec ¶
func (smu *SwitchModelUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SwitchModelUpdate) ExecX ¶
func (smu *SwitchModelUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelUpdate) Mutation ¶
func (smu *SwitchModelUpdate) Mutation() *SwitchModelMutation
Mutation returns the SwitchModelMutation object of the builder.
func (*SwitchModelUpdate) Save ¶
func (smu *SwitchModelUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SwitchModelUpdate) SaveX ¶
func (smu *SwitchModelUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SwitchModelUpdate) SetName ¶
func (smu *SwitchModelUpdate) SetName(s string) *SwitchModelUpdate
SetName sets the "name" field.
func (*SwitchModelUpdate) SetSwitchType ¶
func (smu *SwitchModelUpdate) SetSwitchType(st switchmodel.SwitchType) *SwitchModelUpdate
SetSwitchType sets the "switch_type" field.
func (*SwitchModelUpdate) Where ¶
func (smu *SwitchModelUpdate) Where(ps ...predicate.SwitchModel) *SwitchModelUpdate
Where appends a list predicates to the SwitchModelUpdate builder.
type SwitchModelUpdateOne ¶
type SwitchModelUpdateOne struct {
// contains filtered or unexported fields
}
SwitchModelUpdateOne is the builder for updating a single SwitchModel entity.
func (*SwitchModelUpdateOne) Exec ¶
func (smuo *SwitchModelUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SwitchModelUpdateOne) ExecX ¶
func (smuo *SwitchModelUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SwitchModelUpdateOne) Mutation ¶
func (smuo *SwitchModelUpdateOne) Mutation() *SwitchModelMutation
Mutation returns the SwitchModelMutation object of the builder.
func (*SwitchModelUpdateOne) Save ¶
func (smuo *SwitchModelUpdateOne) Save(ctx context.Context) (*SwitchModel, error)
Save executes the query and returns the updated SwitchModel entity.
func (*SwitchModelUpdateOne) SaveX ¶
func (smuo *SwitchModelUpdateOne) SaveX(ctx context.Context) *SwitchModel
SaveX is like Save, but panics if an error occurs.
func (*SwitchModelUpdateOne) Select ¶
func (smuo *SwitchModelUpdateOne) Select(field string, fields ...string) *SwitchModelUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SwitchModelUpdateOne) SetName ¶
func (smuo *SwitchModelUpdateOne) SetName(s string) *SwitchModelUpdateOne
SetName sets the "name" field.
func (*SwitchModelUpdateOne) SetSwitchType ¶
func (smuo *SwitchModelUpdateOne) SetSwitchType(st switchmodel.SwitchType) *SwitchModelUpdateOne
SetSwitchType sets the "switch_type" field.
func (*SwitchModelUpdateOne) Where ¶
func (smuo *SwitchModelUpdateOne) Where(ps ...predicate.SwitchModel) *SwitchModelUpdateOne
Where appends a list predicates to the SwitchModelUpdate builder.
type SwitchModels ¶
type SwitchModels []*SwitchModel
SwitchModels is a parsable slice of SwitchModel.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Keyboard is the client for interacting with the Keyboard builders. Keyboard *KeyboardClient // KeycapModel is the client for interacting with the KeycapModel builders. KeycapModel *KeycapModelClient // SwitchModel is the client for interacting with the SwitchModel builders. SwitchModel *SwitchModelClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- client.go
- ent.go
- ent2ogen_checks.go
- ent2ogen_mappers.go
- generate.go
- keyboard.go
- keyboard_create.go
- keyboard_delete.go
- keyboard_query.go
- keyboard_update.go
- keycapmodel.go
- keycapmodel_create.go
- keycapmodel_delete.go
- keycapmodel_query.go
- keycapmodel_update.go
- mutation.go
- runtime.go
- switchmodel.go
- switchmodel_create.go
- switchmodel_delete.go
- switchmodel_query.go
- switchmodel_update.go
- tx.go