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 BalanceSnapshot
- type BalanceSnapshotClient
- func (c *BalanceSnapshotClient) Create() *BalanceSnapshotCreate
- func (c *BalanceSnapshotClient) CreateBulk(builders ...*BalanceSnapshotCreate) *BalanceSnapshotCreateBulk
- func (c *BalanceSnapshotClient) Delete() *BalanceSnapshotDelete
- func (c *BalanceSnapshotClient) DeleteOne(bs *BalanceSnapshot) *BalanceSnapshotDeleteOne
- func (c *BalanceSnapshotClient) DeleteOneID(id int) *BalanceSnapshotDeleteOne
- func (c *BalanceSnapshotClient) Get(ctx context.Context, id int) (*BalanceSnapshot, error)
- func (c *BalanceSnapshotClient) GetX(ctx context.Context, id int) *BalanceSnapshot
- func (c *BalanceSnapshotClient) Hooks() []Hook
- func (c *BalanceSnapshotClient) Intercept(interceptors ...Interceptor)
- func (c *BalanceSnapshotClient) Interceptors() []Interceptor
- func (c *BalanceSnapshotClient) MapCreateBulk(slice any, setFunc func(*BalanceSnapshotCreate, int)) *BalanceSnapshotCreateBulk
- func (c *BalanceSnapshotClient) Query() *BalanceSnapshotQuery
- func (c *BalanceSnapshotClient) Update() *BalanceSnapshotUpdate
- func (c *BalanceSnapshotClient) UpdateOne(bs *BalanceSnapshot) *BalanceSnapshotUpdateOne
- func (c *BalanceSnapshotClient) UpdateOneID(id int) *BalanceSnapshotUpdateOne
- func (c *BalanceSnapshotClient) Use(hooks ...Hook)
- type BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) Exec(ctx context.Context) error
- func (bsc *BalanceSnapshotCreate) ExecX(ctx context.Context)
- func (bsc *BalanceSnapshotCreate) Mutation() *BalanceSnapshotMutation
- func (bsc *BalanceSnapshotCreate) OnConflict(opts ...sql.ConflictOption) *BalanceSnapshotUpsertOne
- func (bsc *BalanceSnapshotCreate) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertOne
- func (bsc *BalanceSnapshotCreate) Save(ctx context.Context) (*BalanceSnapshot, error)
- func (bsc *BalanceSnapshotCreate) SaveX(ctx context.Context) *BalanceSnapshot
- func (bsc *BalanceSnapshotCreate) SetAt(t time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetBalance(f float64) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetCreatedAt(t time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetDeletedAt(t time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetGrantBalances(cbm credit.GrantBalanceMap) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetNamespace(s string) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetNillableCreatedAt(t *time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetNillableUpdatedAt(t *time.Time) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetOverage(f float64) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetOwnerID(co credit.GrantOwner) *BalanceSnapshotCreate
- func (bsc *BalanceSnapshotCreate) SetUpdatedAt(t time.Time) *BalanceSnapshotCreate
- type BalanceSnapshotCreateBulk
- func (bscb *BalanceSnapshotCreateBulk) Exec(ctx context.Context) error
- func (bscb *BalanceSnapshotCreateBulk) ExecX(ctx context.Context)
- func (bscb *BalanceSnapshotCreateBulk) OnConflict(opts ...sql.ConflictOption) *BalanceSnapshotUpsertBulk
- func (bscb *BalanceSnapshotCreateBulk) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertBulk
- func (bscb *BalanceSnapshotCreateBulk) Save(ctx context.Context) ([]*BalanceSnapshot, error)
- func (bscb *BalanceSnapshotCreateBulk) SaveX(ctx context.Context) []*BalanceSnapshot
- type BalanceSnapshotDelete
- type BalanceSnapshotDeleteOne
- type BalanceSnapshotGroupBy
- func (bsgb *BalanceSnapshotGroupBy) Aggregate(fns ...AggregateFunc) *BalanceSnapshotGroupBy
- func (s *BalanceSnapshotGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BalanceSnapshotGroupBy) BoolX(ctx context.Context) bool
- func (s *BalanceSnapshotGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BalanceSnapshotGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BalanceSnapshotGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BalanceSnapshotGroupBy) Float64X(ctx context.Context) float64
- func (s *BalanceSnapshotGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BalanceSnapshotGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BalanceSnapshotGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BalanceSnapshotGroupBy) IntX(ctx context.Context) int
- func (s *BalanceSnapshotGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BalanceSnapshotGroupBy) IntsX(ctx context.Context) []int
- func (bsgb *BalanceSnapshotGroupBy) Scan(ctx context.Context, v any) error
- func (s *BalanceSnapshotGroupBy) ScanX(ctx context.Context, v any)
- func (s *BalanceSnapshotGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BalanceSnapshotGroupBy) StringX(ctx context.Context) string
- func (s *BalanceSnapshotGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BalanceSnapshotGroupBy) StringsX(ctx context.Context) []string
- type BalanceSnapshotMutation
- func (m *BalanceSnapshotMutation) AddBalance(f float64)
- func (m *BalanceSnapshotMutation) AddField(name string, value ent.Value) error
- func (m *BalanceSnapshotMutation) AddOverage(f float64)
- func (m *BalanceSnapshotMutation) AddedBalance() (r float64, exists bool)
- func (m *BalanceSnapshotMutation) AddedEdges() []string
- func (m *BalanceSnapshotMutation) AddedField(name string) (ent.Value, bool)
- func (m *BalanceSnapshotMutation) AddedFields() []string
- func (m *BalanceSnapshotMutation) AddedIDs(name string) []ent.Value
- func (m *BalanceSnapshotMutation) AddedOverage() (r float64, exists bool)
- func (m *BalanceSnapshotMutation) At() (r time.Time, exists bool)
- func (m *BalanceSnapshotMutation) Balance() (r float64, exists bool)
- func (m *BalanceSnapshotMutation) ClearDeletedAt()
- func (m *BalanceSnapshotMutation) ClearEdge(name string) error
- func (m *BalanceSnapshotMutation) ClearField(name string) error
- func (m *BalanceSnapshotMutation) ClearedEdges() []string
- func (m *BalanceSnapshotMutation) ClearedFields() []string
- func (m BalanceSnapshotMutation) Client() *Client
- func (m *BalanceSnapshotMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BalanceSnapshotMutation) DeletedAt() (r time.Time, exists bool)
- func (m *BalanceSnapshotMutation) DeletedAtCleared() bool
- func (m *BalanceSnapshotMutation) EdgeCleared(name string) bool
- func (m *BalanceSnapshotMutation) Field(name string) (ent.Value, bool)
- func (m *BalanceSnapshotMutation) FieldCleared(name string) bool
- func (m *BalanceSnapshotMutation) Fields() []string
- func (m *BalanceSnapshotMutation) GrantBalances() (r credit.GrantBalanceMap, exists bool)
- func (m *BalanceSnapshotMutation) ID() (id int, exists bool)
- func (m *BalanceSnapshotMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BalanceSnapshotMutation) Namespace() (r string, exists bool)
- func (m *BalanceSnapshotMutation) OldAt(ctx context.Context) (v time.Time, err error)
- func (m *BalanceSnapshotMutation) OldBalance(ctx context.Context) (v float64, err error)
- func (m *BalanceSnapshotMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BalanceSnapshotMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)
- func (m *BalanceSnapshotMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BalanceSnapshotMutation) OldGrantBalances(ctx context.Context) (v credit.GrantBalanceMap, err error)
- func (m *BalanceSnapshotMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *BalanceSnapshotMutation) OldOverage(ctx context.Context) (v float64, err error)
- func (m *BalanceSnapshotMutation) OldOwnerID(ctx context.Context) (v credit.GrantOwner, err error)
- func (m *BalanceSnapshotMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BalanceSnapshotMutation) Op() Op
- func (m *BalanceSnapshotMutation) Overage() (r float64, exists bool)
- func (m *BalanceSnapshotMutation) OwnerID() (r credit.GrantOwner, exists bool)
- func (m *BalanceSnapshotMutation) RemovedEdges() []string
- func (m *BalanceSnapshotMutation) RemovedIDs(name string) []ent.Value
- func (m *BalanceSnapshotMutation) ResetAt()
- func (m *BalanceSnapshotMutation) ResetBalance()
- func (m *BalanceSnapshotMutation) ResetCreatedAt()
- func (m *BalanceSnapshotMutation) ResetDeletedAt()
- func (m *BalanceSnapshotMutation) ResetEdge(name string) error
- func (m *BalanceSnapshotMutation) ResetField(name string) error
- func (m *BalanceSnapshotMutation) ResetGrantBalances()
- func (m *BalanceSnapshotMutation) ResetNamespace()
- func (m *BalanceSnapshotMutation) ResetOverage()
- func (m *BalanceSnapshotMutation) ResetOwnerID()
- func (m *BalanceSnapshotMutation) ResetUpdatedAt()
- func (m *BalanceSnapshotMutation) SetAt(t time.Time)
- func (m *BalanceSnapshotMutation) SetBalance(f float64)
- func (m *BalanceSnapshotMutation) SetCreatedAt(t time.Time)
- func (m *BalanceSnapshotMutation) SetDeletedAt(t time.Time)
- func (m *BalanceSnapshotMutation) SetField(name string, value ent.Value) error
- func (m *BalanceSnapshotMutation) SetGrantBalances(cbm credit.GrantBalanceMap)
- func (m *BalanceSnapshotMutation) SetNamespace(s string)
- func (m *BalanceSnapshotMutation) SetOp(op Op)
- func (m *BalanceSnapshotMutation) SetOverage(f float64)
- func (m *BalanceSnapshotMutation) SetOwnerID(co credit.GrantOwner)
- func (m *BalanceSnapshotMutation) SetUpdatedAt(t time.Time)
- func (m BalanceSnapshotMutation) Tx() (*Tx, error)
- func (m *BalanceSnapshotMutation) Type() string
- func (m *BalanceSnapshotMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *BalanceSnapshotMutation) Where(ps ...predicate.BalanceSnapshot)
- func (m *BalanceSnapshotMutation) WhereP(ps ...func(*sql.Selector))
- type BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Aggregate(fns ...AggregateFunc) *BalanceSnapshotSelect
- func (bsq *BalanceSnapshotQuery) All(ctx context.Context) ([]*BalanceSnapshot, error)
- func (bsq *BalanceSnapshotQuery) AllX(ctx context.Context) []*BalanceSnapshot
- func (bsq *BalanceSnapshotQuery) Clone() *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Count(ctx context.Context) (int, error)
- func (bsq *BalanceSnapshotQuery) CountX(ctx context.Context) int
- func (bsq *BalanceSnapshotQuery) Exist(ctx context.Context) (bool, error)
- func (bsq *BalanceSnapshotQuery) ExistX(ctx context.Context) bool
- func (bsq *BalanceSnapshotQuery) First(ctx context.Context) (*BalanceSnapshot, error)
- func (bsq *BalanceSnapshotQuery) FirstID(ctx context.Context) (id int, err error)
- func (bsq *BalanceSnapshotQuery) FirstIDX(ctx context.Context) int
- func (bsq *BalanceSnapshotQuery) FirstX(ctx context.Context) *BalanceSnapshot
- func (bsq *BalanceSnapshotQuery) ForShare(opts ...sql.LockOption) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) ForUpdate(opts ...sql.LockOption) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) GroupBy(field string, fields ...string) *BalanceSnapshotGroupBy
- func (bsq *BalanceSnapshotQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bsq *BalanceSnapshotQuery) IDsX(ctx context.Context) []int
- func (bsq *BalanceSnapshotQuery) Limit(limit int) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Offset(offset int) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Only(ctx context.Context) (*BalanceSnapshot, error)
- func (bsq *BalanceSnapshotQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bsq *BalanceSnapshotQuery) OnlyIDX(ctx context.Context) int
- func (bsq *BalanceSnapshotQuery) OnlyX(ctx context.Context) *BalanceSnapshot
- func (bsq *BalanceSnapshotQuery) Order(o ...balancesnapshot.OrderOption) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Select(fields ...string) *BalanceSnapshotSelect
- func (bsq *BalanceSnapshotQuery) Unique(unique bool) *BalanceSnapshotQuery
- func (bsq *BalanceSnapshotQuery) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotQuery
- type BalanceSnapshotSelect
- func (bss *BalanceSnapshotSelect) Aggregate(fns ...AggregateFunc) *BalanceSnapshotSelect
- func (s *BalanceSnapshotSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BalanceSnapshotSelect) BoolX(ctx context.Context) bool
- func (s *BalanceSnapshotSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BalanceSnapshotSelect) BoolsX(ctx context.Context) []bool
- func (s *BalanceSnapshotSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BalanceSnapshotSelect) Float64X(ctx context.Context) float64
- func (s *BalanceSnapshotSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BalanceSnapshotSelect) Float64sX(ctx context.Context) []float64
- func (s *BalanceSnapshotSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BalanceSnapshotSelect) IntX(ctx context.Context) int
- func (s *BalanceSnapshotSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BalanceSnapshotSelect) IntsX(ctx context.Context) []int
- func (bss *BalanceSnapshotSelect) Scan(ctx context.Context, v any) error
- func (s *BalanceSnapshotSelect) ScanX(ctx context.Context, v any)
- func (s *BalanceSnapshotSelect) String(ctx context.Context) (_ string, err error)
- func (s *BalanceSnapshotSelect) StringX(ctx context.Context) string
- func (s *BalanceSnapshotSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BalanceSnapshotSelect) StringsX(ctx context.Context) []string
- type BalanceSnapshotUpdate
- func (bsu *BalanceSnapshotUpdate) ClearDeletedAt() *BalanceSnapshotUpdate
- func (bsu *BalanceSnapshotUpdate) Exec(ctx context.Context) error
- func (bsu *BalanceSnapshotUpdate) ExecX(ctx context.Context)
- func (bsu *BalanceSnapshotUpdate) Mutation() *BalanceSnapshotMutation
- func (bsu *BalanceSnapshotUpdate) Save(ctx context.Context) (int, error)
- func (bsu *BalanceSnapshotUpdate) SaveX(ctx context.Context) int
- func (bsu *BalanceSnapshotUpdate) SetDeletedAt(t time.Time) *BalanceSnapshotUpdate
- func (bsu *BalanceSnapshotUpdate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdate
- func (bsu *BalanceSnapshotUpdate) SetUpdatedAt(t time.Time) *BalanceSnapshotUpdate
- func (bsu *BalanceSnapshotUpdate) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotUpdate
- type BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) ClearDeletedAt() *BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) Exec(ctx context.Context) error
- func (bsuo *BalanceSnapshotUpdateOne) ExecX(ctx context.Context)
- func (bsuo *BalanceSnapshotUpdateOne) Mutation() *BalanceSnapshotMutation
- func (bsuo *BalanceSnapshotUpdateOne) Save(ctx context.Context) (*BalanceSnapshot, error)
- func (bsuo *BalanceSnapshotUpdateOne) SaveX(ctx context.Context) *BalanceSnapshot
- func (bsuo *BalanceSnapshotUpdateOne) Select(field string, fields ...string) *BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) SetDeletedAt(t time.Time) *BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) SetUpdatedAt(t time.Time) *BalanceSnapshotUpdateOne
- func (bsuo *BalanceSnapshotUpdateOne) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotUpdateOne
- type BalanceSnapshotUpsert
- func (u *BalanceSnapshotUpsert) ClearDeletedAt() *BalanceSnapshotUpsert
- func (u *BalanceSnapshotUpsert) SetDeletedAt(v time.Time) *BalanceSnapshotUpsert
- func (u *BalanceSnapshotUpsert) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsert
- func (u *BalanceSnapshotUpsert) UpdateDeletedAt() *BalanceSnapshotUpsert
- func (u *BalanceSnapshotUpsert) UpdateUpdatedAt() *BalanceSnapshotUpsert
- type BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) ClearDeletedAt() *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) DoNothing() *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) Exec(ctx context.Context) error
- func (u *BalanceSnapshotUpsertBulk) ExecX(ctx context.Context)
- func (u *BalanceSnapshotUpsertBulk) Ignore() *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) SetDeletedAt(v time.Time) *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) Update(set func(*BalanceSnapshotUpsert)) *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) UpdateDeletedAt() *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) UpdateNewValues() *BalanceSnapshotUpsertBulk
- func (u *BalanceSnapshotUpsertBulk) UpdateUpdatedAt() *BalanceSnapshotUpsertBulk
- type BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) ClearDeletedAt() *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) DoNothing() *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) Exec(ctx context.Context) error
- func (u *BalanceSnapshotUpsertOne) ExecX(ctx context.Context)
- func (u *BalanceSnapshotUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *BalanceSnapshotUpsertOne) IDX(ctx context.Context) int
- func (u *BalanceSnapshotUpsertOne) Ignore() *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) SetDeletedAt(v time.Time) *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) Update(set func(*BalanceSnapshotUpsert)) *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) UpdateDeletedAt() *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) UpdateNewValues() *BalanceSnapshotUpsertOne
- func (u *BalanceSnapshotUpsertOne) UpdateUpdatedAt() *BalanceSnapshotUpsertOne
- type BalanceSnapshots
- 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) GetConfig() *entutils.RawEntConfig
- func (c *Client) HijackTx(ctx context.Context, opts *sql.TxOptions) (context.Context, *entutils.RawEntConfig, *ExposedTxDriver, error)
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type ExposedTxDriver
- 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(gr *Grant) *GrantDeleteOne
- func (c *GrantClient) DeleteOneID(id string) *GrantDeleteOne
- func (c *GrantClient) Get(ctx context.Context, id string) (*Grant, error)
- func (c *GrantClient) GetX(ctx context.Context, id string) *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(gr *Grant) *GrantUpdateOne
- func (c *GrantClient) UpdateOneID(id string) *GrantUpdateOne
- func (c *GrantClient) Use(hooks ...Hook)
- type GrantCreate
- func (gc *GrantCreate) Exec(ctx context.Context) error
- func (gc *GrantCreate) ExecX(ctx context.Context)
- func (gc *GrantCreate) Mutation() *GrantMutation
- func (gc *GrantCreate) OnConflict(opts ...sql.ConflictOption) *GrantUpsertOne
- func (gc *GrantCreate) OnConflictColumns(columns ...string) *GrantUpsertOne
- func (gc *GrantCreate) Save(ctx context.Context) (*Grant, error)
- func (gc *GrantCreate) SaveX(ctx context.Context) *Grant
- func (gc *GrantCreate) SetAmount(f float64) *GrantCreate
- func (gc *GrantCreate) SetCreatedAt(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetDeletedAt(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetEffectiveAt(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetExpiration(cp credit.ExpirationPeriod) *GrantCreate
- func (gc *GrantCreate) SetExpiresAt(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetID(s string) *GrantCreate
- func (gc *GrantCreate) SetMetadata(m map[string]string) *GrantCreate
- func (gc *GrantCreate) SetNamespace(s string) *GrantCreate
- func (gc *GrantCreate) SetNillableCreatedAt(t *time.Time) *GrantCreate
- func (gc *GrantCreate) SetNillableDeletedAt(t *time.Time) *GrantCreate
- func (gc *GrantCreate) SetNillableID(s *string) *GrantCreate
- func (gc *GrantCreate) SetNillablePriority(u *uint8) *GrantCreate
- func (gc *GrantCreate) SetNillableRecurrenceAnchor(t *time.Time) *GrantCreate
- func (gc *GrantCreate) SetNillableRecurrencePeriod(ri *recurrence.RecurrenceInterval) *GrantCreate
- func (gc *GrantCreate) SetNillableUpdatedAt(t *time.Time) *GrantCreate
- func (gc *GrantCreate) SetNillableVoidedAt(t *time.Time) *GrantCreate
- func (gc *GrantCreate) SetOwnerID(co credit.GrantOwner) *GrantCreate
- func (gc *GrantCreate) SetPriority(u uint8) *GrantCreate
- func (gc *GrantCreate) SetRecurrenceAnchor(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetRecurrencePeriod(ri recurrence.RecurrenceInterval) *GrantCreate
- func (gc *GrantCreate) SetResetMaxRollover(f float64) *GrantCreate
- func (gc *GrantCreate) SetResetMinRollover(f float64) *GrantCreate
- func (gc *GrantCreate) SetUpdatedAt(t time.Time) *GrantCreate
- func (gc *GrantCreate) SetVoidedAt(t time.Time) *GrantCreate
- type GrantCreateBulk
- func (gcb *GrantCreateBulk) Exec(ctx context.Context) error
- func (gcb *GrantCreateBulk) ExecX(ctx context.Context)
- func (gcb *GrantCreateBulk) OnConflict(opts ...sql.ConflictOption) *GrantUpsertBulk
- func (gcb *GrantCreateBulk) OnConflictColumns(columns ...string) *GrantUpsertBulk
- func (gcb *GrantCreateBulk) Save(ctx context.Context) ([]*Grant, error)
- func (gcb *GrantCreateBulk) SaveX(ctx context.Context) []*Grant
- type GrantDelete
- type GrantDeleteOne
- type GrantGroupBy
- func (ggb *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 (ggb *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) AddAmount(f float64)
- func (m *GrantMutation) AddField(name string, value ent.Value) error
- func (m *GrantMutation) AddPriority(u int8)
- func (m *GrantMutation) AddResetMaxRollover(f float64)
- func (m *GrantMutation) AddResetMinRollover(f float64)
- func (m *GrantMutation) AddedAmount() (r float64, exists bool)
- 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) AddedPriority() (r int8, exists bool)
- func (m *GrantMutation) AddedResetMaxRollover() (r float64, exists bool)
- func (m *GrantMutation) AddedResetMinRollover() (r float64, exists bool)
- func (m *GrantMutation) Amount() (r float64, exists bool)
- func (m *GrantMutation) ClearDeletedAt()
- func (m *GrantMutation) ClearEdge(name string) error
- func (m *GrantMutation) ClearField(name string) error
- func (m *GrantMutation) ClearMetadata()
- func (m *GrantMutation) ClearRecurrenceAnchor()
- func (m *GrantMutation) ClearRecurrencePeriod()
- func (m *GrantMutation) ClearVoidedAt()
- func (m *GrantMutation) ClearedEdges() []string
- func (m *GrantMutation) ClearedFields() []string
- func (m GrantMutation) Client() *Client
- func (m *GrantMutation) CreatedAt() (r time.Time, exists bool)
- func (m *GrantMutation) DeletedAt() (r time.Time, exists bool)
- func (m *GrantMutation) DeletedAtCleared() bool
- func (m *GrantMutation) EdgeCleared(name string) bool
- func (m *GrantMutation) EffectiveAt() (r time.Time, exists bool)
- func (m *GrantMutation) Expiration() (r credit.ExpirationPeriod, exists bool)
- func (m *GrantMutation) ExpiresAt() (r time.Time, exists 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 string, exists bool)
- func (m *GrantMutation) IDs(ctx context.Context) ([]string, error)
- func (m *GrantMutation) Metadata() (r map[string]string, exists bool)
- func (m *GrantMutation) MetadataCleared() bool
- func (m *GrantMutation) Namespace() (r string, exists bool)
- func (m *GrantMutation) OldAmount(ctx context.Context) (v float64, err error)
- func (m *GrantMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GrantMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)
- func (m *GrantMutation) OldEffectiveAt(ctx context.Context) (v time.Time, err error)
- func (m *GrantMutation) OldExpiration(ctx context.Context) (v credit.ExpirationPeriod, err error)
- func (m *GrantMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *GrantMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GrantMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)
- func (m *GrantMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *GrantMutation) OldOwnerID(ctx context.Context) (v credit.GrantOwner, err error)
- func (m *GrantMutation) OldPriority(ctx context.Context) (v uint8, err error)
- func (m *GrantMutation) OldRecurrenceAnchor(ctx context.Context) (v *time.Time, err error)
- func (m *GrantMutation) OldRecurrencePeriod(ctx context.Context) (v *recurrence.RecurrenceInterval, err error)
- func (m *GrantMutation) OldResetMaxRollover(ctx context.Context) (v float64, err error)
- func (m *GrantMutation) OldResetMinRollover(ctx context.Context) (v float64, err error)
- func (m *GrantMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GrantMutation) OldVoidedAt(ctx context.Context) (v *time.Time, err error)
- func (m *GrantMutation) Op() Op
- func (m *GrantMutation) OwnerID() (r credit.GrantOwner, exists bool)
- func (m *GrantMutation) Priority() (r uint8, exists bool)
- func (m *GrantMutation) RecurrenceAnchor() (r time.Time, exists bool)
- func (m *GrantMutation) RecurrenceAnchorCleared() bool
- func (m *GrantMutation) RecurrencePeriod() (r recurrence.RecurrenceInterval, exists bool)
- func (m *GrantMutation) RecurrencePeriodCleared() bool
- func (m *GrantMutation) RemovedEdges() []string
- func (m *GrantMutation) RemovedIDs(name string) []ent.Value
- func (m *GrantMutation) ResetAmount()
- func (m *GrantMutation) ResetCreatedAt()
- func (m *GrantMutation) ResetDeletedAt()
- func (m *GrantMutation) ResetEdge(name string) error
- func (m *GrantMutation) ResetEffectiveAt()
- func (m *GrantMutation) ResetExpiration()
- func (m *GrantMutation) ResetExpiresAt()
- func (m *GrantMutation) ResetField(name string) error
- func (m *GrantMutation) ResetMaxRollover() (r float64, exists bool)
- func (m *GrantMutation) ResetMetadata()
- func (m *GrantMutation) ResetMinRollover() (r float64, exists bool)
- func (m *GrantMutation) ResetNamespace()
- func (m *GrantMutation) ResetOwnerID()
- func (m *GrantMutation) ResetPriority()
- func (m *GrantMutation) ResetRecurrenceAnchor()
- func (m *GrantMutation) ResetRecurrencePeriod()
- func (m *GrantMutation) ResetResetMaxRollover()
- func (m *GrantMutation) ResetResetMinRollover()
- func (m *GrantMutation) ResetUpdatedAt()
- func (m *GrantMutation) ResetVoidedAt()
- func (m *GrantMutation) SetAmount(f float64)
- func (m *GrantMutation) SetCreatedAt(t time.Time)
- func (m *GrantMutation) SetDeletedAt(t time.Time)
- func (m *GrantMutation) SetEffectiveAt(t time.Time)
- func (m *GrantMutation) SetExpiration(cp credit.ExpirationPeriod)
- func (m *GrantMutation) SetExpiresAt(t time.Time)
- func (m *GrantMutation) SetField(name string, value ent.Value) error
- func (m *GrantMutation) SetID(id string)
- func (m *GrantMutation) SetMetadata(value map[string]string)
- func (m *GrantMutation) SetNamespace(s string)
- func (m *GrantMutation) SetOp(op Op)
- func (m *GrantMutation) SetOwnerID(co credit.GrantOwner)
- func (m *GrantMutation) SetPriority(u uint8)
- func (m *GrantMutation) SetRecurrenceAnchor(t time.Time)
- func (m *GrantMutation) SetRecurrencePeriod(ri recurrence.RecurrenceInterval)
- func (m *GrantMutation) SetResetMaxRollover(f float64)
- func (m *GrantMutation) SetResetMinRollover(f float64)
- func (m *GrantMutation) SetUpdatedAt(t time.Time)
- func (m *GrantMutation) SetVoidedAt(t time.Time)
- func (m GrantMutation) Tx() (*Tx, error)
- func (m *GrantMutation) Type() string
- func (m *GrantMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *GrantMutation) VoidedAt() (r time.Time, exists bool)
- func (m *GrantMutation) VoidedAtCleared() bool
- func (m *GrantMutation) Where(ps ...predicate.Grant)
- func (m *GrantMutation) WhereP(ps ...func(*sql.Selector))
- type GrantQuery
- func (gq *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect
- func (gq *GrantQuery) All(ctx context.Context) ([]*Grant, error)
- func (gq *GrantQuery) AllX(ctx context.Context) []*Grant
- func (gq *GrantQuery) Clone() *GrantQuery
- func (gq *GrantQuery) Count(ctx context.Context) (int, error)
- func (gq *GrantQuery) CountX(ctx context.Context) int
- func (gq *GrantQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GrantQuery) ExistX(ctx context.Context) bool
- func (gq *GrantQuery) First(ctx context.Context) (*Grant, error)
- func (gq *GrantQuery) FirstID(ctx context.Context) (id string, err error)
- func (gq *GrantQuery) FirstIDX(ctx context.Context) string
- func (gq *GrantQuery) FirstX(ctx context.Context) *Grant
- func (gq *GrantQuery) ForShare(opts ...sql.LockOption) *GrantQuery
- func (gq *GrantQuery) ForUpdate(opts ...sql.LockOption) *GrantQuery
- func (gq *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy
- func (gq *GrantQuery) IDs(ctx context.Context) (ids []string, err error)
- func (gq *GrantQuery) IDsX(ctx context.Context) []string
- func (gq *GrantQuery) Limit(limit int) *GrantQuery
- func (gq *GrantQuery) Offset(offset int) *GrantQuery
- func (gq *GrantQuery) Only(ctx context.Context) (*Grant, error)
- func (gq *GrantQuery) OnlyID(ctx context.Context) (id string, err error)
- func (gq *GrantQuery) OnlyIDX(ctx context.Context) string
- func (gq *GrantQuery) OnlyX(ctx context.Context) *Grant
- func (gq *GrantQuery) Order(o ...grant.OrderOption) *GrantQuery
- func (gq *GrantQuery) Select(fields ...string) *GrantSelect
- func (gq *GrantQuery) Unique(unique bool) *GrantQuery
- func (gq *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery
- type GrantSelect
- func (gs *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 (gs *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 (gu *GrantUpdate) ClearDeletedAt() *GrantUpdate
- func (gu *GrantUpdate) ClearMetadata() *GrantUpdate
- func (gu *GrantUpdate) ClearVoidedAt() *GrantUpdate
- func (gu *GrantUpdate) Exec(ctx context.Context) error
- func (gu *GrantUpdate) ExecX(ctx context.Context)
- func (gu *GrantUpdate) Mutation() *GrantMutation
- func (gu *GrantUpdate) Save(ctx context.Context) (int, error)
- func (gu *GrantUpdate) SaveX(ctx context.Context) int
- func (gu *GrantUpdate) SetDeletedAt(t time.Time) *GrantUpdate
- func (gu *GrantUpdate) SetMetadata(m map[string]string) *GrantUpdate
- func (gu *GrantUpdate) SetNillableDeletedAt(t *time.Time) *GrantUpdate
- func (gu *GrantUpdate) SetNillableVoidedAt(t *time.Time) *GrantUpdate
- func (gu *GrantUpdate) SetUpdatedAt(t time.Time) *GrantUpdate
- func (gu *GrantUpdate) SetVoidedAt(t time.Time) *GrantUpdate
- func (gu *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate
- type GrantUpdateOne
- func (guo *GrantUpdateOne) ClearDeletedAt() *GrantUpdateOne
- func (guo *GrantUpdateOne) ClearMetadata() *GrantUpdateOne
- func (guo *GrantUpdateOne) ClearVoidedAt() *GrantUpdateOne
- func (guo *GrantUpdateOne) Exec(ctx context.Context) error
- func (guo *GrantUpdateOne) ExecX(ctx context.Context)
- func (guo *GrantUpdateOne) Mutation() *GrantMutation
- func (guo *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)
- func (guo *GrantUpdateOne) SaveX(ctx context.Context) *Grant
- func (guo *GrantUpdateOne) Select(field string, fields ...string) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetDeletedAt(t time.Time) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetMetadata(m map[string]string) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetNillableDeletedAt(t *time.Time) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetNillableVoidedAt(t *time.Time) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetUpdatedAt(t time.Time) *GrantUpdateOne
- func (guo *GrantUpdateOne) SetVoidedAt(t time.Time) *GrantUpdateOne
- func (guo *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne
- type GrantUpsert
- func (u *GrantUpsert) ClearDeletedAt() *GrantUpsert
- func (u *GrantUpsert) ClearMetadata() *GrantUpsert
- func (u *GrantUpsert) ClearVoidedAt() *GrantUpsert
- func (u *GrantUpsert) SetDeletedAt(v time.Time) *GrantUpsert
- func (u *GrantUpsert) SetMetadata(v map[string]string) *GrantUpsert
- func (u *GrantUpsert) SetUpdatedAt(v time.Time) *GrantUpsert
- func (u *GrantUpsert) SetVoidedAt(v time.Time) *GrantUpsert
- func (u *GrantUpsert) UpdateDeletedAt() *GrantUpsert
- func (u *GrantUpsert) UpdateMetadata() *GrantUpsert
- func (u *GrantUpsert) UpdateUpdatedAt() *GrantUpsert
- func (u *GrantUpsert) UpdateVoidedAt() *GrantUpsert
- type GrantUpsertBulk
- func (u *GrantUpsertBulk) ClearDeletedAt() *GrantUpsertBulk
- func (u *GrantUpsertBulk) ClearMetadata() *GrantUpsertBulk
- func (u *GrantUpsertBulk) ClearVoidedAt() *GrantUpsertBulk
- func (u *GrantUpsertBulk) DoNothing() *GrantUpsertBulk
- func (u *GrantUpsertBulk) Exec(ctx context.Context) error
- func (u *GrantUpsertBulk) ExecX(ctx context.Context)
- func (u *GrantUpsertBulk) Ignore() *GrantUpsertBulk
- func (u *GrantUpsertBulk) SetDeletedAt(v time.Time) *GrantUpsertBulk
- func (u *GrantUpsertBulk) SetMetadata(v map[string]string) *GrantUpsertBulk
- func (u *GrantUpsertBulk) SetUpdatedAt(v time.Time) *GrantUpsertBulk
- func (u *GrantUpsertBulk) SetVoidedAt(v time.Time) *GrantUpsertBulk
- func (u *GrantUpsertBulk) Update(set func(*GrantUpsert)) *GrantUpsertBulk
- func (u *GrantUpsertBulk) UpdateDeletedAt() *GrantUpsertBulk
- func (u *GrantUpsertBulk) UpdateMetadata() *GrantUpsertBulk
- func (u *GrantUpsertBulk) UpdateNewValues() *GrantUpsertBulk
- func (u *GrantUpsertBulk) UpdateUpdatedAt() *GrantUpsertBulk
- func (u *GrantUpsertBulk) UpdateVoidedAt() *GrantUpsertBulk
- type GrantUpsertOne
- func (u *GrantUpsertOne) ClearDeletedAt() *GrantUpsertOne
- func (u *GrantUpsertOne) ClearMetadata() *GrantUpsertOne
- func (u *GrantUpsertOne) ClearVoidedAt() *GrantUpsertOne
- func (u *GrantUpsertOne) DoNothing() *GrantUpsertOne
- func (u *GrantUpsertOne) Exec(ctx context.Context) error
- func (u *GrantUpsertOne) ExecX(ctx context.Context)
- func (u *GrantUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *GrantUpsertOne) IDX(ctx context.Context) string
- func (u *GrantUpsertOne) Ignore() *GrantUpsertOne
- func (u *GrantUpsertOne) SetDeletedAt(v time.Time) *GrantUpsertOne
- func (u *GrantUpsertOne) SetMetadata(v map[string]string) *GrantUpsertOne
- func (u *GrantUpsertOne) SetUpdatedAt(v time.Time) *GrantUpsertOne
- func (u *GrantUpsertOne) SetVoidedAt(v time.Time) *GrantUpsertOne
- func (u *GrantUpsertOne) Update(set func(*GrantUpsert)) *GrantUpsertOne
- func (u *GrantUpsertOne) UpdateDeletedAt() *GrantUpsertOne
- func (u *GrantUpsertOne) UpdateMetadata() *GrantUpsertOne
- func (u *GrantUpsertOne) UpdateNewValues() *GrantUpsertOne
- func (u *GrantUpsertOne) UpdateUpdatedAt() *GrantUpsertOne
- func (u *GrantUpsertOne) UpdateVoidedAt() *GrantUpsertOne
- type Grants
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type 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. TypeBalanceSnapshot = "BalanceSnapshot" TypeGrant = "Grant" )
Variables ¶
var ErrTxStarted = errors.New("db: 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(db.As(db.Sum(field1), "sum_field1"), (db.As(db.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 BalanceSnapshot ¶
type BalanceSnapshot struct { // ID of the ent. ID int `json:"id,omitempty"` // Namespace holds the value of the "namespace" field. Namespace string `json:"namespace,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"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt *time.Time `json:"deleted_at,omitempty"` // OwnerID holds the value of the "owner_id" field. OwnerID credit.GrantOwner `json:"owner_id,omitempty"` // GrantBalances holds the value of the "grant_balances" field. GrantBalances credit.GrantBalanceMap `json:"grant_balances,omitempty"` // Balance holds the value of the "balance" field. Balance float64 `json:"balance,omitempty"` // Overage holds the value of the "overage" field. Overage float64 `json:"overage,omitempty"` // At holds the value of the "at" field. At time.Time `json:"at,omitempty"` // contains filtered or unexported fields }
BalanceSnapshot is the model entity for the BalanceSnapshot schema.
func (*BalanceSnapshot) String ¶
func (bs *BalanceSnapshot) String() string
String implements the fmt.Stringer.
func (*BalanceSnapshot) Unwrap ¶
func (bs *BalanceSnapshot) Unwrap() *BalanceSnapshot
Unwrap unwraps the BalanceSnapshot 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 (*BalanceSnapshot) Update ¶
func (bs *BalanceSnapshot) Update() *BalanceSnapshotUpdateOne
Update returns a builder for updating this BalanceSnapshot. Note that you need to call BalanceSnapshot.Unwrap() before calling this method if this BalanceSnapshot was returned from a transaction, and the transaction was committed or rolled back.
type BalanceSnapshotClient ¶
type BalanceSnapshotClient struct {
// contains filtered or unexported fields
}
BalanceSnapshotClient is a client for the BalanceSnapshot schema.
func NewBalanceSnapshotClient ¶
func NewBalanceSnapshotClient(c config) *BalanceSnapshotClient
NewBalanceSnapshotClient returns a client for the BalanceSnapshot from the given config.
func (*BalanceSnapshotClient) Create ¶
func (c *BalanceSnapshotClient) Create() *BalanceSnapshotCreate
Create returns a builder for creating a BalanceSnapshot entity.
func (*BalanceSnapshotClient) CreateBulk ¶
func (c *BalanceSnapshotClient) CreateBulk(builders ...*BalanceSnapshotCreate) *BalanceSnapshotCreateBulk
CreateBulk returns a builder for creating a bulk of BalanceSnapshot entities.
func (*BalanceSnapshotClient) Delete ¶
func (c *BalanceSnapshotClient) Delete() *BalanceSnapshotDelete
Delete returns a delete builder for BalanceSnapshot.
func (*BalanceSnapshotClient) DeleteOne ¶
func (c *BalanceSnapshotClient) DeleteOne(bs *BalanceSnapshot) *BalanceSnapshotDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BalanceSnapshotClient) DeleteOneID ¶
func (c *BalanceSnapshotClient) DeleteOneID(id int) *BalanceSnapshotDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BalanceSnapshotClient) Get ¶
func (c *BalanceSnapshotClient) Get(ctx context.Context, id int) (*BalanceSnapshot, error)
Get returns a BalanceSnapshot entity by its id.
func (*BalanceSnapshotClient) GetX ¶
func (c *BalanceSnapshotClient) GetX(ctx context.Context, id int) *BalanceSnapshot
GetX is like Get, but panics if an error occurs.
func (*BalanceSnapshotClient) Hooks ¶
func (c *BalanceSnapshotClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BalanceSnapshotClient) Intercept ¶
func (c *BalanceSnapshotClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `balancesnapshot.Intercept(f(g(h())))`.
func (*BalanceSnapshotClient) Interceptors ¶
func (c *BalanceSnapshotClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BalanceSnapshotClient) MapCreateBulk ¶
func (c *BalanceSnapshotClient) MapCreateBulk(slice any, setFunc func(*BalanceSnapshotCreate, int)) *BalanceSnapshotCreateBulk
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 (*BalanceSnapshotClient) Query ¶
func (c *BalanceSnapshotClient) Query() *BalanceSnapshotQuery
Query returns a query builder for BalanceSnapshot.
func (*BalanceSnapshotClient) Update ¶
func (c *BalanceSnapshotClient) Update() *BalanceSnapshotUpdate
Update returns an update builder for BalanceSnapshot.
func (*BalanceSnapshotClient) UpdateOne ¶
func (c *BalanceSnapshotClient) UpdateOne(bs *BalanceSnapshot) *BalanceSnapshotUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BalanceSnapshotClient) UpdateOneID ¶
func (c *BalanceSnapshotClient) UpdateOneID(id int) *BalanceSnapshotUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BalanceSnapshotClient) Use ¶
func (c *BalanceSnapshotClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `balancesnapshot.Hooks(f(g(h())))`.
type BalanceSnapshotCreate ¶
type BalanceSnapshotCreate struct {
// contains filtered or unexported fields
}
BalanceSnapshotCreate is the builder for creating a BalanceSnapshot entity.
func (*BalanceSnapshotCreate) Exec ¶
func (bsc *BalanceSnapshotCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BalanceSnapshotCreate) ExecX ¶
func (bsc *BalanceSnapshotCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotCreate) Mutation ¶
func (bsc *BalanceSnapshotCreate) Mutation() *BalanceSnapshotMutation
Mutation returns the BalanceSnapshotMutation object of the builder.
func (*BalanceSnapshotCreate) OnConflict ¶
func (bsc *BalanceSnapshotCreate) OnConflict(opts ...sql.ConflictOption) *BalanceSnapshotUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.BalanceSnapshot.Create(). SetNamespace(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BalanceSnapshotUpsert) { SetNamespace(v+v). }). Exec(ctx)
func (*BalanceSnapshotCreate) OnConflictColumns ¶
func (bsc *BalanceSnapshotCreate) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BalanceSnapshotCreate) Save ¶
func (bsc *BalanceSnapshotCreate) Save(ctx context.Context) (*BalanceSnapshot, error)
Save creates the BalanceSnapshot in the database.
func (*BalanceSnapshotCreate) SaveX ¶
func (bsc *BalanceSnapshotCreate) SaveX(ctx context.Context) *BalanceSnapshot
SaveX calls Save and panics if Save returns an error.
func (*BalanceSnapshotCreate) SetAt ¶
func (bsc *BalanceSnapshotCreate) SetAt(t time.Time) *BalanceSnapshotCreate
SetAt sets the "at" field.
func (*BalanceSnapshotCreate) SetBalance ¶
func (bsc *BalanceSnapshotCreate) SetBalance(f float64) *BalanceSnapshotCreate
SetBalance sets the "balance" field.
func (*BalanceSnapshotCreate) SetCreatedAt ¶
func (bsc *BalanceSnapshotCreate) SetCreatedAt(t time.Time) *BalanceSnapshotCreate
SetCreatedAt sets the "created_at" field.
func (*BalanceSnapshotCreate) SetDeletedAt ¶
func (bsc *BalanceSnapshotCreate) SetDeletedAt(t time.Time) *BalanceSnapshotCreate
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotCreate) SetGrantBalances ¶
func (bsc *BalanceSnapshotCreate) SetGrantBalances(cbm credit.GrantBalanceMap) *BalanceSnapshotCreate
SetGrantBalances sets the "grant_balances" field.
func (*BalanceSnapshotCreate) SetNamespace ¶
func (bsc *BalanceSnapshotCreate) SetNamespace(s string) *BalanceSnapshotCreate
SetNamespace sets the "namespace" field.
func (*BalanceSnapshotCreate) SetNillableCreatedAt ¶
func (bsc *BalanceSnapshotCreate) SetNillableCreatedAt(t *time.Time) *BalanceSnapshotCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BalanceSnapshotCreate) SetNillableDeletedAt ¶
func (bsc *BalanceSnapshotCreate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*BalanceSnapshotCreate) SetNillableUpdatedAt ¶
func (bsc *BalanceSnapshotCreate) SetNillableUpdatedAt(t *time.Time) *BalanceSnapshotCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*BalanceSnapshotCreate) SetOverage ¶
func (bsc *BalanceSnapshotCreate) SetOverage(f float64) *BalanceSnapshotCreate
SetOverage sets the "overage" field.
func (*BalanceSnapshotCreate) SetOwnerID ¶
func (bsc *BalanceSnapshotCreate) SetOwnerID(co credit.GrantOwner) *BalanceSnapshotCreate
SetOwnerID sets the "owner_id" field.
func (*BalanceSnapshotCreate) SetUpdatedAt ¶
func (bsc *BalanceSnapshotCreate) SetUpdatedAt(t time.Time) *BalanceSnapshotCreate
SetUpdatedAt sets the "updated_at" field.
type BalanceSnapshotCreateBulk ¶
type BalanceSnapshotCreateBulk struct {
// contains filtered or unexported fields
}
BalanceSnapshotCreateBulk is the builder for creating many BalanceSnapshot entities in bulk.
func (*BalanceSnapshotCreateBulk) Exec ¶
func (bscb *BalanceSnapshotCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BalanceSnapshotCreateBulk) ExecX ¶
func (bscb *BalanceSnapshotCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotCreateBulk) OnConflict ¶
func (bscb *BalanceSnapshotCreateBulk) OnConflict(opts ...sql.ConflictOption) *BalanceSnapshotUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.BalanceSnapshot.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BalanceSnapshotUpsert) { SetNamespace(v+v). }). Exec(ctx)
func (*BalanceSnapshotCreateBulk) OnConflictColumns ¶
func (bscb *BalanceSnapshotCreateBulk) OnConflictColumns(columns ...string) *BalanceSnapshotUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BalanceSnapshotCreateBulk) Save ¶
func (bscb *BalanceSnapshotCreateBulk) Save(ctx context.Context) ([]*BalanceSnapshot, error)
Save creates the BalanceSnapshot entities in the database.
func (*BalanceSnapshotCreateBulk) SaveX ¶
func (bscb *BalanceSnapshotCreateBulk) SaveX(ctx context.Context) []*BalanceSnapshot
SaveX is like Save, but panics if an error occurs.
type BalanceSnapshotDelete ¶
type BalanceSnapshotDelete struct {
// contains filtered or unexported fields
}
BalanceSnapshotDelete is the builder for deleting a BalanceSnapshot entity.
func (*BalanceSnapshotDelete) Exec ¶
func (bsd *BalanceSnapshotDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BalanceSnapshotDelete) ExecX ¶
func (bsd *BalanceSnapshotDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotDelete) Where ¶
func (bsd *BalanceSnapshotDelete) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotDelete
Where appends a list predicates to the BalanceSnapshotDelete builder.
type BalanceSnapshotDeleteOne ¶
type BalanceSnapshotDeleteOne struct {
// contains filtered or unexported fields
}
BalanceSnapshotDeleteOne is the builder for deleting a single BalanceSnapshot entity.
func (*BalanceSnapshotDeleteOne) Exec ¶
func (bsdo *BalanceSnapshotDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BalanceSnapshotDeleteOne) ExecX ¶
func (bsdo *BalanceSnapshotDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotDeleteOne) Where ¶
func (bsdo *BalanceSnapshotDeleteOne) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotDeleteOne
Where appends a list predicates to the BalanceSnapshotDelete builder.
type BalanceSnapshotGroupBy ¶
type BalanceSnapshotGroupBy struct {
// contains filtered or unexported fields
}
BalanceSnapshotGroupBy is the group-by builder for BalanceSnapshot entities.
func (*BalanceSnapshotGroupBy) Aggregate ¶
func (bsgb *BalanceSnapshotGroupBy) Aggregate(fns ...AggregateFunc) *BalanceSnapshotGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BalanceSnapshotGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*BalanceSnapshotGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotGroupBy) Scan ¶
func (bsgb *BalanceSnapshotGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BalanceSnapshotGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BalanceSnapshotMutation ¶
type BalanceSnapshotMutation struct {
// contains filtered or unexported fields
}
BalanceSnapshotMutation represents an operation that mutates the BalanceSnapshot nodes in the graph.
func (*BalanceSnapshotMutation) AddBalance ¶
func (m *BalanceSnapshotMutation) AddBalance(f float64)
AddBalance adds f to the "balance" field.
func (*BalanceSnapshotMutation) AddField ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) AddOverage ¶
func (m *BalanceSnapshotMutation) AddOverage(f float64)
AddOverage adds f to the "overage" field.
func (*BalanceSnapshotMutation) AddedBalance ¶
func (m *BalanceSnapshotMutation) AddedBalance() (r float64, exists bool)
AddedBalance returns the value that was added to the "balance" field in this mutation.
func (*BalanceSnapshotMutation) AddedEdges ¶
func (m *BalanceSnapshotMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BalanceSnapshotMutation) AddedField ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) AddedFields ¶
func (m *BalanceSnapshotMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BalanceSnapshotMutation) AddedIDs ¶
func (m *BalanceSnapshotMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BalanceSnapshotMutation) AddedOverage ¶
func (m *BalanceSnapshotMutation) AddedOverage() (r float64, exists bool)
AddedOverage returns the value that was added to the "overage" field in this mutation.
func (*BalanceSnapshotMutation) At ¶
func (m *BalanceSnapshotMutation) At() (r time.Time, exists bool)
At returns the value of the "at" field in the mutation.
func (*BalanceSnapshotMutation) Balance ¶
func (m *BalanceSnapshotMutation) Balance() (r float64, exists bool)
Balance returns the value of the "balance" field in the mutation.
func (*BalanceSnapshotMutation) ClearDeletedAt ¶
func (m *BalanceSnapshotMutation) ClearDeletedAt()
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotMutation) ClearEdge ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ClearField ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ClearedEdges ¶
func (m *BalanceSnapshotMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BalanceSnapshotMutation) ClearedFields ¶
func (m *BalanceSnapshotMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BalanceSnapshotMutation) Client ¶
func (m BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) CreatedAt ¶
func (m *BalanceSnapshotMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*BalanceSnapshotMutation) DeletedAt ¶
func (m *BalanceSnapshotMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*BalanceSnapshotMutation) DeletedAtCleared ¶
func (m *BalanceSnapshotMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
func (*BalanceSnapshotMutation) EdgeCleared ¶
func (m *BalanceSnapshotMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BalanceSnapshotMutation) Field ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) FieldCleared ¶
func (m *BalanceSnapshotMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BalanceSnapshotMutation) Fields ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) GrantBalances ¶
func (m *BalanceSnapshotMutation) GrantBalances() (r credit.GrantBalanceMap, exists bool)
GrantBalances returns the value of the "grant_balances" field in the mutation.
func (*BalanceSnapshotMutation) ID ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) IDs ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) Namespace ¶
func (m *BalanceSnapshotMutation) Namespace() (r string, exists bool)
Namespace returns the value of the "namespace" field in the mutation.
func (*BalanceSnapshotMutation) OldAt ¶
OldAt returns the old "at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldBalance ¶
func (m *BalanceSnapshotMutation) OldBalance(ctx context.Context) (v float64, err error)
OldBalance returns the old "balance" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldDeletedAt ¶
OldDeletedAt returns the old "deleted_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) OldGrantBalances ¶
func (m *BalanceSnapshotMutation) OldGrantBalances(ctx context.Context) (v credit.GrantBalanceMap, err error)
OldGrantBalances returns the old "grant_balances" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldNamespace ¶
func (m *BalanceSnapshotMutation) OldNamespace(ctx context.Context) (v string, err error)
OldNamespace returns the old "namespace" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldOverage ¶
func (m *BalanceSnapshotMutation) OldOverage(ctx context.Context) (v float64, err error)
OldOverage returns the old "overage" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldOwnerID ¶
func (m *BalanceSnapshotMutation) OldOwnerID(ctx context.Context) (v credit.GrantOwner, err error)
OldOwnerID returns the old "owner_id" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the BalanceSnapshot entity. If the BalanceSnapshot 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 (*BalanceSnapshotMutation) Op ¶
func (m *BalanceSnapshotMutation) Op() Op
Op returns the operation name.
func (*BalanceSnapshotMutation) Overage ¶
func (m *BalanceSnapshotMutation) Overage() (r float64, exists bool)
Overage returns the value of the "overage" field in the mutation.
func (*BalanceSnapshotMutation) OwnerID ¶
func (m *BalanceSnapshotMutation) OwnerID() (r credit.GrantOwner, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*BalanceSnapshotMutation) RemovedEdges ¶
func (m *BalanceSnapshotMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BalanceSnapshotMutation) RemovedIDs ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetAt ¶
func (m *BalanceSnapshotMutation) ResetAt()
ResetAt resets all changes to the "at" field.
func (*BalanceSnapshotMutation) ResetBalance ¶
func (m *BalanceSnapshotMutation) ResetBalance()
ResetBalance resets all changes to the "balance" field.
func (*BalanceSnapshotMutation) ResetCreatedAt ¶
func (m *BalanceSnapshotMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*BalanceSnapshotMutation) ResetDeletedAt ¶
func (m *BalanceSnapshotMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*BalanceSnapshotMutation) ResetEdge ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetField ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) ResetGrantBalances ¶
func (m *BalanceSnapshotMutation) ResetGrantBalances()
ResetGrantBalances resets all changes to the "grant_balances" field.
func (*BalanceSnapshotMutation) ResetNamespace ¶
func (m *BalanceSnapshotMutation) ResetNamespace()
ResetNamespace resets all changes to the "namespace" field.
func (*BalanceSnapshotMutation) ResetOverage ¶
func (m *BalanceSnapshotMutation) ResetOverage()
ResetOverage resets all changes to the "overage" field.
func (*BalanceSnapshotMutation) ResetOwnerID ¶
func (m *BalanceSnapshotMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*BalanceSnapshotMutation) ResetUpdatedAt ¶
func (m *BalanceSnapshotMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*BalanceSnapshotMutation) SetAt ¶
func (m *BalanceSnapshotMutation) SetAt(t time.Time)
SetAt sets the "at" field.
func (*BalanceSnapshotMutation) SetBalance ¶
func (m *BalanceSnapshotMutation) SetBalance(f float64)
SetBalance sets the "balance" field.
func (*BalanceSnapshotMutation) SetCreatedAt ¶
func (m *BalanceSnapshotMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*BalanceSnapshotMutation) SetDeletedAt ¶
func (m *BalanceSnapshotMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotMutation) SetField ¶
func (m *BalanceSnapshotMutation) 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 (*BalanceSnapshotMutation) SetGrantBalances ¶
func (m *BalanceSnapshotMutation) SetGrantBalances(cbm credit.GrantBalanceMap)
SetGrantBalances sets the "grant_balances" field.
func (*BalanceSnapshotMutation) SetNamespace ¶
func (m *BalanceSnapshotMutation) SetNamespace(s string)
SetNamespace sets the "namespace" field.
func (*BalanceSnapshotMutation) SetOp ¶
func (m *BalanceSnapshotMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BalanceSnapshotMutation) SetOverage ¶
func (m *BalanceSnapshotMutation) SetOverage(f float64)
SetOverage sets the "overage" field.
func (*BalanceSnapshotMutation) SetOwnerID ¶
func (m *BalanceSnapshotMutation) SetOwnerID(co credit.GrantOwner)
SetOwnerID sets the "owner_id" field.
func (*BalanceSnapshotMutation) SetUpdatedAt ¶
func (m *BalanceSnapshotMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (BalanceSnapshotMutation) Tx ¶
func (m BalanceSnapshotMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BalanceSnapshotMutation) Type ¶
func (m *BalanceSnapshotMutation) Type() string
Type returns the node type of this mutation (BalanceSnapshot).
func (*BalanceSnapshotMutation) UpdatedAt ¶
func (m *BalanceSnapshotMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*BalanceSnapshotMutation) Where ¶
func (m *BalanceSnapshotMutation) Where(ps ...predicate.BalanceSnapshot)
Where appends a list predicates to the BalanceSnapshotMutation builder.
func (*BalanceSnapshotMutation) WhereP ¶
func (m *BalanceSnapshotMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BalanceSnapshotMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BalanceSnapshotQuery ¶
type BalanceSnapshotQuery struct {
// contains filtered or unexported fields
}
BalanceSnapshotQuery is the builder for querying BalanceSnapshot entities.
func (*BalanceSnapshotQuery) Aggregate ¶
func (bsq *BalanceSnapshotQuery) Aggregate(fns ...AggregateFunc) *BalanceSnapshotSelect
Aggregate returns a BalanceSnapshotSelect configured with the given aggregations.
func (*BalanceSnapshotQuery) All ¶
func (bsq *BalanceSnapshotQuery) All(ctx context.Context) ([]*BalanceSnapshot, error)
All executes the query and returns a list of BalanceSnapshots.
func (*BalanceSnapshotQuery) AllX ¶
func (bsq *BalanceSnapshotQuery) AllX(ctx context.Context) []*BalanceSnapshot
AllX is like All, but panics if an error occurs.
func (*BalanceSnapshotQuery) Clone ¶
func (bsq *BalanceSnapshotQuery) Clone() *BalanceSnapshotQuery
Clone returns a duplicate of the BalanceSnapshotQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BalanceSnapshotQuery) Count ¶
func (bsq *BalanceSnapshotQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BalanceSnapshotQuery) CountX ¶
func (bsq *BalanceSnapshotQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BalanceSnapshotQuery) Exist ¶
func (bsq *BalanceSnapshotQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BalanceSnapshotQuery) ExistX ¶
func (bsq *BalanceSnapshotQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BalanceSnapshotQuery) First ¶
func (bsq *BalanceSnapshotQuery) First(ctx context.Context) (*BalanceSnapshot, error)
First returns the first BalanceSnapshot entity from the query. Returns a *NotFoundError when no BalanceSnapshot was found.
func (*BalanceSnapshotQuery) FirstID ¶
func (bsq *BalanceSnapshotQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first BalanceSnapshot ID from the query. Returns a *NotFoundError when no BalanceSnapshot ID was found.
func (*BalanceSnapshotQuery) FirstIDX ¶
func (bsq *BalanceSnapshotQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BalanceSnapshotQuery) FirstX ¶
func (bsq *BalanceSnapshotQuery) FirstX(ctx context.Context) *BalanceSnapshot
FirstX is like First, but panics if an error occurs.
func (*BalanceSnapshotQuery) ForShare ¶
func (bsq *BalanceSnapshotQuery) ForShare(opts ...sql.LockOption) *BalanceSnapshotQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*BalanceSnapshotQuery) ForUpdate ¶
func (bsq *BalanceSnapshotQuery) ForUpdate(opts ...sql.LockOption) *BalanceSnapshotQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*BalanceSnapshotQuery) GroupBy ¶
func (bsq *BalanceSnapshotQuery) GroupBy(field string, fields ...string) *BalanceSnapshotGroupBy
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 { Namespace string `json:"namespace,omitempty"` Count int `json:"count,omitempty"` } client.BalanceSnapshot.Query(). GroupBy(balancesnapshot.FieldNamespace). Aggregate(db.Count()). Scan(ctx, &v)
func (*BalanceSnapshotQuery) IDs ¶
func (bsq *BalanceSnapshotQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of BalanceSnapshot IDs.
func (*BalanceSnapshotQuery) IDsX ¶
func (bsq *BalanceSnapshotQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BalanceSnapshotQuery) Limit ¶
func (bsq *BalanceSnapshotQuery) Limit(limit int) *BalanceSnapshotQuery
Limit the number of records to be returned by this query.
func (*BalanceSnapshotQuery) Offset ¶
func (bsq *BalanceSnapshotQuery) Offset(offset int) *BalanceSnapshotQuery
Offset to start from.
func (*BalanceSnapshotQuery) Only ¶
func (bsq *BalanceSnapshotQuery) Only(ctx context.Context) (*BalanceSnapshot, error)
Only returns a single BalanceSnapshot entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one BalanceSnapshot entity is found. Returns a *NotFoundError when no BalanceSnapshot entities are found.
func (*BalanceSnapshotQuery) OnlyID ¶
func (bsq *BalanceSnapshotQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only BalanceSnapshot ID in the query. Returns a *NotSingularError when more than one BalanceSnapshot ID is found. Returns a *NotFoundError when no entities are found.
func (*BalanceSnapshotQuery) OnlyIDX ¶
func (bsq *BalanceSnapshotQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BalanceSnapshotQuery) OnlyX ¶
func (bsq *BalanceSnapshotQuery) OnlyX(ctx context.Context) *BalanceSnapshot
OnlyX is like Only, but panics if an error occurs.
func (*BalanceSnapshotQuery) Order ¶
func (bsq *BalanceSnapshotQuery) Order(o ...balancesnapshot.OrderOption) *BalanceSnapshotQuery
Order specifies how the records should be ordered.
func (*BalanceSnapshotQuery) Select ¶
func (bsq *BalanceSnapshotQuery) Select(fields ...string) *BalanceSnapshotSelect
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 { Namespace string `json:"namespace,omitempty"` } client.BalanceSnapshot.Query(). Select(balancesnapshot.FieldNamespace). Scan(ctx, &v)
func (*BalanceSnapshotQuery) Unique ¶
func (bsq *BalanceSnapshotQuery) Unique(unique bool) *BalanceSnapshotQuery
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 (*BalanceSnapshotQuery) Where ¶
func (bsq *BalanceSnapshotQuery) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotQuery
Where adds a new predicate for the BalanceSnapshotQuery builder.
type BalanceSnapshotSelect ¶
type BalanceSnapshotSelect struct { *BalanceSnapshotQuery // contains filtered or unexported fields }
BalanceSnapshotSelect is the builder for selecting fields of BalanceSnapshot entities.
func (*BalanceSnapshotSelect) Aggregate ¶
func (bss *BalanceSnapshotSelect) Aggregate(fns ...AggregateFunc) *BalanceSnapshotSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BalanceSnapshotSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*BalanceSnapshotSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BalanceSnapshotSelect) Scan ¶
func (bss *BalanceSnapshotSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BalanceSnapshotSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BalanceSnapshotUpdate ¶
type BalanceSnapshotUpdate struct {
// contains filtered or unexported fields
}
BalanceSnapshotUpdate is the builder for updating BalanceSnapshot entities.
func (*BalanceSnapshotUpdate) ClearDeletedAt ¶
func (bsu *BalanceSnapshotUpdate) ClearDeletedAt() *BalanceSnapshotUpdate
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotUpdate) Exec ¶
func (bsu *BalanceSnapshotUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BalanceSnapshotUpdate) ExecX ¶
func (bsu *BalanceSnapshotUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotUpdate) Mutation ¶
func (bsu *BalanceSnapshotUpdate) Mutation() *BalanceSnapshotMutation
Mutation returns the BalanceSnapshotMutation object of the builder.
func (*BalanceSnapshotUpdate) Save ¶
func (bsu *BalanceSnapshotUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BalanceSnapshotUpdate) SaveX ¶
func (bsu *BalanceSnapshotUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BalanceSnapshotUpdate) SetDeletedAt ¶
func (bsu *BalanceSnapshotUpdate) SetDeletedAt(t time.Time) *BalanceSnapshotUpdate
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotUpdate) SetNillableDeletedAt ¶
func (bsu *BalanceSnapshotUpdate) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*BalanceSnapshotUpdate) SetUpdatedAt ¶
func (bsu *BalanceSnapshotUpdate) SetUpdatedAt(t time.Time) *BalanceSnapshotUpdate
SetUpdatedAt sets the "updated_at" field.
func (*BalanceSnapshotUpdate) Where ¶
func (bsu *BalanceSnapshotUpdate) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotUpdate
Where appends a list predicates to the BalanceSnapshotUpdate builder.
type BalanceSnapshotUpdateOne ¶
type BalanceSnapshotUpdateOne struct {
// contains filtered or unexported fields
}
BalanceSnapshotUpdateOne is the builder for updating a single BalanceSnapshot entity.
func (*BalanceSnapshotUpdateOne) ClearDeletedAt ¶
func (bsuo *BalanceSnapshotUpdateOne) ClearDeletedAt() *BalanceSnapshotUpdateOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotUpdateOne) Exec ¶
func (bsuo *BalanceSnapshotUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BalanceSnapshotUpdateOne) ExecX ¶
func (bsuo *BalanceSnapshotUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotUpdateOne) Mutation ¶
func (bsuo *BalanceSnapshotUpdateOne) Mutation() *BalanceSnapshotMutation
Mutation returns the BalanceSnapshotMutation object of the builder.
func (*BalanceSnapshotUpdateOne) Save ¶
func (bsuo *BalanceSnapshotUpdateOne) Save(ctx context.Context) (*BalanceSnapshot, error)
Save executes the query and returns the updated BalanceSnapshot entity.
func (*BalanceSnapshotUpdateOne) SaveX ¶
func (bsuo *BalanceSnapshotUpdateOne) SaveX(ctx context.Context) *BalanceSnapshot
SaveX is like Save, but panics if an error occurs.
func (*BalanceSnapshotUpdateOne) Select ¶
func (bsuo *BalanceSnapshotUpdateOne) Select(field string, fields ...string) *BalanceSnapshotUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BalanceSnapshotUpdateOne) SetDeletedAt ¶
func (bsuo *BalanceSnapshotUpdateOne) SetDeletedAt(t time.Time) *BalanceSnapshotUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotUpdateOne) SetNillableDeletedAt ¶
func (bsuo *BalanceSnapshotUpdateOne) SetNillableDeletedAt(t *time.Time) *BalanceSnapshotUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*BalanceSnapshotUpdateOne) SetUpdatedAt ¶
func (bsuo *BalanceSnapshotUpdateOne) SetUpdatedAt(t time.Time) *BalanceSnapshotUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*BalanceSnapshotUpdateOne) Where ¶
func (bsuo *BalanceSnapshotUpdateOne) Where(ps ...predicate.BalanceSnapshot) *BalanceSnapshotUpdateOne
Where appends a list predicates to the BalanceSnapshotUpdate builder.
type BalanceSnapshotUpsert ¶
BalanceSnapshotUpsert is the "OnConflict" setter.
func (*BalanceSnapshotUpsert) ClearDeletedAt ¶
func (u *BalanceSnapshotUpsert) ClearDeletedAt() *BalanceSnapshotUpsert
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotUpsert) SetDeletedAt ¶
func (u *BalanceSnapshotUpsert) SetDeletedAt(v time.Time) *BalanceSnapshotUpsert
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotUpsert) SetUpdatedAt ¶
func (u *BalanceSnapshotUpsert) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsert
SetUpdatedAt sets the "updated_at" field.
func (*BalanceSnapshotUpsert) UpdateDeletedAt ¶
func (u *BalanceSnapshotUpsert) UpdateDeletedAt() *BalanceSnapshotUpsert
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*BalanceSnapshotUpsert) UpdateUpdatedAt ¶
func (u *BalanceSnapshotUpsert) UpdateUpdatedAt() *BalanceSnapshotUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type BalanceSnapshotUpsertBulk ¶
type BalanceSnapshotUpsertBulk struct {
// contains filtered or unexported fields
}
BalanceSnapshotUpsertBulk is the builder for "upsert"-ing a bulk of BalanceSnapshot nodes.
func (*BalanceSnapshotUpsertBulk) ClearDeletedAt ¶
func (u *BalanceSnapshotUpsertBulk) ClearDeletedAt() *BalanceSnapshotUpsertBulk
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotUpsertBulk) DoNothing ¶
func (u *BalanceSnapshotUpsertBulk) DoNothing() *BalanceSnapshotUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BalanceSnapshotUpsertBulk) Exec ¶
func (u *BalanceSnapshotUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BalanceSnapshotUpsertBulk) ExecX ¶
func (u *BalanceSnapshotUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotUpsertBulk) Ignore ¶
func (u *BalanceSnapshotUpsertBulk) Ignore() *BalanceSnapshotUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BalanceSnapshotUpsertBulk) SetDeletedAt ¶
func (u *BalanceSnapshotUpsertBulk) SetDeletedAt(v time.Time) *BalanceSnapshotUpsertBulk
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotUpsertBulk) SetUpdatedAt ¶
func (u *BalanceSnapshotUpsertBulk) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*BalanceSnapshotUpsertBulk) Update ¶
func (u *BalanceSnapshotUpsertBulk) Update(set func(*BalanceSnapshotUpsert)) *BalanceSnapshotUpsertBulk
Update allows overriding fields `UPDATE` values. See the BalanceSnapshotCreateBulk.OnConflict documentation for more info.
func (*BalanceSnapshotUpsertBulk) UpdateDeletedAt ¶
func (u *BalanceSnapshotUpsertBulk) UpdateDeletedAt() *BalanceSnapshotUpsertBulk
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*BalanceSnapshotUpsertBulk) UpdateNewValues ¶
func (u *BalanceSnapshotUpsertBulk) UpdateNewValues() *BalanceSnapshotUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*BalanceSnapshotUpsertBulk) UpdateUpdatedAt ¶
func (u *BalanceSnapshotUpsertBulk) UpdateUpdatedAt() *BalanceSnapshotUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type BalanceSnapshotUpsertOne ¶
type BalanceSnapshotUpsertOne struct {
// contains filtered or unexported fields
}
BalanceSnapshotUpsertOne is the builder for "upsert"-ing
one BalanceSnapshot node.
func (*BalanceSnapshotUpsertOne) ClearDeletedAt ¶
func (u *BalanceSnapshotUpsertOne) ClearDeletedAt() *BalanceSnapshotUpsertOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*BalanceSnapshotUpsertOne) DoNothing ¶
func (u *BalanceSnapshotUpsertOne) DoNothing() *BalanceSnapshotUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BalanceSnapshotUpsertOne) Exec ¶
func (u *BalanceSnapshotUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*BalanceSnapshotUpsertOne) ExecX ¶
func (u *BalanceSnapshotUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BalanceSnapshotUpsertOne) ID ¶
func (u *BalanceSnapshotUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*BalanceSnapshotUpsertOne) IDX ¶
func (u *BalanceSnapshotUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*BalanceSnapshotUpsertOne) Ignore ¶
func (u *BalanceSnapshotUpsertOne) Ignore() *BalanceSnapshotUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BalanceSnapshotUpsertOne) SetDeletedAt ¶
func (u *BalanceSnapshotUpsertOne) SetDeletedAt(v time.Time) *BalanceSnapshotUpsertOne
SetDeletedAt sets the "deleted_at" field.
func (*BalanceSnapshotUpsertOne) SetUpdatedAt ¶
func (u *BalanceSnapshotUpsertOne) SetUpdatedAt(v time.Time) *BalanceSnapshotUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*BalanceSnapshotUpsertOne) Update ¶
func (u *BalanceSnapshotUpsertOne) Update(set func(*BalanceSnapshotUpsert)) *BalanceSnapshotUpsertOne
Update allows overriding fields `UPDATE` values. See the BalanceSnapshotCreate.OnConflict documentation for more info.
func (*BalanceSnapshotUpsertOne) UpdateDeletedAt ¶
func (u *BalanceSnapshotUpsertOne) UpdateDeletedAt() *BalanceSnapshotUpsertOne
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*BalanceSnapshotUpsertOne) UpdateNewValues ¶
func (u *BalanceSnapshotUpsertOne) UpdateNewValues() *BalanceSnapshotUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.BalanceSnapshot.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*BalanceSnapshotUpsertOne) UpdateUpdatedAt ¶
func (u *BalanceSnapshotUpsertOne) UpdateUpdatedAt() *BalanceSnapshotUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type BalanceSnapshots ¶
type BalanceSnapshots []*BalanceSnapshot
BalanceSnapshots is a parsable slice of BalanceSnapshot.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // BalanceSnapshot is the client for interacting with the BalanceSnapshot builders. BalanceSnapshot *BalanceSnapshotClient // Grant is the client for interacting with the Grant builders. Grant *GrantClient // 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(). BalanceSnapshot. Query(). Count(ctx)
func (*Client) GetConfig ¶
func (c *Client) GetConfig() *entutils.RawEntConfig
func (*Client) HijackTx ¶
func (c *Client) HijackTx(ctx context.Context, opts *sql.TxOptions) (context.Context, *entutils.RawEntConfig, *ExposedTxDriver, error)
HijackTx returns a new transaction driver with the provided options. The returned transaction can later be used to instanciate new clients.
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type ExposedTxDriver ¶
type ExposedTxDriver struct {
Driver *txDriver
}
type Grant ¶
type Grant struct { // ID of the ent. ID string `json:"id,omitempty"` // Namespace holds the value of the "namespace" field. Namespace string `json:"namespace,omitempty"` // Metadata holds the value of the "metadata" field. Metadata map[string]string `json:"metadata,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"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt *time.Time `json:"deleted_at,omitempty"` // OwnerID holds the value of the "owner_id" field. OwnerID credit.GrantOwner `json:"owner_id,omitempty"` // Amount holds the value of the "amount" field. Amount float64 `json:"amount,omitempty"` // Priority holds the value of the "priority" field. Priority uint8 `json:"priority,omitempty"` // EffectiveAt holds the value of the "effective_at" field. EffectiveAt time.Time `json:"effective_at,omitempty"` // Expiration holds the value of the "expiration" field. Expiration credit.ExpirationPeriod `json:"expiration,omitempty"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // VoidedAt holds the value of the "voided_at" field. VoidedAt *time.Time `json:"voided_at,omitempty"` // ResetMaxRollover holds the value of the "reset_max_rollover" field. ResetMaxRollover float64 `json:"reset_max_rollover,omitempty"` // ResetMinRollover holds the value of the "reset_min_rollover" field. ResetMinRollover float64 `json:"reset_min_rollover,omitempty"` // RecurrencePeriod holds the value of the "recurrence_period" field. RecurrencePeriod *recurrence.RecurrenceInterval `json:"recurrence_period,omitempty"` // RecurrenceAnchor holds the value of the "recurrence_anchor" field. RecurrenceAnchor *time.Time `json:"recurrence_anchor,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 (gr *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(gr *Grant) *GrantDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GrantClient) DeleteOneID ¶
func (c *GrantClient) DeleteOneID(id string) *GrantDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GrantClient) GetX ¶
func (c *GrantClient) GetX(ctx context.Context, id string) *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(gr *Grant) *GrantUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GrantClient) UpdateOneID ¶
func (c *GrantClient) UpdateOneID(id string) *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 (gc *GrantCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantCreate) ExecX ¶
func (gc *GrantCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantCreate) Mutation ¶
func (gc *GrantCreate) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantCreate) OnConflict ¶
func (gc *GrantCreate) OnConflict(opts ...sql.ConflictOption) *GrantUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Grant.Create(). SetNamespace(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.GrantUpsert) { SetNamespace(v+v). }). Exec(ctx)
func (*GrantCreate) OnConflictColumns ¶
func (gc *GrantCreate) OnConflictColumns(columns ...string) *GrantUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Grant.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*GrantCreate) Save ¶
func (gc *GrantCreate) Save(ctx context.Context) (*Grant, error)
Save creates the Grant in the database.
func (*GrantCreate) SaveX ¶
func (gc *GrantCreate) SaveX(ctx context.Context) *Grant
SaveX calls Save and panics if Save returns an error.
func (*GrantCreate) SetAmount ¶
func (gc *GrantCreate) SetAmount(f float64) *GrantCreate
SetAmount sets the "amount" field.
func (*GrantCreate) SetCreatedAt ¶
func (gc *GrantCreate) SetCreatedAt(t time.Time) *GrantCreate
SetCreatedAt sets the "created_at" field.
func (*GrantCreate) SetDeletedAt ¶
func (gc *GrantCreate) SetDeletedAt(t time.Time) *GrantCreate
SetDeletedAt sets the "deleted_at" field.
func (*GrantCreate) SetEffectiveAt ¶
func (gc *GrantCreate) SetEffectiveAt(t time.Time) *GrantCreate
SetEffectiveAt sets the "effective_at" field.
func (*GrantCreate) SetExpiration ¶
func (gc *GrantCreate) SetExpiration(cp credit.ExpirationPeriod) *GrantCreate
SetExpiration sets the "expiration" field.
func (*GrantCreate) SetExpiresAt ¶
func (gc *GrantCreate) SetExpiresAt(t time.Time) *GrantCreate
SetExpiresAt sets the "expires_at" field.
func (*GrantCreate) SetID ¶
func (gc *GrantCreate) SetID(s string) *GrantCreate
SetID sets the "id" field.
func (*GrantCreate) SetMetadata ¶
func (gc *GrantCreate) SetMetadata(m map[string]string) *GrantCreate
SetMetadata sets the "metadata" field.
func (*GrantCreate) SetNamespace ¶
func (gc *GrantCreate) SetNamespace(s string) *GrantCreate
SetNamespace sets the "namespace" field.
func (*GrantCreate) SetNillableCreatedAt ¶
func (gc *GrantCreate) SetNillableCreatedAt(t *time.Time) *GrantCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*GrantCreate) SetNillableDeletedAt ¶
func (gc *GrantCreate) SetNillableDeletedAt(t *time.Time) *GrantCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*GrantCreate) SetNillableID ¶
func (gc *GrantCreate) SetNillableID(s *string) *GrantCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*GrantCreate) SetNillablePriority ¶
func (gc *GrantCreate) SetNillablePriority(u *uint8) *GrantCreate
SetNillablePriority sets the "priority" field if the given value is not nil.
func (*GrantCreate) SetNillableRecurrenceAnchor ¶
func (gc *GrantCreate) SetNillableRecurrenceAnchor(t *time.Time) *GrantCreate
SetNillableRecurrenceAnchor sets the "recurrence_anchor" field if the given value is not nil.
func (*GrantCreate) SetNillableRecurrencePeriod ¶
func (gc *GrantCreate) SetNillableRecurrencePeriod(ri *recurrence.RecurrenceInterval) *GrantCreate
SetNillableRecurrencePeriod sets the "recurrence_period" field if the given value is not nil.
func (*GrantCreate) SetNillableUpdatedAt ¶
func (gc *GrantCreate) SetNillableUpdatedAt(t *time.Time) *GrantCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*GrantCreate) SetNillableVoidedAt ¶
func (gc *GrantCreate) SetNillableVoidedAt(t *time.Time) *GrantCreate
SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
func (*GrantCreate) SetOwnerID ¶
func (gc *GrantCreate) SetOwnerID(co credit.GrantOwner) *GrantCreate
SetOwnerID sets the "owner_id" field.
func (*GrantCreate) SetPriority ¶
func (gc *GrantCreate) SetPriority(u uint8) *GrantCreate
SetPriority sets the "priority" field.
func (*GrantCreate) SetRecurrenceAnchor ¶
func (gc *GrantCreate) SetRecurrenceAnchor(t time.Time) *GrantCreate
SetRecurrenceAnchor sets the "recurrence_anchor" field.
func (*GrantCreate) SetRecurrencePeriod ¶
func (gc *GrantCreate) SetRecurrencePeriod(ri recurrence.RecurrenceInterval) *GrantCreate
SetRecurrencePeriod sets the "recurrence_period" field.
func (*GrantCreate) SetResetMaxRollover ¶
func (gc *GrantCreate) SetResetMaxRollover(f float64) *GrantCreate
SetResetMaxRollover sets the "reset_max_rollover" field.
func (*GrantCreate) SetResetMinRollover ¶
func (gc *GrantCreate) SetResetMinRollover(f float64) *GrantCreate
SetResetMinRollover sets the "reset_min_rollover" field.
func (*GrantCreate) SetUpdatedAt ¶
func (gc *GrantCreate) SetUpdatedAt(t time.Time) *GrantCreate
SetUpdatedAt sets the "updated_at" field.
func (*GrantCreate) SetVoidedAt ¶
func (gc *GrantCreate) SetVoidedAt(t time.Time) *GrantCreate
SetVoidedAt sets the "voided_at" 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 (gcb *GrantCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantCreateBulk) ExecX ¶
func (gcb *GrantCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantCreateBulk) OnConflict ¶
func (gcb *GrantCreateBulk) OnConflict(opts ...sql.ConflictOption) *GrantUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Grant.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.GrantUpsert) { SetNamespace(v+v). }). Exec(ctx)
func (*GrantCreateBulk) OnConflictColumns ¶
func (gcb *GrantCreateBulk) OnConflictColumns(columns ...string) *GrantUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Grant.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type GrantDelete ¶
type GrantDelete struct {
// contains filtered or unexported fields
}
GrantDelete is the builder for deleting a Grant entity.
func (*GrantDelete) Exec ¶
func (gd *GrantDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GrantDelete) ExecX ¶
func (gd *GrantDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GrantDelete) Where ¶
func (gd *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 (gdo *GrantDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GrantDeleteOne) ExecX ¶
func (gdo *GrantDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantDeleteOne) Where ¶
func (gdo *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 (ggb *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 (ggb *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) AddAmount ¶
func (m *GrantMutation) AddAmount(f float64)
AddAmount adds f to the "amount" field.
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) AddPriority ¶
func (m *GrantMutation) AddPriority(u int8)
AddPriority adds u to the "priority" field.
func (*GrantMutation) AddResetMaxRollover ¶
func (m *GrantMutation) AddResetMaxRollover(f float64)
AddResetMaxRollover adds f to the "reset_max_rollover" field.
func (*GrantMutation) AddResetMinRollover ¶
func (m *GrantMutation) AddResetMinRollover(f float64)
AddResetMinRollover adds f to the "reset_min_rollover" field.
func (*GrantMutation) AddedAmount ¶
func (m *GrantMutation) AddedAmount() (r float64, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
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) AddedPriority ¶
func (m *GrantMutation) AddedPriority() (r int8, exists bool)
AddedPriority returns the value that was added to the "priority" field in this mutation.
func (*GrantMutation) AddedResetMaxRollover ¶
func (m *GrantMutation) AddedResetMaxRollover() (r float64, exists bool)
AddedResetMaxRollover returns the value that was added to the "reset_max_rollover" field in this mutation.
func (*GrantMutation) AddedResetMinRollover ¶
func (m *GrantMutation) AddedResetMinRollover() (r float64, exists bool)
AddedResetMinRollover returns the value that was added to the "reset_min_rollover" field in this mutation.
func (*GrantMutation) Amount ¶
func (m *GrantMutation) Amount() (r float64, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*GrantMutation) ClearDeletedAt ¶
func (m *GrantMutation) ClearDeletedAt()
ClearDeletedAt clears the value of the "deleted_at" field.
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) ClearMetadata ¶
func (m *GrantMutation) ClearMetadata()
ClearMetadata clears the value of the "metadata" field.
func (*GrantMutation) ClearRecurrenceAnchor ¶
func (m *GrantMutation) ClearRecurrenceAnchor()
ClearRecurrenceAnchor clears the value of the "recurrence_anchor" field.
func (*GrantMutation) ClearRecurrencePeriod ¶
func (m *GrantMutation) ClearRecurrencePeriod()
ClearRecurrencePeriod clears the value of the "recurrence_period" field.
func (*GrantMutation) ClearVoidedAt ¶
func (m *GrantMutation) ClearVoidedAt()
ClearVoidedAt clears the value of the "voided_at" field.
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) CreatedAt ¶
func (m *GrantMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*GrantMutation) DeletedAt ¶
func (m *GrantMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*GrantMutation) DeletedAtCleared ¶
func (m *GrantMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the "deleted_at" field was cleared in this 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) EffectiveAt ¶
func (m *GrantMutation) EffectiveAt() (r time.Time, exists bool)
EffectiveAt returns the value of the "effective_at" field in the mutation.
func (*GrantMutation) Expiration ¶
func (m *GrantMutation) Expiration() (r credit.ExpirationPeriod, exists bool)
Expiration returns the value of the "expiration" field in the mutation.
func (*GrantMutation) ExpiresAt ¶
func (m *GrantMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the 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 string, 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) ([]string, 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) Metadata ¶
func (m *GrantMutation) Metadata() (r map[string]string, exists bool)
Metadata returns the value of the "metadata" field in the mutation.
func (*GrantMutation) MetadataCleared ¶
func (m *GrantMutation) MetadataCleared() bool
MetadataCleared returns if the "metadata" field was cleared in this mutation.
func (*GrantMutation) Namespace ¶
func (m *GrantMutation) Namespace() (r string, exists bool)
Namespace returns the value of the "namespace" field in the mutation.
func (*GrantMutation) OldAmount ¶
func (m *GrantMutation) OldAmount(ctx context.Context) (v float64, err error)
OldAmount returns the old "amount" 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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldDeletedAt ¶
OldDeletedAt returns the old "deleted_at" 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) OldEffectiveAt ¶
OldEffectiveAt returns the old "effective_at" 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) OldExpiration ¶
func (m *GrantMutation) OldExpiration(ctx context.Context) (v credit.ExpirationPeriod, err error)
OldExpiration returns the old "expiration" 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) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" 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) OldMetadata ¶
OldMetadata returns the old "metadata" 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) OldNamespace ¶
func (m *GrantMutation) OldNamespace(ctx context.Context) (v string, err error)
OldNamespace returns the old "namespace" 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) OldOwnerID ¶
func (m *GrantMutation) OldOwnerID(ctx context.Context) (v credit.GrantOwner, 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) OldPriority ¶
func (m *GrantMutation) OldPriority(ctx context.Context) (v uint8, err error)
OldPriority returns the old "priority" 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) OldRecurrenceAnchor ¶
OldRecurrenceAnchor returns the old "recurrence_anchor" 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) OldRecurrencePeriod ¶
func (m *GrantMutation) OldRecurrencePeriod(ctx context.Context) (v *recurrence.RecurrenceInterval, err error)
OldRecurrencePeriod returns the old "recurrence_period" 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) OldResetMaxRollover ¶
func (m *GrantMutation) OldResetMaxRollover(ctx context.Context) (v float64, err error)
OldResetMaxRollover returns the old "reset_max_rollover" 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) OldResetMinRollover ¶
func (m *GrantMutation) OldResetMinRollover(ctx context.Context) (v float64, err error)
OldResetMinRollover returns the old "reset_min_rollover" 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) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" 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) OldVoidedAt ¶
OldVoidedAt returns the old "voided_at" 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 credit.GrantOwner, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*GrantMutation) Priority ¶
func (m *GrantMutation) Priority() (r uint8, exists bool)
Priority returns the value of the "priority" field in the mutation.
func (*GrantMutation) RecurrenceAnchor ¶
func (m *GrantMutation) RecurrenceAnchor() (r time.Time, exists bool)
RecurrenceAnchor returns the value of the "recurrence_anchor" field in the mutation.
func (*GrantMutation) RecurrenceAnchorCleared ¶
func (m *GrantMutation) RecurrenceAnchorCleared() bool
RecurrenceAnchorCleared returns if the "recurrence_anchor" field was cleared in this mutation.
func (*GrantMutation) RecurrencePeriod ¶
func (m *GrantMutation) RecurrencePeriod() (r recurrence.RecurrenceInterval, exists bool)
RecurrencePeriod returns the value of the "recurrence_period" field in the mutation.
func (*GrantMutation) RecurrencePeriodCleared ¶
func (m *GrantMutation) RecurrencePeriodCleared() bool
RecurrencePeriodCleared returns if the "recurrence_period" field was cleared in this 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) ResetAmount ¶
func (m *GrantMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*GrantMutation) ResetCreatedAt ¶
func (m *GrantMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*GrantMutation) ResetDeletedAt ¶
func (m *GrantMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" 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) ResetEffectiveAt ¶
func (m *GrantMutation) ResetEffectiveAt()
ResetEffectiveAt resets all changes to the "effective_at" field.
func (*GrantMutation) ResetExpiration ¶
func (m *GrantMutation) ResetExpiration()
ResetExpiration resets all changes to the "expiration" field.
func (*GrantMutation) ResetExpiresAt ¶
func (m *GrantMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
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) ResetMaxRollover ¶
func (m *GrantMutation) ResetMaxRollover() (r float64, exists bool)
ResetMaxRollover returns the value of the "reset_max_rollover" field in the mutation.
func (*GrantMutation) ResetMetadata ¶
func (m *GrantMutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" field.
func (*GrantMutation) ResetMinRollover ¶
func (m *GrantMutation) ResetMinRollover() (r float64, exists bool)
ResetMinRollover returns the value of the "reset_min_rollover" field in the mutation.
func (*GrantMutation) ResetNamespace ¶
func (m *GrantMutation) ResetNamespace()
ResetNamespace resets all changes to the "namespace" field.
func (*GrantMutation) ResetOwnerID ¶
func (m *GrantMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*GrantMutation) ResetPriority ¶
func (m *GrantMutation) ResetPriority()
ResetPriority resets all changes to the "priority" field.
func (*GrantMutation) ResetRecurrenceAnchor ¶
func (m *GrantMutation) ResetRecurrenceAnchor()
ResetRecurrenceAnchor resets all changes to the "recurrence_anchor" field.
func (*GrantMutation) ResetRecurrencePeriod ¶
func (m *GrantMutation) ResetRecurrencePeriod()
ResetRecurrencePeriod resets all changes to the "recurrence_period" field.
func (*GrantMutation) ResetResetMaxRollover ¶
func (m *GrantMutation) ResetResetMaxRollover()
ResetResetMaxRollover resets all changes to the "reset_max_rollover" field.
func (*GrantMutation) ResetResetMinRollover ¶
func (m *GrantMutation) ResetResetMinRollover()
ResetResetMinRollover resets all changes to the "reset_min_rollover" field.
func (*GrantMutation) ResetUpdatedAt ¶
func (m *GrantMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*GrantMutation) ResetVoidedAt ¶
func (m *GrantMutation) ResetVoidedAt()
ResetVoidedAt resets all changes to the "voided_at" field.
func (*GrantMutation) SetAmount ¶
func (m *GrantMutation) SetAmount(f float64)
SetAmount sets the "amount" field.
func (*GrantMutation) SetCreatedAt ¶
func (m *GrantMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*GrantMutation) SetDeletedAt ¶
func (m *GrantMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the "deleted_at" field.
func (*GrantMutation) SetEffectiveAt ¶
func (m *GrantMutation) SetEffectiveAt(t time.Time)
SetEffectiveAt sets the "effective_at" field.
func (*GrantMutation) SetExpiration ¶
func (m *GrantMutation) SetExpiration(cp credit.ExpirationPeriod)
SetExpiration sets the "expiration" field.
func (*GrantMutation) SetExpiresAt ¶
func (m *GrantMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" 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) SetID ¶
func (m *GrantMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Grant entities.
func (*GrantMutation) SetMetadata ¶
func (m *GrantMutation) SetMetadata(value map[string]string)
SetMetadata sets the "metadata" field.
func (*GrantMutation) SetNamespace ¶
func (m *GrantMutation) SetNamespace(s string)
SetNamespace sets the "namespace" field.
func (*GrantMutation) SetOp ¶
func (m *GrantMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*GrantMutation) SetOwnerID ¶
func (m *GrantMutation) SetOwnerID(co credit.GrantOwner)
SetOwnerID sets the "owner_id" field.
func (*GrantMutation) SetPriority ¶
func (m *GrantMutation) SetPriority(u uint8)
SetPriority sets the "priority" field.
func (*GrantMutation) SetRecurrenceAnchor ¶
func (m *GrantMutation) SetRecurrenceAnchor(t time.Time)
SetRecurrenceAnchor sets the "recurrence_anchor" field.
func (*GrantMutation) SetRecurrencePeriod ¶
func (m *GrantMutation) SetRecurrencePeriod(ri recurrence.RecurrenceInterval)
SetRecurrencePeriod sets the "recurrence_period" field.
func (*GrantMutation) SetResetMaxRollover ¶
func (m *GrantMutation) SetResetMaxRollover(f float64)
SetResetMaxRollover sets the "reset_max_rollover" field.
func (*GrantMutation) SetResetMinRollover ¶
func (m *GrantMutation) SetResetMinRollover(f float64)
SetResetMinRollover sets the "reset_min_rollover" field.
func (*GrantMutation) SetUpdatedAt ¶
func (m *GrantMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*GrantMutation) SetVoidedAt ¶
func (m *GrantMutation) SetVoidedAt(t time.Time)
SetVoidedAt sets the "voided_at" 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) UpdatedAt ¶
func (m *GrantMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*GrantMutation) VoidedAt ¶
func (m *GrantMutation) VoidedAt() (r time.Time, exists bool)
VoidedAt returns the value of the "voided_at" field in the mutation.
func (*GrantMutation) VoidedAtCleared ¶
func (m *GrantMutation) VoidedAtCleared() bool
VoidedAtCleared returns if the "voided_at" field was cleared in this mutation.
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 (gq *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect
Aggregate returns a GrantSelect configured with the given aggregations.
func (*GrantQuery) All ¶
func (gq *GrantQuery) All(ctx context.Context) ([]*Grant, error)
All executes the query and returns a list of Grants.
func (*GrantQuery) AllX ¶
func (gq *GrantQuery) AllX(ctx context.Context) []*Grant
AllX is like All, but panics if an error occurs.
func (*GrantQuery) Clone ¶
func (gq *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 (gq *GrantQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GrantQuery) CountX ¶
func (gq *GrantQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GrantQuery) Exist ¶
func (gq *GrantQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GrantQuery) ExistX ¶
func (gq *GrantQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GrantQuery) First ¶
func (gq *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 (gq *GrantQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Grant ID from the query. Returns a *NotFoundError when no Grant ID was found.
func (*GrantQuery) FirstIDX ¶
func (gq *GrantQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*GrantQuery) FirstX ¶
func (gq *GrantQuery) FirstX(ctx context.Context) *Grant
FirstX is like First, but panics if an error occurs.
func (*GrantQuery) ForShare ¶
func (gq *GrantQuery) ForShare(opts ...sql.LockOption) *GrantQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*GrantQuery) ForUpdate ¶
func (gq *GrantQuery) ForUpdate(opts ...sql.LockOption) *GrantQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*GrantQuery) GroupBy ¶
func (gq *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 { Namespace string `json:"namespace,omitempty"` Count int `json:"count,omitempty"` } client.Grant.Query(). GroupBy(grant.FieldNamespace). Aggregate(db.Count()). Scan(ctx, &v)
func (*GrantQuery) IDs ¶
func (gq *GrantQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Grant IDs.
func (*GrantQuery) IDsX ¶
func (gq *GrantQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*GrantQuery) Limit ¶
func (gq *GrantQuery) Limit(limit int) *GrantQuery
Limit the number of records to be returned by this query.
func (*GrantQuery) Offset ¶
func (gq *GrantQuery) Offset(offset int) *GrantQuery
Offset to start from.
func (*GrantQuery) Only ¶
func (gq *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 (gq *GrantQuery) OnlyID(ctx context.Context) (id string, 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 (gq *GrantQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GrantQuery) OnlyX ¶
func (gq *GrantQuery) OnlyX(ctx context.Context) *Grant
OnlyX is like Only, but panics if an error occurs.
func (*GrantQuery) Order ¶
func (gq *GrantQuery) Order(o ...grant.OrderOption) *GrantQuery
Order specifies how the records should be ordered.
func (*GrantQuery) Select ¶
func (gq *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 { Namespace string `json:"namespace,omitempty"` } client.Grant.Query(). Select(grant.FieldNamespace). Scan(ctx, &v)
func (*GrantQuery) Unique ¶
func (gq *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 (gq *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 (gs *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 (gs *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) ClearDeletedAt ¶
func (gu *GrantUpdate) ClearDeletedAt() *GrantUpdate
ClearDeletedAt clears the value of the "deleted_at" field.
func (*GrantUpdate) ClearMetadata ¶
func (gu *GrantUpdate) ClearMetadata() *GrantUpdate
ClearMetadata clears the value of the "metadata" field.
func (*GrantUpdate) ClearVoidedAt ¶
func (gu *GrantUpdate) ClearVoidedAt() *GrantUpdate
ClearVoidedAt clears the value of the "voided_at" field.
func (*GrantUpdate) Exec ¶
func (gu *GrantUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantUpdate) ExecX ¶
func (gu *GrantUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpdate) Mutation ¶
func (gu *GrantUpdate) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantUpdate) Save ¶
func (gu *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 (gu *GrantUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GrantUpdate) SetDeletedAt ¶
func (gu *GrantUpdate) SetDeletedAt(t time.Time) *GrantUpdate
SetDeletedAt sets the "deleted_at" field.
func (*GrantUpdate) SetMetadata ¶
func (gu *GrantUpdate) SetMetadata(m map[string]string) *GrantUpdate
SetMetadata sets the "metadata" field.
func (*GrantUpdate) SetNillableDeletedAt ¶
func (gu *GrantUpdate) SetNillableDeletedAt(t *time.Time) *GrantUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*GrantUpdate) SetNillableVoidedAt ¶
func (gu *GrantUpdate) SetNillableVoidedAt(t *time.Time) *GrantUpdate
SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
func (*GrantUpdate) SetUpdatedAt ¶
func (gu *GrantUpdate) SetUpdatedAt(t time.Time) *GrantUpdate
SetUpdatedAt sets the "updated_at" field.
func (*GrantUpdate) SetVoidedAt ¶
func (gu *GrantUpdate) SetVoidedAt(t time.Time) *GrantUpdate
SetVoidedAt sets the "voided_at" field.
func (*GrantUpdate) Where ¶
func (gu *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) ClearDeletedAt ¶
func (guo *GrantUpdateOne) ClearDeletedAt() *GrantUpdateOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*GrantUpdateOne) ClearMetadata ¶
func (guo *GrantUpdateOne) ClearMetadata() *GrantUpdateOne
ClearMetadata clears the value of the "metadata" field.
func (*GrantUpdateOne) ClearVoidedAt ¶
func (guo *GrantUpdateOne) ClearVoidedAt() *GrantUpdateOne
ClearVoidedAt clears the value of the "voided_at" field.
func (*GrantUpdateOne) Exec ¶
func (guo *GrantUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GrantUpdateOne) ExecX ¶
func (guo *GrantUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpdateOne) Mutation ¶
func (guo *GrantUpdateOne) Mutation() *GrantMutation
Mutation returns the GrantMutation object of the builder.
func (*GrantUpdateOne) Save ¶
func (guo *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)
Save executes the query and returns the updated Grant entity.
func (*GrantUpdateOne) SaveX ¶
func (guo *GrantUpdateOne) SaveX(ctx context.Context) *Grant
SaveX is like Save, but panics if an error occurs.
func (*GrantUpdateOne) Select ¶
func (guo *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) SetDeletedAt ¶
func (guo *GrantUpdateOne) SetDeletedAt(t time.Time) *GrantUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*GrantUpdateOne) SetMetadata ¶
func (guo *GrantUpdateOne) SetMetadata(m map[string]string) *GrantUpdateOne
SetMetadata sets the "metadata" field.
func (*GrantUpdateOne) SetNillableDeletedAt ¶
func (guo *GrantUpdateOne) SetNillableDeletedAt(t *time.Time) *GrantUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*GrantUpdateOne) SetNillableVoidedAt ¶
func (guo *GrantUpdateOne) SetNillableVoidedAt(t *time.Time) *GrantUpdateOne
SetNillableVoidedAt sets the "voided_at" field if the given value is not nil.
func (*GrantUpdateOne) SetUpdatedAt ¶
func (guo *GrantUpdateOne) SetUpdatedAt(t time.Time) *GrantUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*GrantUpdateOne) SetVoidedAt ¶
func (guo *GrantUpdateOne) SetVoidedAt(t time.Time) *GrantUpdateOne
SetVoidedAt sets the "voided_at" field.
func (*GrantUpdateOne) Where ¶
func (guo *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne
Where appends a list predicates to the GrantUpdate builder.
type GrantUpsert ¶
GrantUpsert is the "OnConflict" setter.
func (*GrantUpsert) ClearDeletedAt ¶
func (u *GrantUpsert) ClearDeletedAt() *GrantUpsert
ClearDeletedAt clears the value of the "deleted_at" field.
func (*GrantUpsert) ClearMetadata ¶
func (u *GrantUpsert) ClearMetadata() *GrantUpsert
ClearMetadata clears the value of the "metadata" field.
func (*GrantUpsert) ClearVoidedAt ¶
func (u *GrantUpsert) ClearVoidedAt() *GrantUpsert
ClearVoidedAt clears the value of the "voided_at" field.
func (*GrantUpsert) SetDeletedAt ¶
func (u *GrantUpsert) SetDeletedAt(v time.Time) *GrantUpsert
SetDeletedAt sets the "deleted_at" field.
func (*GrantUpsert) SetMetadata ¶
func (u *GrantUpsert) SetMetadata(v map[string]string) *GrantUpsert
SetMetadata sets the "metadata" field.
func (*GrantUpsert) SetUpdatedAt ¶
func (u *GrantUpsert) SetUpdatedAt(v time.Time) *GrantUpsert
SetUpdatedAt sets the "updated_at" field.
func (*GrantUpsert) SetVoidedAt ¶
func (u *GrantUpsert) SetVoidedAt(v time.Time) *GrantUpsert
SetVoidedAt sets the "voided_at" field.
func (*GrantUpsert) UpdateDeletedAt ¶
func (u *GrantUpsert) UpdateDeletedAt() *GrantUpsert
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*GrantUpsert) UpdateMetadata ¶
func (u *GrantUpsert) UpdateMetadata() *GrantUpsert
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*GrantUpsert) UpdateUpdatedAt ¶
func (u *GrantUpsert) UpdateUpdatedAt() *GrantUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*GrantUpsert) UpdateVoidedAt ¶
func (u *GrantUpsert) UpdateVoidedAt() *GrantUpsert
UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
type GrantUpsertBulk ¶
type GrantUpsertBulk struct {
// contains filtered or unexported fields
}
GrantUpsertBulk is the builder for "upsert"-ing a bulk of Grant nodes.
func (*GrantUpsertBulk) ClearDeletedAt ¶
func (u *GrantUpsertBulk) ClearDeletedAt() *GrantUpsertBulk
ClearDeletedAt clears the value of the "deleted_at" field.
func (*GrantUpsertBulk) ClearMetadata ¶
func (u *GrantUpsertBulk) ClearMetadata() *GrantUpsertBulk
ClearMetadata clears the value of the "metadata" field.
func (*GrantUpsertBulk) ClearVoidedAt ¶
func (u *GrantUpsertBulk) ClearVoidedAt() *GrantUpsertBulk
ClearVoidedAt clears the value of the "voided_at" field.
func (*GrantUpsertBulk) DoNothing ¶
func (u *GrantUpsertBulk) DoNothing() *GrantUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GrantUpsertBulk) Exec ¶
func (u *GrantUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantUpsertBulk) ExecX ¶
func (u *GrantUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpsertBulk) Ignore ¶
func (u *GrantUpsertBulk) Ignore() *GrantUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Grant.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GrantUpsertBulk) SetDeletedAt ¶
func (u *GrantUpsertBulk) SetDeletedAt(v time.Time) *GrantUpsertBulk
SetDeletedAt sets the "deleted_at" field.
func (*GrantUpsertBulk) SetMetadata ¶
func (u *GrantUpsertBulk) SetMetadata(v map[string]string) *GrantUpsertBulk
SetMetadata sets the "metadata" field.
func (*GrantUpsertBulk) SetUpdatedAt ¶
func (u *GrantUpsertBulk) SetUpdatedAt(v time.Time) *GrantUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*GrantUpsertBulk) SetVoidedAt ¶
func (u *GrantUpsertBulk) SetVoidedAt(v time.Time) *GrantUpsertBulk
SetVoidedAt sets the "voided_at" field.
func (*GrantUpsertBulk) Update ¶
func (u *GrantUpsertBulk) Update(set func(*GrantUpsert)) *GrantUpsertBulk
Update allows overriding fields `UPDATE` values. See the GrantCreateBulk.OnConflict documentation for more info.
func (*GrantUpsertBulk) UpdateDeletedAt ¶
func (u *GrantUpsertBulk) UpdateDeletedAt() *GrantUpsertBulk
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*GrantUpsertBulk) UpdateMetadata ¶
func (u *GrantUpsertBulk) UpdateMetadata() *GrantUpsertBulk
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*GrantUpsertBulk) UpdateNewValues ¶
func (u *GrantUpsertBulk) UpdateNewValues() *GrantUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Grant.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(grant.FieldID) }), ). Exec(ctx)
func (*GrantUpsertBulk) UpdateUpdatedAt ¶
func (u *GrantUpsertBulk) UpdateUpdatedAt() *GrantUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*GrantUpsertBulk) UpdateVoidedAt ¶
func (u *GrantUpsertBulk) UpdateVoidedAt() *GrantUpsertBulk
UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
type GrantUpsertOne ¶
type GrantUpsertOne struct {
// contains filtered or unexported fields
}
GrantUpsertOne is the builder for "upsert"-ing
one Grant node.
func (*GrantUpsertOne) ClearDeletedAt ¶
func (u *GrantUpsertOne) ClearDeletedAt() *GrantUpsertOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*GrantUpsertOne) ClearMetadata ¶
func (u *GrantUpsertOne) ClearMetadata() *GrantUpsertOne
ClearMetadata clears the value of the "metadata" field.
func (*GrantUpsertOne) ClearVoidedAt ¶
func (u *GrantUpsertOne) ClearVoidedAt() *GrantUpsertOne
ClearVoidedAt clears the value of the "voided_at" field.
func (*GrantUpsertOne) DoNothing ¶
func (u *GrantUpsertOne) DoNothing() *GrantUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GrantUpsertOne) Exec ¶
func (u *GrantUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*GrantUpsertOne) ExecX ¶
func (u *GrantUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GrantUpsertOne) ID ¶
func (u *GrantUpsertOne) ID(ctx context.Context) (id string, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*GrantUpsertOne) IDX ¶
func (u *GrantUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*GrantUpsertOne) Ignore ¶
func (u *GrantUpsertOne) Ignore() *GrantUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Grant.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GrantUpsertOne) SetDeletedAt ¶
func (u *GrantUpsertOne) SetDeletedAt(v time.Time) *GrantUpsertOne
SetDeletedAt sets the "deleted_at" field.
func (*GrantUpsertOne) SetMetadata ¶
func (u *GrantUpsertOne) SetMetadata(v map[string]string) *GrantUpsertOne
SetMetadata sets the "metadata" field.
func (*GrantUpsertOne) SetUpdatedAt ¶
func (u *GrantUpsertOne) SetUpdatedAt(v time.Time) *GrantUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*GrantUpsertOne) SetVoidedAt ¶
func (u *GrantUpsertOne) SetVoidedAt(v time.Time) *GrantUpsertOne
SetVoidedAt sets the "voided_at" field.
func (*GrantUpsertOne) Update ¶
func (u *GrantUpsertOne) Update(set func(*GrantUpsert)) *GrantUpsertOne
Update allows overriding fields `UPDATE` values. See the GrantCreate.OnConflict documentation for more info.
func (*GrantUpsertOne) UpdateDeletedAt ¶
func (u *GrantUpsertOne) UpdateDeletedAt() *GrantUpsertOne
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*GrantUpsertOne) UpdateMetadata ¶
func (u *GrantUpsertOne) UpdateMetadata() *GrantUpsertOne
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*GrantUpsertOne) UpdateNewValues ¶
func (u *GrantUpsertOne) UpdateNewValues() *GrantUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Grant.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(grant.FieldID) }), ). Exec(ctx)
func (*GrantUpsertOne) UpdateUpdatedAt ¶
func (u *GrantUpsertOne) UpdateUpdatedAt() *GrantUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*GrantUpsertOne) UpdateVoidedAt ¶
func (u *GrantUpsertOne) UpdateVoidedAt() *GrantUpsertOne
UpdateVoidedAt sets the "voided_at" field to the value that was provided on create.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type 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 { // BalanceSnapshot is the client for interacting with the BalanceSnapshot builders. BalanceSnapshot *BalanceSnapshotClient // Grant is the client for interacting with the Grant builders. Grant *GrantClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func NewTxClientFromRawConfig ¶
func NewTxClientFromRawConfig(ctx context.Context, cfg entutils.RawEntConfig) *Tx
NewTxClientFromConfig creates a new transactional client from a (hijacked) configuration.
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.