Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Certification
- type CertificationClient
- func (c *CertificationClient) Create() *CertificationCreate
- func (c *CertificationClient) CreateBulk(builders ...*CertificationCreate) *CertificationCreateBulk
- func (c *CertificationClient) Delete() *CertificationDelete
- func (c *CertificationClient) DeleteOne(ce *Certification) *CertificationDeleteOne
- func (c *CertificationClient) DeleteOneID(id uuid.UUID) *CertificationDeleteOne
- func (c *CertificationClient) Get(ctx context.Context, id uuid.UUID) (*Certification, error)
- func (c *CertificationClient) GetX(ctx context.Context, id uuid.UUID) *Certification
- func (c *CertificationClient) Hooks() []Hook
- func (c *CertificationClient) Intercept(interceptors ...Interceptor)
- func (c *CertificationClient) Interceptors() []Interceptor
- func (c *CertificationClient) MapCreateBulk(slice any, setFunc func(*CertificationCreate, int)) *CertificationCreateBulk
- func (c *CertificationClient) Query() *CertificationQuery
- func (c *CertificationClient) Update() *CertificationUpdate
- func (c *CertificationClient) UpdateOne(ce *Certification) *CertificationUpdateOne
- func (c *CertificationClient) UpdateOneID(id uuid.UUID) *CertificationUpdateOne
- func (c *CertificationClient) Use(hooks ...Hook)
- type CertificationCreate
- func (cc *CertificationCreate) Exec(ctx context.Context) error
- func (cc *CertificationCreate) ExecX(ctx context.Context)
- func (cc *CertificationCreate) Mutation() *CertificationMutation
- func (cc *CertificationCreate) Save(ctx context.Context) (*Certification, error)
- func (cc *CertificationCreate) SaveX(ctx context.Context) *Certification
- func (cc *CertificationCreate) SetAnchorID(i int) *CertificationCreate
- func (cc *CertificationCreate) SetDataID(s string) *CertificationCreate
- func (cc *CertificationCreate) SetHash(s string) *CertificationCreate
- func (cc *CertificationCreate) SetID(u uuid.UUID) *CertificationCreate
- func (cc *CertificationCreate) SetNillableID(u *uuid.UUID) *CertificationCreate
- type CertificationCreateBulk
- type CertificationDelete
- type CertificationDeleteOne
- type CertificationGroupBy
- func (cgb *CertificationGroupBy) Aggregate(fns ...AggregateFunc) *CertificationGroupBy
- func (s *CertificationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CertificationGroupBy) BoolX(ctx context.Context) bool
- func (s *CertificationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CertificationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CertificationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CertificationGroupBy) Float64X(ctx context.Context) float64
- func (s *CertificationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CertificationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CertificationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CertificationGroupBy) IntX(ctx context.Context) int
- func (s *CertificationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CertificationGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CertificationGroupBy) Scan(ctx context.Context, v any) error
- func (s *CertificationGroupBy) ScanX(ctx context.Context, v any)
- func (s *CertificationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CertificationGroupBy) StringX(ctx context.Context) string
- func (s *CertificationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CertificationGroupBy) StringsX(ctx context.Context) []string
- type CertificationMutation
- func (m *CertificationMutation) AddAnchorID(i int)
- func (m *CertificationMutation) AddField(name string, value ent.Value) error
- func (m *CertificationMutation) AddedAnchorID() (r int, exists bool)
- func (m *CertificationMutation) AddedEdges() []string
- func (m *CertificationMutation) AddedField(name string) (ent.Value, bool)
- func (m *CertificationMutation) AddedFields() []string
- func (m *CertificationMutation) AddedIDs(name string) []ent.Value
- func (m *CertificationMutation) AnchorID() (r int, exists bool)
- func (m *CertificationMutation) ClearEdge(name string) error
- func (m *CertificationMutation) ClearField(name string) error
- func (m *CertificationMutation) ClearedEdges() []string
- func (m *CertificationMutation) ClearedFields() []string
- func (m CertificationMutation) Client() *Client
- func (m *CertificationMutation) DataID() (r string, exists bool)
- func (m *CertificationMutation) EdgeCleared(name string) bool
- func (m *CertificationMutation) Field(name string) (ent.Value, bool)
- func (m *CertificationMutation) FieldCleared(name string) bool
- func (m *CertificationMutation) Fields() []string
- func (m *CertificationMutation) Hash() (r string, exists bool)
- func (m *CertificationMutation) ID() (id uuid.UUID, exists bool)
- func (m *CertificationMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *CertificationMutation) OldAnchorID(ctx context.Context) (v int, err error)
- func (m *CertificationMutation) OldDataID(ctx context.Context) (v string, err error)
- func (m *CertificationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CertificationMutation) OldHash(ctx context.Context) (v string, err error)
- func (m *CertificationMutation) Op() Op
- func (m *CertificationMutation) RemovedEdges() []string
- func (m *CertificationMutation) RemovedIDs(name string) []ent.Value
- func (m *CertificationMutation) ResetAnchorID()
- func (m *CertificationMutation) ResetDataID()
- func (m *CertificationMutation) ResetEdge(name string) error
- func (m *CertificationMutation) ResetField(name string) error
- func (m *CertificationMutation) ResetHash()
- func (m *CertificationMutation) SetAnchorID(i int)
- func (m *CertificationMutation) SetDataID(s string)
- func (m *CertificationMutation) SetField(name string, value ent.Value) error
- func (m *CertificationMutation) SetHash(s string)
- func (m *CertificationMutation) SetID(id uuid.UUID)
- func (m *CertificationMutation) SetOp(op Op)
- func (m CertificationMutation) Tx() (*Tx, error)
- func (m *CertificationMutation) Type() string
- func (m *CertificationMutation) Where(ps ...predicate.Certification)
- func (m *CertificationMutation) WhereP(ps ...func(*sql.Selector))
- type CertificationQuery
- func (cq *CertificationQuery) Aggregate(fns ...AggregateFunc) *CertificationSelect
- func (cq *CertificationQuery) All(ctx context.Context) ([]*Certification, error)
- func (cq *CertificationQuery) AllX(ctx context.Context) []*Certification
- func (cq *CertificationQuery) Clone() *CertificationQuery
- func (cq *CertificationQuery) Count(ctx context.Context) (int, error)
- func (cq *CertificationQuery) CountX(ctx context.Context) int
- func (cq *CertificationQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CertificationQuery) ExistX(ctx context.Context) bool
- func (cq *CertificationQuery) First(ctx context.Context) (*Certification, error)
- func (cq *CertificationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CertificationQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (cq *CertificationQuery) FirstX(ctx context.Context) *Certification
- func (cq *CertificationQuery) GroupBy(field string, fields ...string) *CertificationGroupBy
- func (cq *CertificationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (cq *CertificationQuery) IDsX(ctx context.Context) []uuid.UUID
- func (cq *CertificationQuery) Limit(limit int) *CertificationQuery
- func (cq *CertificationQuery) Offset(offset int) *CertificationQuery
- func (cq *CertificationQuery) Only(ctx context.Context) (*Certification, error)
- func (cq *CertificationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CertificationQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (cq *CertificationQuery) OnlyX(ctx context.Context) *Certification
- func (cq *CertificationQuery) Order(o ...certification.OrderOption) *CertificationQuery
- func (cq *CertificationQuery) Select(fields ...string) *CertificationSelect
- func (cq *CertificationQuery) Unique(unique bool) *CertificationQuery
- func (cq *CertificationQuery) Where(ps ...predicate.Certification) *CertificationQuery
- type CertificationSelect
- func (cs *CertificationSelect) Aggregate(fns ...AggregateFunc) *CertificationSelect
- func (s *CertificationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CertificationSelect) BoolX(ctx context.Context) bool
- func (s *CertificationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CertificationSelect) BoolsX(ctx context.Context) []bool
- func (s *CertificationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CertificationSelect) Float64X(ctx context.Context) float64
- func (s *CertificationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CertificationSelect) Float64sX(ctx context.Context) []float64
- func (s *CertificationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CertificationSelect) IntX(ctx context.Context) int
- func (s *CertificationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CertificationSelect) IntsX(ctx context.Context) []int
- func (cs *CertificationSelect) Scan(ctx context.Context, v any) error
- func (s *CertificationSelect) ScanX(ctx context.Context, v any)
- func (s *CertificationSelect) String(ctx context.Context) (_ string, err error)
- func (s *CertificationSelect) StringX(ctx context.Context) string
- func (s *CertificationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CertificationSelect) StringsX(ctx context.Context) []string
- type CertificationUpdate
- func (cu *CertificationUpdate) AddAnchorID(i int) *CertificationUpdate
- func (cu *CertificationUpdate) Exec(ctx context.Context) error
- func (cu *CertificationUpdate) ExecX(ctx context.Context)
- func (cu *CertificationUpdate) Mutation() *CertificationMutation
- func (cu *CertificationUpdate) Save(ctx context.Context) (int, error)
- func (cu *CertificationUpdate) SaveX(ctx context.Context) int
- func (cu *CertificationUpdate) SetAnchorID(i int) *CertificationUpdate
- func (cu *CertificationUpdate) SetDataID(s string) *CertificationUpdate
- func (cu *CertificationUpdate) SetHash(s string) *CertificationUpdate
- func (cu *CertificationUpdate) Where(ps ...predicate.Certification) *CertificationUpdate
- type CertificationUpdateOne
- func (cuo *CertificationUpdateOne) AddAnchorID(i int) *CertificationUpdateOne
- func (cuo *CertificationUpdateOne) Exec(ctx context.Context) error
- func (cuo *CertificationUpdateOne) ExecX(ctx context.Context)
- func (cuo *CertificationUpdateOne) Mutation() *CertificationMutation
- func (cuo *CertificationUpdateOne) Save(ctx context.Context) (*Certification, error)
- func (cuo *CertificationUpdateOne) SaveX(ctx context.Context) *Certification
- func (cuo *CertificationUpdateOne) Select(field string, fields ...string) *CertificationUpdateOne
- func (cuo *CertificationUpdateOne) SetAnchorID(i int) *CertificationUpdateOne
- func (cuo *CertificationUpdateOne) SetDataID(s string) *CertificationUpdateOne
- func (cuo *CertificationUpdateOne) SetHash(s string) *CertificationUpdateOne
- func (cuo *CertificationUpdateOne) Where(ps ...predicate.Certification) *CertificationUpdateOne
- type Certifications
- 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 LocalKey
- type LocalKeyClient
- func (c *LocalKeyClient) Create() *LocalKeyCreate
- func (c *LocalKeyClient) CreateBulk(builders ...*LocalKeyCreate) *LocalKeyCreateBulk
- func (c *LocalKeyClient) Delete() *LocalKeyDelete
- func (c *LocalKeyClient) DeleteOne(lk *LocalKey) *LocalKeyDeleteOne
- func (c *LocalKeyClient) DeleteOneID(id uuid.UUID) *LocalKeyDeleteOne
- func (c *LocalKeyClient) Get(ctx context.Context, id uuid.UUID) (*LocalKey, error)
- func (c *LocalKeyClient) GetX(ctx context.Context, id uuid.UUID) *LocalKey
- func (c *LocalKeyClient) Hooks() []Hook
- func (c *LocalKeyClient) Intercept(interceptors ...Interceptor)
- func (c *LocalKeyClient) Interceptors() []Interceptor
- func (c *LocalKeyClient) MapCreateBulk(slice any, setFunc func(*LocalKeyCreate, int)) *LocalKeyCreateBulk
- func (c *LocalKeyClient) Query() *LocalKeyQuery
- func (c *LocalKeyClient) Update() *LocalKeyUpdate
- func (c *LocalKeyClient) UpdateOne(lk *LocalKey) *LocalKeyUpdateOne
- func (c *LocalKeyClient) UpdateOneID(id uuid.UUID) *LocalKeyUpdateOne
- func (c *LocalKeyClient) Use(hooks ...Hook)
- type LocalKeyCreate
- func (lkc *LocalKeyCreate) Exec(ctx context.Context) error
- func (lkc *LocalKeyCreate) ExecX(ctx context.Context)
- func (lkc *LocalKeyCreate) Mutation() *LocalKeyMutation
- func (lkc *LocalKeyCreate) Save(ctx context.Context) (*LocalKey, error)
- func (lkc *LocalKeyCreate) SaveX(ctx context.Context) *LocalKey
- func (lkc *LocalKeyCreate) SetID(u uuid.UUID) *LocalKeyCreate
- func (lkc *LocalKeyCreate) SetKeyType(s string) *LocalKeyCreate
- func (lkc *LocalKeyCreate) SetLocalKey(kk *key.LocalKey) *LocalKeyCreate
- func (lkc *LocalKeyCreate) SetNillableID(u *uuid.UUID) *LocalKeyCreate
- type LocalKeyCreateBulk
- type LocalKeyDelete
- type LocalKeyDeleteOne
- type LocalKeyGroupBy
- func (lkgb *LocalKeyGroupBy) Aggregate(fns ...AggregateFunc) *LocalKeyGroupBy
- func (s *LocalKeyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocalKeyGroupBy) BoolX(ctx context.Context) bool
- func (s *LocalKeyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LocalKeyGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LocalKeyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocalKeyGroupBy) Float64X(ctx context.Context) float64
- func (s *LocalKeyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocalKeyGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LocalKeyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LocalKeyGroupBy) IntX(ctx context.Context) int
- func (s *LocalKeyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LocalKeyGroupBy) IntsX(ctx context.Context) []int
- func (lkgb *LocalKeyGroupBy) Scan(ctx context.Context, v any) error
- func (s *LocalKeyGroupBy) ScanX(ctx context.Context, v any)
- func (s *LocalKeyGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LocalKeyGroupBy) StringX(ctx context.Context) string
- func (s *LocalKeyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LocalKeyGroupBy) StringsX(ctx context.Context) []string
- type LocalKeyMutation
- func (m *LocalKeyMutation) AddField(name string, value ent.Value) error
- func (m *LocalKeyMutation) AddedEdges() []string
- func (m *LocalKeyMutation) AddedField(name string) (ent.Value, bool)
- func (m *LocalKeyMutation) AddedFields() []string
- func (m *LocalKeyMutation) AddedIDs(name string) []ent.Value
- func (m *LocalKeyMutation) ClearEdge(name string) error
- func (m *LocalKeyMutation) ClearField(name string) error
- func (m *LocalKeyMutation) ClearedEdges() []string
- func (m *LocalKeyMutation) ClearedFields() []string
- func (m LocalKeyMutation) Client() *Client
- func (m *LocalKeyMutation) EdgeCleared(name string) bool
- func (m *LocalKeyMutation) Field(name string) (ent.Value, bool)
- func (m *LocalKeyMutation) FieldCleared(name string) bool
- func (m *LocalKeyMutation) Fields() []string
- func (m *LocalKeyMutation) ID() (id uuid.UUID, exists bool)
- func (m *LocalKeyMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *LocalKeyMutation) KeyType() (r string, exists bool)
- func (m *LocalKeyMutation) LocalKey() (r *key.LocalKey, exists bool)
- func (m *LocalKeyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LocalKeyMutation) OldKeyType(ctx context.Context) (v string, err error)
- func (m *LocalKeyMutation) OldLocalKey(ctx context.Context) (v *key.LocalKey, err error)
- func (m *LocalKeyMutation) Op() Op
- func (m *LocalKeyMutation) RemovedEdges() []string
- func (m *LocalKeyMutation) RemovedIDs(name string) []ent.Value
- func (m *LocalKeyMutation) ResetEdge(name string) error
- func (m *LocalKeyMutation) ResetField(name string) error
- func (m *LocalKeyMutation) ResetKeyType()
- func (m *LocalKeyMutation) ResetLocalKey()
- func (m *LocalKeyMutation) SetField(name string, value ent.Value) error
- func (m *LocalKeyMutation) SetID(id uuid.UUID)
- func (m *LocalKeyMutation) SetKeyType(s string)
- func (m *LocalKeyMutation) SetLocalKey(kk *key.LocalKey)
- func (m *LocalKeyMutation) SetOp(op Op)
- func (m LocalKeyMutation) Tx() (*Tx, error)
- func (m *LocalKeyMutation) Type() string
- func (m *LocalKeyMutation) Where(ps ...predicate.LocalKey)
- func (m *LocalKeyMutation) WhereP(ps ...func(*sql.Selector))
- type LocalKeyQuery
- func (lkq *LocalKeyQuery) Aggregate(fns ...AggregateFunc) *LocalKeySelect
- func (lkq *LocalKeyQuery) All(ctx context.Context) ([]*LocalKey, error)
- func (lkq *LocalKeyQuery) AllX(ctx context.Context) []*LocalKey
- func (lkq *LocalKeyQuery) Clone() *LocalKeyQuery
- func (lkq *LocalKeyQuery) Count(ctx context.Context) (int, error)
- func (lkq *LocalKeyQuery) CountX(ctx context.Context) int
- func (lkq *LocalKeyQuery) Exist(ctx context.Context) (bool, error)
- func (lkq *LocalKeyQuery) ExistX(ctx context.Context) bool
- func (lkq *LocalKeyQuery) First(ctx context.Context) (*LocalKey, error)
- func (lkq *LocalKeyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (lkq *LocalKeyQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (lkq *LocalKeyQuery) FirstX(ctx context.Context) *LocalKey
- func (lkq *LocalKeyQuery) GroupBy(field string, fields ...string) *LocalKeyGroupBy
- func (lkq *LocalKeyQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (lkq *LocalKeyQuery) IDsX(ctx context.Context) []uuid.UUID
- func (lkq *LocalKeyQuery) Limit(limit int) *LocalKeyQuery
- func (lkq *LocalKeyQuery) Offset(offset int) *LocalKeyQuery
- func (lkq *LocalKeyQuery) Only(ctx context.Context) (*LocalKey, error)
- func (lkq *LocalKeyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (lkq *LocalKeyQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (lkq *LocalKeyQuery) OnlyX(ctx context.Context) *LocalKey
- func (lkq *LocalKeyQuery) Order(o ...localkey.OrderOption) *LocalKeyQuery
- func (lkq *LocalKeyQuery) Select(fields ...string) *LocalKeySelect
- func (lkq *LocalKeyQuery) Unique(unique bool) *LocalKeyQuery
- func (lkq *LocalKeyQuery) Where(ps ...predicate.LocalKey) *LocalKeyQuery
- type LocalKeySelect
- func (lks *LocalKeySelect) Aggregate(fns ...AggregateFunc) *LocalKeySelect
- func (s *LocalKeySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocalKeySelect) BoolX(ctx context.Context) bool
- func (s *LocalKeySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LocalKeySelect) BoolsX(ctx context.Context) []bool
- func (s *LocalKeySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocalKeySelect) Float64X(ctx context.Context) float64
- func (s *LocalKeySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocalKeySelect) Float64sX(ctx context.Context) []float64
- func (s *LocalKeySelect) Int(ctx context.Context) (_ int, err error)
- func (s *LocalKeySelect) IntX(ctx context.Context) int
- func (s *LocalKeySelect) Ints(ctx context.Context) ([]int, error)
- func (s *LocalKeySelect) IntsX(ctx context.Context) []int
- func (lks *LocalKeySelect) Scan(ctx context.Context, v any) error
- func (s *LocalKeySelect) ScanX(ctx context.Context, v any)
- func (s *LocalKeySelect) String(ctx context.Context) (_ string, err error)
- func (s *LocalKeySelect) StringX(ctx context.Context) string
- func (s *LocalKeySelect) Strings(ctx context.Context) ([]string, error)
- func (s *LocalKeySelect) StringsX(ctx context.Context) []string
- type LocalKeyUpdate
- func (lku *LocalKeyUpdate) Exec(ctx context.Context) error
- func (lku *LocalKeyUpdate) ExecX(ctx context.Context)
- func (lku *LocalKeyUpdate) Mutation() *LocalKeyMutation
- func (lku *LocalKeyUpdate) Save(ctx context.Context) (int, error)
- func (lku *LocalKeyUpdate) SaveX(ctx context.Context) int
- func (lku *LocalKeyUpdate) SetKeyType(s string) *LocalKeyUpdate
- func (lku *LocalKeyUpdate) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdate
- func (lku *LocalKeyUpdate) Where(ps ...predicate.LocalKey) *LocalKeyUpdate
- type LocalKeyUpdateOne
- func (lkuo *LocalKeyUpdateOne) Exec(ctx context.Context) error
- func (lkuo *LocalKeyUpdateOne) ExecX(ctx context.Context)
- func (lkuo *LocalKeyUpdateOne) Mutation() *LocalKeyMutation
- func (lkuo *LocalKeyUpdateOne) Save(ctx context.Context) (*LocalKey, error)
- func (lkuo *LocalKeyUpdateOne) SaveX(ctx context.Context) *LocalKey
- func (lkuo *LocalKeyUpdateOne) Select(field string, fields ...string) *LocalKeyUpdateOne
- func (lkuo *LocalKeyUpdateOne) SetKeyType(s string) *LocalKeyUpdateOne
- func (lkuo *LocalKeyUpdateOne) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdateOne
- func (lkuo *LocalKeyUpdateOne) Where(ps ...predicate.LocalKey) *LocalKeyUpdateOne
- type LocalKeys
- 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 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. TypeCertification = "Certification" TypeLocalKey = "LocalKey" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type 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 Certification ¶
type Certification struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // AnchorID holds the value of the "anchor_id" field. AnchorID int `json:"anchor_id,omitempty"` // Hash holds the value of the "hash" field. Hash string `json:"hash,omitempty"` // DataID holds the value of the "data_id" field. DataID string `json:"data_id,omitempty"` // contains filtered or unexported fields }
Certification is the model entity for the Certification schema.
func (*Certification) String ¶
func (c *Certification) String() string
String implements the fmt.Stringer.
func (*Certification) Unwrap ¶
func (c *Certification) Unwrap() *Certification
Unwrap unwraps the Certification 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 (*Certification) Update ¶
func (c *Certification) Update() *CertificationUpdateOne
Update returns a builder for updating this Certification. Note that you need to call Certification.Unwrap() before calling this method if this Certification was returned from a transaction, and the transaction was committed or rolled back.
type CertificationClient ¶
type CertificationClient struct {
// contains filtered or unexported fields
}
CertificationClient is a client for the Certification schema.
func NewCertificationClient ¶
func NewCertificationClient(c config) *CertificationClient
NewCertificationClient returns a client for the Certification from the given config.
func (*CertificationClient) Create ¶
func (c *CertificationClient) Create() *CertificationCreate
Create returns a builder for creating a Certification entity.
func (*CertificationClient) CreateBulk ¶
func (c *CertificationClient) CreateBulk(builders ...*CertificationCreate) *CertificationCreateBulk
CreateBulk returns a builder for creating a bulk of Certification entities.
func (*CertificationClient) Delete ¶
func (c *CertificationClient) Delete() *CertificationDelete
Delete returns a delete builder for Certification.
func (*CertificationClient) DeleteOne ¶
func (c *CertificationClient) DeleteOne(ce *Certification) *CertificationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CertificationClient) DeleteOneID ¶
func (c *CertificationClient) DeleteOneID(id uuid.UUID) *CertificationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CertificationClient) Get ¶
func (c *CertificationClient) Get(ctx context.Context, id uuid.UUID) (*Certification, error)
Get returns a Certification entity by its id.
func (*CertificationClient) GetX ¶
func (c *CertificationClient) GetX(ctx context.Context, id uuid.UUID) *Certification
GetX is like Get, but panics if an error occurs.
func (*CertificationClient) Hooks ¶
func (c *CertificationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CertificationClient) Intercept ¶
func (c *CertificationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `certification.Intercept(f(g(h())))`.
func (*CertificationClient) Interceptors ¶
func (c *CertificationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CertificationClient) MapCreateBulk ¶
func (c *CertificationClient) MapCreateBulk(slice any, setFunc func(*CertificationCreate, int)) *CertificationCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CertificationClient) Query ¶
func (c *CertificationClient) Query() *CertificationQuery
Query returns a query builder for Certification.
func (*CertificationClient) Update ¶
func (c *CertificationClient) Update() *CertificationUpdate
Update returns an update builder for Certification.
func (*CertificationClient) UpdateOne ¶
func (c *CertificationClient) UpdateOne(ce *Certification) *CertificationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CertificationClient) UpdateOneID ¶
func (c *CertificationClient) UpdateOneID(id uuid.UUID) *CertificationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CertificationClient) Use ¶
func (c *CertificationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `certification.Hooks(f(g(h())))`.
type CertificationCreate ¶
type CertificationCreate struct {
// contains filtered or unexported fields
}
CertificationCreate is the builder for creating a Certification entity.
func (*CertificationCreate) Exec ¶
func (cc *CertificationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificationCreate) ExecX ¶
func (cc *CertificationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificationCreate) Mutation ¶
func (cc *CertificationCreate) Mutation() *CertificationMutation
Mutation returns the CertificationMutation object of the builder.
func (*CertificationCreate) Save ¶
func (cc *CertificationCreate) Save(ctx context.Context) (*Certification, error)
Save creates the Certification in the database.
func (*CertificationCreate) SaveX ¶
func (cc *CertificationCreate) SaveX(ctx context.Context) *Certification
SaveX calls Save and panics if Save returns an error.
func (*CertificationCreate) SetAnchorID ¶
func (cc *CertificationCreate) SetAnchorID(i int) *CertificationCreate
SetAnchorID sets the "anchor_id" field.
func (*CertificationCreate) SetDataID ¶
func (cc *CertificationCreate) SetDataID(s string) *CertificationCreate
SetDataID sets the "data_id" field.
func (*CertificationCreate) SetHash ¶
func (cc *CertificationCreate) SetHash(s string) *CertificationCreate
SetHash sets the "hash" field.
func (*CertificationCreate) SetID ¶
func (cc *CertificationCreate) SetID(u uuid.UUID) *CertificationCreate
SetID sets the "id" field.
func (*CertificationCreate) SetNillableID ¶
func (cc *CertificationCreate) SetNillableID(u *uuid.UUID) *CertificationCreate
SetNillableID sets the "id" field if the given value is not nil.
type CertificationCreateBulk ¶
type CertificationCreateBulk struct {
// contains filtered or unexported fields
}
CertificationCreateBulk is the builder for creating many Certification entities in bulk.
func (*CertificationCreateBulk) Exec ¶
func (ccb *CertificationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificationCreateBulk) ExecX ¶
func (ccb *CertificationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificationCreateBulk) Save ¶
func (ccb *CertificationCreateBulk) Save(ctx context.Context) ([]*Certification, error)
Save creates the Certification entities in the database.
func (*CertificationCreateBulk) SaveX ¶
func (ccb *CertificationCreateBulk) SaveX(ctx context.Context) []*Certification
SaveX is like Save, but panics if an error occurs.
type CertificationDelete ¶
type CertificationDelete struct {
// contains filtered or unexported fields
}
CertificationDelete is the builder for deleting a Certification entity.
func (*CertificationDelete) Exec ¶
func (cd *CertificationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CertificationDelete) ExecX ¶
func (cd *CertificationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CertificationDelete) Where ¶
func (cd *CertificationDelete) Where(ps ...predicate.Certification) *CertificationDelete
Where appends a list predicates to the CertificationDelete builder.
type CertificationDeleteOne ¶
type CertificationDeleteOne struct {
// contains filtered or unexported fields
}
CertificationDeleteOne is the builder for deleting a single Certification entity.
func (*CertificationDeleteOne) Exec ¶
func (cdo *CertificationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CertificationDeleteOne) ExecX ¶
func (cdo *CertificationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificationDeleteOne) Where ¶
func (cdo *CertificationDeleteOne) Where(ps ...predicate.Certification) *CertificationDeleteOne
Where appends a list predicates to the CertificationDelete builder.
type CertificationGroupBy ¶
type CertificationGroupBy struct {
// contains filtered or unexported fields
}
CertificationGroupBy is the group-by builder for Certification entities.
func (*CertificationGroupBy) Aggregate ¶
func (cgb *CertificationGroupBy) Aggregate(fns ...AggregateFunc) *CertificationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CertificationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CertificationGroupBy) Scan ¶
func (cgb *CertificationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CertificationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CertificationMutation ¶
type CertificationMutation struct {
// contains filtered or unexported fields
}
CertificationMutation represents an operation that mutates the Certification nodes in the graph.
func (*CertificationMutation) AddAnchorID ¶
func (m *CertificationMutation) AddAnchorID(i int)
AddAnchorID adds i to the "anchor_id" field.
func (*CertificationMutation) AddField ¶
func (m *CertificationMutation) 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 (*CertificationMutation) AddedAnchorID ¶
func (m *CertificationMutation) AddedAnchorID() (r int, exists bool)
AddedAnchorID returns the value that was added to the "anchor_id" field in this mutation.
func (*CertificationMutation) AddedEdges ¶
func (m *CertificationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CertificationMutation) AddedField ¶
func (m *CertificationMutation) 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 (*CertificationMutation) AddedFields ¶
func (m *CertificationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CertificationMutation) AddedIDs ¶
func (m *CertificationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CertificationMutation) AnchorID ¶
func (m *CertificationMutation) AnchorID() (r int, exists bool)
AnchorID returns the value of the "anchor_id" field in the mutation.
func (*CertificationMutation) ClearEdge ¶
func (m *CertificationMutation) 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 (*CertificationMutation) ClearField ¶
func (m *CertificationMutation) 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 (*CertificationMutation) ClearedEdges ¶
func (m *CertificationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CertificationMutation) ClearedFields ¶
func (m *CertificationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CertificationMutation) Client ¶
func (m CertificationMutation) 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 (*CertificationMutation) DataID ¶
func (m *CertificationMutation) DataID() (r string, exists bool)
DataID returns the value of the "data_id" field in the mutation.
func (*CertificationMutation) EdgeCleared ¶
func (m *CertificationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CertificationMutation) Field ¶
func (m *CertificationMutation) 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 (*CertificationMutation) FieldCleared ¶
func (m *CertificationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CertificationMutation) Fields ¶
func (m *CertificationMutation) 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 (*CertificationMutation) Hash ¶
func (m *CertificationMutation) Hash() (r string, exists bool)
Hash returns the value of the "hash" field in the mutation.
func (*CertificationMutation) ID ¶
func (m *CertificationMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CertificationMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CertificationMutation) OldAnchorID ¶
func (m *CertificationMutation) OldAnchorID(ctx context.Context) (v int, err error)
OldAnchorID returns the old "anchor_id" field's value of the Certification entity. If the Certification 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 (*CertificationMutation) OldDataID ¶
func (m *CertificationMutation) OldDataID(ctx context.Context) (v string, err error)
OldDataID returns the old "data_id" field's value of the Certification entity. If the Certification 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 (*CertificationMutation) 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 (*CertificationMutation) OldHash ¶
func (m *CertificationMutation) OldHash(ctx context.Context) (v string, err error)
OldHash returns the old "hash" field's value of the Certification entity. If the Certification 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 (*CertificationMutation) Op ¶
func (m *CertificationMutation) Op() Op
Op returns the operation name.
func (*CertificationMutation) RemovedEdges ¶
func (m *CertificationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CertificationMutation) RemovedIDs ¶
func (m *CertificationMutation) 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 (*CertificationMutation) ResetAnchorID ¶
func (m *CertificationMutation) ResetAnchorID()
ResetAnchorID resets all changes to the "anchor_id" field.
func (*CertificationMutation) ResetDataID ¶
func (m *CertificationMutation) ResetDataID()
ResetDataID resets all changes to the "data_id" field.
func (*CertificationMutation) ResetEdge ¶
func (m *CertificationMutation) 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 (*CertificationMutation) ResetField ¶
func (m *CertificationMutation) 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 (*CertificationMutation) ResetHash ¶
func (m *CertificationMutation) ResetHash()
ResetHash resets all changes to the "hash" field.
func (*CertificationMutation) SetAnchorID ¶
func (m *CertificationMutation) SetAnchorID(i int)
SetAnchorID sets the "anchor_id" field.
func (*CertificationMutation) SetDataID ¶
func (m *CertificationMutation) SetDataID(s string)
SetDataID sets the "data_id" field.
func (*CertificationMutation) SetField ¶
func (m *CertificationMutation) 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 (*CertificationMutation) SetHash ¶
func (m *CertificationMutation) SetHash(s string)
SetHash sets the "hash" field.
func (*CertificationMutation) SetID ¶
func (m *CertificationMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Certification entities.
func (*CertificationMutation) SetOp ¶
func (m *CertificationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (CertificationMutation) Tx ¶
func (m CertificationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CertificationMutation) Type ¶
func (m *CertificationMutation) Type() string
Type returns the node type of this mutation (Certification).
func (*CertificationMutation) Where ¶
func (m *CertificationMutation) Where(ps ...predicate.Certification)
Where appends a list predicates to the CertificationMutation builder.
func (*CertificationMutation) WhereP ¶
func (m *CertificationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CertificationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CertificationQuery ¶
type CertificationQuery struct {
// contains filtered or unexported fields
}
CertificationQuery is the builder for querying Certification entities.
func (*CertificationQuery) Aggregate ¶
func (cq *CertificationQuery) Aggregate(fns ...AggregateFunc) *CertificationSelect
Aggregate returns a CertificationSelect configured with the given aggregations.
func (*CertificationQuery) All ¶
func (cq *CertificationQuery) All(ctx context.Context) ([]*Certification, error)
All executes the query and returns a list of Certifications.
func (*CertificationQuery) AllX ¶
func (cq *CertificationQuery) AllX(ctx context.Context) []*Certification
AllX is like All, but panics if an error occurs.
func (*CertificationQuery) Clone ¶
func (cq *CertificationQuery) Clone() *CertificationQuery
Clone returns a duplicate of the CertificationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CertificationQuery) Count ¶
func (cq *CertificationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CertificationQuery) CountX ¶
func (cq *CertificationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CertificationQuery) Exist ¶
func (cq *CertificationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CertificationQuery) ExistX ¶
func (cq *CertificationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CertificationQuery) First ¶
func (cq *CertificationQuery) First(ctx context.Context) (*Certification, error)
First returns the first Certification entity from the query. Returns a *NotFoundError when no Certification was found.
func (*CertificationQuery) FirstID ¶
FirstID returns the first Certification ID from the query. Returns a *NotFoundError when no Certification ID was found.
func (*CertificationQuery) FirstIDX ¶
func (cq *CertificationQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*CertificationQuery) FirstX ¶
func (cq *CertificationQuery) FirstX(ctx context.Context) *Certification
FirstX is like First, but panics if an error occurs.
func (*CertificationQuery) GroupBy ¶
func (cq *CertificationQuery) GroupBy(field string, fields ...string) *CertificationGroupBy
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 { AnchorID int `json:"anchor_id,omitempty"` Count int `json:"count,omitempty"` } client.Certification.Query(). GroupBy(certification.FieldAnchorID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CertificationQuery) IDsX ¶
func (cq *CertificationQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*CertificationQuery) Limit ¶
func (cq *CertificationQuery) Limit(limit int) *CertificationQuery
Limit the number of records to be returned by this query.
func (*CertificationQuery) Offset ¶
func (cq *CertificationQuery) Offset(offset int) *CertificationQuery
Offset to start from.
func (*CertificationQuery) Only ¶
func (cq *CertificationQuery) Only(ctx context.Context) (*Certification, error)
Only returns a single Certification entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Certification entity is found. Returns a *NotFoundError when no Certification entities are found.
func (*CertificationQuery) OnlyID ¶
OnlyID is like Only, but returns the only Certification ID in the query. Returns a *NotSingularError when more than one Certification ID is found. Returns a *NotFoundError when no entities are found.
func (*CertificationQuery) OnlyIDX ¶
func (cq *CertificationQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CertificationQuery) OnlyX ¶
func (cq *CertificationQuery) OnlyX(ctx context.Context) *Certification
OnlyX is like Only, but panics if an error occurs.
func (*CertificationQuery) Order ¶
func (cq *CertificationQuery) Order(o ...certification.OrderOption) *CertificationQuery
Order specifies how the records should be ordered.
func (*CertificationQuery) Select ¶
func (cq *CertificationQuery) Select(fields ...string) *CertificationSelect
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 { AnchorID int `json:"anchor_id,omitempty"` } client.Certification.Query(). Select(certification.FieldAnchorID). Scan(ctx, &v)
func (*CertificationQuery) Unique ¶
func (cq *CertificationQuery) Unique(unique bool) *CertificationQuery
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 (*CertificationQuery) Where ¶
func (cq *CertificationQuery) Where(ps ...predicate.Certification) *CertificationQuery
Where adds a new predicate for the CertificationQuery builder.
type CertificationSelect ¶
type CertificationSelect struct { *CertificationQuery // contains filtered or unexported fields }
CertificationSelect is the builder for selecting fields of Certification entities.
func (*CertificationSelect) Aggregate ¶
func (cs *CertificationSelect) Aggregate(fns ...AggregateFunc) *CertificationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CertificationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CertificationSelect) Scan ¶
func (cs *CertificationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CertificationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CertificationUpdate ¶
type CertificationUpdate struct {
// contains filtered or unexported fields
}
CertificationUpdate is the builder for updating Certification entities.
func (*CertificationUpdate) AddAnchorID ¶
func (cu *CertificationUpdate) AddAnchorID(i int) *CertificationUpdate
AddAnchorID adds i to the "anchor_id" field.
func (*CertificationUpdate) Exec ¶
func (cu *CertificationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CertificationUpdate) ExecX ¶
func (cu *CertificationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificationUpdate) Mutation ¶
func (cu *CertificationUpdate) Mutation() *CertificationMutation
Mutation returns the CertificationMutation object of the builder.
func (*CertificationUpdate) Save ¶
func (cu *CertificationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CertificationUpdate) SaveX ¶
func (cu *CertificationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CertificationUpdate) SetAnchorID ¶
func (cu *CertificationUpdate) SetAnchorID(i int) *CertificationUpdate
SetAnchorID sets the "anchor_id" field.
func (*CertificationUpdate) SetDataID ¶
func (cu *CertificationUpdate) SetDataID(s string) *CertificationUpdate
SetDataID sets the "data_id" field.
func (*CertificationUpdate) SetHash ¶
func (cu *CertificationUpdate) SetHash(s string) *CertificationUpdate
SetHash sets the "hash" field.
func (*CertificationUpdate) Where ¶
func (cu *CertificationUpdate) Where(ps ...predicate.Certification) *CertificationUpdate
Where appends a list predicates to the CertificationUpdate builder.
type CertificationUpdateOne ¶
type CertificationUpdateOne struct {
// contains filtered or unexported fields
}
CertificationUpdateOne is the builder for updating a single Certification entity.
func (*CertificationUpdateOne) AddAnchorID ¶
func (cuo *CertificationUpdateOne) AddAnchorID(i int) *CertificationUpdateOne
AddAnchorID adds i to the "anchor_id" field.
func (*CertificationUpdateOne) Exec ¶
func (cuo *CertificationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CertificationUpdateOne) ExecX ¶
func (cuo *CertificationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CertificationUpdateOne) Mutation ¶
func (cuo *CertificationUpdateOne) Mutation() *CertificationMutation
Mutation returns the CertificationMutation object of the builder.
func (*CertificationUpdateOne) Save ¶
func (cuo *CertificationUpdateOne) Save(ctx context.Context) (*Certification, error)
Save executes the query and returns the updated Certification entity.
func (*CertificationUpdateOne) SaveX ¶
func (cuo *CertificationUpdateOne) SaveX(ctx context.Context) *Certification
SaveX is like Save, but panics if an error occurs.
func (*CertificationUpdateOne) Select ¶
func (cuo *CertificationUpdateOne) Select(field string, fields ...string) *CertificationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CertificationUpdateOne) SetAnchorID ¶
func (cuo *CertificationUpdateOne) SetAnchorID(i int) *CertificationUpdateOne
SetAnchorID sets the "anchor_id" field.
func (*CertificationUpdateOne) SetDataID ¶
func (cuo *CertificationUpdateOne) SetDataID(s string) *CertificationUpdateOne
SetDataID sets the "data_id" field.
func (*CertificationUpdateOne) SetHash ¶
func (cuo *CertificationUpdateOne) SetHash(s string) *CertificationUpdateOne
SetHash sets the "hash" field.
func (*CertificationUpdateOne) Where ¶
func (cuo *CertificationUpdateOne) Where(ps ...predicate.Certification) *CertificationUpdateOne
Where appends a list predicates to the CertificationUpdate builder.
type Certifications ¶
type Certifications []*Certification
Certifications is a parsable slice of Certification.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Certification is the client for interacting with the Certification builders. Certification *CertificationClient // LocalKey is the client for interacting with the LocalKey builders. LocalKey *LocalKeyClient // 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(). Certification. 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 LocalKey ¶
type LocalKey struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // LocalKey holds the value of the "local_key" field. LocalKey *key.LocalKey `json:"local_key,omitempty"` // KeyType holds the value of the "key_type" field. KeyType string `json:"key_type,omitempty"` // contains filtered or unexported fields }
LocalKey is the model entity for the LocalKey schema.
func (*LocalKey) Unwrap ¶
Unwrap unwraps the LocalKey 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 (*LocalKey) Update ¶
func (lk *LocalKey) Update() *LocalKeyUpdateOne
Update returns a builder for updating this LocalKey. Note that you need to call LocalKey.Unwrap() before calling this method if this LocalKey was returned from a transaction, and the transaction was committed or rolled back.
type LocalKeyClient ¶
type LocalKeyClient struct {
// contains filtered or unexported fields
}
LocalKeyClient is a client for the LocalKey schema.
func NewLocalKeyClient ¶
func NewLocalKeyClient(c config) *LocalKeyClient
NewLocalKeyClient returns a client for the LocalKey from the given config.
func (*LocalKeyClient) Create ¶
func (c *LocalKeyClient) Create() *LocalKeyCreate
Create returns a builder for creating a LocalKey entity.
func (*LocalKeyClient) CreateBulk ¶
func (c *LocalKeyClient) CreateBulk(builders ...*LocalKeyCreate) *LocalKeyCreateBulk
CreateBulk returns a builder for creating a bulk of LocalKey entities.
func (*LocalKeyClient) Delete ¶
func (c *LocalKeyClient) Delete() *LocalKeyDelete
Delete returns a delete builder for LocalKey.
func (*LocalKeyClient) DeleteOne ¶
func (c *LocalKeyClient) DeleteOne(lk *LocalKey) *LocalKeyDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LocalKeyClient) DeleteOneID ¶
func (c *LocalKeyClient) DeleteOneID(id uuid.UUID) *LocalKeyDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LocalKeyClient) Hooks ¶
func (c *LocalKeyClient) Hooks() []Hook
Hooks returns the client hooks.
func (*LocalKeyClient) Intercept ¶
func (c *LocalKeyClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `localkey.Intercept(f(g(h())))`.
func (*LocalKeyClient) Interceptors ¶
func (c *LocalKeyClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LocalKeyClient) MapCreateBulk ¶
func (c *LocalKeyClient) MapCreateBulk(slice any, setFunc func(*LocalKeyCreate, int)) *LocalKeyCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*LocalKeyClient) Query ¶
func (c *LocalKeyClient) Query() *LocalKeyQuery
Query returns a query builder for LocalKey.
func (*LocalKeyClient) Update ¶
func (c *LocalKeyClient) Update() *LocalKeyUpdate
Update returns an update builder for LocalKey.
func (*LocalKeyClient) UpdateOne ¶
func (c *LocalKeyClient) UpdateOne(lk *LocalKey) *LocalKeyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LocalKeyClient) UpdateOneID ¶
func (c *LocalKeyClient) UpdateOneID(id uuid.UUID) *LocalKeyUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LocalKeyClient) Use ¶
func (c *LocalKeyClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `localkey.Hooks(f(g(h())))`.
type LocalKeyCreate ¶
type LocalKeyCreate struct {
// contains filtered or unexported fields
}
LocalKeyCreate is the builder for creating a LocalKey entity.
func (*LocalKeyCreate) Exec ¶
func (lkc *LocalKeyCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocalKeyCreate) ExecX ¶
func (lkc *LocalKeyCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocalKeyCreate) Mutation ¶
func (lkc *LocalKeyCreate) Mutation() *LocalKeyMutation
Mutation returns the LocalKeyMutation object of the builder.
func (*LocalKeyCreate) Save ¶
func (lkc *LocalKeyCreate) Save(ctx context.Context) (*LocalKey, error)
Save creates the LocalKey in the database.
func (*LocalKeyCreate) SaveX ¶
func (lkc *LocalKeyCreate) SaveX(ctx context.Context) *LocalKey
SaveX calls Save and panics if Save returns an error.
func (*LocalKeyCreate) SetID ¶
func (lkc *LocalKeyCreate) SetID(u uuid.UUID) *LocalKeyCreate
SetID sets the "id" field.
func (*LocalKeyCreate) SetKeyType ¶
func (lkc *LocalKeyCreate) SetKeyType(s string) *LocalKeyCreate
SetKeyType sets the "key_type" field.
func (*LocalKeyCreate) SetLocalKey ¶
func (lkc *LocalKeyCreate) SetLocalKey(kk *key.LocalKey) *LocalKeyCreate
SetLocalKey sets the "local_key" field.
func (*LocalKeyCreate) SetNillableID ¶
func (lkc *LocalKeyCreate) SetNillableID(u *uuid.UUID) *LocalKeyCreate
SetNillableID sets the "id" field if the given value is not nil.
type LocalKeyCreateBulk ¶
type LocalKeyCreateBulk struct {
// contains filtered or unexported fields
}
LocalKeyCreateBulk is the builder for creating many LocalKey entities in bulk.
func (*LocalKeyCreateBulk) Exec ¶
func (lkcb *LocalKeyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LocalKeyCreateBulk) ExecX ¶
func (lkcb *LocalKeyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LocalKeyDelete ¶
type LocalKeyDelete struct {
// contains filtered or unexported fields
}
LocalKeyDelete is the builder for deleting a LocalKey entity.
func (*LocalKeyDelete) Exec ¶
func (lkd *LocalKeyDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LocalKeyDelete) ExecX ¶
func (lkd *LocalKeyDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LocalKeyDelete) Where ¶
func (lkd *LocalKeyDelete) Where(ps ...predicate.LocalKey) *LocalKeyDelete
Where appends a list predicates to the LocalKeyDelete builder.
type LocalKeyDeleteOne ¶
type LocalKeyDeleteOne struct {
// contains filtered or unexported fields
}
LocalKeyDeleteOne is the builder for deleting a single LocalKey entity.
func (*LocalKeyDeleteOne) Exec ¶
func (lkdo *LocalKeyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LocalKeyDeleteOne) ExecX ¶
func (lkdo *LocalKeyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocalKeyDeleteOne) Where ¶
func (lkdo *LocalKeyDeleteOne) Where(ps ...predicate.LocalKey) *LocalKeyDeleteOne
Where appends a list predicates to the LocalKeyDelete builder.
type LocalKeyGroupBy ¶
type LocalKeyGroupBy struct {
// contains filtered or unexported fields
}
LocalKeyGroupBy is the group-by builder for LocalKey entities.
func (*LocalKeyGroupBy) Aggregate ¶
func (lkgb *LocalKeyGroupBy) Aggregate(fns ...AggregateFunc) *LocalKeyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LocalKeyGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocalKeyGroupBy) Scan ¶
func (lkgb *LocalKeyGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocalKeyGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocalKeyMutation ¶
type LocalKeyMutation struct {
// contains filtered or unexported fields
}
LocalKeyMutation represents an operation that mutates the LocalKey nodes in the graph.
func (*LocalKeyMutation) AddField ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) AddedEdges ¶
func (m *LocalKeyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LocalKeyMutation) AddedField ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) AddedFields ¶
func (m *LocalKeyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LocalKeyMutation) AddedIDs ¶
func (m *LocalKeyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LocalKeyMutation) ClearEdge ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ClearField ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ClearedEdges ¶
func (m *LocalKeyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LocalKeyMutation) ClearedFields ¶
func (m *LocalKeyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LocalKeyMutation) Client ¶
func (m LocalKeyMutation) 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 (*LocalKeyMutation) EdgeCleared ¶
func (m *LocalKeyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LocalKeyMutation) Field ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) FieldCleared ¶
func (m *LocalKeyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LocalKeyMutation) Fields ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ID ¶
func (m *LocalKeyMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*LocalKeyMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*LocalKeyMutation) KeyType ¶
func (m *LocalKeyMutation) KeyType() (r string, exists bool)
KeyType returns the value of the "key_type" field in the mutation.
func (*LocalKeyMutation) LocalKey ¶
func (m *LocalKeyMutation) LocalKey() (r *key.LocalKey, exists bool)
LocalKey returns the value of the "local_key" field in the mutation.
func (*LocalKeyMutation) 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 (*LocalKeyMutation) OldKeyType ¶
func (m *LocalKeyMutation) OldKeyType(ctx context.Context) (v string, err error)
OldKeyType returns the old "key_type" field's value of the LocalKey entity. If the LocalKey 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 (*LocalKeyMutation) OldLocalKey ¶
OldLocalKey returns the old "local_key" field's value of the LocalKey entity. If the LocalKey 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 (*LocalKeyMutation) RemovedEdges ¶
func (m *LocalKeyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LocalKeyMutation) RemovedIDs ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ResetEdge ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ResetField ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) ResetKeyType ¶
func (m *LocalKeyMutation) ResetKeyType()
ResetKeyType resets all changes to the "key_type" field.
func (*LocalKeyMutation) ResetLocalKey ¶
func (m *LocalKeyMutation) ResetLocalKey()
ResetLocalKey resets all changes to the "local_key" field.
func (*LocalKeyMutation) SetField ¶
func (m *LocalKeyMutation) 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 (*LocalKeyMutation) SetID ¶
func (m *LocalKeyMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of LocalKey entities.
func (*LocalKeyMutation) SetKeyType ¶
func (m *LocalKeyMutation) SetKeyType(s string)
SetKeyType sets the "key_type" field.
func (*LocalKeyMutation) SetLocalKey ¶
func (m *LocalKeyMutation) SetLocalKey(kk *key.LocalKey)
SetLocalKey sets the "local_key" field.
func (*LocalKeyMutation) SetOp ¶
func (m *LocalKeyMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (LocalKeyMutation) Tx ¶
func (m LocalKeyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LocalKeyMutation) Type ¶
func (m *LocalKeyMutation) Type() string
Type returns the node type of this mutation (LocalKey).
func (*LocalKeyMutation) Where ¶
func (m *LocalKeyMutation) Where(ps ...predicate.LocalKey)
Where appends a list predicates to the LocalKeyMutation builder.
func (*LocalKeyMutation) WhereP ¶
func (m *LocalKeyMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LocalKeyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LocalKeyQuery ¶
type LocalKeyQuery struct {
// contains filtered or unexported fields
}
LocalKeyQuery is the builder for querying LocalKey entities.
func (*LocalKeyQuery) Aggregate ¶
func (lkq *LocalKeyQuery) Aggregate(fns ...AggregateFunc) *LocalKeySelect
Aggregate returns a LocalKeySelect configured with the given aggregations.
func (*LocalKeyQuery) All ¶
func (lkq *LocalKeyQuery) All(ctx context.Context) ([]*LocalKey, error)
All executes the query and returns a list of LocalKeys.
func (*LocalKeyQuery) AllX ¶
func (lkq *LocalKeyQuery) AllX(ctx context.Context) []*LocalKey
AllX is like All, but panics if an error occurs.
func (*LocalKeyQuery) Clone ¶
func (lkq *LocalKeyQuery) Clone() *LocalKeyQuery
Clone returns a duplicate of the LocalKeyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LocalKeyQuery) Count ¶
func (lkq *LocalKeyQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LocalKeyQuery) CountX ¶
func (lkq *LocalKeyQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LocalKeyQuery) Exist ¶
func (lkq *LocalKeyQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LocalKeyQuery) ExistX ¶
func (lkq *LocalKeyQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LocalKeyQuery) First ¶
func (lkq *LocalKeyQuery) First(ctx context.Context) (*LocalKey, error)
First returns the first LocalKey entity from the query. Returns a *NotFoundError when no LocalKey was found.
func (*LocalKeyQuery) FirstID ¶
FirstID returns the first LocalKey ID from the query. Returns a *NotFoundError when no LocalKey ID was found.
func (*LocalKeyQuery) FirstIDX ¶
func (lkq *LocalKeyQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*LocalKeyQuery) FirstX ¶
func (lkq *LocalKeyQuery) FirstX(ctx context.Context) *LocalKey
FirstX is like First, but panics if an error occurs.
func (*LocalKeyQuery) GroupBy ¶
func (lkq *LocalKeyQuery) GroupBy(field string, fields ...string) *LocalKeyGroupBy
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 { LocalKey *key.LocalKey `json:"local_key,omitempty"` Count int `json:"count,omitempty"` } client.LocalKey.Query(). GroupBy(localkey.FieldLocalKey). Aggregate(ent.Count()). Scan(ctx, &v)
func (*LocalKeyQuery) IDsX ¶
func (lkq *LocalKeyQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*LocalKeyQuery) Limit ¶
func (lkq *LocalKeyQuery) Limit(limit int) *LocalKeyQuery
Limit the number of records to be returned by this query.
func (*LocalKeyQuery) Offset ¶
func (lkq *LocalKeyQuery) Offset(offset int) *LocalKeyQuery
Offset to start from.
func (*LocalKeyQuery) Only ¶
func (lkq *LocalKeyQuery) Only(ctx context.Context) (*LocalKey, error)
Only returns a single LocalKey entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one LocalKey entity is found. Returns a *NotFoundError when no LocalKey entities are found.
func (*LocalKeyQuery) OnlyID ¶
OnlyID is like Only, but returns the only LocalKey ID in the query. Returns a *NotSingularError when more than one LocalKey ID is found. Returns a *NotFoundError when no entities are found.
func (*LocalKeyQuery) OnlyIDX ¶
func (lkq *LocalKeyQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LocalKeyQuery) OnlyX ¶
func (lkq *LocalKeyQuery) OnlyX(ctx context.Context) *LocalKey
OnlyX is like Only, but panics if an error occurs.
func (*LocalKeyQuery) Order ¶
func (lkq *LocalKeyQuery) Order(o ...localkey.OrderOption) *LocalKeyQuery
Order specifies how the records should be ordered.
func (*LocalKeyQuery) Select ¶
func (lkq *LocalKeyQuery) Select(fields ...string) *LocalKeySelect
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 { LocalKey *key.LocalKey `json:"local_key,omitempty"` } client.LocalKey.Query(). Select(localkey.FieldLocalKey). Scan(ctx, &v)
func (*LocalKeyQuery) Unique ¶
func (lkq *LocalKeyQuery) Unique(unique bool) *LocalKeyQuery
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 (*LocalKeyQuery) Where ¶
func (lkq *LocalKeyQuery) Where(ps ...predicate.LocalKey) *LocalKeyQuery
Where adds a new predicate for the LocalKeyQuery builder.
type LocalKeySelect ¶
type LocalKeySelect struct { *LocalKeyQuery // contains filtered or unexported fields }
LocalKeySelect is the builder for selecting fields of LocalKey entities.
func (*LocalKeySelect) Aggregate ¶
func (lks *LocalKeySelect) Aggregate(fns ...AggregateFunc) *LocalKeySelect
Aggregate adds the given aggregation functions to the selector query.
func (*LocalKeySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocalKeySelect) Scan ¶
func (lks *LocalKeySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocalKeySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocalKeyUpdate ¶
type LocalKeyUpdate struct {
// contains filtered or unexported fields
}
LocalKeyUpdate is the builder for updating LocalKey entities.
func (*LocalKeyUpdate) Exec ¶
func (lku *LocalKeyUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocalKeyUpdate) ExecX ¶
func (lku *LocalKeyUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocalKeyUpdate) Mutation ¶
func (lku *LocalKeyUpdate) Mutation() *LocalKeyMutation
Mutation returns the LocalKeyMutation object of the builder.
func (*LocalKeyUpdate) Save ¶
func (lku *LocalKeyUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LocalKeyUpdate) SaveX ¶
func (lku *LocalKeyUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LocalKeyUpdate) SetKeyType ¶
func (lku *LocalKeyUpdate) SetKeyType(s string) *LocalKeyUpdate
SetKeyType sets the "key_type" field.
func (*LocalKeyUpdate) SetLocalKey ¶
func (lku *LocalKeyUpdate) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdate
SetLocalKey sets the "local_key" field.
func (*LocalKeyUpdate) Where ¶
func (lku *LocalKeyUpdate) Where(ps ...predicate.LocalKey) *LocalKeyUpdate
Where appends a list predicates to the LocalKeyUpdate builder.
type LocalKeyUpdateOne ¶
type LocalKeyUpdateOne struct {
// contains filtered or unexported fields
}
LocalKeyUpdateOne is the builder for updating a single LocalKey entity.
func (*LocalKeyUpdateOne) Exec ¶
func (lkuo *LocalKeyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LocalKeyUpdateOne) ExecX ¶
func (lkuo *LocalKeyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocalKeyUpdateOne) Mutation ¶
func (lkuo *LocalKeyUpdateOne) Mutation() *LocalKeyMutation
Mutation returns the LocalKeyMutation object of the builder.
func (*LocalKeyUpdateOne) Save ¶
func (lkuo *LocalKeyUpdateOne) Save(ctx context.Context) (*LocalKey, error)
Save executes the query and returns the updated LocalKey entity.
func (*LocalKeyUpdateOne) SaveX ¶
func (lkuo *LocalKeyUpdateOne) SaveX(ctx context.Context) *LocalKey
SaveX is like Save, but panics if an error occurs.
func (*LocalKeyUpdateOne) Select ¶
func (lkuo *LocalKeyUpdateOne) Select(field string, fields ...string) *LocalKeyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LocalKeyUpdateOne) SetKeyType ¶
func (lkuo *LocalKeyUpdateOne) SetKeyType(s string) *LocalKeyUpdateOne
SetKeyType sets the "key_type" field.
func (*LocalKeyUpdateOne) SetLocalKey ¶
func (lkuo *LocalKeyUpdateOne) SetLocalKey(kk *key.LocalKey) *LocalKeyUpdateOne
SetLocalKey sets the "local_key" field.
func (*LocalKeyUpdateOne) Where ¶
func (lkuo *LocalKeyUpdateOne) Where(ps ...predicate.LocalKey) *LocalKeyUpdateOne
Where appends a list predicates to the LocalKeyUpdate builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Certification is the client for interacting with the Certification builders. Certification *CertificationClient // LocalKey is the client for interacting with the LocalKey builders. LocalKey *LocalKeyClient // 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.