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 Binding
- type BindingClient
- func (c *BindingClient) Create() *BindingCreate
- func (c *BindingClient) CreateBulk(builders ...*BindingCreate) *BindingCreateBulk
- func (c *BindingClient) Delete() *BindingDelete
- func (c *BindingClient) DeleteOne(_m *Binding) *BindingDeleteOne
- func (c *BindingClient) DeleteOneID(id int) *BindingDeleteOne
- func (c *BindingClient) Get(ctx context.Context, id int) (*Binding, error)
- func (c *BindingClient) GetX(ctx context.Context, id int) *Binding
- func (c *BindingClient) Hooks() []Hook
- func (c *BindingClient) Intercept(interceptors ...Interceptor)
- func (c *BindingClient) Interceptors() []Interceptor
- func (c *BindingClient) MapCreateBulk(slice any, setFunc func(*BindingCreate, int)) *BindingCreateBulk
- func (c *BindingClient) Query() *BindingQuery
- func (c *BindingClient) Update() *BindingUpdate
- func (c *BindingClient) UpdateOne(_m *Binding) *BindingUpdateOne
- func (c *BindingClient) UpdateOneID(id int) *BindingUpdateOne
- func (c *BindingClient) Use(hooks ...Hook)
- type BindingCreate
- func (_c *BindingCreate) Exec(ctx context.Context) error
- func (_c *BindingCreate) ExecX(ctx context.Context)
- func (_c *BindingCreate) Mutation() *BindingMutation
- func (_c *BindingCreate) Save(ctx context.Context) (*Binding, error)
- func (_c *BindingCreate) SaveX(ctx context.Context) *Binding
- func (_c *BindingCreate) SetConnectionID(v string) *BindingCreate
- func (_c *BindingCreate) SetConsumerID(v string) *BindingCreate
- func (_c *BindingCreate) SetConsumerKind(v string) *BindingCreate
- func (_c *BindingCreate) SetCreatedAt(v time.Time) *BindingCreate
- func (_c *BindingCreate) SetOwnerID(v string) *BindingCreate
- func (_c *BindingCreate) SetPurpose(v string) *BindingCreate
- type BindingCreateBulk
- type BindingDelete
- type BindingDeleteOne
- type BindingGroupBy
- func (_g *BindingGroupBy) Aggregate(fns ...AggregateFunc) *BindingGroupBy
- func (s *BindingGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BindingGroupBy) BoolX(ctx context.Context) bool
- func (s *BindingGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BindingGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BindingGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BindingGroupBy) Float64X(ctx context.Context) float64
- func (s *BindingGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BindingGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BindingGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BindingGroupBy) IntX(ctx context.Context) int
- func (s *BindingGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BindingGroupBy) IntsX(ctx context.Context) []int
- func (_g *BindingGroupBy) Scan(ctx context.Context, v any) error
- func (s *BindingGroupBy) ScanX(ctx context.Context, v any)
- func (s *BindingGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BindingGroupBy) StringX(ctx context.Context) string
- func (s *BindingGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BindingGroupBy) StringsX(ctx context.Context) []string
- type BindingMutation
- func (m *BindingMutation) AddField(name string, value ent.Value) error
- func (m *BindingMutation) AddedEdges() []string
- func (m *BindingMutation) AddedField(name string) (ent.Value, bool)
- func (m *BindingMutation) AddedFields() []string
- func (m *BindingMutation) AddedIDs(name string) []ent.Value
- func (m *BindingMutation) ClearEdge(name string) error
- func (m *BindingMutation) ClearField(name string) error
- func (m *BindingMutation) ClearedEdges() []string
- func (m *BindingMutation) ClearedFields() []string
- func (m BindingMutation) Client() *Client
- func (m *BindingMutation) ConnectionID() (r string, exists bool)
- func (m *BindingMutation) ConsumerID() (r string, exists bool)
- func (m *BindingMutation) ConsumerKind() (r string, exists bool)
- func (m *BindingMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BindingMutation) EdgeCleared(name string) bool
- func (m *BindingMutation) Field(name string) (ent.Value, bool)
- func (m *BindingMutation) FieldCleared(name string) bool
- func (m *BindingMutation) Fields() []string
- func (m *BindingMutation) ID() (id int, exists bool)
- func (m *BindingMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BindingMutation) OldConnectionID(ctx context.Context) (v string, err error)
- func (m *BindingMutation) OldConsumerID(ctx context.Context) (v string, err error)
- func (m *BindingMutation) OldConsumerKind(ctx context.Context) (v string, err error)
- func (m *BindingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BindingMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BindingMutation) OldOwnerID(ctx context.Context) (v string, err error)
- func (m *BindingMutation) OldPurpose(ctx context.Context) (v string, err error)
- func (m *BindingMutation) Op() Op
- func (m *BindingMutation) OwnerID() (r string, exists bool)
- func (m *BindingMutation) Purpose() (r string, exists bool)
- func (m *BindingMutation) RemovedEdges() []string
- func (m *BindingMutation) RemovedIDs(name string) []ent.Value
- func (m *BindingMutation) ResetConnectionID()
- func (m *BindingMutation) ResetConsumerID()
- func (m *BindingMutation) ResetConsumerKind()
- func (m *BindingMutation) ResetCreatedAt()
- func (m *BindingMutation) ResetEdge(name string) error
- func (m *BindingMutation) ResetField(name string) error
- func (m *BindingMutation) ResetOwnerID()
- func (m *BindingMutation) ResetPurpose()
- func (m *BindingMutation) SetConnectionID(s string)
- func (m *BindingMutation) SetConsumerID(s string)
- func (m *BindingMutation) SetConsumerKind(s string)
- func (m *BindingMutation) SetCreatedAt(t time.Time)
- func (m *BindingMutation) SetField(name string, value ent.Value) error
- func (m *BindingMutation) SetOp(op Op)
- func (m *BindingMutation) SetOwnerID(s string)
- func (m *BindingMutation) SetPurpose(s string)
- func (m BindingMutation) Tx() (*Tx, error)
- func (m *BindingMutation) Type() string
- func (m *BindingMutation) Where(ps ...predicate.Binding)
- func (m *BindingMutation) WhereP(ps ...func(*sql.Selector))
- type BindingQuery
- func (_q *BindingQuery) Aggregate(fns ...AggregateFunc) *BindingSelect
- func (_q *BindingQuery) All(ctx context.Context) ([]*Binding, error)
- func (_q *BindingQuery) AllX(ctx context.Context) []*Binding
- func (_q *BindingQuery) Clone() *BindingQuery
- func (_q *BindingQuery) Count(ctx context.Context) (int, error)
- func (_q *BindingQuery) CountX(ctx context.Context) int
- func (_q *BindingQuery) Exist(ctx context.Context) (bool, error)
- func (_q *BindingQuery) ExistX(ctx context.Context) bool
- func (_q *BindingQuery) First(ctx context.Context) (*Binding, error)
- func (_q *BindingQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *BindingQuery) FirstIDX(ctx context.Context) int
- func (_q *BindingQuery) FirstX(ctx context.Context) *Binding
- func (_q *BindingQuery) GroupBy(field string, fields ...string) *BindingGroupBy
- func (_q *BindingQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *BindingQuery) IDsX(ctx context.Context) []int
- func (_q *BindingQuery) Limit(limit int) *BindingQuery
- func (_q *BindingQuery) Offset(offset int) *BindingQuery
- func (_q *BindingQuery) Only(ctx context.Context) (*Binding, error)
- func (_q *BindingQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *BindingQuery) OnlyIDX(ctx context.Context) int
- func (_q *BindingQuery) OnlyX(ctx context.Context) *Binding
- func (_q *BindingQuery) Order(o ...binding.OrderOption) *BindingQuery
- func (_q *BindingQuery) Select(fields ...string) *BindingSelect
- func (_q *BindingQuery) Unique(unique bool) *BindingQuery
- func (_q *BindingQuery) Where(ps ...predicate.Binding) *BindingQuery
- type BindingSelect
- func (_s *BindingSelect) Aggregate(fns ...AggregateFunc) *BindingSelect
- func (s *BindingSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BindingSelect) BoolX(ctx context.Context) bool
- func (s *BindingSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BindingSelect) BoolsX(ctx context.Context) []bool
- func (s *BindingSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BindingSelect) Float64X(ctx context.Context) float64
- func (s *BindingSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BindingSelect) Float64sX(ctx context.Context) []float64
- func (s *BindingSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BindingSelect) IntX(ctx context.Context) int
- func (s *BindingSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BindingSelect) IntsX(ctx context.Context) []int
- func (_s *BindingSelect) Scan(ctx context.Context, v any) error
- func (s *BindingSelect) ScanX(ctx context.Context, v any)
- func (s *BindingSelect) String(ctx context.Context) (_ string, err error)
- func (s *BindingSelect) StringX(ctx context.Context) string
- func (s *BindingSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BindingSelect) StringsX(ctx context.Context) []string
- type BindingUpdate
- func (_u *BindingUpdate) Exec(ctx context.Context) error
- func (_u *BindingUpdate) ExecX(ctx context.Context)
- func (_u *BindingUpdate) Mutation() *BindingMutation
- func (_u *BindingUpdate) Save(ctx context.Context) (int, error)
- func (_u *BindingUpdate) SaveX(ctx context.Context) int
- func (_u *BindingUpdate) Where(ps ...predicate.Binding) *BindingUpdate
- type BindingUpdateOne
- func (_u *BindingUpdateOne) Exec(ctx context.Context) error
- func (_u *BindingUpdateOne) ExecX(ctx context.Context)
- func (_u *BindingUpdateOne) Mutation() *BindingMutation
- func (_u *BindingUpdateOne) Save(ctx context.Context) (*Binding, error)
- func (_u *BindingUpdateOne) SaveX(ctx context.Context) *Binding
- func (_u *BindingUpdateOne) Select(field string, fields ...string) *BindingUpdateOne
- func (_u *BindingUpdateOne) Where(ps ...predicate.Binding) *BindingUpdateOne
- type Bindings
- 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 Connection
- type ConnectionClient
- func (c *ConnectionClient) Create() *ConnectionCreate
- func (c *ConnectionClient) CreateBulk(builders ...*ConnectionCreate) *ConnectionCreateBulk
- func (c *ConnectionClient) Delete() *ConnectionDelete
- func (c *ConnectionClient) DeleteOne(_m *Connection) *ConnectionDeleteOne
- func (c *ConnectionClient) DeleteOneID(id int) *ConnectionDeleteOne
- func (c *ConnectionClient) Get(ctx context.Context, id int) (*Connection, error)
- func (c *ConnectionClient) GetX(ctx context.Context, id int) *Connection
- func (c *ConnectionClient) Hooks() []Hook
- func (c *ConnectionClient) Intercept(interceptors ...Interceptor)
- func (c *ConnectionClient) Interceptors() []Interceptor
- func (c *ConnectionClient) MapCreateBulk(slice any, setFunc func(*ConnectionCreate, int)) *ConnectionCreateBulk
- func (c *ConnectionClient) Query() *ConnectionQuery
- func (c *ConnectionClient) Update() *ConnectionUpdate
- func (c *ConnectionClient) UpdateOne(_m *Connection) *ConnectionUpdateOne
- func (c *ConnectionClient) UpdateOneID(id int) *ConnectionUpdateOne
- func (c *ConnectionClient) Use(hooks ...Hook)
- type ConnectionCreate
- func (_c *ConnectionCreate) Exec(ctx context.Context) error
- func (_c *ConnectionCreate) ExecX(ctx context.Context)
- func (_c *ConnectionCreate) Mutation() *ConnectionMutation
- func (_c *ConnectionCreate) Save(ctx context.Context) (*Connection, error)
- func (_c *ConnectionCreate) SaveX(ctx context.Context) *Connection
- func (_c *ConnectionCreate) SetAuthMethod(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetConnectionID(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetCreatedAt(v time.Time) *ConnectionCreate
- func (_c *ConnectionCreate) SetCreatedByID(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetCreatedByKind(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetDisplayName(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetExternalAccountID(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetExternalLabel(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetHealth(v connectionforge.Health) *ConnectionCreate
- func (_c *ConnectionCreate) SetMetadata(v map[string]string) *ConnectionCreate
- func (_c *ConnectionCreate) SetNillableExternalAccountID(v *string) *ConnectionCreate
- func (_c *ConnectionCreate) SetNillableExternalLabel(v *string) *ConnectionCreate
- func (_c *ConnectionCreate) SetOwnerID(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetProvider(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetRevision(v uint64) *ConnectionCreate
- func (_c *ConnectionCreate) SetScopes(v []string) *ConnectionCreate
- func (_c *ConnectionCreate) SetState(v string) *ConnectionCreate
- func (_c *ConnectionCreate) SetUpdatedAt(v time.Time) *ConnectionCreate
- type ConnectionCreateBulk
- type ConnectionDelete
- type ConnectionDeleteOne
- type ConnectionGroupBy
- func (_g *ConnectionGroupBy) Aggregate(fns ...AggregateFunc) *ConnectionGroupBy
- func (s *ConnectionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ConnectionGroupBy) BoolX(ctx context.Context) bool
- func (s *ConnectionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ConnectionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ConnectionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ConnectionGroupBy) Float64X(ctx context.Context) float64
- func (s *ConnectionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ConnectionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ConnectionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ConnectionGroupBy) IntX(ctx context.Context) int
- func (s *ConnectionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ConnectionGroupBy) IntsX(ctx context.Context) []int
- func (_g *ConnectionGroupBy) Scan(ctx context.Context, v any) error
- func (s *ConnectionGroupBy) ScanX(ctx context.Context, v any)
- func (s *ConnectionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ConnectionGroupBy) StringX(ctx context.Context) string
- func (s *ConnectionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ConnectionGroupBy) StringsX(ctx context.Context) []string
- type ConnectionMutation
- func (m *ConnectionMutation) AddField(name string, value ent.Value) error
- func (m *ConnectionMutation) AddRevision(u int64)
- func (m *ConnectionMutation) AddedEdges() []string
- func (m *ConnectionMutation) AddedField(name string) (ent.Value, bool)
- func (m *ConnectionMutation) AddedFields() []string
- func (m *ConnectionMutation) AddedIDs(name string) []ent.Value
- func (m *ConnectionMutation) AddedRevision() (r int64, exists bool)
- func (m *ConnectionMutation) AppendScopes(s []string)
- func (m *ConnectionMutation) AppendedScopes() ([]string, bool)
- func (m *ConnectionMutation) AuthMethod() (r string, exists bool)
- func (m *ConnectionMutation) ClearEdge(name string) error
- func (m *ConnectionMutation) ClearField(name string) error
- func (m *ConnectionMutation) ClearMetadata()
- func (m *ConnectionMutation) ClearScopes()
- func (m *ConnectionMutation) ClearedEdges() []string
- func (m *ConnectionMutation) ClearedFields() []string
- func (m ConnectionMutation) Client() *Client
- func (m *ConnectionMutation) ConnectionID() (r string, exists bool)
- func (m *ConnectionMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ConnectionMutation) CreatedByID() (r string, exists bool)
- func (m *ConnectionMutation) CreatedByKind() (r string, exists bool)
- func (m *ConnectionMutation) DisplayName() (r string, exists bool)
- func (m *ConnectionMutation) EdgeCleared(name string) bool
- func (m *ConnectionMutation) ExternalAccountID() (r string, exists bool)
- func (m *ConnectionMutation) ExternalLabel() (r string, exists bool)
- func (m *ConnectionMutation) Field(name string) (ent.Value, bool)
- func (m *ConnectionMutation) FieldCleared(name string) bool
- func (m *ConnectionMutation) Fields() []string
- func (m *ConnectionMutation) Health() (r connectionforge.Health, exists bool)
- func (m *ConnectionMutation) ID() (id int, exists bool)
- func (m *ConnectionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ConnectionMutation) Metadata() (r map[string]string, exists bool)
- func (m *ConnectionMutation) MetadataCleared() bool
- func (m *ConnectionMutation) OldAuthMethod(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldConnectionID(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ConnectionMutation) OldCreatedByID(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldCreatedByKind(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldExternalAccountID(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldExternalLabel(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ConnectionMutation) OldHealth(ctx context.Context) (v connectionforge.Health, err error)
- func (m *ConnectionMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)
- func (m *ConnectionMutation) OldOwnerID(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldProvider(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldRevision(ctx context.Context) (v uint64, err error)
- func (m *ConnectionMutation) OldScopes(ctx context.Context) (v []string, err error)
- func (m *ConnectionMutation) OldState(ctx context.Context) (v string, err error)
- func (m *ConnectionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ConnectionMutation) Op() Op
- func (m *ConnectionMutation) OwnerID() (r string, exists bool)
- func (m *ConnectionMutation) Provider() (r string, exists bool)
- func (m *ConnectionMutation) RemovedEdges() []string
- func (m *ConnectionMutation) RemovedIDs(name string) []ent.Value
- func (m *ConnectionMutation) ResetAuthMethod()
- func (m *ConnectionMutation) ResetConnectionID()
- func (m *ConnectionMutation) ResetCreatedAt()
- func (m *ConnectionMutation) ResetCreatedByID()
- func (m *ConnectionMutation) ResetCreatedByKind()
- func (m *ConnectionMutation) ResetDisplayName()
- func (m *ConnectionMutation) ResetEdge(name string) error
- func (m *ConnectionMutation) ResetExternalAccountID()
- func (m *ConnectionMutation) ResetExternalLabel()
- func (m *ConnectionMutation) ResetField(name string) error
- func (m *ConnectionMutation) ResetHealth()
- func (m *ConnectionMutation) ResetMetadata()
- func (m *ConnectionMutation) ResetOwnerID()
- func (m *ConnectionMutation) ResetProvider()
- func (m *ConnectionMutation) ResetRevision()
- func (m *ConnectionMutation) ResetScopes()
- func (m *ConnectionMutation) ResetState()
- func (m *ConnectionMutation) ResetUpdatedAt()
- func (m *ConnectionMutation) Revision() (r uint64, exists bool)
- func (m *ConnectionMutation) Scopes() (r []string, exists bool)
- func (m *ConnectionMutation) ScopesCleared() bool
- func (m *ConnectionMutation) SetAuthMethod(s string)
- func (m *ConnectionMutation) SetConnectionID(s string)
- func (m *ConnectionMutation) SetCreatedAt(t time.Time)
- func (m *ConnectionMutation) SetCreatedByID(s string)
- func (m *ConnectionMutation) SetCreatedByKind(s string)
- func (m *ConnectionMutation) SetDisplayName(s string)
- func (m *ConnectionMutation) SetExternalAccountID(s string)
- func (m *ConnectionMutation) SetExternalLabel(s string)
- func (m *ConnectionMutation) SetField(name string, value ent.Value) error
- func (m *ConnectionMutation) SetHealth(c connectionforge.Health)
- func (m *ConnectionMutation) SetMetadata(value map[string]string)
- func (m *ConnectionMutation) SetOp(op Op)
- func (m *ConnectionMutation) SetOwnerID(s string)
- func (m *ConnectionMutation) SetProvider(s string)
- func (m *ConnectionMutation) SetRevision(u uint64)
- func (m *ConnectionMutation) SetScopes(s []string)
- func (m *ConnectionMutation) SetState(s string)
- func (m *ConnectionMutation) SetUpdatedAt(t time.Time)
- func (m *ConnectionMutation) State() (r string, exists bool)
- func (m ConnectionMutation) Tx() (*Tx, error)
- func (m *ConnectionMutation) Type() string
- func (m *ConnectionMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ConnectionMutation) Where(ps ...predicate.Connection)
- func (m *ConnectionMutation) WhereP(ps ...func(*sql.Selector))
- type ConnectionQuery
- func (_q *ConnectionQuery) Aggregate(fns ...AggregateFunc) *ConnectionSelect
- func (_q *ConnectionQuery) All(ctx context.Context) ([]*Connection, error)
- func (_q *ConnectionQuery) AllX(ctx context.Context) []*Connection
- func (_q *ConnectionQuery) Clone() *ConnectionQuery
- func (_q *ConnectionQuery) Count(ctx context.Context) (int, error)
- func (_q *ConnectionQuery) CountX(ctx context.Context) int
- func (_q *ConnectionQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ConnectionQuery) ExistX(ctx context.Context) bool
- func (_q *ConnectionQuery) First(ctx context.Context) (*Connection, error)
- func (_q *ConnectionQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ConnectionQuery) FirstIDX(ctx context.Context) int
- func (_q *ConnectionQuery) FirstX(ctx context.Context) *Connection
- func (_q *ConnectionQuery) GroupBy(field string, fields ...string) *ConnectionGroupBy
- func (_q *ConnectionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ConnectionQuery) IDsX(ctx context.Context) []int
- func (_q *ConnectionQuery) Limit(limit int) *ConnectionQuery
- func (_q *ConnectionQuery) Offset(offset int) *ConnectionQuery
- func (_q *ConnectionQuery) Only(ctx context.Context) (*Connection, error)
- func (_q *ConnectionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ConnectionQuery) OnlyIDX(ctx context.Context) int
- func (_q *ConnectionQuery) OnlyX(ctx context.Context) *Connection
- func (_q *ConnectionQuery) Order(o ...connection.OrderOption) *ConnectionQuery
- func (_q *ConnectionQuery) Select(fields ...string) *ConnectionSelect
- func (_q *ConnectionQuery) Unique(unique bool) *ConnectionQuery
- func (_q *ConnectionQuery) Where(ps ...predicate.Connection) *ConnectionQuery
- type ConnectionSelect
- func (_s *ConnectionSelect) Aggregate(fns ...AggregateFunc) *ConnectionSelect
- func (s *ConnectionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ConnectionSelect) BoolX(ctx context.Context) bool
- func (s *ConnectionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ConnectionSelect) BoolsX(ctx context.Context) []bool
- func (s *ConnectionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ConnectionSelect) Float64X(ctx context.Context) float64
- func (s *ConnectionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ConnectionSelect) Float64sX(ctx context.Context) []float64
- func (s *ConnectionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ConnectionSelect) IntX(ctx context.Context) int
- func (s *ConnectionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ConnectionSelect) IntsX(ctx context.Context) []int
- func (_s *ConnectionSelect) Scan(ctx context.Context, v any) error
- func (s *ConnectionSelect) ScanX(ctx context.Context, v any)
- func (s *ConnectionSelect) String(ctx context.Context) (_ string, err error)
- func (s *ConnectionSelect) StringX(ctx context.Context) string
- func (s *ConnectionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ConnectionSelect) StringsX(ctx context.Context) []string
- type ConnectionUpdate
- func (_u *ConnectionUpdate) AddRevision(v int64) *ConnectionUpdate
- func (_u *ConnectionUpdate) AppendScopes(v []string) *ConnectionUpdate
- func (_u *ConnectionUpdate) ClearMetadata() *ConnectionUpdate
- func (_u *ConnectionUpdate) ClearScopes() *ConnectionUpdate
- func (_u *ConnectionUpdate) Exec(ctx context.Context) error
- func (_u *ConnectionUpdate) ExecX(ctx context.Context)
- func (_u *ConnectionUpdate) Mutation() *ConnectionMutation
- func (_u *ConnectionUpdate) Save(ctx context.Context) (int, error)
- func (_u *ConnectionUpdate) SaveX(ctx context.Context) int
- func (_u *ConnectionUpdate) SetAuthMethod(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetCreatedByID(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetCreatedByKind(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetDisplayName(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetExternalAccountID(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetExternalLabel(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetHealth(v connectionforge.Health) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetMetadata(v map[string]string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableAuthMethod(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableCreatedByID(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableCreatedByKind(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableDisplayName(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableExternalAccountID(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableExternalLabel(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableHealth(v *connectionforge.Health) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableRevision(v *uint64) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableState(v *string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetRevision(v uint64) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetScopes(v []string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetState(v string) *ConnectionUpdate
- func (_u *ConnectionUpdate) SetUpdatedAt(v time.Time) *ConnectionUpdate
- func (_u *ConnectionUpdate) Where(ps ...predicate.Connection) *ConnectionUpdate
- type ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) AddRevision(v int64) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) AppendScopes(v []string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) ClearMetadata() *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) ClearScopes() *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) Exec(ctx context.Context) error
- func (_u *ConnectionUpdateOne) ExecX(ctx context.Context)
- func (_u *ConnectionUpdateOne) Mutation() *ConnectionMutation
- func (_u *ConnectionUpdateOne) Save(ctx context.Context) (*Connection, error)
- func (_u *ConnectionUpdateOne) SaveX(ctx context.Context) *Connection
- func (_u *ConnectionUpdateOne) Select(field string, fields ...string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetAuthMethod(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetCreatedByID(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetCreatedByKind(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetDisplayName(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetExternalAccountID(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetExternalLabel(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetHealth(v connectionforge.Health) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetMetadata(v map[string]string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableAuthMethod(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableCreatedByID(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableCreatedByKind(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableDisplayName(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableExternalAccountID(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableExternalLabel(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableHealth(v *connectionforge.Health) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableRevision(v *uint64) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableState(v *string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetRevision(v uint64) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetScopes(v []string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetState(v string) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) SetUpdatedAt(v time.Time) *ConnectionUpdateOne
- func (_u *ConnectionUpdateOne) Where(ps ...predicate.Connection) *ConnectionUpdateOne
- type Connections
- type ConstraintError
- type Credential
- type CredentialClient
- func (c *CredentialClient) Create() *CredentialCreate
- func (c *CredentialClient) CreateBulk(builders ...*CredentialCreate) *CredentialCreateBulk
- func (c *CredentialClient) Delete() *CredentialDelete
- func (c *CredentialClient) DeleteOne(_m *Credential) *CredentialDeleteOne
- func (c *CredentialClient) DeleteOneID(id int) *CredentialDeleteOne
- func (c *CredentialClient) Get(ctx context.Context, id int) (*Credential, error)
- func (c *CredentialClient) GetX(ctx context.Context, id int) *Credential
- func (c *CredentialClient) Hooks() []Hook
- func (c *CredentialClient) Intercept(interceptors ...Interceptor)
- func (c *CredentialClient) Interceptors() []Interceptor
- func (c *CredentialClient) MapCreateBulk(slice any, setFunc func(*CredentialCreate, int)) *CredentialCreateBulk
- func (c *CredentialClient) Query() *CredentialQuery
- func (c *CredentialClient) Update() *CredentialUpdate
- func (c *CredentialClient) UpdateOne(_m *Credential) *CredentialUpdateOne
- func (c *CredentialClient) UpdateOneID(id int) *CredentialUpdateOne
- func (c *CredentialClient) Use(hooks ...Hook)
- type CredentialCreate
- func (_c *CredentialCreate) Exec(ctx context.Context) error
- func (_c *CredentialCreate) ExecX(ctx context.Context)
- func (_c *CredentialCreate) Mutation() *CredentialMutation
- func (_c *CredentialCreate) Save(ctx context.Context) (*Credential, error)
- func (_c *CredentialCreate) SaveX(ctx context.Context) *Credential
- func (_c *CredentialCreate) SetCiphertext(v []byte) *CredentialCreate
- func (_c *CredentialCreate) SetConnectionID(v string) *CredentialCreate
- func (_c *CredentialCreate) SetCreatedAt(v time.Time) *CredentialCreate
- func (_c *CredentialCreate) SetExpiresAt(v time.Time) *CredentialCreate
- func (_c *CredentialCreate) SetKind(v string) *CredentialCreate
- func (_c *CredentialCreate) SetNillableExpiresAt(v *time.Time) *CredentialCreate
- func (_c *CredentialCreate) SetOwnerID(v string) *CredentialCreate
- func (_c *CredentialCreate) SetVersion(v int) *CredentialCreate
- type CredentialCreateBulk
- type CredentialDelete
- type CredentialDeleteOne
- type CredentialGroupBy
- func (_g *CredentialGroupBy) Aggregate(fns ...AggregateFunc) *CredentialGroupBy
- func (s *CredentialGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CredentialGroupBy) BoolX(ctx context.Context) bool
- func (s *CredentialGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CredentialGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CredentialGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CredentialGroupBy) Float64X(ctx context.Context) float64
- func (s *CredentialGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CredentialGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CredentialGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CredentialGroupBy) IntX(ctx context.Context) int
- func (s *CredentialGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CredentialGroupBy) IntsX(ctx context.Context) []int
- func (_g *CredentialGroupBy) Scan(ctx context.Context, v any) error
- func (s *CredentialGroupBy) ScanX(ctx context.Context, v any)
- func (s *CredentialGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CredentialGroupBy) StringX(ctx context.Context) string
- func (s *CredentialGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CredentialGroupBy) StringsX(ctx context.Context) []string
- type CredentialMutation
- func (m *CredentialMutation) AddField(name string, value ent.Value) error
- func (m *CredentialMutation) AddVersion(i int)
- func (m *CredentialMutation) AddedEdges() []string
- func (m *CredentialMutation) AddedField(name string) (ent.Value, bool)
- func (m *CredentialMutation) AddedFields() []string
- func (m *CredentialMutation) AddedIDs(name string) []ent.Value
- func (m *CredentialMutation) AddedVersion() (r int, exists bool)
- func (m *CredentialMutation) Ciphertext() (r []byte, exists bool)
- func (m *CredentialMutation) ClearEdge(name string) error
- func (m *CredentialMutation) ClearExpiresAt()
- func (m *CredentialMutation) ClearField(name string) error
- func (m *CredentialMutation) ClearedEdges() []string
- func (m *CredentialMutation) ClearedFields() []string
- func (m CredentialMutation) Client() *Client
- func (m *CredentialMutation) ConnectionID() (r string, exists bool)
- func (m *CredentialMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CredentialMutation) EdgeCleared(name string) bool
- func (m *CredentialMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *CredentialMutation) ExpiresAtCleared() bool
- func (m *CredentialMutation) Field(name string) (ent.Value, bool)
- func (m *CredentialMutation) FieldCleared(name string) bool
- func (m *CredentialMutation) Fields() []string
- func (m *CredentialMutation) ID() (id int, exists bool)
- func (m *CredentialMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CredentialMutation) Kind() (r string, exists bool)
- func (m *CredentialMutation) OldCiphertext(ctx context.Context) (v []byte, err error)
- func (m *CredentialMutation) OldConnectionID(ctx context.Context) (v string, err error)
- func (m *CredentialMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CredentialMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)
- func (m *CredentialMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CredentialMutation) OldKind(ctx context.Context) (v string, err error)
- func (m *CredentialMutation) OldOwnerID(ctx context.Context) (v string, err error)
- func (m *CredentialMutation) OldVersion(ctx context.Context) (v int, err error)
- func (m *CredentialMutation) Op() Op
- func (m *CredentialMutation) OwnerID() (r string, exists bool)
- func (m *CredentialMutation) RemovedEdges() []string
- func (m *CredentialMutation) RemovedIDs(name string) []ent.Value
- func (m *CredentialMutation) ResetCiphertext()
- func (m *CredentialMutation) ResetConnectionID()
- func (m *CredentialMutation) ResetCreatedAt()
- func (m *CredentialMutation) ResetEdge(name string) error
- func (m *CredentialMutation) ResetExpiresAt()
- func (m *CredentialMutation) ResetField(name string) error
- func (m *CredentialMutation) ResetKind()
- func (m *CredentialMutation) ResetOwnerID()
- func (m *CredentialMutation) ResetVersion()
- func (m *CredentialMutation) SetCiphertext(b []byte)
- func (m *CredentialMutation) SetConnectionID(s string)
- func (m *CredentialMutation) SetCreatedAt(t time.Time)
- func (m *CredentialMutation) SetExpiresAt(t time.Time)
- func (m *CredentialMutation) SetField(name string, value ent.Value) error
- func (m *CredentialMutation) SetKind(s string)
- func (m *CredentialMutation) SetOp(op Op)
- func (m *CredentialMutation) SetOwnerID(s string)
- func (m *CredentialMutation) SetVersion(i int)
- func (m CredentialMutation) Tx() (*Tx, error)
- func (m *CredentialMutation) Type() string
- func (m *CredentialMutation) Version() (r int, exists bool)
- func (m *CredentialMutation) Where(ps ...predicate.Credential)
- func (m *CredentialMutation) WhereP(ps ...func(*sql.Selector))
- type CredentialQuery
- func (_q *CredentialQuery) Aggregate(fns ...AggregateFunc) *CredentialSelect
- func (_q *CredentialQuery) All(ctx context.Context) ([]*Credential, error)
- func (_q *CredentialQuery) AllX(ctx context.Context) []*Credential
- func (_q *CredentialQuery) Clone() *CredentialQuery
- func (_q *CredentialQuery) Count(ctx context.Context) (int, error)
- func (_q *CredentialQuery) CountX(ctx context.Context) int
- func (_q *CredentialQuery) Exist(ctx context.Context) (bool, error)
- func (_q *CredentialQuery) ExistX(ctx context.Context) bool
- func (_q *CredentialQuery) First(ctx context.Context) (*Credential, error)
- func (_q *CredentialQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *CredentialQuery) FirstIDX(ctx context.Context) int
- func (_q *CredentialQuery) FirstX(ctx context.Context) *Credential
- func (_q *CredentialQuery) GroupBy(field string, fields ...string) *CredentialGroupBy
- func (_q *CredentialQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *CredentialQuery) IDsX(ctx context.Context) []int
- func (_q *CredentialQuery) Limit(limit int) *CredentialQuery
- func (_q *CredentialQuery) Offset(offset int) *CredentialQuery
- func (_q *CredentialQuery) Only(ctx context.Context) (*Credential, error)
- func (_q *CredentialQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *CredentialQuery) OnlyIDX(ctx context.Context) int
- func (_q *CredentialQuery) OnlyX(ctx context.Context) *Credential
- func (_q *CredentialQuery) Order(o ...credential.OrderOption) *CredentialQuery
- func (_q *CredentialQuery) Select(fields ...string) *CredentialSelect
- func (_q *CredentialQuery) Unique(unique bool) *CredentialQuery
- func (_q *CredentialQuery) Where(ps ...predicate.Credential) *CredentialQuery
- type CredentialSelect
- func (_s *CredentialSelect) Aggregate(fns ...AggregateFunc) *CredentialSelect
- func (s *CredentialSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CredentialSelect) BoolX(ctx context.Context) bool
- func (s *CredentialSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CredentialSelect) BoolsX(ctx context.Context) []bool
- func (s *CredentialSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CredentialSelect) Float64X(ctx context.Context) float64
- func (s *CredentialSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CredentialSelect) Float64sX(ctx context.Context) []float64
- func (s *CredentialSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CredentialSelect) IntX(ctx context.Context) int
- func (s *CredentialSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CredentialSelect) IntsX(ctx context.Context) []int
- func (_s *CredentialSelect) Scan(ctx context.Context, v any) error
- func (s *CredentialSelect) ScanX(ctx context.Context, v any)
- func (s *CredentialSelect) String(ctx context.Context) (_ string, err error)
- func (s *CredentialSelect) StringX(ctx context.Context) string
- func (s *CredentialSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CredentialSelect) StringsX(ctx context.Context) []string
- type CredentialUpdate
- func (_u *CredentialUpdate) Exec(ctx context.Context) error
- func (_u *CredentialUpdate) ExecX(ctx context.Context)
- func (_u *CredentialUpdate) Mutation() *CredentialMutation
- func (_u *CredentialUpdate) Save(ctx context.Context) (int, error)
- func (_u *CredentialUpdate) SaveX(ctx context.Context) int
- func (_u *CredentialUpdate) Where(ps ...predicate.Credential) *CredentialUpdate
- type CredentialUpdateOne
- func (_u *CredentialUpdateOne) Exec(ctx context.Context) error
- func (_u *CredentialUpdateOne) ExecX(ctx context.Context)
- func (_u *CredentialUpdateOne) Mutation() *CredentialMutation
- func (_u *CredentialUpdateOne) Save(ctx context.Context) (*Credential, error)
- func (_u *CredentialUpdateOne) SaveX(ctx context.Context) *Credential
- func (_u *CredentialUpdateOne) Select(field string, fields ...string) *CredentialUpdateOne
- func (_u *CredentialUpdateOne) Where(ps ...predicate.Credential) *CredentialUpdateOne
- type Credentials
- type Grant
- type GrantClient
- func (c *GrantClient) Create() *GrantCreate
- func (c *GrantClient) CreateBulk(builders ...*GrantCreate) *GrantCreateBulk
- func (c *GrantClient) Delete() *GrantDelete
- func (c *GrantClient) DeleteOne(_m *Grant) *GrantDeleteOne
- func (c *GrantClient) DeleteOneID(id int) *GrantDeleteOne
- func (c *GrantClient) Get(ctx context.Context, id int) (*Grant, error)
- func (c *GrantClient) GetX(ctx context.Context, id int) *Grant
- func (c *GrantClient) Hooks() []Hook
- func (c *GrantClient) Intercept(interceptors ...Interceptor)
- func (c *GrantClient) Interceptors() []Interceptor
- func (c *GrantClient) MapCreateBulk(slice any, setFunc func(*GrantCreate, int)) *GrantCreateBulk
- func (c *GrantClient) Query() *GrantQuery
- func (c *GrantClient) Update() *GrantUpdate
- func (c *GrantClient) UpdateOne(_m *Grant) *GrantUpdateOne
- func (c *GrantClient) UpdateOneID(id int) *GrantUpdateOne
- func (c *GrantClient) Use(hooks ...Hook)
- type GrantCreate
- func (_c *GrantCreate) Exec(ctx context.Context) error
- func (_c *GrantCreate) ExecX(ctx context.Context)
- func (_c *GrantCreate) Mutation() *GrantMutation
- func (_c *GrantCreate) Save(ctx context.Context) (*Grant, error)
- func (_c *GrantCreate) SaveX(ctx context.Context) *Grant
- func (_c *GrantCreate) SetActions(v []string) *GrantCreate
- func (_c *GrantCreate) SetConnectionID(v string) *GrantCreate
- func (_c *GrantCreate) SetOwnerID(v string) *GrantCreate
- func (_c *GrantCreate) SetPrincipalID(v string) *GrantCreate
- func (_c *GrantCreate) SetPrincipalKind(v string) *GrantCreate
- type GrantCreateBulk
- type GrantDelete
- type GrantDeleteOne
- type GrantGroupBy
- func (_g *GrantGroupBy) Aggregate(fns ...AggregateFunc) *GrantGroupBy
- func (s *GrantGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *GrantGroupBy) BoolX(ctx context.Context) bool
- func (s *GrantGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *GrantGroupBy) BoolsX(ctx context.Context) []bool
- func (s *GrantGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *GrantGroupBy) Float64X(ctx context.Context) float64
- func (s *GrantGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *GrantGroupBy) Float64sX(ctx context.Context) []float64
- func (s *GrantGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *GrantGroupBy) IntX(ctx context.Context) int
- func (s *GrantGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *GrantGroupBy) IntsX(ctx context.Context) []int
- func (_g *GrantGroupBy) Scan(ctx context.Context, v any) error
- func (s *GrantGroupBy) ScanX(ctx context.Context, v any)
- func (s *GrantGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *GrantGroupBy) StringX(ctx context.Context) string
- func (s *GrantGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *GrantGroupBy) StringsX(ctx context.Context) []string
- type GrantMutation
- func (m *GrantMutation) Actions() (r []string, exists bool)
- func (m *GrantMutation) AddField(name string, value ent.Value) error
- func (m *GrantMutation) AddedEdges() []string
- func (m *GrantMutation) AddedField(name string) (ent.Value, bool)
- func (m *GrantMutation) AddedFields() []string
- func (m *GrantMutation) AddedIDs(name string) []ent.Value
- func (m *GrantMutation) AppendActions(s []string)
- func (m *GrantMutation) AppendedActions() ([]string, bool)
- func (m *GrantMutation) ClearEdge(name string) error
- func (m *GrantMutation) ClearField(name string) error
- func (m *GrantMutation) ClearedEdges() []string
- func (m *GrantMutation) ClearedFields() []string
- func (m GrantMutation) Client() *Client
- func (m *GrantMutation) ConnectionID() (r string, exists bool)
- func (m *GrantMutation) EdgeCleared(name string) bool
- func (m *GrantMutation) Field(name string) (ent.Value, bool)
- func (m *GrantMutation) FieldCleared(name string) bool
- func (m *GrantMutation) Fields() []string
- func (m *GrantMutation) ID() (id int, exists bool)
- func (m *GrantMutation) IDs(ctx context.Context) ([]int, error)
- func (m *GrantMutation) OldActions(ctx context.Context) (v []string, err error)
- func (m *GrantMutation) OldConnectionID(ctx context.Context) (v string, err error)
- func (m *GrantMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GrantMutation) OldOwnerID(ctx context.Context) (v string, err error)
- func (m *GrantMutation) OldPrincipalID(ctx context.Context) (v string, err error)
- func (m *GrantMutation) OldPrincipalKind(ctx context.Context) (v string, err error)
- func (m *GrantMutation) Op() Op
- func (m *GrantMutation) OwnerID() (r string, exists bool)
- func (m *GrantMutation) PrincipalID() (r string, exists bool)
- func (m *GrantMutation) PrincipalKind() (r string, exists bool)
- func (m *GrantMutation) RemovedEdges() []string
- func (m *GrantMutation) RemovedIDs(name string) []ent.Value
- func (m *GrantMutation) ResetActions()
- func (m *GrantMutation) ResetConnectionID()
- func (m *GrantMutation) ResetEdge(name string) error
- func (m *GrantMutation) ResetField(name string) error
- func (m *GrantMutation) ResetOwnerID()
- func (m *GrantMutation) ResetPrincipalID()
- func (m *GrantMutation) ResetPrincipalKind()
- func (m *GrantMutation) SetActions(s []string)
- func (m *GrantMutation) SetConnectionID(s string)
- func (m *GrantMutation) SetField(name string, value ent.Value) error
- func (m *GrantMutation) SetOp(op Op)
- func (m *GrantMutation) SetOwnerID(s string)
- func (m *GrantMutation) SetPrincipalID(s string)
- func (m *GrantMutation) SetPrincipalKind(s string)
- func (m GrantMutation) Tx() (*Tx, error)
- func (m *GrantMutation) Type() string
- func (m *GrantMutation) Where(ps ...predicate.Grant)
- func (m *GrantMutation) WhereP(ps ...func(*sql.Selector))
- type GrantQuery
- func (_q *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect
- func (_q *GrantQuery) All(ctx context.Context) ([]*Grant, error)
- func (_q *GrantQuery) AllX(ctx context.Context) []*Grant
- func (_q *GrantQuery) Clone() *GrantQuery
- func (_q *GrantQuery) Count(ctx context.Context) (int, error)
- func (_q *GrantQuery) CountX(ctx context.Context) int
- func (_q *GrantQuery) Exist(ctx context.Context) (bool, error)
- func (_q *GrantQuery) ExistX(ctx context.Context) bool
- func (_q *GrantQuery) First(ctx context.Context) (*Grant, error)
- func (_q *GrantQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *GrantQuery) FirstIDX(ctx context.Context) int
- func (_q *GrantQuery) FirstX(ctx context.Context) *Grant
- func (_q *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy
- func (_q *GrantQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *GrantQuery) IDsX(ctx context.Context) []int
- func (_q *GrantQuery) Limit(limit int) *GrantQuery
- func (_q *GrantQuery) Offset(offset int) *GrantQuery
- func (_q *GrantQuery) Only(ctx context.Context) (*Grant, error)
- func (_q *GrantQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *GrantQuery) OnlyIDX(ctx context.Context) int
- func (_q *GrantQuery) OnlyX(ctx context.Context) *Grant
- func (_q *GrantQuery) Order(o ...grant.OrderOption) *GrantQuery
- func (_q *GrantQuery) Select(fields ...string) *GrantSelect
- func (_q *GrantQuery) Unique(unique bool) *GrantQuery
- func (_q *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery
- type GrantSelect
- func (_s *GrantSelect) Aggregate(fns ...AggregateFunc) *GrantSelect
- func (s *GrantSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *GrantSelect) BoolX(ctx context.Context) bool
- func (s *GrantSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *GrantSelect) BoolsX(ctx context.Context) []bool
- func (s *GrantSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *GrantSelect) Float64X(ctx context.Context) float64
- func (s *GrantSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *GrantSelect) Float64sX(ctx context.Context) []float64
- func (s *GrantSelect) Int(ctx context.Context) (_ int, err error)
- func (s *GrantSelect) IntX(ctx context.Context) int
- func (s *GrantSelect) Ints(ctx context.Context) ([]int, error)
- func (s *GrantSelect) IntsX(ctx context.Context) []int
- func (_s *GrantSelect) Scan(ctx context.Context, v any) error
- func (s *GrantSelect) ScanX(ctx context.Context, v any)
- func (s *GrantSelect) String(ctx context.Context) (_ string, err error)
- func (s *GrantSelect) StringX(ctx context.Context) string
- func (s *GrantSelect) Strings(ctx context.Context) ([]string, error)
- func (s *GrantSelect) StringsX(ctx context.Context) []string
- type GrantUpdate
- func (_u *GrantUpdate) AppendActions(v []string) *GrantUpdate
- func (_u *GrantUpdate) Exec(ctx context.Context) error
- func (_u *GrantUpdate) ExecX(ctx context.Context)
- func (_u *GrantUpdate) Mutation() *GrantMutation
- func (_u *GrantUpdate) Save(ctx context.Context) (int, error)
- func (_u *GrantUpdate) SaveX(ctx context.Context) int
- func (_u *GrantUpdate) SetActions(v []string) *GrantUpdate
- func (_u *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate
- type GrantUpdateOne
- func (_u *GrantUpdateOne) AppendActions(v []string) *GrantUpdateOne
- func (_u *GrantUpdateOne) Exec(ctx context.Context) error
- func (_u *GrantUpdateOne) ExecX(ctx context.Context)
- func (_u *GrantUpdateOne) Mutation() *GrantMutation
- func (_u *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)
- func (_u *GrantUpdateOne) SaveX(ctx context.Context) *Grant
- func (_u *GrantUpdateOne) Select(field string, fields ...string) *GrantUpdateOne
- func (_u *GrantUpdateOne) SetActions(v []string) *GrantUpdateOne
- func (_u *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne
- type Grants
- type Hook
- type InterceptFunc
- type Interceptor
- type Lease
- type LeaseClient
- func (c *LeaseClient) Create() *LeaseCreate
- func (c *LeaseClient) CreateBulk(builders ...*LeaseCreate) *LeaseCreateBulk
- func (c *LeaseClient) Delete() *LeaseDelete
- func (c *LeaseClient) DeleteOne(_m *Lease) *LeaseDeleteOne
- func (c *LeaseClient) DeleteOneID(id int) *LeaseDeleteOne
- func (c *LeaseClient) Get(ctx context.Context, id int) (*Lease, error)
- func (c *LeaseClient) GetX(ctx context.Context, id int) *Lease
- func (c *LeaseClient) Hooks() []Hook
- func (c *LeaseClient) Intercept(interceptors ...Interceptor)
- func (c *LeaseClient) Interceptors() []Interceptor
- func (c *LeaseClient) MapCreateBulk(slice any, setFunc func(*LeaseCreate, int)) *LeaseCreateBulk
- func (c *LeaseClient) Query() *LeaseQuery
- func (c *LeaseClient) Update() *LeaseUpdate
- func (c *LeaseClient) UpdateOne(_m *Lease) *LeaseUpdateOne
- func (c *LeaseClient) UpdateOneID(id int) *LeaseUpdateOne
- func (c *LeaseClient) Use(hooks ...Hook)
- type LeaseCreate
- func (_c *LeaseCreate) Exec(ctx context.Context) error
- func (_c *LeaseCreate) ExecX(ctx context.Context)
- func (_c *LeaseCreate) Mutation() *LeaseMutation
- func (_c *LeaseCreate) Save(ctx context.Context) (*Lease, error)
- func (_c *LeaseCreate) SaveX(ctx context.Context) *Lease
- func (_c *LeaseCreate) SetExpiresAt(v time.Time) *LeaseCreate
- func (_c *LeaseCreate) SetName(v string) *LeaseCreate
- func (_c *LeaseCreate) SetToken(v string) *LeaseCreate
- type LeaseCreateBulk
- type LeaseDelete
- type LeaseDeleteOne
- type LeaseGroupBy
- func (_g *LeaseGroupBy) Aggregate(fns ...AggregateFunc) *LeaseGroupBy
- func (s *LeaseGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LeaseGroupBy) BoolX(ctx context.Context) bool
- func (s *LeaseGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LeaseGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LeaseGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LeaseGroupBy) Float64X(ctx context.Context) float64
- func (s *LeaseGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LeaseGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LeaseGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LeaseGroupBy) IntX(ctx context.Context) int
- func (s *LeaseGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LeaseGroupBy) IntsX(ctx context.Context) []int
- func (_g *LeaseGroupBy) Scan(ctx context.Context, v any) error
- func (s *LeaseGroupBy) ScanX(ctx context.Context, v any)
- func (s *LeaseGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LeaseGroupBy) StringX(ctx context.Context) string
- func (s *LeaseGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LeaseGroupBy) StringsX(ctx context.Context) []string
- type LeaseMutation
- func (m *LeaseMutation) AddField(name string, value ent.Value) error
- func (m *LeaseMutation) AddedEdges() []string
- func (m *LeaseMutation) AddedField(name string) (ent.Value, bool)
- func (m *LeaseMutation) AddedFields() []string
- func (m *LeaseMutation) AddedIDs(name string) []ent.Value
- func (m *LeaseMutation) ClearEdge(name string) error
- func (m *LeaseMutation) ClearField(name string) error
- func (m *LeaseMutation) ClearedEdges() []string
- func (m *LeaseMutation) ClearedFields() []string
- func (m LeaseMutation) Client() *Client
- func (m *LeaseMutation) EdgeCleared(name string) bool
- func (m *LeaseMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *LeaseMutation) Field(name string) (ent.Value, bool)
- func (m *LeaseMutation) FieldCleared(name string) bool
- func (m *LeaseMutation) Fields() []string
- func (m *LeaseMutation) ID() (id int, exists bool)
- func (m *LeaseMutation) IDs(ctx context.Context) ([]int, error)
- func (m *LeaseMutation) Name() (r string, exists bool)
- func (m *LeaseMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *LeaseMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LeaseMutation) OldName(ctx context.Context) (v string, err error)
- func (m *LeaseMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *LeaseMutation) Op() Op
- func (m *LeaseMutation) RemovedEdges() []string
- func (m *LeaseMutation) RemovedIDs(name string) []ent.Value
- func (m *LeaseMutation) ResetEdge(name string) error
- func (m *LeaseMutation) ResetExpiresAt()
- func (m *LeaseMutation) ResetField(name string) error
- func (m *LeaseMutation) ResetName()
- func (m *LeaseMutation) ResetToken()
- func (m *LeaseMutation) SetExpiresAt(t time.Time)
- func (m *LeaseMutation) SetField(name string, value ent.Value) error
- func (m *LeaseMutation) SetName(s string)
- func (m *LeaseMutation) SetOp(op Op)
- func (m *LeaseMutation) SetToken(s string)
- func (m *LeaseMutation) Token() (r string, exists bool)
- func (m LeaseMutation) Tx() (*Tx, error)
- func (m *LeaseMutation) Type() string
- func (m *LeaseMutation) Where(ps ...predicate.Lease)
- func (m *LeaseMutation) WhereP(ps ...func(*sql.Selector))
- type LeaseQuery
- func (_q *LeaseQuery) Aggregate(fns ...AggregateFunc) *LeaseSelect
- func (_q *LeaseQuery) All(ctx context.Context) ([]*Lease, error)
- func (_q *LeaseQuery) AllX(ctx context.Context) []*Lease
- func (_q *LeaseQuery) Clone() *LeaseQuery
- func (_q *LeaseQuery) Count(ctx context.Context) (int, error)
- func (_q *LeaseQuery) CountX(ctx context.Context) int
- func (_q *LeaseQuery) Exist(ctx context.Context) (bool, error)
- func (_q *LeaseQuery) ExistX(ctx context.Context) bool
- func (_q *LeaseQuery) First(ctx context.Context) (*Lease, error)
- func (_q *LeaseQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *LeaseQuery) FirstIDX(ctx context.Context) int
- func (_q *LeaseQuery) FirstX(ctx context.Context) *Lease
- func (_q *LeaseQuery) GroupBy(field string, fields ...string) *LeaseGroupBy
- func (_q *LeaseQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *LeaseQuery) IDsX(ctx context.Context) []int
- func (_q *LeaseQuery) Limit(limit int) *LeaseQuery
- func (_q *LeaseQuery) Offset(offset int) *LeaseQuery
- func (_q *LeaseQuery) Only(ctx context.Context) (*Lease, error)
- func (_q *LeaseQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *LeaseQuery) OnlyIDX(ctx context.Context) int
- func (_q *LeaseQuery) OnlyX(ctx context.Context) *Lease
- func (_q *LeaseQuery) Order(o ...lease.OrderOption) *LeaseQuery
- func (_q *LeaseQuery) Select(fields ...string) *LeaseSelect
- func (_q *LeaseQuery) Unique(unique bool) *LeaseQuery
- func (_q *LeaseQuery) Where(ps ...predicate.Lease) *LeaseQuery
- type LeaseSelect
- func (_s *LeaseSelect) Aggregate(fns ...AggregateFunc) *LeaseSelect
- func (s *LeaseSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LeaseSelect) BoolX(ctx context.Context) bool
- func (s *LeaseSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LeaseSelect) BoolsX(ctx context.Context) []bool
- func (s *LeaseSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LeaseSelect) Float64X(ctx context.Context) float64
- func (s *LeaseSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LeaseSelect) Float64sX(ctx context.Context) []float64
- func (s *LeaseSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LeaseSelect) IntX(ctx context.Context) int
- func (s *LeaseSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LeaseSelect) IntsX(ctx context.Context) []int
- func (_s *LeaseSelect) Scan(ctx context.Context, v any) error
- func (s *LeaseSelect) ScanX(ctx context.Context, v any)
- func (s *LeaseSelect) String(ctx context.Context) (_ string, err error)
- func (s *LeaseSelect) StringX(ctx context.Context) string
- func (s *LeaseSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LeaseSelect) StringsX(ctx context.Context) []string
- type LeaseUpdate
- func (_u *LeaseUpdate) Exec(ctx context.Context) error
- func (_u *LeaseUpdate) ExecX(ctx context.Context)
- func (_u *LeaseUpdate) Mutation() *LeaseMutation
- func (_u *LeaseUpdate) Save(ctx context.Context) (int, error)
- func (_u *LeaseUpdate) SaveX(ctx context.Context) int
- func (_u *LeaseUpdate) SetExpiresAt(v time.Time) *LeaseUpdate
- func (_u *LeaseUpdate) SetNillableExpiresAt(v *time.Time) *LeaseUpdate
- func (_u *LeaseUpdate) SetNillableToken(v *string) *LeaseUpdate
- func (_u *LeaseUpdate) SetToken(v string) *LeaseUpdate
- func (_u *LeaseUpdate) Where(ps ...predicate.Lease) *LeaseUpdate
- type LeaseUpdateOne
- func (_u *LeaseUpdateOne) Exec(ctx context.Context) error
- func (_u *LeaseUpdateOne) ExecX(ctx context.Context)
- func (_u *LeaseUpdateOne) Mutation() *LeaseMutation
- func (_u *LeaseUpdateOne) Save(ctx context.Context) (*Lease, error)
- func (_u *LeaseUpdateOne) SaveX(ctx context.Context) *Lease
- func (_u *LeaseUpdateOne) Select(field string, fields ...string) *LeaseUpdateOne
- func (_u *LeaseUpdateOne) SetExpiresAt(v time.Time) *LeaseUpdateOne
- func (_u *LeaseUpdateOne) SetNillableExpiresAt(v *time.Time) *LeaseUpdateOne
- func (_u *LeaseUpdateOne) SetNillableToken(v *string) *LeaseUpdateOne
- func (_u *LeaseUpdateOne) SetToken(v string) *LeaseUpdateOne
- func (_u *LeaseUpdateOne) Where(ps ...predicate.Lease) *LeaseUpdateOne
- type Leases
- 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. TypeBinding = "Binding" TypeConnection = "Connection" TypeCredential = "Credential" TypeGrant = "Grant" TypeLease = "Lease" )
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 Binding ¶
type Binding struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// OwnerID holds the value of the "owner_id" field.
OwnerID string `json:"owner_id,omitempty"`
// ConnectionID holds the value of the "connection_id" field.
ConnectionID string `json:"connection_id,omitempty"`
// ConsumerKind holds the value of the "consumer_kind" field.
ConsumerKind string `json:"consumer_kind,omitempty"`
// ConsumerID holds the value of the "consumer_id" field.
ConsumerID string `json:"consumer_id,omitempty"`
// Purpose holds the value of the "purpose" field.
Purpose string `json:"purpose,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// contains filtered or unexported fields
}
Binding is the model entity for the Binding schema.
func (*Binding) Unwrap ¶
Unwrap unwraps the Binding 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 (*Binding) Update ¶
func (_m *Binding) Update() *BindingUpdateOne
Update returns a builder for updating this Binding. Note that you need to call Binding.Unwrap() before calling this method if this Binding was returned from a transaction, and the transaction was committed or rolled back.
type BindingClient ¶
type BindingClient struct {
// contains filtered or unexported fields
}
BindingClient is a client for the Binding schema.
func NewBindingClient ¶
func NewBindingClient(c config) *BindingClient
NewBindingClient returns a client for the Binding from the given config.
func (*BindingClient) Create ¶
func (c *BindingClient) Create() *BindingCreate
Create returns a builder for creating a Binding entity.
func (*BindingClient) CreateBulk ¶
func (c *BindingClient) CreateBulk(builders ...*BindingCreate) *BindingCreateBulk
CreateBulk returns a builder for creating a bulk of Binding entities.
func (*BindingClient) Delete ¶
func (c *BindingClient) Delete() *BindingDelete
Delete returns a delete builder for Binding.
func (*BindingClient) DeleteOne ¶
func (c *BindingClient) DeleteOne(_m *Binding) *BindingDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BindingClient) DeleteOneID ¶
func (c *BindingClient) DeleteOneID(id int) *BindingDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BindingClient) GetX ¶
func (c *BindingClient) GetX(ctx context.Context, id int) *Binding
GetX is like Get, but panics if an error occurs.
func (*BindingClient) Hooks ¶
func (c *BindingClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BindingClient) Intercept ¶
func (c *BindingClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `binding.Intercept(f(g(h())))`.
func (*BindingClient) Interceptors ¶
func (c *BindingClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BindingClient) MapCreateBulk ¶
func (c *BindingClient) MapCreateBulk(slice any, setFunc func(*BindingCreate, int)) *BindingCreateBulk
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 (*BindingClient) Query ¶
func (c *BindingClient) Query() *BindingQuery
Query returns a query builder for Binding.
func (*BindingClient) Update ¶
func (c *BindingClient) Update() *BindingUpdate
Update returns an update builder for Binding.
func (*BindingClient) UpdateOne ¶
func (c *BindingClient) UpdateOne(_m *Binding) *BindingUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BindingClient) UpdateOneID ¶
func (c *BindingClient) UpdateOneID(id int) *BindingUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BindingClient) Use ¶
func (c *BindingClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `binding.Hooks(f(g(h())))`.
type BindingCreate ¶
type BindingCreate struct {
// contains filtered or unexported fields
}
BindingCreate is the builder for creating a Binding entity.
func (*BindingCreate) Exec ¶
func (_c *BindingCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BindingCreate) ExecX ¶
func (_c *BindingCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BindingCreate) Mutation ¶
func (_c *BindingCreate) Mutation() *BindingMutation
Mutation returns the BindingMutation object of the builder.
func (*BindingCreate) Save ¶
func (_c *BindingCreate) Save(ctx context.Context) (*Binding, error)
Save creates the Binding in the database.
func (*BindingCreate) SaveX ¶
func (_c *BindingCreate) SaveX(ctx context.Context) *Binding
SaveX calls Save and panics if Save returns an error.
func (*BindingCreate) SetConnectionID ¶
func (_c *BindingCreate) SetConnectionID(v string) *BindingCreate
SetConnectionID sets the "connection_id" field.
func (*BindingCreate) SetConsumerID ¶
func (_c *BindingCreate) SetConsumerID(v string) *BindingCreate
SetConsumerID sets the "consumer_id" field.
func (*BindingCreate) SetConsumerKind ¶
func (_c *BindingCreate) SetConsumerKind(v string) *BindingCreate
SetConsumerKind sets the "consumer_kind" field.
func (*BindingCreate) SetCreatedAt ¶
func (_c *BindingCreate) SetCreatedAt(v time.Time) *BindingCreate
SetCreatedAt sets the "created_at" field.
func (*BindingCreate) SetOwnerID ¶
func (_c *BindingCreate) SetOwnerID(v string) *BindingCreate
SetOwnerID sets the "owner_id" field.
func (*BindingCreate) SetPurpose ¶
func (_c *BindingCreate) SetPurpose(v string) *BindingCreate
SetPurpose sets the "purpose" field.
type BindingCreateBulk ¶
type BindingCreateBulk struct {
// contains filtered or unexported fields
}
BindingCreateBulk is the builder for creating many Binding entities in bulk.
func (*BindingCreateBulk) Exec ¶
func (_c *BindingCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BindingCreateBulk) ExecX ¶
func (_c *BindingCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BindingDelete ¶
type BindingDelete struct {
// contains filtered or unexported fields
}
BindingDelete is the builder for deleting a Binding entity.
func (*BindingDelete) Exec ¶
func (_d *BindingDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BindingDelete) ExecX ¶
func (_d *BindingDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BindingDelete) Where ¶
func (_d *BindingDelete) Where(ps ...predicate.Binding) *BindingDelete
Where appends a list predicates to the BindingDelete builder.
type BindingDeleteOne ¶
type BindingDeleteOne struct {
// contains filtered or unexported fields
}
BindingDeleteOne is the builder for deleting a single Binding entity.
func (*BindingDeleteOne) Exec ¶
func (_d *BindingDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BindingDeleteOne) ExecX ¶
func (_d *BindingDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BindingDeleteOne) Where ¶
func (_d *BindingDeleteOne) Where(ps ...predicate.Binding) *BindingDeleteOne
Where appends a list predicates to the BindingDelete builder.
type BindingGroupBy ¶
type BindingGroupBy struct {
// contains filtered or unexported fields
}
BindingGroupBy is the group-by builder for Binding entities.
func (*BindingGroupBy) Aggregate ¶
func (_g *BindingGroupBy) Aggregate(fns ...AggregateFunc) *BindingGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BindingGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BindingGroupBy) Scan ¶
func (_g *BindingGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BindingGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BindingMutation ¶
type BindingMutation struct {
// contains filtered or unexported fields
}
BindingMutation represents an operation that mutates the Binding nodes in the graph.
func (*BindingMutation) AddField ¶
func (m *BindingMutation) 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 (*BindingMutation) AddedEdges ¶
func (m *BindingMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BindingMutation) AddedField ¶
func (m *BindingMutation) 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 (*BindingMutation) AddedFields ¶
func (m *BindingMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BindingMutation) AddedIDs ¶
func (m *BindingMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BindingMutation) ClearEdge ¶
func (m *BindingMutation) 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 (*BindingMutation) ClearField ¶
func (m *BindingMutation) 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 (*BindingMutation) ClearedEdges ¶
func (m *BindingMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BindingMutation) ClearedFields ¶
func (m *BindingMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BindingMutation) Client ¶
func (m BindingMutation) 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 (*BindingMutation) ConnectionID ¶
func (m *BindingMutation) ConnectionID() (r string, exists bool)
ConnectionID returns the value of the "connection_id" field in the mutation.
func (*BindingMutation) ConsumerID ¶
func (m *BindingMutation) ConsumerID() (r string, exists bool)
ConsumerID returns the value of the "consumer_id" field in the mutation.
func (*BindingMutation) ConsumerKind ¶
func (m *BindingMutation) ConsumerKind() (r string, exists bool)
ConsumerKind returns the value of the "consumer_kind" field in the mutation.
func (*BindingMutation) CreatedAt ¶
func (m *BindingMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*BindingMutation) EdgeCleared ¶
func (m *BindingMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BindingMutation) Field ¶
func (m *BindingMutation) 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 (*BindingMutation) FieldCleared ¶
func (m *BindingMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BindingMutation) Fields ¶
func (m *BindingMutation) 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 (*BindingMutation) ID ¶
func (m *BindingMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*BindingMutation) IDs ¶
func (m *BindingMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BindingMutation) OldConnectionID ¶
func (m *BindingMutation) OldConnectionID(ctx context.Context) (v string, err error)
OldConnectionID returns the old "connection_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldConsumerID ¶
func (m *BindingMutation) OldConsumerID(ctx context.Context) (v string, err error)
OldConsumerID returns the old "consumer_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldConsumerKind ¶
func (m *BindingMutation) OldConsumerKind(ctx context.Context) (v string, err error)
OldConsumerKind returns the old "consumer_kind" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Binding entity. If the Binding 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 (*BindingMutation) 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 (*BindingMutation) OldOwnerID ¶
func (m *BindingMutation) OldOwnerID(ctx context.Context) (v string, err error)
OldOwnerID returns the old "owner_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldPurpose ¶
func (m *BindingMutation) OldPurpose(ctx context.Context) (v string, err error)
OldPurpose returns the old "purpose" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OwnerID ¶
func (m *BindingMutation) OwnerID() (r string, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*BindingMutation) Purpose ¶
func (m *BindingMutation) Purpose() (r string, exists bool)
Purpose returns the value of the "purpose" field in the mutation.
func (*BindingMutation) RemovedEdges ¶
func (m *BindingMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BindingMutation) RemovedIDs ¶
func (m *BindingMutation) 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 (*BindingMutation) ResetConnectionID ¶
func (m *BindingMutation) ResetConnectionID()
ResetConnectionID resets all changes to the "connection_id" field.
func (*BindingMutation) ResetConsumerID ¶
func (m *BindingMutation) ResetConsumerID()
ResetConsumerID resets all changes to the "consumer_id" field.
func (*BindingMutation) ResetConsumerKind ¶
func (m *BindingMutation) ResetConsumerKind()
ResetConsumerKind resets all changes to the "consumer_kind" field.
func (*BindingMutation) ResetCreatedAt ¶
func (m *BindingMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*BindingMutation) ResetEdge ¶
func (m *BindingMutation) 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 (*BindingMutation) ResetField ¶
func (m *BindingMutation) 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 (*BindingMutation) ResetOwnerID ¶
func (m *BindingMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*BindingMutation) ResetPurpose ¶
func (m *BindingMutation) ResetPurpose()
ResetPurpose resets all changes to the "purpose" field.
func (*BindingMutation) SetConnectionID ¶
func (m *BindingMutation) SetConnectionID(s string)
SetConnectionID sets the "connection_id" field.
func (*BindingMutation) SetConsumerID ¶
func (m *BindingMutation) SetConsumerID(s string)
SetConsumerID sets the "consumer_id" field.
func (*BindingMutation) SetConsumerKind ¶
func (m *BindingMutation) SetConsumerKind(s string)
SetConsumerKind sets the "consumer_kind" field.
func (*BindingMutation) SetCreatedAt ¶
func (m *BindingMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*BindingMutation) SetField ¶
func (m *BindingMutation) 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 (*BindingMutation) SetOp ¶
func (m *BindingMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BindingMutation) SetOwnerID ¶
func (m *BindingMutation) SetOwnerID(s string)
SetOwnerID sets the "owner_id" field.
func (*BindingMutation) SetPurpose ¶
func (m *BindingMutation) SetPurpose(s string)
SetPurpose sets the "purpose" field.
func (BindingMutation) Tx ¶
func (m BindingMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BindingMutation) Type ¶
func (m *BindingMutation) Type() string
Type returns the node type of this mutation (Binding).
func (*BindingMutation) Where ¶
func (m *BindingMutation) Where(ps ...predicate.Binding)
Where appends a list predicates to the BindingMutation builder.
func (*BindingMutation) WhereP ¶
func (m *BindingMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BindingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BindingQuery ¶
type BindingQuery struct {
// contains filtered or unexported fields
}
BindingQuery is the builder for querying Binding entities.
func (*BindingQuery) Aggregate ¶
func (_q *BindingQuery) Aggregate(fns ...AggregateFunc) *BindingSelect
Aggregate returns a BindingSelect configured with the given aggregations.
func (*BindingQuery) All ¶
func (_q *BindingQuery) All(ctx context.Context) ([]*Binding, error)
All executes the query and returns a list of Bindings.
func (*BindingQuery) AllX ¶
func (_q *BindingQuery) AllX(ctx context.Context) []*Binding
AllX is like All, but panics if an error occurs.
func (*BindingQuery) Clone ¶
func (_q *BindingQuery) Clone() *BindingQuery
Clone returns a duplicate of the BindingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BindingQuery) Count ¶
func (_q *BindingQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BindingQuery) CountX ¶
func (_q *BindingQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BindingQuery) Exist ¶
func (_q *BindingQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BindingQuery) ExistX ¶
func (_q *BindingQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BindingQuery) First ¶
func (_q *BindingQuery) First(ctx context.Context) (*Binding, error)
First returns the first Binding entity from the query. Returns a *NotFoundError when no Binding was found.
func (*BindingQuery) FirstID ¶
func (_q *BindingQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Binding ID from the query. Returns a *NotFoundError when no Binding ID was found.
func (*BindingQuery) FirstIDX ¶
func (_q *BindingQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BindingQuery) FirstX ¶
func (_q *BindingQuery) FirstX(ctx context.Context) *Binding
FirstX is like First, but panics if an error occurs.
func (*BindingQuery) GroupBy ¶
func (_q *BindingQuery) GroupBy(field string, fields ...string) *BindingGroupBy
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 {
OwnerID string `json:"owner_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Binding.Query().
GroupBy(binding.FieldOwnerID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*BindingQuery) IDs ¶
func (_q *BindingQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Binding IDs.
func (*BindingQuery) IDsX ¶
func (_q *BindingQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BindingQuery) Limit ¶
func (_q *BindingQuery) Limit(limit int) *BindingQuery
Limit the number of records to be returned by this query.
func (*BindingQuery) Offset ¶
func (_q *BindingQuery) Offset(offset int) *BindingQuery
Offset to start from.
func (*BindingQuery) Only ¶
func (_q *BindingQuery) Only(ctx context.Context) (*Binding, error)
Only returns a single Binding entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Binding entity is found. Returns a *NotFoundError when no Binding entities are found.
func (*BindingQuery) OnlyID ¶
func (_q *BindingQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Binding ID in the query. Returns a *NotSingularError when more than one Binding ID is found. Returns a *NotFoundError when no entities are found.
func (*BindingQuery) OnlyIDX ¶
func (_q *BindingQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BindingQuery) OnlyX ¶
func (_q *BindingQuery) OnlyX(ctx context.Context) *Binding
OnlyX is like Only, but panics if an error occurs.
func (*BindingQuery) Order ¶
func (_q *BindingQuery) Order(o ...binding.OrderOption) *BindingQuery
Order specifies how the records should be ordered.
func (*BindingQuery) Select ¶
func (_q *BindingQuery) Select(fields ...string) *BindingSelect
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 {
OwnerID string `json:"owner_id,omitempty"`
}
client.Binding.Query().
Select(binding.FieldOwnerID).
Scan(ctx, &v)
func (*BindingQuery) Unique ¶
func (_q *BindingQuery) Unique(unique bool) *BindingQuery
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 (*BindingQuery) Where ¶
func (_q *BindingQuery) Where(ps ...predicate.Binding) *BindingQuery
Where adds a new predicate for the BindingQuery builder.
type BindingSelect ¶
type BindingSelect struct {
*BindingQuery
// contains filtered or unexported fields
}
BindingSelect is the builder for selecting fields of Binding entities.
func (*BindingSelect) Aggregate ¶
func (_s *BindingSelect) Aggregate(fns ...AggregateFunc) *BindingSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BindingSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BindingSelect) Scan ¶
func (_s *BindingSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BindingSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BindingUpdate ¶
type BindingUpdate struct {
// contains filtered or unexported fields
}
BindingUpdate is the builder for updating Binding entities.
func (*BindingUpdate) Exec ¶
func (_u *BindingUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BindingUpdate) ExecX ¶
func (_u *BindingUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BindingUpdate) Mutation ¶
func (_u *BindingUpdate) Mutation() *BindingMutation
Mutation returns the BindingMutation object of the builder.
func (*BindingUpdate) Save ¶
func (_u *BindingUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BindingUpdate) SaveX ¶
func (_u *BindingUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BindingUpdate) Where ¶
func (_u *BindingUpdate) Where(ps ...predicate.Binding) *BindingUpdate
Where appends a list predicates to the BindingUpdate builder.
type BindingUpdateOne ¶
type BindingUpdateOne struct {
// contains filtered or unexported fields
}
BindingUpdateOne is the builder for updating a single Binding entity.
func (*BindingUpdateOne) Exec ¶
func (_u *BindingUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BindingUpdateOne) ExecX ¶
func (_u *BindingUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BindingUpdateOne) Mutation ¶
func (_u *BindingUpdateOne) Mutation() *BindingMutation
Mutation returns the BindingMutation object of the builder.
func (*BindingUpdateOne) Save ¶
func (_u *BindingUpdateOne) Save(ctx context.Context) (*Binding, error)
Save executes the query and returns the updated Binding entity.
func (*BindingUpdateOne) SaveX ¶
func (_u *BindingUpdateOne) SaveX(ctx context.Context) *Binding
SaveX is like Save, but panics if an error occurs.
func (*BindingUpdateOne) Select ¶
func (_u *BindingUpdateOne) Select(field string, fields ...string) *BindingUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BindingUpdateOne) Where ¶
func (_u *BindingUpdateOne) Where(ps ...predicate.Binding) *BindingUpdateOne
Where appends a list predicates to the BindingUpdate builder.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// Binding is the client for interacting with the Binding builders.
Binding *BindingClient
// Connection is the client for interacting with the Connection builders.
Connection *ConnectionClient
// Credential is the client for interacting with the Credential builders.
Credential *CredentialClient
// Grant is the client for interacting with the Grant builders.
Grant *GrantClient
// Lease is the client for interacting with the Lease builders.
Lease *LeaseClient
// 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(). Binding. 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 Connection ¶
type Connection struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// OwnerID holds the value of the "owner_id" field.
OwnerID string `json:"owner_id,omitempty"`
// ConnectionID holds the value of the "connection_id" field.
ConnectionID string `json:"connection_id,omitempty"`
// Provider holds the value of the "provider" field.
Provider string `json:"provider,omitempty"`
// AuthMethod holds the value of the "auth_method" field.
AuthMethod string `json:"auth_method,omitempty"`
// DisplayName holds the value of the "display_name" field.
DisplayName string `json:"display_name,omitempty"`
// ExternalAccountID holds the value of the "external_account_id" field.
ExternalAccountID string `json:"external_account_id,omitempty"`
// ExternalLabel holds the value of the "external_label" field.
ExternalLabel string `json:"external_label,omitempty"`
// Scopes holds the value of the "scopes" field.
Scopes []string `json:"scopes,omitempty"`
// State holds the value of the "state" field.
State string `json:"state,omitempty"`
// Health holds the value of the "health" field.
Health connectionforge.Health `json:"health,omitempty"`
// Metadata holds the value of the "metadata" field.
Metadata map[string]string `json:"metadata,omitempty"`
// CreatedByKind holds the value of the "created_by_kind" field.
CreatedByKind string `json:"created_by_kind,omitempty"`
// CreatedByID holds the value of the "created_by_id" field.
CreatedByID string `json:"created_by_id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Revision holds the value of the "revision" field.
Revision uint64 `json:"revision,omitempty"`
// contains filtered or unexported fields
}
Connection is the model entity for the Connection schema.
func (*Connection) String ¶
func (_m *Connection) String() string
String implements the fmt.Stringer.
func (*Connection) Unwrap ¶
func (_m *Connection) Unwrap() *Connection
Unwrap unwraps the Connection 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 (*Connection) Update ¶
func (_m *Connection) Update() *ConnectionUpdateOne
Update returns a builder for updating this Connection. Note that you need to call Connection.Unwrap() before calling this method if this Connection was returned from a transaction, and the transaction was committed or rolled back.
type ConnectionClient ¶
type ConnectionClient struct {
// contains filtered or unexported fields
}
ConnectionClient is a client for the Connection schema.
func NewConnectionClient ¶
func NewConnectionClient(c config) *ConnectionClient
NewConnectionClient returns a client for the Connection from the given config.
func (*ConnectionClient) Create ¶
func (c *ConnectionClient) Create() *ConnectionCreate
Create returns a builder for creating a Connection entity.
func (*ConnectionClient) CreateBulk ¶
func (c *ConnectionClient) CreateBulk(builders ...*ConnectionCreate) *ConnectionCreateBulk
CreateBulk returns a builder for creating a bulk of Connection entities.
func (*ConnectionClient) Delete ¶
func (c *ConnectionClient) Delete() *ConnectionDelete
Delete returns a delete builder for Connection.
func (*ConnectionClient) DeleteOne ¶
func (c *ConnectionClient) DeleteOne(_m *Connection) *ConnectionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ConnectionClient) DeleteOneID ¶
func (c *ConnectionClient) DeleteOneID(id int) *ConnectionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ConnectionClient) Get ¶
func (c *ConnectionClient) Get(ctx context.Context, id int) (*Connection, error)
Get returns a Connection entity by its id.
func (*ConnectionClient) GetX ¶
func (c *ConnectionClient) GetX(ctx context.Context, id int) *Connection
GetX is like Get, but panics if an error occurs.
func (*ConnectionClient) Hooks ¶
func (c *ConnectionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ConnectionClient) Intercept ¶
func (c *ConnectionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `connection.Intercept(f(g(h())))`.
func (*ConnectionClient) Interceptors ¶
func (c *ConnectionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ConnectionClient) MapCreateBulk ¶
func (c *ConnectionClient) MapCreateBulk(slice any, setFunc func(*ConnectionCreate, int)) *ConnectionCreateBulk
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 (*ConnectionClient) Query ¶
func (c *ConnectionClient) Query() *ConnectionQuery
Query returns a query builder for Connection.
func (*ConnectionClient) Update ¶
func (c *ConnectionClient) Update() *ConnectionUpdate
Update returns an update builder for Connection.
func (*ConnectionClient) UpdateOne ¶
func (c *ConnectionClient) UpdateOne(_m *Connection) *ConnectionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ConnectionClient) UpdateOneID ¶
func (c *ConnectionClient) UpdateOneID(id int) *ConnectionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ConnectionClient) Use ¶
func (c *ConnectionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `connection.Hooks(f(g(h())))`.
type ConnectionCreate ¶
type ConnectionCreate struct {
// contains filtered or unexported fields
}
ConnectionCreate is the builder for creating a Connection entity.
func (*ConnectionCreate) Exec ¶
func (_c *ConnectionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ConnectionCreate) ExecX ¶
func (_c *ConnectionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionCreate) Mutation ¶
func (_c *ConnectionCreate) Mutation() *ConnectionMutation
Mutation returns the ConnectionMutation object of the builder.
func (*ConnectionCreate) Save ¶
func (_c *ConnectionCreate) Save(ctx context.Context) (*Connection, error)
Save creates the Connection in the database.
func (*ConnectionCreate) SaveX ¶
func (_c *ConnectionCreate) SaveX(ctx context.Context) *Connection
SaveX calls Save and panics if Save returns an error.
func (*ConnectionCreate) SetAuthMethod ¶
func (_c *ConnectionCreate) SetAuthMethod(v string) *ConnectionCreate
SetAuthMethod sets the "auth_method" field.
func (*ConnectionCreate) SetConnectionID ¶
func (_c *ConnectionCreate) SetConnectionID(v string) *ConnectionCreate
SetConnectionID sets the "connection_id" field.
func (*ConnectionCreate) SetCreatedAt ¶
func (_c *ConnectionCreate) SetCreatedAt(v time.Time) *ConnectionCreate
SetCreatedAt sets the "created_at" field.
func (*ConnectionCreate) SetCreatedByID ¶
func (_c *ConnectionCreate) SetCreatedByID(v string) *ConnectionCreate
SetCreatedByID sets the "created_by_id" field.
func (*ConnectionCreate) SetCreatedByKind ¶
func (_c *ConnectionCreate) SetCreatedByKind(v string) *ConnectionCreate
SetCreatedByKind sets the "created_by_kind" field.
func (*ConnectionCreate) SetDisplayName ¶
func (_c *ConnectionCreate) SetDisplayName(v string) *ConnectionCreate
SetDisplayName sets the "display_name" field.
func (*ConnectionCreate) SetExternalAccountID ¶
func (_c *ConnectionCreate) SetExternalAccountID(v string) *ConnectionCreate
SetExternalAccountID sets the "external_account_id" field.
func (*ConnectionCreate) SetExternalLabel ¶
func (_c *ConnectionCreate) SetExternalLabel(v string) *ConnectionCreate
SetExternalLabel sets the "external_label" field.
func (*ConnectionCreate) SetHealth ¶
func (_c *ConnectionCreate) SetHealth(v connectionforge.Health) *ConnectionCreate
SetHealth sets the "health" field.
func (*ConnectionCreate) SetMetadata ¶
func (_c *ConnectionCreate) SetMetadata(v map[string]string) *ConnectionCreate
SetMetadata sets the "metadata" field.
func (*ConnectionCreate) SetNillableExternalAccountID ¶
func (_c *ConnectionCreate) SetNillableExternalAccountID(v *string) *ConnectionCreate
SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.
func (*ConnectionCreate) SetNillableExternalLabel ¶
func (_c *ConnectionCreate) SetNillableExternalLabel(v *string) *ConnectionCreate
SetNillableExternalLabel sets the "external_label" field if the given value is not nil.
func (*ConnectionCreate) SetOwnerID ¶
func (_c *ConnectionCreate) SetOwnerID(v string) *ConnectionCreate
SetOwnerID sets the "owner_id" field.
func (*ConnectionCreate) SetProvider ¶
func (_c *ConnectionCreate) SetProvider(v string) *ConnectionCreate
SetProvider sets the "provider" field.
func (*ConnectionCreate) SetRevision ¶
func (_c *ConnectionCreate) SetRevision(v uint64) *ConnectionCreate
SetRevision sets the "revision" field.
func (*ConnectionCreate) SetScopes ¶
func (_c *ConnectionCreate) SetScopes(v []string) *ConnectionCreate
SetScopes sets the "scopes" field.
func (*ConnectionCreate) SetState ¶
func (_c *ConnectionCreate) SetState(v string) *ConnectionCreate
SetState sets the "state" field.
func (*ConnectionCreate) SetUpdatedAt ¶
func (_c *ConnectionCreate) SetUpdatedAt(v time.Time) *ConnectionCreate
SetUpdatedAt sets the "updated_at" field.
type ConnectionCreateBulk ¶
type ConnectionCreateBulk struct {
// contains filtered or unexported fields
}
ConnectionCreateBulk is the builder for creating many Connection entities in bulk.
func (*ConnectionCreateBulk) Exec ¶
func (_c *ConnectionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ConnectionCreateBulk) ExecX ¶
func (_c *ConnectionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionCreateBulk) Save ¶
func (_c *ConnectionCreateBulk) Save(ctx context.Context) ([]*Connection, error)
Save creates the Connection entities in the database.
func (*ConnectionCreateBulk) SaveX ¶
func (_c *ConnectionCreateBulk) SaveX(ctx context.Context) []*Connection
SaveX is like Save, but panics if an error occurs.
type ConnectionDelete ¶
type ConnectionDelete struct {
// contains filtered or unexported fields
}
ConnectionDelete is the builder for deleting a Connection entity.
func (*ConnectionDelete) Exec ¶
func (_d *ConnectionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ConnectionDelete) ExecX ¶
func (_d *ConnectionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionDelete) Where ¶
func (_d *ConnectionDelete) Where(ps ...predicate.Connection) *ConnectionDelete
Where appends a list predicates to the ConnectionDelete builder.
type ConnectionDeleteOne ¶
type ConnectionDeleteOne struct {
// contains filtered or unexported fields
}
ConnectionDeleteOne is the builder for deleting a single Connection entity.
func (*ConnectionDeleteOne) Exec ¶
func (_d *ConnectionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ConnectionDeleteOne) ExecX ¶
func (_d *ConnectionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionDeleteOne) Where ¶
func (_d *ConnectionDeleteOne) Where(ps ...predicate.Connection) *ConnectionDeleteOne
Where appends a list predicates to the ConnectionDelete builder.
type ConnectionGroupBy ¶
type ConnectionGroupBy struct {
// contains filtered or unexported fields
}
ConnectionGroupBy is the group-by builder for Connection entities.
func (*ConnectionGroupBy) Aggregate ¶
func (_g *ConnectionGroupBy) Aggregate(fns ...AggregateFunc) *ConnectionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ConnectionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ConnectionGroupBy) Scan ¶
func (_g *ConnectionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ConnectionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ConnectionMutation ¶
type ConnectionMutation struct {
// contains filtered or unexported fields
}
ConnectionMutation represents an operation that mutates the Connection nodes in the graph.
func (*ConnectionMutation) AddField ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) AddRevision ¶
func (m *ConnectionMutation) AddRevision(u int64)
AddRevision adds u to the "revision" field.
func (*ConnectionMutation) AddedEdges ¶
func (m *ConnectionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ConnectionMutation) AddedField ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) AddedFields ¶
func (m *ConnectionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ConnectionMutation) AddedIDs ¶
func (m *ConnectionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ConnectionMutation) AddedRevision ¶
func (m *ConnectionMutation) AddedRevision() (r int64, exists bool)
AddedRevision returns the value that was added to the "revision" field in this mutation.
func (*ConnectionMutation) AppendScopes ¶
func (m *ConnectionMutation) AppendScopes(s []string)
AppendScopes adds s to the "scopes" field.
func (*ConnectionMutation) AppendedScopes ¶
func (m *ConnectionMutation) AppendedScopes() ([]string, bool)
AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation.
func (*ConnectionMutation) AuthMethod ¶
func (m *ConnectionMutation) AuthMethod() (r string, exists bool)
AuthMethod returns the value of the "auth_method" field in the mutation.
func (*ConnectionMutation) ClearEdge ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) ClearField ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) ClearMetadata ¶
func (m *ConnectionMutation) ClearMetadata()
ClearMetadata clears the value of the "metadata" field.
func (*ConnectionMutation) ClearScopes ¶
func (m *ConnectionMutation) ClearScopes()
ClearScopes clears the value of the "scopes" field.
func (*ConnectionMutation) ClearedEdges ¶
func (m *ConnectionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ConnectionMutation) ClearedFields ¶
func (m *ConnectionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ConnectionMutation) Client ¶
func (m ConnectionMutation) 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 (*ConnectionMutation) ConnectionID ¶
func (m *ConnectionMutation) ConnectionID() (r string, exists bool)
ConnectionID returns the value of the "connection_id" field in the mutation.
func (*ConnectionMutation) CreatedAt ¶
func (m *ConnectionMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ConnectionMutation) CreatedByID ¶
func (m *ConnectionMutation) CreatedByID() (r string, exists bool)
CreatedByID returns the value of the "created_by_id" field in the mutation.
func (*ConnectionMutation) CreatedByKind ¶
func (m *ConnectionMutation) CreatedByKind() (r string, exists bool)
CreatedByKind returns the value of the "created_by_kind" field in the mutation.
func (*ConnectionMutation) DisplayName ¶
func (m *ConnectionMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*ConnectionMutation) EdgeCleared ¶
func (m *ConnectionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ConnectionMutation) ExternalAccountID ¶
func (m *ConnectionMutation) ExternalAccountID() (r string, exists bool)
ExternalAccountID returns the value of the "external_account_id" field in the mutation.
func (*ConnectionMutation) ExternalLabel ¶
func (m *ConnectionMutation) ExternalLabel() (r string, exists bool)
ExternalLabel returns the value of the "external_label" field in the mutation.
func (*ConnectionMutation) Field ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) FieldCleared ¶
func (m *ConnectionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ConnectionMutation) Fields ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) Health ¶
func (m *ConnectionMutation) Health() (r connectionforge.Health, exists bool)
Health returns the value of the "health" field in the mutation.
func (*ConnectionMutation) ID ¶
func (m *ConnectionMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ConnectionMutation) IDs ¶
func (m *ConnectionMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ConnectionMutation) Metadata ¶
func (m *ConnectionMutation) Metadata() (r map[string]string, exists bool)
Metadata returns the value of the "metadata" field in the mutation.
func (*ConnectionMutation) MetadataCleared ¶
func (m *ConnectionMutation) MetadataCleared() bool
MetadataCleared returns if the "metadata" field was cleared in this mutation.
func (*ConnectionMutation) OldAuthMethod ¶
func (m *ConnectionMutation) OldAuthMethod(ctx context.Context) (v string, err error)
OldAuthMethod returns the old "auth_method" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldConnectionID ¶
func (m *ConnectionMutation) OldConnectionID(ctx context.Context) (v string, err error)
OldConnectionID returns the old "connection_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldCreatedByID ¶
func (m *ConnectionMutation) OldCreatedByID(ctx context.Context) (v string, err error)
OldCreatedByID returns the old "created_by_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldCreatedByKind ¶
func (m *ConnectionMutation) OldCreatedByKind(ctx context.Context) (v string, err error)
OldCreatedByKind returns the old "created_by_kind" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldDisplayName ¶
func (m *ConnectionMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_name" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldExternalAccountID ¶
func (m *ConnectionMutation) OldExternalAccountID(ctx context.Context) (v string, err error)
OldExternalAccountID returns the old "external_account_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldExternalLabel ¶
func (m *ConnectionMutation) OldExternalLabel(ctx context.Context) (v string, err error)
OldExternalLabel returns the old "external_label" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) 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 (*ConnectionMutation) OldHealth ¶
func (m *ConnectionMutation) OldHealth(ctx context.Context) (v connectionforge.Health, err error)
OldHealth returns the old "health" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldMetadata ¶
OldMetadata returns the old "metadata" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldOwnerID ¶
func (m *ConnectionMutation) OldOwnerID(ctx context.Context) (v string, err error)
OldOwnerID returns the old "owner_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldProvider ¶
func (m *ConnectionMutation) OldProvider(ctx context.Context) (v string, err error)
OldProvider returns the old "provider" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldRevision ¶
func (m *ConnectionMutation) OldRevision(ctx context.Context) (v uint64, err error)
OldRevision returns the old "revision" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldScopes ¶
func (m *ConnectionMutation) OldScopes(ctx context.Context) (v []string, err error)
OldScopes returns the old "scopes" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldState ¶
func (m *ConnectionMutation) OldState(ctx context.Context) (v string, err error)
OldState returns the old "state" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OwnerID ¶
func (m *ConnectionMutation) OwnerID() (r string, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*ConnectionMutation) Provider ¶
func (m *ConnectionMutation) Provider() (r string, exists bool)
Provider returns the value of the "provider" field in the mutation.
func (*ConnectionMutation) RemovedEdges ¶
func (m *ConnectionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ConnectionMutation) RemovedIDs ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetAuthMethod ¶
func (m *ConnectionMutation) ResetAuthMethod()
ResetAuthMethod resets all changes to the "auth_method" field.
func (*ConnectionMutation) ResetConnectionID ¶
func (m *ConnectionMutation) ResetConnectionID()
ResetConnectionID resets all changes to the "connection_id" field.
func (*ConnectionMutation) ResetCreatedAt ¶
func (m *ConnectionMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ConnectionMutation) ResetCreatedByID ¶
func (m *ConnectionMutation) ResetCreatedByID()
ResetCreatedByID resets all changes to the "created_by_id" field.
func (*ConnectionMutation) ResetCreatedByKind ¶
func (m *ConnectionMutation) ResetCreatedByKind()
ResetCreatedByKind resets all changes to the "created_by_kind" field.
func (*ConnectionMutation) ResetDisplayName ¶
func (m *ConnectionMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
func (*ConnectionMutation) ResetEdge ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetExternalAccountID ¶
func (m *ConnectionMutation) ResetExternalAccountID()
ResetExternalAccountID resets all changes to the "external_account_id" field.
func (*ConnectionMutation) ResetExternalLabel ¶
func (m *ConnectionMutation) ResetExternalLabel()
ResetExternalLabel resets all changes to the "external_label" field.
func (*ConnectionMutation) ResetField ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetHealth ¶
func (m *ConnectionMutation) ResetHealth()
ResetHealth resets all changes to the "health" field.
func (*ConnectionMutation) ResetMetadata ¶
func (m *ConnectionMutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" field.
func (*ConnectionMutation) ResetOwnerID ¶
func (m *ConnectionMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*ConnectionMutation) ResetProvider ¶
func (m *ConnectionMutation) ResetProvider()
ResetProvider resets all changes to the "provider" field.
func (*ConnectionMutation) ResetRevision ¶
func (m *ConnectionMutation) ResetRevision()
ResetRevision resets all changes to the "revision" field.
func (*ConnectionMutation) ResetScopes ¶
func (m *ConnectionMutation) ResetScopes()
ResetScopes resets all changes to the "scopes" field.
func (*ConnectionMutation) ResetState ¶
func (m *ConnectionMutation) ResetState()
ResetState resets all changes to the "state" field.
func (*ConnectionMutation) ResetUpdatedAt ¶
func (m *ConnectionMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ConnectionMutation) Revision ¶
func (m *ConnectionMutation) Revision() (r uint64, exists bool)
Revision returns the value of the "revision" field in the mutation.
func (*ConnectionMutation) Scopes ¶
func (m *ConnectionMutation) Scopes() (r []string, exists bool)
Scopes returns the value of the "scopes" field in the mutation.
func (*ConnectionMutation) ScopesCleared ¶
func (m *ConnectionMutation) ScopesCleared() bool
ScopesCleared returns if the "scopes" field was cleared in this mutation.
func (*ConnectionMutation) SetAuthMethod ¶
func (m *ConnectionMutation) SetAuthMethod(s string)
SetAuthMethod sets the "auth_method" field.
func (*ConnectionMutation) SetConnectionID ¶
func (m *ConnectionMutation) SetConnectionID(s string)
SetConnectionID sets the "connection_id" field.
func (*ConnectionMutation) SetCreatedAt ¶
func (m *ConnectionMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ConnectionMutation) SetCreatedByID ¶
func (m *ConnectionMutation) SetCreatedByID(s string)
SetCreatedByID sets the "created_by_id" field.
func (*ConnectionMutation) SetCreatedByKind ¶
func (m *ConnectionMutation) SetCreatedByKind(s string)
SetCreatedByKind sets the "created_by_kind" field.
func (*ConnectionMutation) SetDisplayName ¶
func (m *ConnectionMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*ConnectionMutation) SetExternalAccountID ¶
func (m *ConnectionMutation) SetExternalAccountID(s string)
SetExternalAccountID sets the "external_account_id" field.
func (*ConnectionMutation) SetExternalLabel ¶
func (m *ConnectionMutation) SetExternalLabel(s string)
SetExternalLabel sets the "external_label" field.
func (*ConnectionMutation) SetField ¶
func (m *ConnectionMutation) 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 (*ConnectionMutation) SetHealth ¶
func (m *ConnectionMutation) SetHealth(c connectionforge.Health)
SetHealth sets the "health" field.
func (*ConnectionMutation) SetMetadata ¶
func (m *ConnectionMutation) SetMetadata(value map[string]string)
SetMetadata sets the "metadata" field.
func (*ConnectionMutation) SetOp ¶
func (m *ConnectionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ConnectionMutation) SetOwnerID ¶
func (m *ConnectionMutation) SetOwnerID(s string)
SetOwnerID sets the "owner_id" field.
func (*ConnectionMutation) SetProvider ¶
func (m *ConnectionMutation) SetProvider(s string)
SetProvider sets the "provider" field.
func (*ConnectionMutation) SetRevision ¶
func (m *ConnectionMutation) SetRevision(u uint64)
SetRevision sets the "revision" field.
func (*ConnectionMutation) SetScopes ¶
func (m *ConnectionMutation) SetScopes(s []string)
SetScopes sets the "scopes" field.
func (*ConnectionMutation) SetState ¶
func (m *ConnectionMutation) SetState(s string)
SetState sets the "state" field.
func (*ConnectionMutation) SetUpdatedAt ¶
func (m *ConnectionMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ConnectionMutation) State ¶
func (m *ConnectionMutation) State() (r string, exists bool)
State returns the value of the "state" field in the mutation.
func (ConnectionMutation) Tx ¶
func (m ConnectionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ConnectionMutation) Type ¶
func (m *ConnectionMutation) Type() string
Type returns the node type of this mutation (Connection).
func (*ConnectionMutation) UpdatedAt ¶
func (m *ConnectionMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ConnectionMutation) Where ¶
func (m *ConnectionMutation) Where(ps ...predicate.Connection)
Where appends a list predicates to the ConnectionMutation builder.
func (*ConnectionMutation) WhereP ¶
func (m *ConnectionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ConnectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ConnectionQuery ¶
type ConnectionQuery struct {
// contains filtered or unexported fields
}
ConnectionQuery is the builder for querying Connection entities.
func (*ConnectionQuery) Aggregate ¶
func (_q *ConnectionQuery) Aggregate(fns ...AggregateFunc) *ConnectionSelect
Aggregate returns a ConnectionSelect configured with the given aggregations.
func (*ConnectionQuery) All ¶
func (_q *ConnectionQuery) All(ctx context.Context) ([]*Connection, error)
All executes the query and returns a list of Connections.
func (*ConnectionQuery) AllX ¶
func (_q *ConnectionQuery) AllX(ctx context.Context) []*Connection
AllX is like All, but panics if an error occurs.
func (*ConnectionQuery) Clone ¶
func (_q *ConnectionQuery) Clone() *ConnectionQuery
Clone returns a duplicate of the ConnectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ConnectionQuery) Count ¶
func (_q *ConnectionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ConnectionQuery) CountX ¶
func (_q *ConnectionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ConnectionQuery) Exist ¶
func (_q *ConnectionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ConnectionQuery) ExistX ¶
func (_q *ConnectionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ConnectionQuery) First ¶
func (_q *ConnectionQuery) First(ctx context.Context) (*Connection, error)
First returns the first Connection entity from the query. Returns a *NotFoundError when no Connection was found.
func (*ConnectionQuery) FirstID ¶
func (_q *ConnectionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Connection ID from the query. Returns a *NotFoundError when no Connection ID was found.
func (*ConnectionQuery) FirstIDX ¶
func (_q *ConnectionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ConnectionQuery) FirstX ¶
func (_q *ConnectionQuery) FirstX(ctx context.Context) *Connection
FirstX is like First, but panics if an error occurs.
func (*ConnectionQuery) GroupBy ¶
func (_q *ConnectionQuery) GroupBy(field string, fields ...string) *ConnectionGroupBy
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 {
OwnerID string `json:"owner_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Connection.Query().
GroupBy(connection.FieldOwnerID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*ConnectionQuery) IDs ¶
func (_q *ConnectionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Connection IDs.
func (*ConnectionQuery) IDsX ¶
func (_q *ConnectionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ConnectionQuery) Limit ¶
func (_q *ConnectionQuery) Limit(limit int) *ConnectionQuery
Limit the number of records to be returned by this query.
func (*ConnectionQuery) Offset ¶
func (_q *ConnectionQuery) Offset(offset int) *ConnectionQuery
Offset to start from.
func (*ConnectionQuery) Only ¶
func (_q *ConnectionQuery) Only(ctx context.Context) (*Connection, error)
Only returns a single Connection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Connection entity is found. Returns a *NotFoundError when no Connection entities are found.
func (*ConnectionQuery) OnlyID ¶
func (_q *ConnectionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Connection ID in the query. Returns a *NotSingularError when more than one Connection ID is found. Returns a *NotFoundError when no entities are found.
func (*ConnectionQuery) OnlyIDX ¶
func (_q *ConnectionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ConnectionQuery) OnlyX ¶
func (_q *ConnectionQuery) OnlyX(ctx context.Context) *Connection
OnlyX is like Only, but panics if an error occurs.
func (*ConnectionQuery) Order ¶
func (_q *ConnectionQuery) Order(o ...connection.OrderOption) *ConnectionQuery
Order specifies how the records should be ordered.
func (*ConnectionQuery) Select ¶
func (_q *ConnectionQuery) Select(fields ...string) *ConnectionSelect
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 {
OwnerID string `json:"owner_id,omitempty"`
}
client.Connection.Query().
Select(connection.FieldOwnerID).
Scan(ctx, &v)
func (*ConnectionQuery) Unique ¶
func (_q *ConnectionQuery) Unique(unique bool) *ConnectionQuery
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 (*ConnectionQuery) Where ¶
func (_q *ConnectionQuery) Where(ps ...predicate.Connection) *ConnectionQuery
Where adds a new predicate for the ConnectionQuery builder.
type ConnectionSelect ¶
type ConnectionSelect struct {
*ConnectionQuery
// contains filtered or unexported fields
}
ConnectionSelect is the builder for selecting fields of Connection entities.
func (*ConnectionSelect) Aggregate ¶
func (_s *ConnectionSelect) Aggregate(fns ...AggregateFunc) *ConnectionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ConnectionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ConnectionSelect) Scan ¶
func (_s *ConnectionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ConnectionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ConnectionUpdate ¶
type ConnectionUpdate struct {
// contains filtered or unexported fields
}
ConnectionUpdate is the builder for updating Connection entities.
func (*ConnectionUpdate) AddRevision ¶
func (_u *ConnectionUpdate) AddRevision(v int64) *ConnectionUpdate
AddRevision adds value to the "revision" field.
func (*ConnectionUpdate) AppendScopes ¶
func (_u *ConnectionUpdate) AppendScopes(v []string) *ConnectionUpdate
AppendScopes appends value to the "scopes" field.
func (*ConnectionUpdate) ClearMetadata ¶
func (_u *ConnectionUpdate) ClearMetadata() *ConnectionUpdate
ClearMetadata clears the value of the "metadata" field.
func (*ConnectionUpdate) ClearScopes ¶
func (_u *ConnectionUpdate) ClearScopes() *ConnectionUpdate
ClearScopes clears the value of the "scopes" field.
func (*ConnectionUpdate) Exec ¶
func (_u *ConnectionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ConnectionUpdate) ExecX ¶
func (_u *ConnectionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionUpdate) Mutation ¶
func (_u *ConnectionUpdate) Mutation() *ConnectionMutation
Mutation returns the ConnectionMutation object of the builder.
func (*ConnectionUpdate) Save ¶
func (_u *ConnectionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ConnectionUpdate) SaveX ¶
func (_u *ConnectionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ConnectionUpdate) SetAuthMethod ¶
func (_u *ConnectionUpdate) SetAuthMethod(v string) *ConnectionUpdate
SetAuthMethod sets the "auth_method" field.
func (*ConnectionUpdate) SetCreatedByID ¶
func (_u *ConnectionUpdate) SetCreatedByID(v string) *ConnectionUpdate
SetCreatedByID sets the "created_by_id" field.
func (*ConnectionUpdate) SetCreatedByKind ¶
func (_u *ConnectionUpdate) SetCreatedByKind(v string) *ConnectionUpdate
SetCreatedByKind sets the "created_by_kind" field.
func (*ConnectionUpdate) SetDisplayName ¶
func (_u *ConnectionUpdate) SetDisplayName(v string) *ConnectionUpdate
SetDisplayName sets the "display_name" field.
func (*ConnectionUpdate) SetExternalAccountID ¶
func (_u *ConnectionUpdate) SetExternalAccountID(v string) *ConnectionUpdate
SetExternalAccountID sets the "external_account_id" field.
func (*ConnectionUpdate) SetExternalLabel ¶
func (_u *ConnectionUpdate) SetExternalLabel(v string) *ConnectionUpdate
SetExternalLabel sets the "external_label" field.
func (*ConnectionUpdate) SetHealth ¶
func (_u *ConnectionUpdate) SetHealth(v connectionforge.Health) *ConnectionUpdate
SetHealth sets the "health" field.
func (*ConnectionUpdate) SetMetadata ¶
func (_u *ConnectionUpdate) SetMetadata(v map[string]string) *ConnectionUpdate
SetMetadata sets the "metadata" field.
func (*ConnectionUpdate) SetNillableAuthMethod ¶
func (_u *ConnectionUpdate) SetNillableAuthMethod(v *string) *ConnectionUpdate
SetNillableAuthMethod sets the "auth_method" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableCreatedByID ¶
func (_u *ConnectionUpdate) SetNillableCreatedByID(v *string) *ConnectionUpdate
SetNillableCreatedByID sets the "created_by_id" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableCreatedByKind ¶
func (_u *ConnectionUpdate) SetNillableCreatedByKind(v *string) *ConnectionUpdate
SetNillableCreatedByKind sets the "created_by_kind" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableDisplayName ¶
func (_u *ConnectionUpdate) SetNillableDisplayName(v *string) *ConnectionUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableExternalAccountID ¶
func (_u *ConnectionUpdate) SetNillableExternalAccountID(v *string) *ConnectionUpdate
SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableExternalLabel ¶
func (_u *ConnectionUpdate) SetNillableExternalLabel(v *string) *ConnectionUpdate
SetNillableExternalLabel sets the "external_label" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableHealth ¶
func (_u *ConnectionUpdate) SetNillableHealth(v *connectionforge.Health) *ConnectionUpdate
SetNillableHealth sets the "health" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableRevision ¶
func (_u *ConnectionUpdate) SetNillableRevision(v *uint64) *ConnectionUpdate
SetNillableRevision sets the "revision" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableState ¶
func (_u *ConnectionUpdate) SetNillableState(v *string) *ConnectionUpdate
SetNillableState sets the "state" field if the given value is not nil.
func (*ConnectionUpdate) SetNillableUpdatedAt ¶
func (_u *ConnectionUpdate) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ConnectionUpdate) SetRevision ¶
func (_u *ConnectionUpdate) SetRevision(v uint64) *ConnectionUpdate
SetRevision sets the "revision" field.
func (*ConnectionUpdate) SetScopes ¶
func (_u *ConnectionUpdate) SetScopes(v []string) *ConnectionUpdate
SetScopes sets the "scopes" field.
func (*ConnectionUpdate) SetState ¶
func (_u *ConnectionUpdate) SetState(v string) *ConnectionUpdate
SetState sets the "state" field.
func (*ConnectionUpdate) SetUpdatedAt ¶
func (_u *ConnectionUpdate) SetUpdatedAt(v time.Time) *ConnectionUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ConnectionUpdate) Where ¶
func (_u *ConnectionUpdate) Where(ps ...predicate.Connection) *ConnectionUpdate
Where appends a list predicates to the ConnectionUpdate builder.
type ConnectionUpdateOne ¶
type ConnectionUpdateOne struct {
// contains filtered or unexported fields
}
ConnectionUpdateOne is the builder for updating a single Connection entity.
func (*ConnectionUpdateOne) AddRevision ¶
func (_u *ConnectionUpdateOne) AddRevision(v int64) *ConnectionUpdateOne
AddRevision adds value to the "revision" field.
func (*ConnectionUpdateOne) AppendScopes ¶
func (_u *ConnectionUpdateOne) AppendScopes(v []string) *ConnectionUpdateOne
AppendScopes appends value to the "scopes" field.
func (*ConnectionUpdateOne) ClearMetadata ¶
func (_u *ConnectionUpdateOne) ClearMetadata() *ConnectionUpdateOne
ClearMetadata clears the value of the "metadata" field.
func (*ConnectionUpdateOne) ClearScopes ¶
func (_u *ConnectionUpdateOne) ClearScopes() *ConnectionUpdateOne
ClearScopes clears the value of the "scopes" field.
func (*ConnectionUpdateOne) Exec ¶
func (_u *ConnectionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ConnectionUpdateOne) ExecX ¶
func (_u *ConnectionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ConnectionUpdateOne) Mutation ¶
func (_u *ConnectionUpdateOne) Mutation() *ConnectionMutation
Mutation returns the ConnectionMutation object of the builder.
func (*ConnectionUpdateOne) Save ¶
func (_u *ConnectionUpdateOne) Save(ctx context.Context) (*Connection, error)
Save executes the query and returns the updated Connection entity.
func (*ConnectionUpdateOne) SaveX ¶
func (_u *ConnectionUpdateOne) SaveX(ctx context.Context) *Connection
SaveX is like Save, but panics if an error occurs.
func (*ConnectionUpdateOne) Select ¶
func (_u *ConnectionUpdateOne) Select(field string, fields ...string) *ConnectionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ConnectionUpdateOne) SetAuthMethod ¶
func (_u *ConnectionUpdateOne) SetAuthMethod(v string) *ConnectionUpdateOne
SetAuthMethod sets the "auth_method" field.
func (*ConnectionUpdateOne) SetCreatedByID ¶
func (_u *ConnectionUpdateOne) SetCreatedByID(v string) *ConnectionUpdateOne
SetCreatedByID sets the "created_by_id" field.
func (*ConnectionUpdateOne) SetCreatedByKind ¶
func (_u *ConnectionUpdateOne) SetCreatedByKind(v string) *ConnectionUpdateOne
SetCreatedByKind sets the "created_by_kind" field.
func (*ConnectionUpdateOne) SetDisplayName ¶
func (_u *ConnectionUpdateOne) SetDisplayName(v string) *ConnectionUpdateOne
SetDisplayName sets the "display_name" field.
func (*ConnectionUpdateOne) SetExternalAccountID ¶
func (_u *ConnectionUpdateOne) SetExternalAccountID(v string) *ConnectionUpdateOne
SetExternalAccountID sets the "external_account_id" field.
func (*ConnectionUpdateOne) SetExternalLabel ¶
func (_u *ConnectionUpdateOne) SetExternalLabel(v string) *ConnectionUpdateOne
SetExternalLabel sets the "external_label" field.
func (*ConnectionUpdateOne) SetHealth ¶
func (_u *ConnectionUpdateOne) SetHealth(v connectionforge.Health) *ConnectionUpdateOne
SetHealth sets the "health" field.
func (*ConnectionUpdateOne) SetMetadata ¶
func (_u *ConnectionUpdateOne) SetMetadata(v map[string]string) *ConnectionUpdateOne
SetMetadata sets the "metadata" field.
func (*ConnectionUpdateOne) SetNillableAuthMethod ¶
func (_u *ConnectionUpdateOne) SetNillableAuthMethod(v *string) *ConnectionUpdateOne
SetNillableAuthMethod sets the "auth_method" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableCreatedByID ¶
func (_u *ConnectionUpdateOne) SetNillableCreatedByID(v *string) *ConnectionUpdateOne
SetNillableCreatedByID sets the "created_by_id" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableCreatedByKind ¶
func (_u *ConnectionUpdateOne) SetNillableCreatedByKind(v *string) *ConnectionUpdateOne
SetNillableCreatedByKind sets the "created_by_kind" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableDisplayName ¶
func (_u *ConnectionUpdateOne) SetNillableDisplayName(v *string) *ConnectionUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableExternalAccountID ¶
func (_u *ConnectionUpdateOne) SetNillableExternalAccountID(v *string) *ConnectionUpdateOne
SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableExternalLabel ¶
func (_u *ConnectionUpdateOne) SetNillableExternalLabel(v *string) *ConnectionUpdateOne
SetNillableExternalLabel sets the "external_label" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableHealth ¶
func (_u *ConnectionUpdateOne) SetNillableHealth(v *connectionforge.Health) *ConnectionUpdateOne
SetNillableHealth sets the "health" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableRevision ¶
func (_u *ConnectionUpdateOne) SetNillableRevision(v *uint64) *ConnectionUpdateOne
SetNillableRevision sets the "revision" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableState ¶
func (_u *ConnectionUpdateOne) SetNillableState(v *string) *ConnectionUpdateOne
SetNillableState sets the "state" field if the given value is not nil.
func (*ConnectionUpdateOne) SetNillableUpdatedAt ¶
func (_u *ConnectionUpdateOne) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ConnectionUpdateOne) SetRevision ¶
func (_u *ConnectionUpdateOne) SetRevision(v uint64) *ConnectionUpdateOne
SetRevision sets the "revision" field.
func (*ConnectionUpdateOne) SetScopes ¶
func (_u *ConnectionUpdateOne) SetScopes(v []string) *ConnectionUpdateOne
SetScopes sets the "scopes" field.
func (*ConnectionUpdateOne) SetState ¶
func (_u *ConnectionUpdateOne) SetState(v string) *ConnectionUpdateOne
SetState sets the "state" field.
func (*ConnectionUpdateOne) SetUpdatedAt ¶
func (_u *ConnectionUpdateOne) SetUpdatedAt(v time.Time) *ConnectionUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ConnectionUpdateOne) Where ¶
func (_u *ConnectionUpdateOne) Where(ps ...predicate.Connection) *ConnectionUpdateOne
Where appends a list predicates to the ConnectionUpdate builder.
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 Credential ¶
type Credential struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// OwnerID holds the value of the "owner_id" field.
OwnerID string `json:"owner_id,omitempty"`
// ConnectionID holds the value of the "connection_id" field.
ConnectionID string `json:"connection_id,omitempty"`
// Version holds the value of the "version" field.
Version int `json:"version,omitempty"`
// Kind holds the value of the "kind" field.
Kind string `json:"kind,omitempty"`
// Ciphertext holds the value of the "ciphertext" field.
Ciphertext []byte `json:"ciphertext,omitempty"`
// ExpiresAt holds the value of the "expires_at" field.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// contains filtered or unexported fields
}
Credential is the model entity for the Credential schema.
func (*Credential) String ¶
func (_m *Credential) String() string
String implements the fmt.Stringer.
func (*Credential) Unwrap ¶
func (_m *Credential) Unwrap() *Credential
Unwrap unwraps the Credential 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 (*Credential) Update ¶
func (_m *Credential) Update() *CredentialUpdateOne
Update returns a builder for updating this Credential. Note that you need to call Credential.Unwrap() before calling this method if this Credential was returned from a transaction, and the transaction was committed or rolled back.
type CredentialClient ¶
type CredentialClient struct {
// contains filtered or unexported fields
}
CredentialClient is a client for the Credential schema.
func NewCredentialClient ¶
func NewCredentialClient(c config) *CredentialClient
NewCredentialClient returns a client for the Credential from the given config.
func (*CredentialClient) Create ¶
func (c *CredentialClient) Create() *CredentialCreate
Create returns a builder for creating a Credential entity.
func (*CredentialClient) CreateBulk ¶
func (c *CredentialClient) CreateBulk(builders ...*CredentialCreate) *CredentialCreateBulk
CreateBulk returns a builder for creating a bulk of Credential entities.
func (*CredentialClient) Delete ¶
func (c *CredentialClient) Delete() *CredentialDelete
Delete returns a delete builder for Credential.
func (*CredentialClient) DeleteOne ¶
func (c *CredentialClient) DeleteOne(_m *Credential) *CredentialDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CredentialClient) DeleteOneID ¶
func (c *CredentialClient) DeleteOneID(id int) *CredentialDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CredentialClient) Get ¶
func (c *CredentialClient) Get(ctx context.Context, id int) (*Credential, error)
Get returns a Credential entity by its id.
func (*CredentialClient) GetX ¶
func (c *CredentialClient) GetX(ctx context.Context, id int) *Credential
GetX is like Get, but panics if an error occurs.
func (*CredentialClient) Hooks ¶
func (c *CredentialClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CredentialClient) Intercept ¶
func (c *CredentialClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `credential.Intercept(f(g(h())))`.
func (*CredentialClient) Interceptors ¶
func (c *CredentialClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CredentialClient) MapCreateBulk ¶
func (c *CredentialClient) MapCreateBulk(slice any, setFunc func(*CredentialCreate, int)) *CredentialCreateBulk
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 (*CredentialClient) Query ¶
func (c *CredentialClient) Query() *CredentialQuery
Query returns a query builder for Credential.
func (*CredentialClient) Update ¶
func (c *CredentialClient) Update() *CredentialUpdate
Update returns an update builder for Credential.
func (*CredentialClient) UpdateOne ¶
func (c *CredentialClient) UpdateOne(_m *Credential) *CredentialUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CredentialClient) UpdateOneID ¶
func (c *CredentialClient) UpdateOneID(id int) *CredentialUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CredentialClient) Use ¶
func (c *CredentialClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `credential.Hooks(f(g(h())))`.
type CredentialCreate ¶
type CredentialCreate struct {
// contains filtered or unexported fields
}
CredentialCreate is the builder for creating a Credential entity.
func (*CredentialCreate) Exec ¶
func (_c *CredentialCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CredentialCreate) ExecX ¶
func (_c *CredentialCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CredentialCreate) Mutation ¶
func (_c *CredentialCreate) Mutation() *CredentialMutation
Mutation returns the CredentialMutation object of the builder.
func (*CredentialCreate) Save ¶
func (_c *CredentialCreate) Save(ctx context.Context) (*Credential, error)
Save creates the Credential in the database.
func (*CredentialCreate) SaveX ¶
func (_c *CredentialCreate) SaveX(ctx context.Context) *Credential
SaveX calls Save and panics if Save returns an error.
func (*CredentialCreate) SetCiphertext ¶
func (_c *CredentialCreate) SetCiphertext(v []byte) *CredentialCreate
SetCiphertext sets the "ciphertext" field.
func (*CredentialCreate) SetConnectionID ¶
func (_c *CredentialCreate) SetConnectionID(v string) *CredentialCreate
SetConnectionID sets the "connection_id" field.
func (*CredentialCreate) SetCreatedAt ¶
func (_c *CredentialCreate) SetCreatedAt(v time.Time) *CredentialCreate
SetCreatedAt sets the "created_at" field.
func (*CredentialCreate) SetExpiresAt ¶
func (_c *CredentialCreate) SetExpiresAt(v time.Time) *CredentialCreate
SetExpiresAt sets the "expires_at" field.
func (*CredentialCreate) SetKind ¶
func (_c *CredentialCreate) SetKind(v string) *CredentialCreate
SetKind sets the "kind" field.
func (*CredentialCreate) SetNillableExpiresAt ¶
func (_c *CredentialCreate) SetNillableExpiresAt(v *time.Time) *CredentialCreate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*CredentialCreate) SetOwnerID ¶
func (_c *CredentialCreate) SetOwnerID(v string) *CredentialCreate
SetOwnerID sets the "owner_id" field.
func (*CredentialCreate) SetVersion ¶
func (_c *CredentialCreate) SetVersion(v int) *CredentialCreate
SetVersion sets the "version" field.
type CredentialCreateBulk ¶
type CredentialCreateBulk struct {
// contains filtered or unexported fields
}
CredentialCreateBulk is the builder for creating many Credential entities in bulk.
func (*CredentialCreateBulk) Exec ¶
func (_c *CredentialCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CredentialCreateBulk) ExecX ¶
func (_c *CredentialCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CredentialCreateBulk) Save ¶
func (_c *CredentialCreateBulk) Save(ctx context.Context) ([]*Credential, error)
Save creates the Credential entities in the database.
func (*CredentialCreateBulk) SaveX ¶
func (_c *CredentialCreateBulk) SaveX(ctx context.Context) []*Credential
SaveX is like Save, but panics if an error occurs.
type CredentialDelete ¶
type CredentialDelete struct {
// contains filtered or unexported fields
}
CredentialDelete is the builder for deleting a Credential entity.
func (*CredentialDelete) Exec ¶
func (_d *CredentialDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CredentialDelete) ExecX ¶
func (_d *CredentialDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CredentialDelete) Where ¶
func (_d *CredentialDelete) Where(ps ...predicate.Credential) *CredentialDelete
Where appends a list predicates to the CredentialDelete builder.
type CredentialDeleteOne ¶
type CredentialDeleteOne struct {
// contains filtered or unexported fields
}
CredentialDeleteOne is the builder for deleting a single Credential entity.
func (*CredentialDeleteOne) Exec ¶
func (_d *CredentialDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CredentialDeleteOne) ExecX ¶
func (_d *CredentialDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CredentialDeleteOne) Where ¶
func (_d *CredentialDeleteOne) Where(ps ...predicate.Credential) *CredentialDeleteOne
Where appends a list predicates to the CredentialDelete builder.
type CredentialGroupBy ¶
type CredentialGroupBy struct {
// contains filtered or unexported fields
}
CredentialGroupBy is the group-by builder for Credential entities.
func (*CredentialGroupBy) Aggregate ¶
func (_g *CredentialGroupBy) Aggregate(fns ...AggregateFunc) *CredentialGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CredentialGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CredentialGroupBy) Scan ¶
func (_g *CredentialGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CredentialGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CredentialMutation ¶
type CredentialMutation struct {
// contains filtered or unexported fields
}
CredentialMutation represents an operation that mutates the Credential nodes in the graph.
func (*CredentialMutation) AddField ¶
func (m *CredentialMutation) 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 (*CredentialMutation) AddVersion ¶
func (m *CredentialMutation) AddVersion(i int)
AddVersion adds i to the "version" field.
func (*CredentialMutation) AddedEdges ¶
func (m *CredentialMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CredentialMutation) AddedField ¶
func (m *CredentialMutation) 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 (*CredentialMutation) AddedFields ¶
func (m *CredentialMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CredentialMutation) AddedIDs ¶
func (m *CredentialMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CredentialMutation) AddedVersion ¶
func (m *CredentialMutation) AddedVersion() (r int, exists bool)
AddedVersion returns the value that was added to the "version" field in this mutation.
func (*CredentialMutation) Ciphertext ¶
func (m *CredentialMutation) Ciphertext() (r []byte, exists bool)
Ciphertext returns the value of the "ciphertext" field in the mutation.
func (*CredentialMutation) ClearEdge ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ClearExpiresAt ¶
func (m *CredentialMutation) ClearExpiresAt()
ClearExpiresAt clears the value of the "expires_at" field.
func (*CredentialMutation) ClearField ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ClearedEdges ¶
func (m *CredentialMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CredentialMutation) ClearedFields ¶
func (m *CredentialMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CredentialMutation) Client ¶
func (m CredentialMutation) 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 (*CredentialMutation) ConnectionID ¶
func (m *CredentialMutation) ConnectionID() (r string, exists bool)
ConnectionID returns the value of the "connection_id" field in the mutation.
func (*CredentialMutation) CreatedAt ¶
func (m *CredentialMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CredentialMutation) EdgeCleared ¶
func (m *CredentialMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CredentialMutation) ExpiresAt ¶
func (m *CredentialMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*CredentialMutation) ExpiresAtCleared ¶
func (m *CredentialMutation) ExpiresAtCleared() bool
ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.
func (*CredentialMutation) Field ¶
func (m *CredentialMutation) 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 (*CredentialMutation) FieldCleared ¶
func (m *CredentialMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CredentialMutation) Fields ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ID ¶
func (m *CredentialMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CredentialMutation) IDs ¶
func (m *CredentialMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CredentialMutation) Kind ¶
func (m *CredentialMutation) Kind() (r string, exists bool)
Kind returns the value of the "kind" field in the mutation.
func (*CredentialMutation) OldCiphertext ¶
func (m *CredentialMutation) OldCiphertext(ctx context.Context) (v []byte, err error)
OldCiphertext returns the old "ciphertext" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldConnectionID ¶
func (m *CredentialMutation) OldConnectionID(ctx context.Context) (v string, err error)
OldConnectionID returns the old "connection_id" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) 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 (*CredentialMutation) OldKind ¶
func (m *CredentialMutation) OldKind(ctx context.Context) (v string, err error)
OldKind returns the old "kind" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldOwnerID ¶
func (m *CredentialMutation) OldOwnerID(ctx context.Context) (v string, err error)
OldOwnerID returns the old "owner_id" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldVersion ¶
func (m *CredentialMutation) OldVersion(ctx context.Context) (v int, err error)
OldVersion returns the old "version" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OwnerID ¶
func (m *CredentialMutation) OwnerID() (r string, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*CredentialMutation) RemovedEdges ¶
func (m *CredentialMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CredentialMutation) RemovedIDs ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ResetCiphertext ¶
func (m *CredentialMutation) ResetCiphertext()
ResetCiphertext resets all changes to the "ciphertext" field.
func (*CredentialMutation) ResetConnectionID ¶
func (m *CredentialMutation) ResetConnectionID()
ResetConnectionID resets all changes to the "connection_id" field.
func (*CredentialMutation) ResetCreatedAt ¶
func (m *CredentialMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CredentialMutation) ResetEdge ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ResetExpiresAt ¶
func (m *CredentialMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*CredentialMutation) ResetField ¶
func (m *CredentialMutation) 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 (*CredentialMutation) ResetKind ¶
func (m *CredentialMutation) ResetKind()
ResetKind resets all changes to the "kind" field.
func (*CredentialMutation) ResetOwnerID ¶
func (m *CredentialMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*CredentialMutation) ResetVersion ¶
func (m *CredentialMutation) ResetVersion()
ResetVersion resets all changes to the "version" field.
func (*CredentialMutation) SetCiphertext ¶
func (m *CredentialMutation) SetCiphertext(b []byte)
SetCiphertext sets the "ciphertext" field.
func (*CredentialMutation) SetConnectionID ¶
func (m *CredentialMutation) SetConnectionID(s string)
SetConnectionID sets the "connection_id" field.
func (*CredentialMutation) SetCreatedAt ¶
func (m *CredentialMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CredentialMutation) SetExpiresAt ¶
func (m *CredentialMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*CredentialMutation) SetField ¶
func (m *CredentialMutation) 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 (*CredentialMutation) SetKind ¶
func (m *CredentialMutation) SetKind(s string)
SetKind sets the "kind" field.
func (*CredentialMutation) SetOp ¶
func (m *CredentialMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CredentialMutation) SetOwnerID ¶
func (m *CredentialMutation) SetOwnerID(s string)
SetOwnerID sets the "owner_id" field.
func (*CredentialMutation) SetVersion ¶
func (m *CredentialMutation) SetVersion(i int)
SetVersion sets the "version" field.
func (CredentialMutation) Tx ¶
func (m CredentialMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CredentialMutation) Type ¶
func (m *CredentialMutation) Type() string
Type returns the node type of this mutation (Credential).
func (*CredentialMutation) Version ¶
func (m *CredentialMutation) Version() (r int, exists bool)
Version returns the value of the "version" field in the mutation.
func (*CredentialMutation) Where ¶
func (m *CredentialMutation) Where(ps ...predicate.Credential)
Where appends a list predicates to the CredentialMutation builder.
func (*CredentialMutation) WhereP ¶
func (m *CredentialMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CredentialMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CredentialQuery ¶
type CredentialQuery struct {
// contains filtered or unexported fields
}
CredentialQuery is the builder for querying Credential entities.
func (*CredentialQuery) Aggregate ¶
func (_q *CredentialQuery) Aggregate(fns ...AggregateFunc) *CredentialSelect
Aggregate returns a CredentialSelect configured with the given aggregations.
func (*CredentialQuery) All ¶
func (_q *CredentialQuery) All(ctx context.Context) ([]*Credential, error)
All executes the query and returns a list of Credentials.
func (*CredentialQuery) AllX ¶
func (_q *CredentialQuery) AllX(ctx context.Context) []*Credential
AllX is like All, but panics if an error occurs.
func (*CredentialQuery) Clone ¶
func (_q *CredentialQuery) Clone() *CredentialQuery
Clone returns a duplicate of the CredentialQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CredentialQuery) Count ¶
func (_q *CredentialQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CredentialQuery) CountX ¶
func (_q *CredentialQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CredentialQuery) Exist ¶
func (_q *CredentialQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CredentialQuery) ExistX ¶
func (_q *CredentialQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CredentialQuery) First ¶
func (_q *CredentialQuery) First(ctx context.Context) (*Credential, error)
First returns the first Credential entity from the query. Returns a *NotFoundError when no Credential was found.
func (*CredentialQuery) FirstID ¶
func (_q *CredentialQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Credential ID from the query. Returns a *NotFoundError when no Credential ID was found.
func (*CredentialQuery) FirstIDX ¶
func (_q *CredentialQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CredentialQuery) FirstX ¶
func (_q *CredentialQuery) FirstX(ctx context.Context) *Credential
FirstX is like First, but panics if an error occurs.
func (*CredentialQuery) GroupBy ¶
func (_q *CredentialQuery) GroupBy(field string, fields ...string) *CredentialGroupBy
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 {
OwnerID string `json:"owner_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Credential.Query().
GroupBy(credential.FieldOwnerID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*CredentialQuery) IDs ¶
func (_q *CredentialQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Credential IDs.
func (*CredentialQuery) IDsX ¶
func (_q *CredentialQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CredentialQuery) Limit ¶
func (_q *CredentialQuery) Limit(limit int) *CredentialQuery
Limit the number of records to be returned by this query.
func (*CredentialQuery) Offset ¶
func (_q *CredentialQuery) Offset(offset int) *CredentialQuery
Offset to start from.
func (*CredentialQuery) Only ¶
func (_q *CredentialQuery) Only(ctx context.Context) (*Credential, error)
Only returns a single Credential entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Credential entity is found. Returns a *NotFoundError when no Credential entities are found.
func (*CredentialQuery) OnlyID ¶
func (_q *CredentialQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Credential ID in the query. Returns a *NotSingularError when more than one Credential ID is found. Returns a *NotFoundError when no entities are found.
func (*CredentialQuery) OnlyIDX ¶
func (_q *CredentialQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CredentialQuery) OnlyX ¶
func (_q *CredentialQuery) OnlyX(ctx context.Context) *Credential
OnlyX is like Only, but panics if an error occurs.
func (*CredentialQuery) Order ¶
func (_q *CredentialQuery) Order(o ...credential.OrderOption) *CredentialQuery
Order specifies how the records should be ordered.
func (*CredentialQuery) Select ¶
func (_q *CredentialQuery) Select(fields ...string) *CredentialSelect
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 {
OwnerID string `json:"owner_id,omitempty"`
}
client.Credential.Query().
Select(credential.FieldOwnerID).
Scan(ctx, &v)
func (*CredentialQuery) Unique ¶
func (_q *CredentialQuery) Unique(unique bool) *CredentialQuery
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 (*CredentialQuery) Where ¶
func (_q *CredentialQuery) Where(ps ...predicate.Credential) *CredentialQuery
Where adds a new predicate for the CredentialQuery builder.
type CredentialSelect ¶
type CredentialSelect struct {
*CredentialQuery
// contains filtered or unexported fields
}
CredentialSelect is the builder for selecting fields of Credential entities.
func (*CredentialSelect) Aggregate ¶
func (_s *CredentialSelect) Aggregate(fns ...AggregateFunc) *CredentialSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CredentialSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CredentialSelect) Scan ¶
func (_s *CredentialSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CredentialSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CredentialUpdate ¶
type CredentialUpdate struct {
// contains filtered or unexported fields
}
CredentialUpdate is the builder for updating Credential entities.
func (*CredentialUpdate) Exec ¶
func (_u *CredentialUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CredentialUpdate) ExecX ¶
func (_u *CredentialUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CredentialUpdate) Mutation ¶
func (_u *CredentialUpdate) Mutation() *CredentialMutation
Mutation returns the CredentialMutation object of the builder.
func (*CredentialUpdate) Save ¶
func (_u *CredentialUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CredentialUpdate) SaveX ¶
func (_u *CredentialUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CredentialUpdate) Where ¶
func (_u *CredentialUpdate) Where(ps ...predicate.Credential) *CredentialUpdate
Where appends a list predicates to the CredentialUpdate builder.
type CredentialUpdateOne ¶
type CredentialUpdateOne struct {
// contains filtered or unexported fields
}
CredentialUpdateOne is the builder for updating a single Credential entity.
func (*CredentialUpdateOne) Exec ¶
func (_u *CredentialUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CredentialUpdateOne) ExecX ¶
func (_u *CredentialUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CredentialUpdateOne) Mutation ¶
func (_u *CredentialUpdateOne) Mutation() *CredentialMutation
Mutation returns the CredentialMutation object of the builder.
func (*CredentialUpdateOne) Save ¶
func (_u *CredentialUpdateOne) Save(ctx context.Context) (*Credential, error)
Save executes the query and returns the updated Credential entity.
func (*CredentialUpdateOne) SaveX ¶
func (_u *CredentialUpdateOne) SaveX(ctx context.Context) *Credential
SaveX is like Save, but panics if an error occurs.
func (*CredentialUpdateOne) Select ¶
func (_u *CredentialUpdateOne) Select(field string, fields ...string) *CredentialUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CredentialUpdateOne) Where ¶
func (_u *CredentialUpdateOne) Where(ps ...predicate.Credential) *CredentialUpdateOne
Where appends a list predicates to the CredentialUpdate builder.
type Grant ¶
type Grant struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// OwnerID holds the value of the "owner_id" field.
OwnerID string `json:"owner_id,omitempty"`
// ConnectionID holds the value of the "connection_id" field.
ConnectionID string `json:"connection_id,omitempty"`
// PrincipalKind holds the value of the "principal_kind" field.
PrincipalKind string `json:"principal_kind,omitempty"`
// PrincipalID holds the value of the "principal_id" field.
PrincipalID string `json:"principal_id,omitempty"`
// Actions holds the value of the "actions" field.
Actions []string `json:"actions,omitempty"`
// contains filtered or unexported fields
}
Grant is the model entity for the Grant schema.
func (*Grant) Unwrap ¶
Unwrap unwraps the Grant 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 (*Grant) Update ¶
func (_m *Grant) Update() *GrantUpdateOne
Update returns a builder for updating this Grant. Note that you need to call Grant.Unwrap() before calling this method if this Grant was returned from a transaction, and the transaction was committed or rolled back.
type GrantClient ¶
type GrantClient struct {
// contains filtered or unexported fields
}
GrantClient is a client for the Grant schema.
func NewGrantClient ¶
func NewGrantClient(c config) *GrantClient
NewGrantClient returns a client for the Grant from the given config.
func (*GrantClient) Create ¶
func (c *GrantClient) Create() *GrantCreate
Create returns a builder for creating a Grant entity.
func (*GrantClient) CreateBulk ¶
func (c *GrantClient) CreateBulk(builders ...*GrantCreate) *GrantCreateBulk
CreateBulk returns a builder for creating a bulk of Grant entities.
func (*GrantClient) Delete ¶
func (c *GrantClient) Delete() *GrantDelete
Delete returns a delete builder for Grant.
func (*GrantClient) DeleteOne ¶
func (c *GrantClient) DeleteOne(_m *Grant) *GrantDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GrantClient) DeleteOneID ¶
func (c *GrantClient) DeleteOneID(id int) *GrantDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GrantClient) GetX ¶
func (c *GrantClient) GetX(ctx context.Context, id int) *Grant
GetX is like Get, but panics if an error occurs.
func (*GrantClient) Intercept ¶
func (c *GrantClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `grant.Intercept(f(g(h())))`.
func (*GrantClient) Interceptors ¶
func (c *GrantClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*GrantClient) MapCreateBulk ¶
func (c *GrantClient) MapCreateBulk(slice any, setFunc func(*GrantCreate, int)) *GrantCreateBulk
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 (*GrantClient) Query ¶
func (c *GrantClient) Query() *GrantQuery
Query returns a query builder for Grant.
func (*GrantClient) Update ¶
func (c *GrantClient) Update() *GrantUpdate
Update returns an update builder for Grant.
func (*GrantClient) UpdateOne ¶
func (c *GrantClient) UpdateOne(_m *Grant) *GrantUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GrantClient) UpdateOneID ¶
func (c *GrantClient) UpdateOneID(id int) *GrantUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GrantClient) Use ¶
func (c *GrantClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `grant.Hooks(f(g(h())))`.
type GrantCreate ¶
type GrantCreate struct {
// contains filtered or unexported fields
}
GrantCreate is the builder for creating a Grant entity.
func (*GrantCreate) Exec ¶
func (_c *GrantCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantCreate) ExecX ¶
func (_c *GrantCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantCreate) Mutation ¶
func (_c *GrantCreate) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantCreate) Save ¶
func (_c *GrantCreate) Save(ctx context.Context) (*Grant, error)
Save creates the Grant in the database.
func (*GrantCreate) SaveX ¶
func (_c *GrantCreate) SaveX(ctx context.Context) *Grant
SaveX calls Save and panics if Save returns an error.
func (*GrantCreate) SetActions ¶
func (_c *GrantCreate) SetActions(v []string) *GrantCreate
SetActions sets the "actions" field.
func (*GrantCreate) SetConnectionID ¶
func (_c *GrantCreate) SetConnectionID(v string) *GrantCreate
SetConnectionID sets the "connection_id" field.
func (*GrantCreate) SetOwnerID ¶
func (_c *GrantCreate) SetOwnerID(v string) *GrantCreate
SetOwnerID sets the "owner_id" field.
func (*GrantCreate) SetPrincipalID ¶
func (_c *GrantCreate) SetPrincipalID(v string) *GrantCreate
SetPrincipalID sets the "principal_id" field.
func (*GrantCreate) SetPrincipalKind ¶
func (_c *GrantCreate) SetPrincipalKind(v string) *GrantCreate
SetPrincipalKind sets the "principal_kind" field.
type GrantCreateBulk ¶
type GrantCreateBulk struct {
// contains filtered or unexported fields
}
GrantCreateBulk is the builder for creating many Grant entities in bulk.
func (*GrantCreateBulk) Exec ¶
func (_c *GrantCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantCreateBulk) ExecX ¶
func (_c *GrantCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type GrantDelete ¶
type GrantDelete struct {
// contains filtered or unexported fields
}
GrantDelete is the builder for deleting a Grant entity.
func (*GrantDelete) Exec ¶
func (_d *GrantDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GrantDelete) ExecX ¶
func (_d *GrantDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GrantDelete) Where ¶
func (_d *GrantDelete) Where(ps ...predicate.Grant) *GrantDelete
Where appends a list predicates to the GrantDelete builder.
type GrantDeleteOne ¶
type GrantDeleteOne struct {
// contains filtered or unexported fields
}
GrantDeleteOne is the builder for deleting a single Grant entity.
func (*GrantDeleteOne) Exec ¶
func (_d *GrantDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GrantDeleteOne) ExecX ¶
func (_d *GrantDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantDeleteOne) Where ¶
func (_d *GrantDeleteOne) Where(ps ...predicate.Grant) *GrantDeleteOne
Where appends a list predicates to the GrantDelete builder.
type GrantGroupBy ¶
type GrantGroupBy struct {
// contains filtered or unexported fields
}
GrantGroupBy is the group-by builder for Grant entities.
func (*GrantGroupBy) Aggregate ¶
func (_g *GrantGroupBy) Aggregate(fns ...AggregateFunc) *GrantGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GrantGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GrantGroupBy) Scan ¶
func (_g *GrantGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GrantGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GrantMutation ¶
type GrantMutation struct {
// contains filtered or unexported fields
}
GrantMutation represents an operation that mutates the Grant nodes in the graph.
func (*GrantMutation) Actions ¶
func (m *GrantMutation) Actions() (r []string, exists bool)
Actions returns the value of the "actions" field in the mutation.
func (*GrantMutation) AddField ¶
func (m *GrantMutation) 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 (*GrantMutation) AddedEdges ¶
func (m *GrantMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GrantMutation) AddedField ¶
func (m *GrantMutation) 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 (*GrantMutation) AddedFields ¶
func (m *GrantMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GrantMutation) AddedIDs ¶
func (m *GrantMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GrantMutation) AppendActions ¶
func (m *GrantMutation) AppendActions(s []string)
AppendActions adds s to the "actions" field.
func (*GrantMutation) AppendedActions ¶
func (m *GrantMutation) AppendedActions() ([]string, bool)
AppendedActions returns the list of values that were appended to the "actions" field in this mutation.
func (*GrantMutation) ClearEdge ¶
func (m *GrantMutation) 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 (*GrantMutation) ClearField ¶
func (m *GrantMutation) 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 (*GrantMutation) ClearedEdges ¶
func (m *GrantMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GrantMutation) ClearedFields ¶
func (m *GrantMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GrantMutation) Client ¶
func (m GrantMutation) 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 (*GrantMutation) ConnectionID ¶
func (m *GrantMutation) ConnectionID() (r string, exists bool)
ConnectionID returns the value of the "connection_id" field in the mutation.
func (*GrantMutation) EdgeCleared ¶
func (m *GrantMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GrantMutation) Field ¶
func (m *GrantMutation) 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 (*GrantMutation) FieldCleared ¶
func (m *GrantMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GrantMutation) Fields ¶
func (m *GrantMutation) 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 (*GrantMutation) ID ¶
func (m *GrantMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*GrantMutation) IDs ¶
func (m *GrantMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*GrantMutation) OldActions ¶
func (m *GrantMutation) OldActions(ctx context.Context) (v []string, err error)
OldActions returns the old "actions" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldConnectionID ¶
func (m *GrantMutation) OldConnectionID(ctx context.Context) (v string, err error)
OldConnectionID returns the old "connection_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) 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 (*GrantMutation) OldOwnerID ¶
func (m *GrantMutation) OldOwnerID(ctx context.Context) (v string, err error)
OldOwnerID returns the old "owner_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPrincipalID ¶
func (m *GrantMutation) OldPrincipalID(ctx context.Context) (v string, err error)
OldPrincipalID returns the old "principal_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPrincipalKind ¶
func (m *GrantMutation) OldPrincipalKind(ctx context.Context) (v string, err error)
OldPrincipalKind returns the old "principal_kind" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OwnerID ¶
func (m *GrantMutation) OwnerID() (r string, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*GrantMutation) PrincipalID ¶
func (m *GrantMutation) PrincipalID() (r string, exists bool)
PrincipalID returns the value of the "principal_id" field in the mutation.
func (*GrantMutation) PrincipalKind ¶
func (m *GrantMutation) PrincipalKind() (r string, exists bool)
PrincipalKind returns the value of the "principal_kind" field in the mutation.
func (*GrantMutation) RemovedEdges ¶
func (m *GrantMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GrantMutation) RemovedIDs ¶
func (m *GrantMutation) 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 (*GrantMutation) ResetActions ¶
func (m *GrantMutation) ResetActions()
ResetActions resets all changes to the "actions" field.
func (*GrantMutation) ResetConnectionID ¶
func (m *GrantMutation) ResetConnectionID()
ResetConnectionID resets all changes to the "connection_id" field.
func (*GrantMutation) ResetEdge ¶
func (m *GrantMutation) 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 (*GrantMutation) ResetField ¶
func (m *GrantMutation) 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 (*GrantMutation) ResetOwnerID ¶
func (m *GrantMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*GrantMutation) ResetPrincipalID ¶
func (m *GrantMutation) ResetPrincipalID()
ResetPrincipalID resets all changes to the "principal_id" field.
func (*GrantMutation) ResetPrincipalKind ¶
func (m *GrantMutation) ResetPrincipalKind()
ResetPrincipalKind resets all changes to the "principal_kind" field.
func (*GrantMutation) SetActions ¶
func (m *GrantMutation) SetActions(s []string)
SetActions sets the "actions" field.
func (*GrantMutation) SetConnectionID ¶
func (m *GrantMutation) SetConnectionID(s string)
SetConnectionID sets the "connection_id" field.
func (*GrantMutation) SetField ¶
func (m *GrantMutation) 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 (*GrantMutation) SetOp ¶
func (m *GrantMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*GrantMutation) SetOwnerID ¶
func (m *GrantMutation) SetOwnerID(s string)
SetOwnerID sets the "owner_id" field.
func (*GrantMutation) SetPrincipalID ¶
func (m *GrantMutation) SetPrincipalID(s string)
SetPrincipalID sets the "principal_id" field.
func (*GrantMutation) SetPrincipalKind ¶
func (m *GrantMutation) SetPrincipalKind(s string)
SetPrincipalKind sets the "principal_kind" field.
func (GrantMutation) Tx ¶
func (m GrantMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GrantMutation) Type ¶
func (m *GrantMutation) Type() string
Type returns the node type of this mutation (Grant).
func (*GrantMutation) Where ¶
func (m *GrantMutation) Where(ps ...predicate.Grant)
Where appends a list predicates to the GrantMutation builder.
func (*GrantMutation) WhereP ¶
func (m *GrantMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the GrantMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type GrantQuery ¶
type GrantQuery struct {
// contains filtered or unexported fields
}
GrantQuery is the builder for querying Grant entities.
func (*GrantQuery) Aggregate ¶
func (_q *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect
Aggregate returns a GrantSelect configured with the given aggregations.
func (*GrantQuery) All ¶
func (_q *GrantQuery) All(ctx context.Context) ([]*Grant, error)
All executes the query and returns a list of Grants.
func (*GrantQuery) AllX ¶
func (_q *GrantQuery) AllX(ctx context.Context) []*Grant
AllX is like All, but panics if an error occurs.
func (*GrantQuery) Clone ¶
func (_q *GrantQuery) Clone() *GrantQuery
Clone returns a duplicate of the GrantQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GrantQuery) Count ¶
func (_q *GrantQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GrantQuery) CountX ¶
func (_q *GrantQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GrantQuery) Exist ¶
func (_q *GrantQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GrantQuery) ExistX ¶
func (_q *GrantQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GrantQuery) First ¶
func (_q *GrantQuery) First(ctx context.Context) (*Grant, error)
First returns the first Grant entity from the query. Returns a *NotFoundError when no Grant was found.
func (*GrantQuery) FirstID ¶
func (_q *GrantQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Grant ID from the query. Returns a *NotFoundError when no Grant ID was found.
func (*GrantQuery) FirstIDX ¶
func (_q *GrantQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*GrantQuery) FirstX ¶
func (_q *GrantQuery) FirstX(ctx context.Context) *Grant
FirstX is like First, but panics if an error occurs.
func (*GrantQuery) GroupBy ¶
func (_q *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy
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 {
OwnerID string `json:"owner_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.Grant.Query().
GroupBy(grant.FieldOwnerID).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*GrantQuery) IDs ¶
func (_q *GrantQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Grant IDs.
func (*GrantQuery) IDsX ¶
func (_q *GrantQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*GrantQuery) Limit ¶
func (_q *GrantQuery) Limit(limit int) *GrantQuery
Limit the number of records to be returned by this query.
func (*GrantQuery) Offset ¶
func (_q *GrantQuery) Offset(offset int) *GrantQuery
Offset to start from.
func (*GrantQuery) Only ¶
func (_q *GrantQuery) Only(ctx context.Context) (*Grant, error)
Only returns a single Grant entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Grant entity is found. Returns a *NotFoundError when no Grant entities are found.
func (*GrantQuery) OnlyID ¶
func (_q *GrantQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Grant ID in the query. Returns a *NotSingularError when more than one Grant ID is found. Returns a *NotFoundError when no entities are found.
func (*GrantQuery) OnlyIDX ¶
func (_q *GrantQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GrantQuery) OnlyX ¶
func (_q *GrantQuery) OnlyX(ctx context.Context) *Grant
OnlyX is like Only, but panics if an error occurs.
func (*GrantQuery) Order ¶
func (_q *GrantQuery) Order(o ...grant.OrderOption) *GrantQuery
Order specifies how the records should be ordered.
func (*GrantQuery) Select ¶
func (_q *GrantQuery) Select(fields ...string) *GrantSelect
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 {
OwnerID string `json:"owner_id,omitempty"`
}
client.Grant.Query().
Select(grant.FieldOwnerID).
Scan(ctx, &v)
func (*GrantQuery) Unique ¶
func (_q *GrantQuery) Unique(unique bool) *GrantQuery
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 (*GrantQuery) Where ¶
func (_q *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery
Where adds a new predicate for the GrantQuery builder.
type GrantSelect ¶
type GrantSelect struct {
*GrantQuery
// contains filtered or unexported fields
}
GrantSelect is the builder for selecting fields of Grant entities.
func (*GrantSelect) Aggregate ¶
func (_s *GrantSelect) Aggregate(fns ...AggregateFunc) *GrantSelect
Aggregate adds the given aggregation functions to the selector query.
func (*GrantSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GrantSelect) Scan ¶
func (_s *GrantSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GrantSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GrantUpdate ¶
type GrantUpdate struct {
// contains filtered or unexported fields
}
GrantUpdate is the builder for updating Grant entities.
func (*GrantUpdate) AppendActions ¶
func (_u *GrantUpdate) AppendActions(v []string) *GrantUpdate
AppendActions appends value to the "actions" field.
func (*GrantUpdate) Exec ¶
func (_u *GrantUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantUpdate) ExecX ¶
func (_u *GrantUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpdate) Mutation ¶
func (_u *GrantUpdate) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantUpdate) Save ¶
func (_u *GrantUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GrantUpdate) SaveX ¶
func (_u *GrantUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GrantUpdate) SetActions ¶
func (_u *GrantUpdate) SetActions(v []string) *GrantUpdate
SetActions sets the "actions" field.
func (*GrantUpdate) Where ¶
func (_u *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate
Where appends a list predicates to the GrantUpdate builder.
type GrantUpdateOne ¶
type GrantUpdateOne struct {
// contains filtered or unexported fields
}
GrantUpdateOne is the builder for updating a single Grant entity.
func (*GrantUpdateOne) AppendActions ¶
func (_u *GrantUpdateOne) AppendActions(v []string) *GrantUpdateOne
AppendActions appends value to the "actions" field.
func (*GrantUpdateOne) Exec ¶
func (_u *GrantUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GrantUpdateOne) ExecX ¶
func (_u *GrantUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpdateOne) Mutation ¶
func (_u *GrantUpdateOne) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantUpdateOne) Save ¶
func (_u *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)
Save executes the query and returns the updated Grant entity.
func (*GrantUpdateOne) SaveX ¶
func (_u *GrantUpdateOne) SaveX(ctx context.Context) *Grant
SaveX is like Save, but panics if an error occurs.
func (*GrantUpdateOne) Select ¶
func (_u *GrantUpdateOne) Select(field string, fields ...string) *GrantUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*GrantUpdateOne) SetActions ¶
func (_u *GrantUpdateOne) SetActions(v []string) *GrantUpdateOne
SetActions sets the "actions" field.
func (*GrantUpdateOne) Where ¶
func (_u *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne
Where appends a list predicates to the GrantUpdate builder.
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 Lease ¶
type Lease struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// Token holds the value of the "token" field.
Token string `json:"token,omitempty"`
// ExpiresAt holds the value of the "expires_at" field.
ExpiresAt time.Time `json:"expires_at,omitempty"`
// contains filtered or unexported fields
}
Lease is the model entity for the Lease schema.
func (*Lease) Unwrap ¶
Unwrap unwraps the Lease 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 (*Lease) Update ¶
func (_m *Lease) Update() *LeaseUpdateOne
Update returns a builder for updating this Lease. Note that you need to call Lease.Unwrap() before calling this method if this Lease was returned from a transaction, and the transaction was committed or rolled back.
type LeaseClient ¶
type LeaseClient struct {
// contains filtered or unexported fields
}
LeaseClient is a client for the Lease schema.
func NewLeaseClient ¶
func NewLeaseClient(c config) *LeaseClient
NewLeaseClient returns a client for the Lease from the given config.
func (*LeaseClient) Create ¶
func (c *LeaseClient) Create() *LeaseCreate
Create returns a builder for creating a Lease entity.
func (*LeaseClient) CreateBulk ¶
func (c *LeaseClient) CreateBulk(builders ...*LeaseCreate) *LeaseCreateBulk
CreateBulk returns a builder for creating a bulk of Lease entities.
func (*LeaseClient) Delete ¶
func (c *LeaseClient) Delete() *LeaseDelete
Delete returns a delete builder for Lease.
func (*LeaseClient) DeleteOne ¶
func (c *LeaseClient) DeleteOne(_m *Lease) *LeaseDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LeaseClient) DeleteOneID ¶
func (c *LeaseClient) DeleteOneID(id int) *LeaseDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LeaseClient) GetX ¶
func (c *LeaseClient) GetX(ctx context.Context, id int) *Lease
GetX is like Get, but panics if an error occurs.
func (*LeaseClient) Intercept ¶
func (c *LeaseClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `lease.Intercept(f(g(h())))`.
func (*LeaseClient) Interceptors ¶
func (c *LeaseClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LeaseClient) MapCreateBulk ¶
func (c *LeaseClient) MapCreateBulk(slice any, setFunc func(*LeaseCreate, int)) *LeaseCreateBulk
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 (*LeaseClient) Query ¶
func (c *LeaseClient) Query() *LeaseQuery
Query returns a query builder for Lease.
func (*LeaseClient) Update ¶
func (c *LeaseClient) Update() *LeaseUpdate
Update returns an update builder for Lease.
func (*LeaseClient) UpdateOne ¶
func (c *LeaseClient) UpdateOne(_m *Lease) *LeaseUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LeaseClient) UpdateOneID ¶
func (c *LeaseClient) UpdateOneID(id int) *LeaseUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LeaseClient) Use ¶
func (c *LeaseClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `lease.Hooks(f(g(h())))`.
type LeaseCreate ¶
type LeaseCreate struct {
// contains filtered or unexported fields
}
LeaseCreate is the builder for creating a Lease entity.
func (*LeaseCreate) Exec ¶
func (_c *LeaseCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LeaseCreate) ExecX ¶
func (_c *LeaseCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LeaseCreate) Mutation ¶
func (_c *LeaseCreate) Mutation() *LeaseMutation
Mutation returns the LeaseMutation object of the builder.
func (*LeaseCreate) Save ¶
func (_c *LeaseCreate) Save(ctx context.Context) (*Lease, error)
Save creates the Lease in the database.
func (*LeaseCreate) SaveX ¶
func (_c *LeaseCreate) SaveX(ctx context.Context) *Lease
SaveX calls Save and panics if Save returns an error.
func (*LeaseCreate) SetExpiresAt ¶
func (_c *LeaseCreate) SetExpiresAt(v time.Time) *LeaseCreate
SetExpiresAt sets the "expires_at" field.
func (*LeaseCreate) SetName ¶
func (_c *LeaseCreate) SetName(v string) *LeaseCreate
SetName sets the "name" field.
func (*LeaseCreate) SetToken ¶
func (_c *LeaseCreate) SetToken(v string) *LeaseCreate
SetToken sets the "token" field.
type LeaseCreateBulk ¶
type LeaseCreateBulk struct {
// contains filtered or unexported fields
}
LeaseCreateBulk is the builder for creating many Lease entities in bulk.
func (*LeaseCreateBulk) Exec ¶
func (_c *LeaseCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LeaseCreateBulk) ExecX ¶
func (_c *LeaseCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LeaseDelete ¶
type LeaseDelete struct {
// contains filtered or unexported fields
}
LeaseDelete is the builder for deleting a Lease entity.
func (*LeaseDelete) Exec ¶
func (_d *LeaseDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LeaseDelete) ExecX ¶
func (_d *LeaseDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LeaseDelete) Where ¶
func (_d *LeaseDelete) Where(ps ...predicate.Lease) *LeaseDelete
Where appends a list predicates to the LeaseDelete builder.
type LeaseDeleteOne ¶
type LeaseDeleteOne struct {
// contains filtered or unexported fields
}
LeaseDeleteOne is the builder for deleting a single Lease entity.
func (*LeaseDeleteOne) Exec ¶
func (_d *LeaseDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LeaseDeleteOne) ExecX ¶
func (_d *LeaseDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LeaseDeleteOne) Where ¶
func (_d *LeaseDeleteOne) Where(ps ...predicate.Lease) *LeaseDeleteOne
Where appends a list predicates to the LeaseDelete builder.
type LeaseGroupBy ¶
type LeaseGroupBy struct {
// contains filtered or unexported fields
}
LeaseGroupBy is the group-by builder for Lease entities.
func (*LeaseGroupBy) Aggregate ¶
func (_g *LeaseGroupBy) Aggregate(fns ...AggregateFunc) *LeaseGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LeaseGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LeaseGroupBy) Scan ¶
func (_g *LeaseGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LeaseGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LeaseMutation ¶
type LeaseMutation struct {
// contains filtered or unexported fields
}
LeaseMutation represents an operation that mutates the Lease nodes in the graph.
func (*LeaseMutation) AddField ¶
func (m *LeaseMutation) 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 (*LeaseMutation) AddedEdges ¶
func (m *LeaseMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LeaseMutation) AddedField ¶
func (m *LeaseMutation) 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 (*LeaseMutation) AddedFields ¶
func (m *LeaseMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LeaseMutation) AddedIDs ¶
func (m *LeaseMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LeaseMutation) ClearEdge ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ClearField ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ClearedEdges ¶
func (m *LeaseMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LeaseMutation) ClearedFields ¶
func (m *LeaseMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LeaseMutation) Client ¶
func (m LeaseMutation) 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 (*LeaseMutation) EdgeCleared ¶
func (m *LeaseMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LeaseMutation) ExpiresAt ¶
func (m *LeaseMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*LeaseMutation) Field ¶
func (m *LeaseMutation) 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 (*LeaseMutation) FieldCleared ¶
func (m *LeaseMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LeaseMutation) Fields ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ID ¶
func (m *LeaseMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*LeaseMutation) IDs ¶
func (m *LeaseMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*LeaseMutation) Name ¶
func (m *LeaseMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*LeaseMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the Lease entity. If the Lease 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 (*LeaseMutation) 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 (*LeaseMutation) OldName ¶
func (m *LeaseMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Lease entity. If the Lease 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 (*LeaseMutation) OldToken ¶
func (m *LeaseMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the Lease entity. If the Lease 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 (*LeaseMutation) RemovedEdges ¶
func (m *LeaseMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LeaseMutation) RemovedIDs ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ResetEdge ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ResetExpiresAt ¶
func (m *LeaseMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*LeaseMutation) ResetField ¶
func (m *LeaseMutation) 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 (*LeaseMutation) ResetName ¶
func (m *LeaseMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*LeaseMutation) ResetToken ¶
func (m *LeaseMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*LeaseMutation) SetExpiresAt ¶
func (m *LeaseMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*LeaseMutation) SetField ¶
func (m *LeaseMutation) 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 (*LeaseMutation) SetName ¶
func (m *LeaseMutation) SetName(s string)
SetName sets the "name" field.
func (*LeaseMutation) SetOp ¶
func (m *LeaseMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*LeaseMutation) SetToken ¶
func (m *LeaseMutation) SetToken(s string)
SetToken sets the "token" field.
func (*LeaseMutation) Token ¶
func (m *LeaseMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (LeaseMutation) Tx ¶
func (m LeaseMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LeaseMutation) Type ¶
func (m *LeaseMutation) Type() string
Type returns the node type of this mutation (Lease).
func (*LeaseMutation) Where ¶
func (m *LeaseMutation) Where(ps ...predicate.Lease)
Where appends a list predicates to the LeaseMutation builder.
func (*LeaseMutation) WhereP ¶
func (m *LeaseMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LeaseMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LeaseQuery ¶
type LeaseQuery struct {
// contains filtered or unexported fields
}
LeaseQuery is the builder for querying Lease entities.
func (*LeaseQuery) Aggregate ¶
func (_q *LeaseQuery) Aggregate(fns ...AggregateFunc) *LeaseSelect
Aggregate returns a LeaseSelect configured with the given aggregations.
func (*LeaseQuery) All ¶
func (_q *LeaseQuery) All(ctx context.Context) ([]*Lease, error)
All executes the query and returns a list of Leases.
func (*LeaseQuery) AllX ¶
func (_q *LeaseQuery) AllX(ctx context.Context) []*Lease
AllX is like All, but panics if an error occurs.
func (*LeaseQuery) Clone ¶
func (_q *LeaseQuery) Clone() *LeaseQuery
Clone returns a duplicate of the LeaseQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LeaseQuery) Count ¶
func (_q *LeaseQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LeaseQuery) CountX ¶
func (_q *LeaseQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LeaseQuery) Exist ¶
func (_q *LeaseQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LeaseQuery) ExistX ¶
func (_q *LeaseQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LeaseQuery) First ¶
func (_q *LeaseQuery) First(ctx context.Context) (*Lease, error)
First returns the first Lease entity from the query. Returns a *NotFoundError when no Lease was found.
func (*LeaseQuery) FirstID ¶
func (_q *LeaseQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Lease ID from the query. Returns a *NotFoundError when no Lease ID was found.
func (*LeaseQuery) FirstIDX ¶
func (_q *LeaseQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*LeaseQuery) FirstX ¶
func (_q *LeaseQuery) FirstX(ctx context.Context) *Lease
FirstX is like First, but panics if an error occurs.
func (*LeaseQuery) GroupBy ¶
func (_q *LeaseQuery) GroupBy(field string, fields ...string) *LeaseGroupBy
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.Lease.Query().
GroupBy(lease.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*LeaseQuery) IDs ¶
func (_q *LeaseQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Lease IDs.
func (*LeaseQuery) IDsX ¶
func (_q *LeaseQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*LeaseQuery) Limit ¶
func (_q *LeaseQuery) Limit(limit int) *LeaseQuery
Limit the number of records to be returned by this query.
func (*LeaseQuery) Offset ¶
func (_q *LeaseQuery) Offset(offset int) *LeaseQuery
Offset to start from.
func (*LeaseQuery) Only ¶
func (_q *LeaseQuery) Only(ctx context.Context) (*Lease, error)
Only returns a single Lease entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Lease entity is found. Returns a *NotFoundError when no Lease entities are found.
func (*LeaseQuery) OnlyID ¶
func (_q *LeaseQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Lease ID in the query. Returns a *NotSingularError when more than one Lease ID is found. Returns a *NotFoundError when no entities are found.
func (*LeaseQuery) OnlyIDX ¶
func (_q *LeaseQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LeaseQuery) OnlyX ¶
func (_q *LeaseQuery) OnlyX(ctx context.Context) *Lease
OnlyX is like Only, but panics if an error occurs.
func (*LeaseQuery) Order ¶
func (_q *LeaseQuery) Order(o ...lease.OrderOption) *LeaseQuery
Order specifies how the records should be ordered.
func (*LeaseQuery) Select ¶
func (_q *LeaseQuery) Select(fields ...string) *LeaseSelect
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.Lease.Query().
Select(lease.FieldName).
Scan(ctx, &v)
func (*LeaseQuery) Unique ¶
func (_q *LeaseQuery) Unique(unique bool) *LeaseQuery
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 (*LeaseQuery) Where ¶
func (_q *LeaseQuery) Where(ps ...predicate.Lease) *LeaseQuery
Where adds a new predicate for the LeaseQuery builder.
type LeaseSelect ¶
type LeaseSelect struct {
*LeaseQuery
// contains filtered or unexported fields
}
LeaseSelect is the builder for selecting fields of Lease entities.
func (*LeaseSelect) Aggregate ¶
func (_s *LeaseSelect) Aggregate(fns ...AggregateFunc) *LeaseSelect
Aggregate adds the given aggregation functions to the selector query.
func (*LeaseSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LeaseSelect) Scan ¶
func (_s *LeaseSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LeaseSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LeaseUpdate ¶
type LeaseUpdate struct {
// contains filtered or unexported fields
}
LeaseUpdate is the builder for updating Lease entities.
func (*LeaseUpdate) Exec ¶
func (_u *LeaseUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LeaseUpdate) ExecX ¶
func (_u *LeaseUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LeaseUpdate) Mutation ¶
func (_u *LeaseUpdate) Mutation() *LeaseMutation
Mutation returns the LeaseMutation object of the builder.
func (*LeaseUpdate) Save ¶
func (_u *LeaseUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LeaseUpdate) SaveX ¶
func (_u *LeaseUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LeaseUpdate) SetExpiresAt ¶
func (_u *LeaseUpdate) SetExpiresAt(v time.Time) *LeaseUpdate
SetExpiresAt sets the "expires_at" field.
func (*LeaseUpdate) SetNillableExpiresAt ¶
func (_u *LeaseUpdate) SetNillableExpiresAt(v *time.Time) *LeaseUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*LeaseUpdate) SetNillableToken ¶
func (_u *LeaseUpdate) SetNillableToken(v *string) *LeaseUpdate
SetNillableToken sets the "token" field if the given value is not nil.
func (*LeaseUpdate) SetToken ¶
func (_u *LeaseUpdate) SetToken(v string) *LeaseUpdate
SetToken sets the "token" field.
func (*LeaseUpdate) Where ¶
func (_u *LeaseUpdate) Where(ps ...predicate.Lease) *LeaseUpdate
Where appends a list predicates to the LeaseUpdate builder.
type LeaseUpdateOne ¶
type LeaseUpdateOne struct {
// contains filtered or unexported fields
}
LeaseUpdateOne is the builder for updating a single Lease entity.
func (*LeaseUpdateOne) Exec ¶
func (_u *LeaseUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LeaseUpdateOne) ExecX ¶
func (_u *LeaseUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LeaseUpdateOne) Mutation ¶
func (_u *LeaseUpdateOne) Mutation() *LeaseMutation
Mutation returns the LeaseMutation object of the builder.
func (*LeaseUpdateOne) Save ¶
func (_u *LeaseUpdateOne) Save(ctx context.Context) (*Lease, error)
Save executes the query and returns the updated Lease entity.
func (*LeaseUpdateOne) SaveX ¶
func (_u *LeaseUpdateOne) SaveX(ctx context.Context) *Lease
SaveX is like Save, but panics if an error occurs.
func (*LeaseUpdateOne) Select ¶
func (_u *LeaseUpdateOne) Select(field string, fields ...string) *LeaseUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LeaseUpdateOne) SetExpiresAt ¶
func (_u *LeaseUpdateOne) SetExpiresAt(v time.Time) *LeaseUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*LeaseUpdateOne) SetNillableExpiresAt ¶
func (_u *LeaseUpdateOne) SetNillableExpiresAt(v *time.Time) *LeaseUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*LeaseUpdateOne) SetNillableToken ¶
func (_u *LeaseUpdateOne) SetNillableToken(v *string) *LeaseUpdateOne
SetNillableToken sets the "token" field if the given value is not nil.
func (*LeaseUpdateOne) SetToken ¶
func (_u *LeaseUpdateOne) SetToken(v string) *LeaseUpdateOne
SetToken sets the "token" field.
func (*LeaseUpdateOne) Where ¶
func (_u *LeaseUpdateOne) Where(ps ...predicate.Lease) *LeaseUpdateOne
Where appends a list predicates to the LeaseUpdate 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 {
// Binding is the client for interacting with the Binding builders.
Binding *BindingClient
// Connection is the client for interacting with the Connection builders.
Connection *ConnectionClient
// Credential is the client for interacting with the Credential builders.
Credential *CredentialClient
// Grant is the client for interacting with the Grant builders.
Grant *GrantClient
// Lease is the client for interacting with the Lease builders.
Lease *LeaseClient
// 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
¶
- binding.go
- binding_create.go
- binding_delete.go
- binding_query.go
- binding_update.go
- client.go
- connection.go
- connection_create.go
- connection_delete.go
- connection_query.go
- connection_update.go
- credential.go
- credential_create.go
- credential_delete.go
- credential_query.go
- credential_update.go
- ent.go
- grant.go
- grant_create.go
- grant_delete.go
- grant_query.go
- grant_update.go
- lease.go
- lease_create.go
- lease_delete.go
- lease_query.go
- lease_update.go
- mutation.go
- runtime.go
- tx.go