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 Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type CreditEntries
- type CreditEntry
- func (ce *CreditEntry) QueryChildren() *CreditEntryQuery
- func (ce *CreditEntry) QueryFeature() *FeatureQuery
- func (ce *CreditEntry) QueryParent() *CreditEntryQuery
- func (ce *CreditEntry) String() string
- func (ce *CreditEntry) Unwrap() *CreditEntry
- func (ce *CreditEntry) Update() *CreditEntryUpdateOne
- func (ce *CreditEntry) Value(name string) (ent.Value, error)
- type CreditEntryClient
- func (c *CreditEntryClient) Create() *CreditEntryCreate
- func (c *CreditEntryClient) CreateBulk(builders ...*CreditEntryCreate) *CreditEntryCreateBulk
- func (c *CreditEntryClient) Delete() *CreditEntryDelete
- func (c *CreditEntryClient) DeleteOne(ce *CreditEntry) *CreditEntryDeleteOne
- func (c *CreditEntryClient) DeleteOneID(id pgulid.ULID) *CreditEntryDeleteOne
- func (c *CreditEntryClient) Get(ctx context.Context, id pgulid.ULID) (*CreditEntry, error)
- func (c *CreditEntryClient) GetX(ctx context.Context, id pgulid.ULID) *CreditEntry
- func (c *CreditEntryClient) Hooks() []Hook
- func (c *CreditEntryClient) Intercept(interceptors ...Interceptor)
- func (c *CreditEntryClient) Interceptors() []Interceptor
- func (c *CreditEntryClient) MapCreateBulk(slice any, setFunc func(*CreditEntryCreate, int)) *CreditEntryCreateBulk
- func (c *CreditEntryClient) Query() *CreditEntryQuery
- func (c *CreditEntryClient) QueryChildren(ce *CreditEntry) *CreditEntryQuery
- func (c *CreditEntryClient) QueryFeature(ce *CreditEntry) *FeatureQuery
- func (c *CreditEntryClient) QueryParent(ce *CreditEntry) *CreditEntryQuery
- func (c *CreditEntryClient) Update() *CreditEntryUpdate
- func (c *CreditEntryClient) UpdateOne(ce *CreditEntry) *CreditEntryUpdateOne
- func (c *CreditEntryClient) UpdateOneID(id pgulid.ULID) *CreditEntryUpdateOne
- func (c *CreditEntryClient) Use(hooks ...Hook)
- type CreditEntryCreate
- func (cec *CreditEntryCreate) Exec(ctx context.Context) error
- func (cec *CreditEntryCreate) ExecX(ctx context.Context)
- func (cec *CreditEntryCreate) Mutation() *CreditEntryMutation
- func (cec *CreditEntryCreate) OnConflict(opts ...sql.ConflictOption) *CreditEntryUpsertOne
- func (cec *CreditEntryCreate) OnConflictColumns(columns ...string) *CreditEntryUpsertOne
- func (cec *CreditEntryCreate) Save(ctx context.Context) (*CreditEntry, error)
- func (cec *CreditEntryCreate) SaveX(ctx context.Context) *CreditEntry
- func (cec *CreditEntryCreate) SetAmount(f float64) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetChildren(c *CreditEntry) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetChildrenID(id pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetCreatedAt(t time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetEffectiveAt(t time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetEntryType(ct credit.EntryType) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetExpirationAt(t time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetExpirationPeriodCount(u uint8) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetExpirationPeriodDuration(cpd credit.ExpirationPeriodDuration) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetFeature(f *Feature) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetFeatureID(pg pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetID(pg pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetLedgerID(pg pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetMetadata(m map[string]string) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNamespace(s string) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableAmount(f *float64) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableCreatedAt(t *time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableEffectiveAt(t *time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableExpirationAt(t *time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableExpirationPeriodCount(u *uint8) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableExpirationPeriodDuration(cpd *credit.ExpirationPeriodDuration) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableFeatureID(pg *pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableID(pg *pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableParentID(pg *pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillablePriority(u *uint8) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableRolloverMaxAmount(f *float64) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableRolloverType(crt *credit.GrantRolloverType) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableType(ct *credit.GrantType) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetNillableUpdatedAt(t *time.Time) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetParent(c *CreditEntry) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetParentID(pg pgulid.ULID) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetPriority(u uint8) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetRolloverMaxAmount(f float64) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetRolloverType(crt credit.GrantRolloverType) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetType(ct credit.GrantType) *CreditEntryCreate
- func (cec *CreditEntryCreate) SetUpdatedAt(t time.Time) *CreditEntryCreate
- type CreditEntryCreateBulk
- func (cecb *CreditEntryCreateBulk) Exec(ctx context.Context) error
- func (cecb *CreditEntryCreateBulk) ExecX(ctx context.Context)
- func (cecb *CreditEntryCreateBulk) OnConflict(opts ...sql.ConflictOption) *CreditEntryUpsertBulk
- func (cecb *CreditEntryCreateBulk) OnConflictColumns(columns ...string) *CreditEntryUpsertBulk
- func (cecb *CreditEntryCreateBulk) Save(ctx context.Context) ([]*CreditEntry, error)
- func (cecb *CreditEntryCreateBulk) SaveX(ctx context.Context) []*CreditEntry
- type CreditEntryDelete
- type CreditEntryDeleteOne
- type CreditEntryEdges
- type CreditEntryGroupBy
- func (cegb *CreditEntryGroupBy) Aggregate(fns ...AggregateFunc) *CreditEntryGroupBy
- func (s *CreditEntryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CreditEntryGroupBy) BoolX(ctx context.Context) bool
- func (s *CreditEntryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CreditEntryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CreditEntryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CreditEntryGroupBy) Float64X(ctx context.Context) float64
- func (s *CreditEntryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CreditEntryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CreditEntryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CreditEntryGroupBy) IntX(ctx context.Context) int
- func (s *CreditEntryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CreditEntryGroupBy) IntsX(ctx context.Context) []int
- func (cegb *CreditEntryGroupBy) Scan(ctx context.Context, v any) error
- func (s *CreditEntryGroupBy) ScanX(ctx context.Context, v any)
- func (s *CreditEntryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CreditEntryGroupBy) StringX(ctx context.Context) string
- func (s *CreditEntryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CreditEntryGroupBy) StringsX(ctx context.Context) []string
- type CreditEntryMutation
- func (m *CreditEntryMutation) AddAmount(f float64)
- func (m *CreditEntryMutation) AddExpirationPeriodCount(u int8)
- func (m *CreditEntryMutation) AddField(name string, value ent.Value) error
- func (m *CreditEntryMutation) AddPriority(u int8)
- func (m *CreditEntryMutation) AddRolloverMaxAmount(f float64)
- func (m *CreditEntryMutation) AddedAmount() (r float64, exists bool)
- func (m *CreditEntryMutation) AddedEdges() []string
- func (m *CreditEntryMutation) AddedExpirationPeriodCount() (r int8, exists bool)
- func (m *CreditEntryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CreditEntryMutation) AddedFields() []string
- func (m *CreditEntryMutation) AddedIDs(name string) []ent.Value
- func (m *CreditEntryMutation) AddedPriority() (r int8, exists bool)
- func (m *CreditEntryMutation) AddedRolloverMaxAmount() (r float64, exists bool)
- func (m *CreditEntryMutation) Amount() (r float64, exists bool)
- func (m *CreditEntryMutation) AmountCleared() bool
- func (m *CreditEntryMutation) ChildrenCleared() bool
- func (m *CreditEntryMutation) ChildrenID() (id pgulid.ULID, exists bool)
- func (m *CreditEntryMutation) ChildrenIDs() (ids []pgulid.ULID)
- func (m *CreditEntryMutation) ClearAmount()
- func (m *CreditEntryMutation) ClearChildren()
- func (m *CreditEntryMutation) ClearEdge(name string) error
- func (m *CreditEntryMutation) ClearExpirationAt()
- func (m *CreditEntryMutation) ClearExpirationPeriodCount()
- func (m *CreditEntryMutation) ClearExpirationPeriodDuration()
- func (m *CreditEntryMutation) ClearFeature()
- func (m *CreditEntryMutation) ClearFeatureID()
- func (m *CreditEntryMutation) ClearField(name string) error
- func (m *CreditEntryMutation) ClearMetadata()
- func (m *CreditEntryMutation) ClearParent()
- func (m *CreditEntryMutation) ClearParentID()
- func (m *CreditEntryMutation) ClearRolloverMaxAmount()
- func (m *CreditEntryMutation) ClearRolloverType()
- func (m *CreditEntryMutation) ClearType()
- func (m *CreditEntryMutation) ClearedEdges() []string
- func (m *CreditEntryMutation) ClearedFields() []string
- func (m CreditEntryMutation) Client() *Client
- func (m *CreditEntryMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CreditEntryMutation) EdgeCleared(name string) bool
- func (m *CreditEntryMutation) EffectiveAt() (r time.Time, exists bool)
- func (m *CreditEntryMutation) EntryType() (r credit.EntryType, exists bool)
- func (m *CreditEntryMutation) ExpirationAt() (r time.Time, exists bool)
- func (m *CreditEntryMutation) ExpirationAtCleared() bool
- func (m *CreditEntryMutation) ExpirationPeriodCount() (r uint8, exists bool)
- func (m *CreditEntryMutation) ExpirationPeriodCountCleared() bool
- func (m *CreditEntryMutation) ExpirationPeriodDuration() (r credit.ExpirationPeriodDuration, exists bool)
- func (m *CreditEntryMutation) ExpirationPeriodDurationCleared() bool
- func (m *CreditEntryMutation) FeatureCleared() bool
- func (m *CreditEntryMutation) FeatureID() (r pgulid.ULID, exists bool)
- func (m *CreditEntryMutation) FeatureIDCleared() bool
- func (m *CreditEntryMutation) FeatureIDs() (ids []pgulid.ULID)
- func (m *CreditEntryMutation) Field(name string) (ent.Value, bool)
- func (m *CreditEntryMutation) FieldCleared(name string) bool
- func (m *CreditEntryMutation) Fields() []string
- func (m *CreditEntryMutation) GetType() (r credit.GrantType, exists bool)
- func (m *CreditEntryMutation) ID() (id pgulid.ULID, exists bool)
- func (m *CreditEntryMutation) IDs(ctx context.Context) ([]pgulid.ULID, error)
- func (m *CreditEntryMutation) LedgerID() (r pgulid.ULID, exists bool)
- func (m *CreditEntryMutation) Metadata() (r map[string]string, exists bool)
- func (m *CreditEntryMutation) MetadataCleared() bool
- func (m *CreditEntryMutation) Namespace() (r string, exists bool)
- func (m *CreditEntryMutation) OldAmount(ctx context.Context) (v *float64, err error)
- func (m *CreditEntryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CreditEntryMutation) OldEffectiveAt(ctx context.Context) (v time.Time, err error)
- func (m *CreditEntryMutation) OldEntryType(ctx context.Context) (v credit.EntryType, err error)
- func (m *CreditEntryMutation) OldExpirationAt(ctx context.Context) (v *time.Time, err error)
- func (m *CreditEntryMutation) OldExpirationPeriodCount(ctx context.Context) (v *uint8, err error)
- func (m *CreditEntryMutation) OldExpirationPeriodDuration(ctx context.Context) (v *credit.ExpirationPeriodDuration, err error)
- func (m *CreditEntryMutation) OldFeatureID(ctx context.Context) (v *pgulid.ULID, err error)
- func (m *CreditEntryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CreditEntryMutation) OldLedgerID(ctx context.Context) (v pgulid.ULID, err error)
- func (m *CreditEntryMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)
- func (m *CreditEntryMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *CreditEntryMutation) OldParentID(ctx context.Context) (v *pgulid.ULID, err error)
- func (m *CreditEntryMutation) OldPriority(ctx context.Context) (v uint8, err error)
- func (m *CreditEntryMutation) OldRolloverMaxAmount(ctx context.Context) (v *float64, err error)
- func (m *CreditEntryMutation) OldRolloverType(ctx context.Context) (v *credit.GrantRolloverType, err error)
- func (m *CreditEntryMutation) OldType(ctx context.Context) (v *credit.GrantType, err error)
- func (m *CreditEntryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CreditEntryMutation) Op() Op
- func (m *CreditEntryMutation) ParentCleared() bool
- func (m *CreditEntryMutation) ParentID() (r pgulid.ULID, exists bool)
- func (m *CreditEntryMutation) ParentIDCleared() bool
- func (m *CreditEntryMutation) ParentIDs() (ids []pgulid.ULID)
- func (m *CreditEntryMutation) Priority() (r uint8, exists bool)
- func (m *CreditEntryMutation) RemovedEdges() []string
- func (m *CreditEntryMutation) RemovedIDs(name string) []ent.Value
- func (m *CreditEntryMutation) ResetAmount()
- func (m *CreditEntryMutation) ResetChildren()
- func (m *CreditEntryMutation) ResetCreatedAt()
- func (m *CreditEntryMutation) ResetEdge(name string) error
- func (m *CreditEntryMutation) ResetEffectiveAt()
- func (m *CreditEntryMutation) ResetEntryType()
- func (m *CreditEntryMutation) ResetExpirationAt()
- func (m *CreditEntryMutation) ResetExpirationPeriodCount()
- func (m *CreditEntryMutation) ResetExpirationPeriodDuration()
- func (m *CreditEntryMutation) ResetFeature()
- func (m *CreditEntryMutation) ResetFeatureID()
- func (m *CreditEntryMutation) ResetField(name string) error
- func (m *CreditEntryMutation) ResetLedgerID()
- func (m *CreditEntryMutation) ResetMetadata()
- func (m *CreditEntryMutation) ResetNamespace()
- func (m *CreditEntryMutation) ResetParent()
- func (m *CreditEntryMutation) ResetParentID()
- func (m *CreditEntryMutation) ResetPriority()
- func (m *CreditEntryMutation) ResetRolloverMaxAmount()
- func (m *CreditEntryMutation) ResetRolloverType()
- func (m *CreditEntryMutation) ResetType()
- func (m *CreditEntryMutation) ResetUpdatedAt()
- func (m *CreditEntryMutation) RolloverMaxAmount() (r float64, exists bool)
- func (m *CreditEntryMutation) RolloverMaxAmountCleared() bool
- func (m *CreditEntryMutation) RolloverType() (r credit.GrantRolloverType, exists bool)
- func (m *CreditEntryMutation) RolloverTypeCleared() bool
- func (m *CreditEntryMutation) SetAmount(f float64)
- func (m *CreditEntryMutation) SetChildrenID(id pgulid.ULID)
- func (m *CreditEntryMutation) SetCreatedAt(t time.Time)
- func (m *CreditEntryMutation) SetEffectiveAt(t time.Time)
- func (m *CreditEntryMutation) SetEntryType(ct credit.EntryType)
- func (m *CreditEntryMutation) SetExpirationAt(t time.Time)
- func (m *CreditEntryMutation) SetExpirationPeriodCount(u uint8)
- func (m *CreditEntryMutation) SetExpirationPeriodDuration(cpd credit.ExpirationPeriodDuration)
- func (m *CreditEntryMutation) SetFeatureID(pg pgulid.ULID)
- func (m *CreditEntryMutation) SetField(name string, value ent.Value) error
- func (m *CreditEntryMutation) SetID(id pgulid.ULID)
- func (m *CreditEntryMutation) SetLedgerID(pg pgulid.ULID)
- func (m *CreditEntryMutation) SetMetadata(value map[string]string)
- func (m *CreditEntryMutation) SetNamespace(s string)
- func (m *CreditEntryMutation) SetOp(op Op)
- func (m *CreditEntryMutation) SetParentID(pg pgulid.ULID)
- func (m *CreditEntryMutation) SetPriority(u uint8)
- func (m *CreditEntryMutation) SetRolloverMaxAmount(f float64)
- func (m *CreditEntryMutation) SetRolloverType(crt credit.GrantRolloverType)
- func (m *CreditEntryMutation) SetType(ct credit.GrantType)
- func (m *CreditEntryMutation) SetUpdatedAt(t time.Time)
- func (m CreditEntryMutation) Tx() (*Tx, error)
- func (m *CreditEntryMutation) Type() string
- func (m *CreditEntryMutation) TypeCleared() bool
- func (m *CreditEntryMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CreditEntryMutation) Where(ps ...predicate.CreditEntry)
- func (m *CreditEntryMutation) WhereP(ps ...func(*sql.Selector))
- type CreditEntryQuery
- func (ceq *CreditEntryQuery) Aggregate(fns ...AggregateFunc) *CreditEntrySelect
- func (ceq *CreditEntryQuery) All(ctx context.Context) ([]*CreditEntry, error)
- func (ceq *CreditEntryQuery) AllX(ctx context.Context) []*CreditEntry
- func (ceq *CreditEntryQuery) Clone() *CreditEntryQuery
- func (ceq *CreditEntryQuery) Count(ctx context.Context) (int, error)
- func (ceq *CreditEntryQuery) CountX(ctx context.Context) int
- func (ceq *CreditEntryQuery) Exist(ctx context.Context) (bool, error)
- func (ceq *CreditEntryQuery) ExistX(ctx context.Context) bool
- func (ceq *CreditEntryQuery) First(ctx context.Context) (*CreditEntry, error)
- func (ceq *CreditEntryQuery) FirstID(ctx context.Context) (id pgulid.ULID, err error)
- func (ceq *CreditEntryQuery) FirstIDX(ctx context.Context) pgulid.ULID
- func (ceq *CreditEntryQuery) FirstX(ctx context.Context) *CreditEntry
- func (ceq *CreditEntryQuery) ForShare(opts ...sql.LockOption) *CreditEntryQuery
- func (ceq *CreditEntryQuery) ForUpdate(opts ...sql.LockOption) *CreditEntryQuery
- func (ceq *CreditEntryQuery) GroupBy(field string, fields ...string) *CreditEntryGroupBy
- func (ceq *CreditEntryQuery) IDs(ctx context.Context) (ids []pgulid.ULID, err error)
- func (ceq *CreditEntryQuery) IDsX(ctx context.Context) []pgulid.ULID
- func (ceq *CreditEntryQuery) Limit(limit int) *CreditEntryQuery
- func (ceq *CreditEntryQuery) Offset(offset int) *CreditEntryQuery
- func (ceq *CreditEntryQuery) Only(ctx context.Context) (*CreditEntry, error)
- func (ceq *CreditEntryQuery) OnlyID(ctx context.Context) (id pgulid.ULID, err error)
- func (ceq *CreditEntryQuery) OnlyIDX(ctx context.Context) pgulid.ULID
- func (ceq *CreditEntryQuery) OnlyX(ctx context.Context) *CreditEntry
- func (ceq *CreditEntryQuery) Order(o ...creditentry.OrderOption) *CreditEntryQuery
- func (ceq *CreditEntryQuery) QueryChildren() *CreditEntryQuery
- func (ceq *CreditEntryQuery) QueryFeature() *FeatureQuery
- func (ceq *CreditEntryQuery) QueryParent() *CreditEntryQuery
- func (ceq *CreditEntryQuery) Select(fields ...string) *CreditEntrySelect
- func (ceq *CreditEntryQuery) Unique(unique bool) *CreditEntryQuery
- func (ceq *CreditEntryQuery) Where(ps ...predicate.CreditEntry) *CreditEntryQuery
- func (ceq *CreditEntryQuery) WithChildren(opts ...func(*CreditEntryQuery)) *CreditEntryQuery
- func (ceq *CreditEntryQuery) WithFeature(opts ...func(*FeatureQuery)) *CreditEntryQuery
- func (ceq *CreditEntryQuery) WithParent(opts ...func(*CreditEntryQuery)) *CreditEntryQuery
- type CreditEntrySelect
- func (ces *CreditEntrySelect) Aggregate(fns ...AggregateFunc) *CreditEntrySelect
- func (s *CreditEntrySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CreditEntrySelect) BoolX(ctx context.Context) bool
- func (s *CreditEntrySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CreditEntrySelect) BoolsX(ctx context.Context) []bool
- func (s *CreditEntrySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CreditEntrySelect) Float64X(ctx context.Context) float64
- func (s *CreditEntrySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CreditEntrySelect) Float64sX(ctx context.Context) []float64
- func (s *CreditEntrySelect) Int(ctx context.Context) (_ int, err error)
- func (s *CreditEntrySelect) IntX(ctx context.Context) int
- func (s *CreditEntrySelect) Ints(ctx context.Context) ([]int, error)
- func (s *CreditEntrySelect) IntsX(ctx context.Context) []int
- func (ces *CreditEntrySelect) Scan(ctx context.Context, v any) error
- func (s *CreditEntrySelect) ScanX(ctx context.Context, v any)
- func (s *CreditEntrySelect) String(ctx context.Context) (_ string, err error)
- func (s *CreditEntrySelect) StringX(ctx context.Context) string
- func (s *CreditEntrySelect) Strings(ctx context.Context) ([]string, error)
- func (s *CreditEntrySelect) StringsX(ctx context.Context) []string
- type CreditEntryUpdate
- func (ceu *CreditEntryUpdate) ClearChildren() *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) ClearMetadata() *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) Exec(ctx context.Context) error
- func (ceu *CreditEntryUpdate) ExecX(ctx context.Context)
- func (ceu *CreditEntryUpdate) Mutation() *CreditEntryMutation
- func (ceu *CreditEntryUpdate) Save(ctx context.Context) (int, error)
- func (ceu *CreditEntryUpdate) SaveX(ctx context.Context) int
- func (ceu *CreditEntryUpdate) SetChildren(c *CreditEntry) *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) SetChildrenID(id pgulid.ULID) *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) SetMetadata(m map[string]string) *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) SetUpdatedAt(t time.Time) *CreditEntryUpdate
- func (ceu *CreditEntryUpdate) Where(ps ...predicate.CreditEntry) *CreditEntryUpdate
- type CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) ClearChildren() *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) ClearMetadata() *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) Exec(ctx context.Context) error
- func (ceuo *CreditEntryUpdateOne) ExecX(ctx context.Context)
- func (ceuo *CreditEntryUpdateOne) Mutation() *CreditEntryMutation
- func (ceuo *CreditEntryUpdateOne) Save(ctx context.Context) (*CreditEntry, error)
- func (ceuo *CreditEntryUpdateOne) SaveX(ctx context.Context) *CreditEntry
- func (ceuo *CreditEntryUpdateOne) Select(field string, fields ...string) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) SetChildren(c *CreditEntry) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) SetChildrenID(id pgulid.ULID) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) SetMetadata(m map[string]string) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) SetUpdatedAt(t time.Time) *CreditEntryUpdateOne
- func (ceuo *CreditEntryUpdateOne) Where(ps ...predicate.CreditEntry) *CreditEntryUpdateOne
- type CreditEntryUpsert
- func (u *CreditEntryUpsert) ClearMetadata() *CreditEntryUpsert
- func (u *CreditEntryUpsert) SetMetadata(v map[string]string) *CreditEntryUpsert
- func (u *CreditEntryUpsert) SetUpdatedAt(v time.Time) *CreditEntryUpsert
- func (u *CreditEntryUpsert) UpdateMetadata() *CreditEntryUpsert
- func (u *CreditEntryUpsert) UpdateUpdatedAt() *CreditEntryUpsert
- type CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) ClearMetadata() *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) DoNothing() *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) Exec(ctx context.Context) error
- func (u *CreditEntryUpsertBulk) ExecX(ctx context.Context)
- func (u *CreditEntryUpsertBulk) Ignore() *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) SetMetadata(v map[string]string) *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) SetUpdatedAt(v time.Time) *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) Update(set func(*CreditEntryUpsert)) *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) UpdateMetadata() *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) UpdateNewValues() *CreditEntryUpsertBulk
- func (u *CreditEntryUpsertBulk) UpdateUpdatedAt() *CreditEntryUpsertBulk
- type CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) ClearMetadata() *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) DoNothing() *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) Exec(ctx context.Context) error
- func (u *CreditEntryUpsertOne) ExecX(ctx context.Context)
- func (u *CreditEntryUpsertOne) ID(ctx context.Context) (id pgulid.ULID, err error)
- func (u *CreditEntryUpsertOne) IDX(ctx context.Context) pgulid.ULID
- func (u *CreditEntryUpsertOne) Ignore() *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) SetMetadata(v map[string]string) *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) SetUpdatedAt(v time.Time) *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) Update(set func(*CreditEntryUpsert)) *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) UpdateMetadata() *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) UpdateNewValues() *CreditEntryUpsertOne
- func (u *CreditEntryUpsertOne) UpdateUpdatedAt() *CreditEntryUpsertOne
- type Feature
- type FeatureClient
- func (c *FeatureClient) Create() *FeatureCreate
- func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk
- func (c *FeatureClient) Delete() *FeatureDelete
- func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne
- func (c *FeatureClient) DeleteOneID(id pgulid.ULID) *FeatureDeleteOne
- func (c *FeatureClient) Get(ctx context.Context, id pgulid.ULID) (*Feature, error)
- func (c *FeatureClient) GetX(ctx context.Context, id pgulid.ULID) *Feature
- func (c *FeatureClient) Hooks() []Hook
- func (c *FeatureClient) Intercept(interceptors ...Interceptor)
- func (c *FeatureClient) Interceptors() []Interceptor
- func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk
- func (c *FeatureClient) Query() *FeatureQuery
- func (c *FeatureClient) QueryCreditGrants(f *Feature) *CreditEntryQuery
- func (c *FeatureClient) Update() *FeatureUpdate
- func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne
- func (c *FeatureClient) UpdateOneID(id pgulid.ULID) *FeatureUpdateOne
- func (c *FeatureClient) Use(hooks ...Hook)
- type FeatureCreate
- func (fc *FeatureCreate) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureCreate
- func (fc *FeatureCreate) AddCreditGrants(c ...*CreditEntry) *FeatureCreate
- func (fc *FeatureCreate) Exec(ctx context.Context) error
- func (fc *FeatureCreate) ExecX(ctx context.Context)
- func (fc *FeatureCreate) Mutation() *FeatureMutation
- func (fc *FeatureCreate) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertOne
- func (fc *FeatureCreate) OnConflictColumns(columns ...string) *FeatureUpsertOne
- func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)
- func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature
- func (fc *FeatureCreate) SetArchived(b bool) *FeatureCreate
- func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetID(pg pgulid.ULID) *FeatureCreate
- func (fc *FeatureCreate) SetMeterGroupByFilters(m map[string]string) *FeatureCreate
- func (fc *FeatureCreate) SetMeterSlug(s string) *FeatureCreate
- func (fc *FeatureCreate) SetName(s string) *FeatureCreate
- func (fc *FeatureCreate) SetNamespace(s string) *FeatureCreate
- func (fc *FeatureCreate) SetNillableArchived(b *bool) *FeatureCreate
- func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetNillableID(pg *pgulid.ULID) *FeatureCreate
- func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate
- type FeatureCreateBulk
- func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error
- func (fcb *FeatureCreateBulk) ExecX(ctx context.Context)
- func (fcb *FeatureCreateBulk) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertBulk
- func (fcb *FeatureCreateBulk) OnConflictColumns(columns ...string) *FeatureUpsertBulk
- func (fcb *FeatureCreateBulk) Save(ctx context.Context) ([]*Feature, error)
- func (fcb *FeatureCreateBulk) SaveX(ctx context.Context) []*Feature
- type FeatureDelete
- type FeatureDeleteOne
- type FeatureEdges
- type FeatureGroupBy
- func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy
- func (s *FeatureGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FeatureGroupBy) BoolX(ctx context.Context) bool
- func (s *FeatureGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FeatureGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FeatureGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FeatureGroupBy) Float64X(ctx context.Context) float64
- func (s *FeatureGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FeatureGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FeatureGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FeatureGroupBy) IntX(ctx context.Context) int
- func (s *FeatureGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FeatureGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error
- func (s *FeatureGroupBy) ScanX(ctx context.Context, v any)
- func (s *FeatureGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FeatureGroupBy) StringX(ctx context.Context) string
- func (s *FeatureGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FeatureGroupBy) StringsX(ctx context.Context) []string
- type FeatureMutation
- func (m *FeatureMutation) AddCreditGrantIDs(ids ...pgulid.ULID)
- func (m *FeatureMutation) AddField(name string, value ent.Value) error
- func (m *FeatureMutation) AddedEdges() []string
- func (m *FeatureMutation) AddedField(name string) (ent.Value, bool)
- func (m *FeatureMutation) AddedFields() []string
- func (m *FeatureMutation) AddedIDs(name string) []ent.Value
- func (m *FeatureMutation) Archived() (r bool, exists bool)
- func (m *FeatureMutation) ClearCreditGrants()
- func (m *FeatureMutation) ClearEdge(name string) error
- func (m *FeatureMutation) ClearField(name string) error
- func (m *FeatureMutation) ClearMeterGroupByFilters()
- func (m *FeatureMutation) ClearedEdges() []string
- func (m *FeatureMutation) ClearedFields() []string
- func (m FeatureMutation) Client() *Client
- func (m *FeatureMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FeatureMutation) CreditGrantsCleared() bool
- func (m *FeatureMutation) CreditGrantsIDs() (ids []pgulid.ULID)
- func (m *FeatureMutation) EdgeCleared(name string) bool
- func (m *FeatureMutation) Field(name string) (ent.Value, bool)
- func (m *FeatureMutation) FieldCleared(name string) bool
- func (m *FeatureMutation) Fields() []string
- func (m *FeatureMutation) ID() (id pgulid.ULID, exists bool)
- func (m *FeatureMutation) IDs(ctx context.Context) ([]pgulid.ULID, error)
- func (m *FeatureMutation) MeterGroupByFilters() (r map[string]string, exists bool)
- func (m *FeatureMutation) MeterGroupByFiltersCleared() bool
- func (m *FeatureMutation) MeterSlug() (r string, exists bool)
- func (m *FeatureMutation) Name() (r string, exists bool)
- func (m *FeatureMutation) Namespace() (r string, exists bool)
- func (m *FeatureMutation) OldArchived(ctx context.Context) (v bool, err error)
- func (m *FeatureMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FeatureMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FeatureMutation) OldMeterGroupByFilters(ctx context.Context) (v map[string]string, err error)
- func (m *FeatureMutation) OldMeterSlug(ctx context.Context) (v string, err error)
- func (m *FeatureMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FeatureMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *FeatureMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FeatureMutation) Op() Op
- func (m *FeatureMutation) RemoveCreditGrantIDs(ids ...pgulid.ULID)
- func (m *FeatureMutation) RemovedCreditGrantsIDs() (ids []pgulid.ULID)
- func (m *FeatureMutation) RemovedEdges() []string
- func (m *FeatureMutation) RemovedIDs(name string) []ent.Value
- func (m *FeatureMutation) ResetArchived()
- func (m *FeatureMutation) ResetCreatedAt()
- func (m *FeatureMutation) ResetCreditGrants()
- func (m *FeatureMutation) ResetEdge(name string) error
- func (m *FeatureMutation) ResetField(name string) error
- func (m *FeatureMutation) ResetMeterGroupByFilters()
- func (m *FeatureMutation) ResetMeterSlug()
- func (m *FeatureMutation) ResetName()
- func (m *FeatureMutation) ResetNamespace()
- func (m *FeatureMutation) ResetUpdatedAt()
- func (m *FeatureMutation) SetArchived(b bool)
- func (m *FeatureMutation) SetCreatedAt(t time.Time)
- func (m *FeatureMutation) SetField(name string, value ent.Value) error
- func (m *FeatureMutation) SetID(id pgulid.ULID)
- func (m *FeatureMutation) SetMeterGroupByFilters(value map[string]string)
- func (m *FeatureMutation) SetMeterSlug(s string)
- func (m *FeatureMutation) SetName(s string)
- func (m *FeatureMutation) SetNamespace(s string)
- func (m *FeatureMutation) SetOp(op Op)
- func (m *FeatureMutation) SetUpdatedAt(t time.Time)
- func (m FeatureMutation) Tx() (*Tx, error)
- func (m *FeatureMutation) Type() string
- func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *FeatureMutation) Where(ps ...predicate.Feature)
- func (m *FeatureMutation) WhereP(ps ...func(*sql.Selector))
- type FeatureQuery
- func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect
- func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)
- func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature
- func (fq *FeatureQuery) Clone() *FeatureQuery
- func (fq *FeatureQuery) Count(ctx context.Context) (int, error)
- func (fq *FeatureQuery) CountX(ctx context.Context) int
- func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FeatureQuery) ExistX(ctx context.Context) bool
- func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)
- func (fq *FeatureQuery) FirstID(ctx context.Context) (id pgulid.ULID, err error)
- func (fq *FeatureQuery) FirstIDX(ctx context.Context) pgulid.ULID
- func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature
- func (fq *FeatureQuery) ForShare(opts ...sql.LockOption) *FeatureQuery
- func (fq *FeatureQuery) ForUpdate(opts ...sql.LockOption) *FeatureQuery
- func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy
- func (fq *FeatureQuery) IDs(ctx context.Context) (ids []pgulid.ULID, err error)
- func (fq *FeatureQuery) IDsX(ctx context.Context) []pgulid.ULID
- func (fq *FeatureQuery) Limit(limit int) *FeatureQuery
- func (fq *FeatureQuery) Offset(offset int) *FeatureQuery
- func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)
- func (fq *FeatureQuery) OnlyID(ctx context.Context) (id pgulid.ULID, err error)
- func (fq *FeatureQuery) OnlyIDX(ctx context.Context) pgulid.ULID
- func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature
- func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery
- func (fq *FeatureQuery) QueryCreditGrants() *CreditEntryQuery
- func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect
- func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery
- func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery
- func (fq *FeatureQuery) WithCreditGrants(opts ...func(*CreditEntryQuery)) *FeatureQuery
- type FeatureSelect
- func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect
- func (s *FeatureSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FeatureSelect) BoolX(ctx context.Context) bool
- func (s *FeatureSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FeatureSelect) BoolsX(ctx context.Context) []bool
- func (s *FeatureSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FeatureSelect) Float64X(ctx context.Context) float64
- func (s *FeatureSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FeatureSelect) Float64sX(ctx context.Context) []float64
- func (s *FeatureSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FeatureSelect) IntX(ctx context.Context) int
- func (s *FeatureSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FeatureSelect) IntsX(ctx context.Context) []int
- func (fs *FeatureSelect) Scan(ctx context.Context, v any) error
- func (s *FeatureSelect) ScanX(ctx context.Context, v any)
- func (s *FeatureSelect) String(ctx context.Context) (_ string, err error)
- func (s *FeatureSelect) StringX(ctx context.Context) string
- func (s *FeatureSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FeatureSelect) StringsX(ctx context.Context) []string
- type FeatureUpdate
- func (fu *FeatureUpdate) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdate
- func (fu *FeatureUpdate) AddCreditGrants(c ...*CreditEntry) *FeatureUpdate
- func (fu *FeatureUpdate) ClearCreditGrants() *FeatureUpdate
- func (fu *FeatureUpdate) ClearMeterGroupByFilters() *FeatureUpdate
- func (fu *FeatureUpdate) Exec(ctx context.Context) error
- func (fu *FeatureUpdate) ExecX(ctx context.Context)
- func (fu *FeatureUpdate) Mutation() *FeatureMutation
- func (fu *FeatureUpdate) RemoveCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdate
- func (fu *FeatureUpdate) RemoveCreditGrants(c ...*CreditEntry) *FeatureUpdate
- func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)
- func (fu *FeatureUpdate) SaveX(ctx context.Context) int
- func (fu *FeatureUpdate) SetArchived(b bool) *FeatureUpdate
- func (fu *FeatureUpdate) SetMeterGroupByFilters(m map[string]string) *FeatureUpdate
- func (fu *FeatureUpdate) SetName(s string) *FeatureUpdate
- func (fu *FeatureUpdate) SetNillableArchived(b *bool) *FeatureUpdate
- func (fu *FeatureUpdate) SetNillableName(s *string) *FeatureUpdate
- func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate
- func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate
- type FeatureUpdateOne
- func (fuo *FeatureUpdateOne) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) AddCreditGrants(c ...*CreditEntry) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) ClearCreditGrants() *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) ClearMeterGroupByFilters() *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error
- func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)
- func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation
- func (fuo *FeatureUpdateOne) RemoveCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) RemoveCreditGrants(c ...*CreditEntry) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)
- func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature
- func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetArchived(b bool) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetMeterGroupByFilters(m map[string]string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetName(s string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetNillableArchived(b *bool) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetNillableName(s *string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Where(ps ...predicate.Feature) *FeatureUpdateOne
- type FeatureUpsert
- func (u *FeatureUpsert) ClearMeterGroupByFilters() *FeatureUpsert
- func (u *FeatureUpsert) SetArchived(v bool) *FeatureUpsert
- func (u *FeatureUpsert) SetMeterGroupByFilters(v map[string]string) *FeatureUpsert
- func (u *FeatureUpsert) SetName(v string) *FeatureUpsert
- func (u *FeatureUpsert) SetUpdatedAt(v time.Time) *FeatureUpsert
- func (u *FeatureUpsert) UpdateArchived() *FeatureUpsert
- func (u *FeatureUpsert) UpdateMeterGroupByFilters() *FeatureUpsert
- func (u *FeatureUpsert) UpdateName() *FeatureUpsert
- func (u *FeatureUpsert) UpdateUpdatedAt() *FeatureUpsert
- type FeatureUpsertBulk
- func (u *FeatureUpsertBulk) ClearMeterGroupByFilters() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) DoNothing() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) Exec(ctx context.Context) error
- func (u *FeatureUpsertBulk) ExecX(ctx context.Context)
- func (u *FeatureUpsertBulk) Ignore() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) SetArchived(v bool) *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) SetName(v string) *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) SetUpdatedAt(v time.Time) *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) Update(set func(*FeatureUpsert)) *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) UpdateArchived() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) UpdateMeterGroupByFilters() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) UpdateName() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) UpdateNewValues() *FeatureUpsertBulk
- func (u *FeatureUpsertBulk) UpdateUpdatedAt() *FeatureUpsertBulk
- type FeatureUpsertOne
- func (u *FeatureUpsertOne) ClearMeterGroupByFilters() *FeatureUpsertOne
- func (u *FeatureUpsertOne) DoNothing() *FeatureUpsertOne
- func (u *FeatureUpsertOne) Exec(ctx context.Context) error
- func (u *FeatureUpsertOne) ExecX(ctx context.Context)
- func (u *FeatureUpsertOne) ID(ctx context.Context) (id pgulid.ULID, err error)
- func (u *FeatureUpsertOne) IDX(ctx context.Context) pgulid.ULID
- func (u *FeatureUpsertOne) Ignore() *FeatureUpsertOne
- func (u *FeatureUpsertOne) SetArchived(v bool) *FeatureUpsertOne
- func (u *FeatureUpsertOne) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertOne
- func (u *FeatureUpsertOne) SetName(v string) *FeatureUpsertOne
- func (u *FeatureUpsertOne) SetUpdatedAt(v time.Time) *FeatureUpsertOne
- func (u *FeatureUpsertOne) Update(set func(*FeatureUpsert)) *FeatureUpsertOne
- func (u *FeatureUpsertOne) UpdateArchived() *FeatureUpsertOne
- func (u *FeatureUpsertOne) UpdateMeterGroupByFilters() *FeatureUpsertOne
- func (u *FeatureUpsertOne) UpdateName() *FeatureUpsertOne
- func (u *FeatureUpsertOne) UpdateNewValues() *FeatureUpsertOne
- func (u *FeatureUpsertOne) UpdateUpdatedAt() *FeatureUpsertOne
- type Features
- type Hook
- type InterceptFunc
- type Interceptor
- type Ledger
- type LedgerClient
- func (c *LedgerClient) Create() *LedgerCreate
- func (c *LedgerClient) CreateBulk(builders ...*LedgerCreate) *LedgerCreateBulk
- func (c *LedgerClient) Delete() *LedgerDelete
- func (c *LedgerClient) DeleteOne(l *Ledger) *LedgerDeleteOne
- func (c *LedgerClient) DeleteOneID(id pgulid.ULID) *LedgerDeleteOne
- func (c *LedgerClient) Get(ctx context.Context, id pgulid.ULID) (*Ledger, error)
- func (c *LedgerClient) GetX(ctx context.Context, id pgulid.ULID) *Ledger
- func (c *LedgerClient) Hooks() []Hook
- func (c *LedgerClient) Intercept(interceptors ...Interceptor)
- func (c *LedgerClient) Interceptors() []Interceptor
- func (c *LedgerClient) MapCreateBulk(slice any, setFunc func(*LedgerCreate, int)) *LedgerCreateBulk
- func (c *LedgerClient) Query() *LedgerQuery
- func (c *LedgerClient) Update() *LedgerUpdate
- func (c *LedgerClient) UpdateOne(l *Ledger) *LedgerUpdateOne
- func (c *LedgerClient) UpdateOneID(id pgulid.ULID) *LedgerUpdateOne
- func (c *LedgerClient) Use(hooks ...Hook)
- type LedgerCreate
- func (lc *LedgerCreate) Exec(ctx context.Context) error
- func (lc *LedgerCreate) ExecX(ctx context.Context)
- func (lc *LedgerCreate) Mutation() *LedgerMutation
- func (lc *LedgerCreate) OnConflict(opts ...sql.ConflictOption) *LedgerUpsertOne
- func (lc *LedgerCreate) OnConflictColumns(columns ...string) *LedgerUpsertOne
- func (lc *LedgerCreate) Save(ctx context.Context) (*Ledger, error)
- func (lc *LedgerCreate) SaveX(ctx context.Context) *Ledger
- func (lc *LedgerCreate) SetCreatedAt(t time.Time) *LedgerCreate
- func (lc *LedgerCreate) SetHighwatermark(t time.Time) *LedgerCreate
- func (lc *LedgerCreate) SetID(pg pgulid.ULID) *LedgerCreate
- func (lc *LedgerCreate) SetMetadata(m map[string]string) *LedgerCreate
- func (lc *LedgerCreate) SetNamespace(s string) *LedgerCreate
- func (lc *LedgerCreate) SetNillableCreatedAt(t *time.Time) *LedgerCreate
- func (lc *LedgerCreate) SetNillableHighwatermark(t *time.Time) *LedgerCreate
- func (lc *LedgerCreate) SetNillableID(pg *pgulid.ULID) *LedgerCreate
- func (lc *LedgerCreate) SetNillableUpdatedAt(t *time.Time) *LedgerCreate
- func (lc *LedgerCreate) SetSubject(s string) *LedgerCreate
- func (lc *LedgerCreate) SetUpdatedAt(t time.Time) *LedgerCreate
- type LedgerCreateBulk
- func (lcb *LedgerCreateBulk) Exec(ctx context.Context) error
- func (lcb *LedgerCreateBulk) ExecX(ctx context.Context)
- func (lcb *LedgerCreateBulk) OnConflict(opts ...sql.ConflictOption) *LedgerUpsertBulk
- func (lcb *LedgerCreateBulk) OnConflictColumns(columns ...string) *LedgerUpsertBulk
- func (lcb *LedgerCreateBulk) Save(ctx context.Context) ([]*Ledger, error)
- func (lcb *LedgerCreateBulk) SaveX(ctx context.Context) []*Ledger
- type LedgerDelete
- type LedgerDeleteOne
- type LedgerGroupBy
- func (lgb *LedgerGroupBy) Aggregate(fns ...AggregateFunc) *LedgerGroupBy
- func (s *LedgerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LedgerGroupBy) BoolX(ctx context.Context) bool
- func (s *LedgerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LedgerGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LedgerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LedgerGroupBy) Float64X(ctx context.Context) float64
- func (s *LedgerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LedgerGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LedgerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LedgerGroupBy) IntX(ctx context.Context) int
- func (s *LedgerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LedgerGroupBy) IntsX(ctx context.Context) []int
- func (lgb *LedgerGroupBy) Scan(ctx context.Context, v any) error
- func (s *LedgerGroupBy) ScanX(ctx context.Context, v any)
- func (s *LedgerGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LedgerGroupBy) StringX(ctx context.Context) string
- func (s *LedgerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LedgerGroupBy) StringsX(ctx context.Context) []string
- type LedgerMutation
- func (m *LedgerMutation) AddField(name string, value ent.Value) error
- func (m *LedgerMutation) AddedEdges() []string
- func (m *LedgerMutation) AddedField(name string) (ent.Value, bool)
- func (m *LedgerMutation) AddedFields() []string
- func (m *LedgerMutation) AddedIDs(name string) []ent.Value
- func (m *LedgerMutation) ClearEdge(name string) error
- func (m *LedgerMutation) ClearField(name string) error
- func (m *LedgerMutation) ClearMetadata()
- func (m *LedgerMutation) ClearedEdges() []string
- func (m *LedgerMutation) ClearedFields() []string
- func (m LedgerMutation) Client() *Client
- func (m *LedgerMutation) CreatedAt() (r time.Time, exists bool)
- func (m *LedgerMutation) EdgeCleared(name string) bool
- func (m *LedgerMutation) Field(name string) (ent.Value, bool)
- func (m *LedgerMutation) FieldCleared(name string) bool
- func (m *LedgerMutation) Fields() []string
- func (m *LedgerMutation) Highwatermark() (r time.Time, exists bool)
- func (m *LedgerMutation) ID() (id pgulid.ULID, exists bool)
- func (m *LedgerMutation) IDs(ctx context.Context) ([]pgulid.ULID, error)
- func (m *LedgerMutation) Metadata() (r map[string]string, exists bool)
- func (m *LedgerMutation) MetadataCleared() bool
- func (m *LedgerMutation) Namespace() (r string, exists bool)
- func (m *LedgerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *LedgerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LedgerMutation) OldHighwatermark(ctx context.Context) (v time.Time, err error)
- func (m *LedgerMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)
- func (m *LedgerMutation) OldNamespace(ctx context.Context) (v string, err error)
- func (m *LedgerMutation) OldSubject(ctx context.Context) (v string, err error)
- func (m *LedgerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *LedgerMutation) Op() Op
- func (m *LedgerMutation) RemovedEdges() []string
- func (m *LedgerMutation) RemovedIDs(name string) []ent.Value
- func (m *LedgerMutation) ResetCreatedAt()
- func (m *LedgerMutation) ResetEdge(name string) error
- func (m *LedgerMutation) ResetField(name string) error
- func (m *LedgerMutation) ResetHighwatermark()
- func (m *LedgerMutation) ResetMetadata()
- func (m *LedgerMutation) ResetNamespace()
- func (m *LedgerMutation) ResetSubject()
- func (m *LedgerMutation) ResetUpdatedAt()
- func (m *LedgerMutation) SetCreatedAt(t time.Time)
- func (m *LedgerMutation) SetField(name string, value ent.Value) error
- func (m *LedgerMutation) SetHighwatermark(t time.Time)
- func (m *LedgerMutation) SetID(id pgulid.ULID)
- func (m *LedgerMutation) SetMetadata(value map[string]string)
- func (m *LedgerMutation) SetNamespace(s string)
- func (m *LedgerMutation) SetOp(op Op)
- func (m *LedgerMutation) SetSubject(s string)
- func (m *LedgerMutation) SetUpdatedAt(t time.Time)
- func (m *LedgerMutation) Subject() (r string, exists bool)
- func (m LedgerMutation) Tx() (*Tx, error)
- func (m *LedgerMutation) Type() string
- func (m *LedgerMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *LedgerMutation) Where(ps ...predicate.Ledger)
- func (m *LedgerMutation) WhereP(ps ...func(*sql.Selector))
- type LedgerQuery
- func (lq *LedgerQuery) Aggregate(fns ...AggregateFunc) *LedgerSelect
- func (lq *LedgerQuery) All(ctx context.Context) ([]*Ledger, error)
- func (lq *LedgerQuery) AllX(ctx context.Context) []*Ledger
- func (lq *LedgerQuery) Clone() *LedgerQuery
- func (lq *LedgerQuery) Count(ctx context.Context) (int, error)
- func (lq *LedgerQuery) CountX(ctx context.Context) int
- func (lq *LedgerQuery) Exist(ctx context.Context) (bool, error)
- func (lq *LedgerQuery) ExistX(ctx context.Context) bool
- func (lq *LedgerQuery) First(ctx context.Context) (*Ledger, error)
- func (lq *LedgerQuery) FirstID(ctx context.Context) (id pgulid.ULID, err error)
- func (lq *LedgerQuery) FirstIDX(ctx context.Context) pgulid.ULID
- func (lq *LedgerQuery) FirstX(ctx context.Context) *Ledger
- func (lq *LedgerQuery) ForShare(opts ...sql.LockOption) *LedgerQuery
- func (lq *LedgerQuery) ForUpdate(opts ...sql.LockOption) *LedgerQuery
- func (lq *LedgerQuery) GroupBy(field string, fields ...string) *LedgerGroupBy
- func (lq *LedgerQuery) IDs(ctx context.Context) (ids []pgulid.ULID, err error)
- func (lq *LedgerQuery) IDsX(ctx context.Context) []pgulid.ULID
- func (lq *LedgerQuery) Limit(limit int) *LedgerQuery
- func (lq *LedgerQuery) Offset(offset int) *LedgerQuery
- func (lq *LedgerQuery) Only(ctx context.Context) (*Ledger, error)
- func (lq *LedgerQuery) OnlyID(ctx context.Context) (id pgulid.ULID, err error)
- func (lq *LedgerQuery) OnlyIDX(ctx context.Context) pgulid.ULID
- func (lq *LedgerQuery) OnlyX(ctx context.Context) *Ledger
- func (lq *LedgerQuery) Order(o ...ledger.OrderOption) *LedgerQuery
- func (lq *LedgerQuery) Select(fields ...string) *LedgerSelect
- func (lq *LedgerQuery) Unique(unique bool) *LedgerQuery
- func (lq *LedgerQuery) Where(ps ...predicate.Ledger) *LedgerQuery
- type LedgerSelect
- func (ls *LedgerSelect) Aggregate(fns ...AggregateFunc) *LedgerSelect
- func (s *LedgerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LedgerSelect) BoolX(ctx context.Context) bool
- func (s *LedgerSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LedgerSelect) BoolsX(ctx context.Context) []bool
- func (s *LedgerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LedgerSelect) Float64X(ctx context.Context) float64
- func (s *LedgerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LedgerSelect) Float64sX(ctx context.Context) []float64
- func (s *LedgerSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LedgerSelect) IntX(ctx context.Context) int
- func (s *LedgerSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LedgerSelect) IntsX(ctx context.Context) []int
- func (ls *LedgerSelect) Scan(ctx context.Context, v any) error
- func (s *LedgerSelect) ScanX(ctx context.Context, v any)
- func (s *LedgerSelect) String(ctx context.Context) (_ string, err error)
- func (s *LedgerSelect) StringX(ctx context.Context) string
- func (s *LedgerSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LedgerSelect) StringsX(ctx context.Context) []string
- type LedgerUpdate
- func (lu *LedgerUpdate) ClearMetadata() *LedgerUpdate
- func (lu *LedgerUpdate) Exec(ctx context.Context) error
- func (lu *LedgerUpdate) ExecX(ctx context.Context)
- func (lu *LedgerUpdate) Mutation() *LedgerMutation
- func (lu *LedgerUpdate) Save(ctx context.Context) (int, error)
- func (lu *LedgerUpdate) SaveX(ctx context.Context) int
- func (lu *LedgerUpdate) SetHighwatermark(t time.Time) *LedgerUpdate
- func (lu *LedgerUpdate) SetMetadata(m map[string]string) *LedgerUpdate
- func (lu *LedgerUpdate) SetNillableHighwatermark(t *time.Time) *LedgerUpdate
- func (lu *LedgerUpdate) SetUpdatedAt(t time.Time) *LedgerUpdate
- func (lu *LedgerUpdate) Where(ps ...predicate.Ledger) *LedgerUpdate
- type LedgerUpdateOne
- func (luo *LedgerUpdateOne) ClearMetadata() *LedgerUpdateOne
- func (luo *LedgerUpdateOne) Exec(ctx context.Context) error
- func (luo *LedgerUpdateOne) ExecX(ctx context.Context)
- func (luo *LedgerUpdateOne) Mutation() *LedgerMutation
- func (luo *LedgerUpdateOne) Save(ctx context.Context) (*Ledger, error)
- func (luo *LedgerUpdateOne) SaveX(ctx context.Context) *Ledger
- func (luo *LedgerUpdateOne) Select(field string, fields ...string) *LedgerUpdateOne
- func (luo *LedgerUpdateOne) SetHighwatermark(t time.Time) *LedgerUpdateOne
- func (luo *LedgerUpdateOne) SetMetadata(m map[string]string) *LedgerUpdateOne
- func (luo *LedgerUpdateOne) SetNillableHighwatermark(t *time.Time) *LedgerUpdateOne
- func (luo *LedgerUpdateOne) SetUpdatedAt(t time.Time) *LedgerUpdateOne
- func (luo *LedgerUpdateOne) Where(ps ...predicate.Ledger) *LedgerUpdateOne
- type LedgerUpsert
- func (u *LedgerUpsert) ClearMetadata() *LedgerUpsert
- func (u *LedgerUpsert) SetHighwatermark(v time.Time) *LedgerUpsert
- func (u *LedgerUpsert) SetMetadata(v map[string]string) *LedgerUpsert
- func (u *LedgerUpsert) SetUpdatedAt(v time.Time) *LedgerUpsert
- func (u *LedgerUpsert) UpdateHighwatermark() *LedgerUpsert
- func (u *LedgerUpsert) UpdateMetadata() *LedgerUpsert
- func (u *LedgerUpsert) UpdateUpdatedAt() *LedgerUpsert
- type LedgerUpsertBulk
- func (u *LedgerUpsertBulk) ClearMetadata() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) DoNothing() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) Exec(ctx context.Context) error
- func (u *LedgerUpsertBulk) ExecX(ctx context.Context)
- func (u *LedgerUpsertBulk) Ignore() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) SetHighwatermark(v time.Time) *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) SetMetadata(v map[string]string) *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) SetUpdatedAt(v time.Time) *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) Update(set func(*LedgerUpsert)) *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) UpdateHighwatermark() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) UpdateMetadata() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) UpdateNewValues() *LedgerUpsertBulk
- func (u *LedgerUpsertBulk) UpdateUpdatedAt() *LedgerUpsertBulk
- type LedgerUpsertOne
- func (u *LedgerUpsertOne) ClearMetadata() *LedgerUpsertOne
- func (u *LedgerUpsertOne) DoNothing() *LedgerUpsertOne
- func (u *LedgerUpsertOne) Exec(ctx context.Context) error
- func (u *LedgerUpsertOne) ExecX(ctx context.Context)
- func (u *LedgerUpsertOne) ID(ctx context.Context) (id pgulid.ULID, err error)
- func (u *LedgerUpsertOne) IDX(ctx context.Context) pgulid.ULID
- func (u *LedgerUpsertOne) Ignore() *LedgerUpsertOne
- func (u *LedgerUpsertOne) SetHighwatermark(v time.Time) *LedgerUpsertOne
- func (u *LedgerUpsertOne) SetMetadata(v map[string]string) *LedgerUpsertOne
- func (u *LedgerUpsertOne) SetUpdatedAt(v time.Time) *LedgerUpsertOne
- func (u *LedgerUpsertOne) Update(set func(*LedgerUpsert)) *LedgerUpsertOne
- func (u *LedgerUpsertOne) UpdateHighwatermark() *LedgerUpsertOne
- func (u *LedgerUpsertOne) UpdateMetadata() *LedgerUpsertOne
- func (u *LedgerUpsertOne) UpdateNewValues() *LedgerUpsertOne
- func (u *LedgerUpsertOne) UpdateUpdatedAt() *LedgerUpsertOne
- type Ledgers
- 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. TypeCreditEntry = "CreditEntry" TypeFeature = "Feature" TypeLedger = "Ledger" )
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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // CreditEntry is the client for interacting with the CreditEntry builders. CreditEntry *CreditEntryClient // Feature is the client for interacting with the Feature builders. Feature *FeatureClient // Ledger is the client for interacting with the Ledger builders. Ledger *LedgerClient // 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(). CreditEntry. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type CreditEntries ¶
type CreditEntries []*CreditEntry
CreditEntries is a parsable slice of CreditEntry.
type CreditEntry ¶
type CreditEntry struct { // ID of the ent. ID pgulid.ULID `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Namespace holds the value of the "namespace" field. Namespace string `json:"namespace,omitempty"` // LedgerID holds the value of the "ledger_id" field. LedgerID pgulid.ULID `json:"ledger_id,omitempty"` // EntryType holds the value of the "entry_type" field. EntryType credit.EntryType `json:"entry_type,omitempty"` // Type holds the value of the "type" field. Type *credit.GrantType `json:"type,omitempty"` // FeatureID holds the value of the "feature_id" field. FeatureID *pgulid.ULID `json:"feature_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"` // ExpirationPeriodDuration holds the value of the "expiration_period_duration" field. ExpirationPeriodDuration *credit.ExpirationPeriodDuration `json:"expiration_period_duration,omitempty"` // ExpirationPeriodCount holds the value of the "expiration_period_count" field. ExpirationPeriodCount *uint8 `json:"expiration_period_count,omitempty"` // ExpirationAt holds the value of the "expiration_at" field. ExpirationAt *time.Time `json:"expiration_at,omitempty"` // RolloverType holds the value of the "rollover_type" field. RolloverType *credit.GrantRolloverType `json:"rollover_type,omitempty"` // RolloverMaxAmount holds the value of the "rollover_max_amount" field. RolloverMaxAmount *float64 `json:"rollover_max_amount,omitempty"` // Metadata holds the value of the "metadata" field. Metadata map[string]string `json:"metadata,omitempty"` // ParentID holds the value of the "parent_id" field. ParentID *pgulid.ULID `json:"parent_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CreditEntryQuery when eager-loading is set. Edges CreditEntryEdges `json:"edges"` // contains filtered or unexported fields }
CreditEntry is the model entity for the CreditEntry schema.
func (*CreditEntry) QueryChildren ¶
func (ce *CreditEntry) QueryChildren() *CreditEntryQuery
QueryChildren queries the "children" edge of the CreditEntry entity.
func (*CreditEntry) QueryFeature ¶
func (ce *CreditEntry) QueryFeature() *FeatureQuery
QueryFeature queries the "feature" edge of the CreditEntry entity.
func (*CreditEntry) QueryParent ¶
func (ce *CreditEntry) QueryParent() *CreditEntryQuery
QueryParent queries the "parent" edge of the CreditEntry entity.
func (*CreditEntry) String ¶
func (ce *CreditEntry) String() string
String implements the fmt.Stringer.
func (*CreditEntry) Unwrap ¶
func (ce *CreditEntry) Unwrap() *CreditEntry
Unwrap unwraps the CreditEntry 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 (*CreditEntry) Update ¶
func (ce *CreditEntry) Update() *CreditEntryUpdateOne
Update returns a builder for updating this CreditEntry. Note that you need to call CreditEntry.Unwrap() before calling this method if this CreditEntry was returned from a transaction, and the transaction was committed or rolled back.
type CreditEntryClient ¶
type CreditEntryClient struct {
// contains filtered or unexported fields
}
CreditEntryClient is a client for the CreditEntry schema.
func NewCreditEntryClient ¶
func NewCreditEntryClient(c config) *CreditEntryClient
NewCreditEntryClient returns a client for the CreditEntry from the given config.
func (*CreditEntryClient) Create ¶
func (c *CreditEntryClient) Create() *CreditEntryCreate
Create returns a builder for creating a CreditEntry entity.
func (*CreditEntryClient) CreateBulk ¶
func (c *CreditEntryClient) CreateBulk(builders ...*CreditEntryCreate) *CreditEntryCreateBulk
CreateBulk returns a builder for creating a bulk of CreditEntry entities.
func (*CreditEntryClient) Delete ¶
func (c *CreditEntryClient) Delete() *CreditEntryDelete
Delete returns a delete builder for CreditEntry.
func (*CreditEntryClient) DeleteOne ¶
func (c *CreditEntryClient) DeleteOne(ce *CreditEntry) *CreditEntryDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CreditEntryClient) DeleteOneID ¶
func (c *CreditEntryClient) DeleteOneID(id pgulid.ULID) *CreditEntryDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CreditEntryClient) Get ¶
func (c *CreditEntryClient) Get(ctx context.Context, id pgulid.ULID) (*CreditEntry, error)
Get returns a CreditEntry entity by its id.
func (*CreditEntryClient) GetX ¶
func (c *CreditEntryClient) GetX(ctx context.Context, id pgulid.ULID) *CreditEntry
GetX is like Get, but panics if an error occurs.
func (*CreditEntryClient) Hooks ¶
func (c *CreditEntryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CreditEntryClient) Intercept ¶
func (c *CreditEntryClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `creditentry.Intercept(f(g(h())))`.
func (*CreditEntryClient) Interceptors ¶
func (c *CreditEntryClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CreditEntryClient) MapCreateBulk ¶
func (c *CreditEntryClient) MapCreateBulk(slice any, setFunc func(*CreditEntryCreate, int)) *CreditEntryCreateBulk
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 (*CreditEntryClient) Query ¶
func (c *CreditEntryClient) Query() *CreditEntryQuery
Query returns a query builder for CreditEntry.
func (*CreditEntryClient) QueryChildren ¶
func (c *CreditEntryClient) QueryChildren(ce *CreditEntry) *CreditEntryQuery
QueryChildren queries the children edge of a CreditEntry.
func (*CreditEntryClient) QueryFeature ¶
func (c *CreditEntryClient) QueryFeature(ce *CreditEntry) *FeatureQuery
QueryFeature queries the feature edge of a CreditEntry.
func (*CreditEntryClient) QueryParent ¶
func (c *CreditEntryClient) QueryParent(ce *CreditEntry) *CreditEntryQuery
QueryParent queries the parent edge of a CreditEntry.
func (*CreditEntryClient) Update ¶
func (c *CreditEntryClient) Update() *CreditEntryUpdate
Update returns an update builder for CreditEntry.
func (*CreditEntryClient) UpdateOne ¶
func (c *CreditEntryClient) UpdateOne(ce *CreditEntry) *CreditEntryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CreditEntryClient) UpdateOneID ¶
func (c *CreditEntryClient) UpdateOneID(id pgulid.ULID) *CreditEntryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CreditEntryClient) Use ¶
func (c *CreditEntryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `creditentry.Hooks(f(g(h())))`.
type CreditEntryCreate ¶
type CreditEntryCreate struct {
// contains filtered or unexported fields
}
CreditEntryCreate is the builder for creating a CreditEntry entity.
func (*CreditEntryCreate) Exec ¶
func (cec *CreditEntryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CreditEntryCreate) ExecX ¶
func (cec *CreditEntryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryCreate) Mutation ¶
func (cec *CreditEntryCreate) Mutation() *CreditEntryMutation
Mutation returns the CreditEntryMutation object of the builder.
func (*CreditEntryCreate) OnConflict ¶
func (cec *CreditEntryCreate) OnConflict(opts ...sql.ConflictOption) *CreditEntryUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.CreditEntry.Create(). SetCreatedAt(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.CreditEntryUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CreditEntryCreate) OnConflictColumns ¶
func (cec *CreditEntryCreate) OnConflictColumns(columns ...string) *CreditEntryUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.CreditEntry.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*CreditEntryCreate) Save ¶
func (cec *CreditEntryCreate) Save(ctx context.Context) (*CreditEntry, error)
Save creates the CreditEntry in the database.
func (*CreditEntryCreate) SaveX ¶
func (cec *CreditEntryCreate) SaveX(ctx context.Context) *CreditEntry
SaveX calls Save and panics if Save returns an error.
func (*CreditEntryCreate) SetAmount ¶
func (cec *CreditEntryCreate) SetAmount(f float64) *CreditEntryCreate
SetAmount sets the "amount" field.
func (*CreditEntryCreate) SetChildren ¶
func (cec *CreditEntryCreate) SetChildren(c *CreditEntry) *CreditEntryCreate
SetChildren sets the "children" edge to the CreditEntry entity.
func (*CreditEntryCreate) SetChildrenID ¶
func (cec *CreditEntryCreate) SetChildrenID(id pgulid.ULID) *CreditEntryCreate
SetChildrenID sets the "children" edge to the CreditEntry entity by ID.
func (*CreditEntryCreate) SetCreatedAt ¶
func (cec *CreditEntryCreate) SetCreatedAt(t time.Time) *CreditEntryCreate
SetCreatedAt sets the "created_at" field.
func (*CreditEntryCreate) SetEffectiveAt ¶
func (cec *CreditEntryCreate) SetEffectiveAt(t time.Time) *CreditEntryCreate
SetEffectiveAt sets the "effective_at" field.
func (*CreditEntryCreate) SetEntryType ¶
func (cec *CreditEntryCreate) SetEntryType(ct credit.EntryType) *CreditEntryCreate
SetEntryType sets the "entry_type" field.
func (*CreditEntryCreate) SetExpirationAt ¶
func (cec *CreditEntryCreate) SetExpirationAt(t time.Time) *CreditEntryCreate
SetExpirationAt sets the "expiration_at" field.
func (*CreditEntryCreate) SetExpirationPeriodCount ¶
func (cec *CreditEntryCreate) SetExpirationPeriodCount(u uint8) *CreditEntryCreate
SetExpirationPeriodCount sets the "expiration_period_count" field.
func (*CreditEntryCreate) SetExpirationPeriodDuration ¶
func (cec *CreditEntryCreate) SetExpirationPeriodDuration(cpd credit.ExpirationPeriodDuration) *CreditEntryCreate
SetExpirationPeriodDuration sets the "expiration_period_duration" field.
func (*CreditEntryCreate) SetFeature ¶
func (cec *CreditEntryCreate) SetFeature(f *Feature) *CreditEntryCreate
SetFeature sets the "feature" edge to the Feature entity.
func (*CreditEntryCreate) SetFeatureID ¶
func (cec *CreditEntryCreate) SetFeatureID(pg pgulid.ULID) *CreditEntryCreate
SetFeatureID sets the "feature_id" field.
func (*CreditEntryCreate) SetID ¶
func (cec *CreditEntryCreate) SetID(pg pgulid.ULID) *CreditEntryCreate
SetID sets the "id" field.
func (*CreditEntryCreate) SetLedgerID ¶
func (cec *CreditEntryCreate) SetLedgerID(pg pgulid.ULID) *CreditEntryCreate
SetLedgerID sets the "ledger_id" field.
func (*CreditEntryCreate) SetMetadata ¶
func (cec *CreditEntryCreate) SetMetadata(m map[string]string) *CreditEntryCreate
SetMetadata sets the "metadata" field.
func (*CreditEntryCreate) SetNamespace ¶
func (cec *CreditEntryCreate) SetNamespace(s string) *CreditEntryCreate
SetNamespace sets the "namespace" field.
func (*CreditEntryCreate) SetNillableAmount ¶
func (cec *CreditEntryCreate) SetNillableAmount(f *float64) *CreditEntryCreate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableChildrenID ¶
func (cec *CreditEntryCreate) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryCreate
SetNillableChildrenID sets the "children" edge to the CreditEntry entity by ID if the given value is not nil.
func (*CreditEntryCreate) SetNillableCreatedAt ¶
func (cec *CreditEntryCreate) SetNillableCreatedAt(t *time.Time) *CreditEntryCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableEffectiveAt ¶
func (cec *CreditEntryCreate) SetNillableEffectiveAt(t *time.Time) *CreditEntryCreate
SetNillableEffectiveAt sets the "effective_at" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableExpirationAt ¶
func (cec *CreditEntryCreate) SetNillableExpirationAt(t *time.Time) *CreditEntryCreate
SetNillableExpirationAt sets the "expiration_at" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableExpirationPeriodCount ¶
func (cec *CreditEntryCreate) SetNillableExpirationPeriodCount(u *uint8) *CreditEntryCreate
SetNillableExpirationPeriodCount sets the "expiration_period_count" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableExpirationPeriodDuration ¶
func (cec *CreditEntryCreate) SetNillableExpirationPeriodDuration(cpd *credit.ExpirationPeriodDuration) *CreditEntryCreate
SetNillableExpirationPeriodDuration sets the "expiration_period_duration" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableFeatureID ¶
func (cec *CreditEntryCreate) SetNillableFeatureID(pg *pgulid.ULID) *CreditEntryCreate
SetNillableFeatureID sets the "feature_id" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableID ¶
func (cec *CreditEntryCreate) SetNillableID(pg *pgulid.ULID) *CreditEntryCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableParentID ¶
func (cec *CreditEntryCreate) SetNillableParentID(pg *pgulid.ULID) *CreditEntryCreate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*CreditEntryCreate) SetNillablePriority ¶
func (cec *CreditEntryCreate) SetNillablePriority(u *uint8) *CreditEntryCreate
SetNillablePriority sets the "priority" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableRolloverMaxAmount ¶
func (cec *CreditEntryCreate) SetNillableRolloverMaxAmount(f *float64) *CreditEntryCreate
SetNillableRolloverMaxAmount sets the "rollover_max_amount" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableRolloverType ¶
func (cec *CreditEntryCreate) SetNillableRolloverType(crt *credit.GrantRolloverType) *CreditEntryCreate
SetNillableRolloverType sets the "rollover_type" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableType ¶
func (cec *CreditEntryCreate) SetNillableType(ct *credit.GrantType) *CreditEntryCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*CreditEntryCreate) SetNillableUpdatedAt ¶
func (cec *CreditEntryCreate) SetNillableUpdatedAt(t *time.Time) *CreditEntryCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CreditEntryCreate) SetParent ¶
func (cec *CreditEntryCreate) SetParent(c *CreditEntry) *CreditEntryCreate
SetParent sets the "parent" edge to the CreditEntry entity.
func (*CreditEntryCreate) SetParentID ¶
func (cec *CreditEntryCreate) SetParentID(pg pgulid.ULID) *CreditEntryCreate
SetParentID sets the "parent_id" field.
func (*CreditEntryCreate) SetPriority ¶
func (cec *CreditEntryCreate) SetPriority(u uint8) *CreditEntryCreate
SetPriority sets the "priority" field.
func (*CreditEntryCreate) SetRolloverMaxAmount ¶
func (cec *CreditEntryCreate) SetRolloverMaxAmount(f float64) *CreditEntryCreate
SetRolloverMaxAmount sets the "rollover_max_amount" field.
func (*CreditEntryCreate) SetRolloverType ¶
func (cec *CreditEntryCreate) SetRolloverType(crt credit.GrantRolloverType) *CreditEntryCreate
SetRolloverType sets the "rollover_type" field.
func (*CreditEntryCreate) SetType ¶
func (cec *CreditEntryCreate) SetType(ct credit.GrantType) *CreditEntryCreate
SetType sets the "type" field.
func (*CreditEntryCreate) SetUpdatedAt ¶
func (cec *CreditEntryCreate) SetUpdatedAt(t time.Time) *CreditEntryCreate
SetUpdatedAt sets the "updated_at" field.
type CreditEntryCreateBulk ¶
type CreditEntryCreateBulk struct {
// contains filtered or unexported fields
}
CreditEntryCreateBulk is the builder for creating many CreditEntry entities in bulk.
func (*CreditEntryCreateBulk) Exec ¶
func (cecb *CreditEntryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CreditEntryCreateBulk) ExecX ¶
func (cecb *CreditEntryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryCreateBulk) OnConflict ¶
func (cecb *CreditEntryCreateBulk) OnConflict(opts ...sql.ConflictOption) *CreditEntryUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.CreditEntry.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.CreditEntryUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CreditEntryCreateBulk) OnConflictColumns ¶
func (cecb *CreditEntryCreateBulk) OnConflictColumns(columns ...string) *CreditEntryUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.CreditEntry.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*CreditEntryCreateBulk) Save ¶
func (cecb *CreditEntryCreateBulk) Save(ctx context.Context) ([]*CreditEntry, error)
Save creates the CreditEntry entities in the database.
func (*CreditEntryCreateBulk) SaveX ¶
func (cecb *CreditEntryCreateBulk) SaveX(ctx context.Context) []*CreditEntry
SaveX is like Save, but panics if an error occurs.
type CreditEntryDelete ¶
type CreditEntryDelete struct {
// contains filtered or unexported fields
}
CreditEntryDelete is the builder for deleting a CreditEntry entity.
func (*CreditEntryDelete) Exec ¶
func (ced *CreditEntryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CreditEntryDelete) ExecX ¶
func (ced *CreditEntryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryDelete) Where ¶
func (ced *CreditEntryDelete) Where(ps ...predicate.CreditEntry) *CreditEntryDelete
Where appends a list predicates to the CreditEntryDelete builder.
type CreditEntryDeleteOne ¶
type CreditEntryDeleteOne struct {
// contains filtered or unexported fields
}
CreditEntryDeleteOne is the builder for deleting a single CreditEntry entity.
func (*CreditEntryDeleteOne) Exec ¶
func (cedo *CreditEntryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CreditEntryDeleteOne) ExecX ¶
func (cedo *CreditEntryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryDeleteOne) Where ¶
func (cedo *CreditEntryDeleteOne) Where(ps ...predicate.CreditEntry) *CreditEntryDeleteOne
Where appends a list predicates to the CreditEntryDelete builder.
type CreditEntryEdges ¶
type CreditEntryEdges struct { // Parent holds the value of the parent edge. Parent *CreditEntry `json:"parent,omitempty"` // Children holds the value of the children edge. Children *CreditEntry `json:"children,omitempty"` // Feature holds the value of the feature edge. Feature *Feature `json:"feature,omitempty"` // contains filtered or unexported fields }
CreditEntryEdges holds the relations/edges for other nodes in the graph.
func (CreditEntryEdges) ChildrenOrErr ¶
func (e CreditEntryEdges) ChildrenOrErr() (*CreditEntry, error)
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CreditEntryEdges) FeatureOrErr ¶
func (e CreditEntryEdges) FeatureOrErr() (*Feature, error)
FeatureOrErr returns the Feature value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CreditEntryEdges) ParentOrErr ¶
func (e CreditEntryEdges) ParentOrErr() (*CreditEntry, error)
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CreditEntryGroupBy ¶
type CreditEntryGroupBy struct {
// contains filtered or unexported fields
}
CreditEntryGroupBy is the group-by builder for CreditEntry entities.
func (*CreditEntryGroupBy) Aggregate ¶
func (cegb *CreditEntryGroupBy) Aggregate(fns ...AggregateFunc) *CreditEntryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CreditEntryGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CreditEntryGroupBy) Scan ¶
func (cegb *CreditEntryGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CreditEntryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CreditEntryMutation ¶
type CreditEntryMutation struct {
// contains filtered or unexported fields
}
CreditEntryMutation represents an operation that mutates the CreditEntry nodes in the graph.
func (*CreditEntryMutation) AddAmount ¶
func (m *CreditEntryMutation) AddAmount(f float64)
AddAmount adds f to the "amount" field.
func (*CreditEntryMutation) AddExpirationPeriodCount ¶
func (m *CreditEntryMutation) AddExpirationPeriodCount(u int8)
AddExpirationPeriodCount adds u to the "expiration_period_count" field.
func (*CreditEntryMutation) AddField ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) AddPriority ¶
func (m *CreditEntryMutation) AddPriority(u int8)
AddPriority adds u to the "priority" field.
func (*CreditEntryMutation) AddRolloverMaxAmount ¶
func (m *CreditEntryMutation) AddRolloverMaxAmount(f float64)
AddRolloverMaxAmount adds f to the "rollover_max_amount" field.
func (*CreditEntryMutation) AddedAmount ¶
func (m *CreditEntryMutation) AddedAmount() (r float64, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
func (*CreditEntryMutation) AddedEdges ¶
func (m *CreditEntryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CreditEntryMutation) AddedExpirationPeriodCount ¶
func (m *CreditEntryMutation) AddedExpirationPeriodCount() (r int8, exists bool)
AddedExpirationPeriodCount returns the value that was added to the "expiration_period_count" field in this mutation.
func (*CreditEntryMutation) AddedField ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) AddedFields ¶
func (m *CreditEntryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CreditEntryMutation) AddedIDs ¶
func (m *CreditEntryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CreditEntryMutation) AddedPriority ¶
func (m *CreditEntryMutation) AddedPriority() (r int8, exists bool)
AddedPriority returns the value that was added to the "priority" field in this mutation.
func (*CreditEntryMutation) AddedRolloverMaxAmount ¶
func (m *CreditEntryMutation) AddedRolloverMaxAmount() (r float64, exists bool)
AddedRolloverMaxAmount returns the value that was added to the "rollover_max_amount" field in this mutation.
func (*CreditEntryMutation) Amount ¶
func (m *CreditEntryMutation) Amount() (r float64, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*CreditEntryMutation) AmountCleared ¶
func (m *CreditEntryMutation) AmountCleared() bool
AmountCleared returns if the "amount" field was cleared in this mutation.
func (*CreditEntryMutation) ChildrenCleared ¶
func (m *CreditEntryMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the CreditEntry entity was cleared.
func (*CreditEntryMutation) ChildrenID ¶
func (m *CreditEntryMutation) ChildrenID() (id pgulid.ULID, exists bool)
ChildrenID returns the "children" edge ID in the mutation.
func (*CreditEntryMutation) ChildrenIDs ¶
func (m *CreditEntryMutation) ChildrenIDs() (ids []pgulid.ULID)
ChildrenIDs returns the "children" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ChildrenID instead. It exists only for internal usage by the builders.
func (*CreditEntryMutation) ClearAmount ¶
func (m *CreditEntryMutation) ClearAmount()
ClearAmount clears the value of the "amount" field.
func (*CreditEntryMutation) ClearChildren ¶
func (m *CreditEntryMutation) ClearChildren()
ClearChildren clears the "children" edge to the CreditEntry entity.
func (*CreditEntryMutation) ClearEdge ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) ClearExpirationAt ¶
func (m *CreditEntryMutation) ClearExpirationAt()
ClearExpirationAt clears the value of the "expiration_at" field.
func (*CreditEntryMutation) ClearExpirationPeriodCount ¶
func (m *CreditEntryMutation) ClearExpirationPeriodCount()
ClearExpirationPeriodCount clears the value of the "expiration_period_count" field.
func (*CreditEntryMutation) ClearExpirationPeriodDuration ¶
func (m *CreditEntryMutation) ClearExpirationPeriodDuration()
ClearExpirationPeriodDuration clears the value of the "expiration_period_duration" field.
func (*CreditEntryMutation) ClearFeature ¶
func (m *CreditEntryMutation) ClearFeature()
ClearFeature clears the "feature" edge to the Feature entity.
func (*CreditEntryMutation) ClearFeatureID ¶
func (m *CreditEntryMutation) ClearFeatureID()
ClearFeatureID clears the value of the "feature_id" field.
func (*CreditEntryMutation) ClearField ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) ClearMetadata ¶
func (m *CreditEntryMutation) ClearMetadata()
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryMutation) ClearParent ¶
func (m *CreditEntryMutation) ClearParent()
ClearParent clears the "parent" edge to the CreditEntry entity.
func (*CreditEntryMutation) ClearParentID ¶
func (m *CreditEntryMutation) ClearParentID()
ClearParentID clears the value of the "parent_id" field.
func (*CreditEntryMutation) ClearRolloverMaxAmount ¶
func (m *CreditEntryMutation) ClearRolloverMaxAmount()
ClearRolloverMaxAmount clears the value of the "rollover_max_amount" field.
func (*CreditEntryMutation) ClearRolloverType ¶
func (m *CreditEntryMutation) ClearRolloverType()
ClearRolloverType clears the value of the "rollover_type" field.
func (*CreditEntryMutation) ClearType ¶
func (m *CreditEntryMutation) ClearType()
ClearType clears the value of the "type" field.
func (*CreditEntryMutation) ClearedEdges ¶
func (m *CreditEntryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CreditEntryMutation) ClearedFields ¶
func (m *CreditEntryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CreditEntryMutation) Client ¶
func (m CreditEntryMutation) 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 (*CreditEntryMutation) CreatedAt ¶
func (m *CreditEntryMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CreditEntryMutation) EdgeCleared ¶
func (m *CreditEntryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CreditEntryMutation) EffectiveAt ¶
func (m *CreditEntryMutation) EffectiveAt() (r time.Time, exists bool)
EffectiveAt returns the value of the "effective_at" field in the mutation.
func (*CreditEntryMutation) EntryType ¶
func (m *CreditEntryMutation) EntryType() (r credit.EntryType, exists bool)
EntryType returns the value of the "entry_type" field in the mutation.
func (*CreditEntryMutation) ExpirationAt ¶
func (m *CreditEntryMutation) ExpirationAt() (r time.Time, exists bool)
ExpirationAt returns the value of the "expiration_at" field in the mutation.
func (*CreditEntryMutation) ExpirationAtCleared ¶
func (m *CreditEntryMutation) ExpirationAtCleared() bool
ExpirationAtCleared returns if the "expiration_at" field was cleared in this mutation.
func (*CreditEntryMutation) ExpirationPeriodCount ¶
func (m *CreditEntryMutation) ExpirationPeriodCount() (r uint8, exists bool)
ExpirationPeriodCount returns the value of the "expiration_period_count" field in the mutation.
func (*CreditEntryMutation) ExpirationPeriodCountCleared ¶
func (m *CreditEntryMutation) ExpirationPeriodCountCleared() bool
ExpirationPeriodCountCleared returns if the "expiration_period_count" field was cleared in this mutation.
func (*CreditEntryMutation) ExpirationPeriodDuration ¶
func (m *CreditEntryMutation) ExpirationPeriodDuration() (r credit.ExpirationPeriodDuration, exists bool)
ExpirationPeriodDuration returns the value of the "expiration_period_duration" field in the mutation.
func (*CreditEntryMutation) ExpirationPeriodDurationCleared ¶
func (m *CreditEntryMutation) ExpirationPeriodDurationCleared() bool
ExpirationPeriodDurationCleared returns if the "expiration_period_duration" field was cleared in this mutation.
func (*CreditEntryMutation) FeatureCleared ¶
func (m *CreditEntryMutation) FeatureCleared() bool
FeatureCleared reports if the "feature" edge to the Feature entity was cleared.
func (*CreditEntryMutation) FeatureID ¶
func (m *CreditEntryMutation) FeatureID() (r pgulid.ULID, exists bool)
FeatureID returns the value of the "feature_id" field in the mutation.
func (*CreditEntryMutation) FeatureIDCleared ¶
func (m *CreditEntryMutation) FeatureIDCleared() bool
FeatureIDCleared returns if the "feature_id" field was cleared in this mutation.
func (*CreditEntryMutation) FeatureIDs ¶
func (m *CreditEntryMutation) FeatureIDs() (ids []pgulid.ULID)
FeatureIDs returns the "feature" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FeatureID instead. It exists only for internal usage by the builders.
func (*CreditEntryMutation) Field ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) FieldCleared ¶
func (m *CreditEntryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CreditEntryMutation) Fields ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) GetType ¶
func (m *CreditEntryMutation) GetType() (r credit.GrantType, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*CreditEntryMutation) ID ¶
func (m *CreditEntryMutation) ID() (id pgulid.ULID, 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 (*CreditEntryMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CreditEntryMutation) LedgerID ¶
func (m *CreditEntryMutation) LedgerID() (r pgulid.ULID, exists bool)
LedgerID returns the value of the "ledger_id" field in the mutation.
func (*CreditEntryMutation) Metadata ¶
func (m *CreditEntryMutation) Metadata() (r map[string]string, exists bool)
Metadata returns the value of the "metadata" field in the mutation.
func (*CreditEntryMutation) MetadataCleared ¶
func (m *CreditEntryMutation) MetadataCleared() bool
MetadataCleared returns if the "metadata" field was cleared in this mutation.
func (*CreditEntryMutation) Namespace ¶
func (m *CreditEntryMutation) Namespace() (r string, exists bool)
Namespace returns the value of the "namespace" field in the mutation.
func (*CreditEntryMutation) OldAmount ¶
func (m *CreditEntryMutation) OldAmount(ctx context.Context) (v *float64, err error)
OldAmount returns the old "amount" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldEffectiveAt ¶
OldEffectiveAt returns the old "effective_at" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldEntryType ¶
OldEntryType returns the old "entry_type" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldExpirationAt ¶
OldExpirationAt returns the old "expiration_at" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldExpirationPeriodCount ¶
func (m *CreditEntryMutation) OldExpirationPeriodCount(ctx context.Context) (v *uint8, err error)
OldExpirationPeriodCount returns the old "expiration_period_count" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldExpirationPeriodDuration ¶
func (m *CreditEntryMutation) OldExpirationPeriodDuration(ctx context.Context) (v *credit.ExpirationPeriodDuration, err error)
OldExpirationPeriodDuration returns the old "expiration_period_duration" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldFeatureID ¶
OldFeatureID returns the old "feature_id" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) 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 (*CreditEntryMutation) OldLedgerID ¶
OldLedgerID returns the old "ledger_id" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldMetadata ¶
OldMetadata returns the old "metadata" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldNamespace ¶
func (m *CreditEntryMutation) OldNamespace(ctx context.Context) (v string, err error)
OldNamespace returns the old "namespace" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldParentID ¶
OldParentID returns the old "parent_id" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldPriority ¶
func (m *CreditEntryMutation) OldPriority(ctx context.Context) (v uint8, err error)
OldPriority returns the old "priority" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldRolloverMaxAmount ¶
func (m *CreditEntryMutation) OldRolloverMaxAmount(ctx context.Context) (v *float64, err error)
OldRolloverMaxAmount returns the old "rollover_max_amount" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldRolloverType ¶
func (m *CreditEntryMutation) OldRolloverType(ctx context.Context) (v *credit.GrantRolloverType, err error)
OldRolloverType returns the old "rollover_type" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldType ¶
OldType returns the old "type" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the CreditEntry entity. If the CreditEntry 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 (*CreditEntryMutation) Op ¶
func (m *CreditEntryMutation) Op() Op
Op returns the operation name.
func (*CreditEntryMutation) ParentCleared ¶
func (m *CreditEntryMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the CreditEntry entity was cleared.
func (*CreditEntryMutation) ParentID ¶
func (m *CreditEntryMutation) ParentID() (r pgulid.ULID, exists bool)
ParentID returns the value of the "parent_id" field in the mutation.
func (*CreditEntryMutation) ParentIDCleared ¶
func (m *CreditEntryMutation) ParentIDCleared() bool
ParentIDCleared returns if the "parent_id" field was cleared in this mutation.
func (*CreditEntryMutation) ParentIDs ¶
func (m *CreditEntryMutation) ParentIDs() (ids []pgulid.ULID)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*CreditEntryMutation) Priority ¶
func (m *CreditEntryMutation) Priority() (r uint8, exists bool)
Priority returns the value of the "priority" field in the mutation.
func (*CreditEntryMutation) RemovedEdges ¶
func (m *CreditEntryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CreditEntryMutation) RemovedIDs ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) ResetAmount ¶
func (m *CreditEntryMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*CreditEntryMutation) ResetChildren ¶
func (m *CreditEntryMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*CreditEntryMutation) ResetCreatedAt ¶
func (m *CreditEntryMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CreditEntryMutation) ResetEdge ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) ResetEffectiveAt ¶
func (m *CreditEntryMutation) ResetEffectiveAt()
ResetEffectiveAt resets all changes to the "effective_at" field.
func (*CreditEntryMutation) ResetEntryType ¶
func (m *CreditEntryMutation) ResetEntryType()
ResetEntryType resets all changes to the "entry_type" field.
func (*CreditEntryMutation) ResetExpirationAt ¶
func (m *CreditEntryMutation) ResetExpirationAt()
ResetExpirationAt resets all changes to the "expiration_at" field.
func (*CreditEntryMutation) ResetExpirationPeriodCount ¶
func (m *CreditEntryMutation) ResetExpirationPeriodCount()
ResetExpirationPeriodCount resets all changes to the "expiration_period_count" field.
func (*CreditEntryMutation) ResetExpirationPeriodDuration ¶
func (m *CreditEntryMutation) ResetExpirationPeriodDuration()
ResetExpirationPeriodDuration resets all changes to the "expiration_period_duration" field.
func (*CreditEntryMutation) ResetFeature ¶
func (m *CreditEntryMutation) ResetFeature()
ResetFeature resets all changes to the "feature" edge.
func (*CreditEntryMutation) ResetFeatureID ¶
func (m *CreditEntryMutation) ResetFeatureID()
ResetFeatureID resets all changes to the "feature_id" field.
func (*CreditEntryMutation) ResetField ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) ResetLedgerID ¶
func (m *CreditEntryMutation) ResetLedgerID()
ResetLedgerID resets all changes to the "ledger_id" field.
func (*CreditEntryMutation) ResetMetadata ¶
func (m *CreditEntryMutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" field.
func (*CreditEntryMutation) ResetNamespace ¶
func (m *CreditEntryMutation) ResetNamespace()
ResetNamespace resets all changes to the "namespace" field.
func (*CreditEntryMutation) ResetParent ¶
func (m *CreditEntryMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*CreditEntryMutation) ResetParentID ¶
func (m *CreditEntryMutation) ResetParentID()
ResetParentID resets all changes to the "parent_id" field.
func (*CreditEntryMutation) ResetPriority ¶
func (m *CreditEntryMutation) ResetPriority()
ResetPriority resets all changes to the "priority" field.
func (*CreditEntryMutation) ResetRolloverMaxAmount ¶
func (m *CreditEntryMutation) ResetRolloverMaxAmount()
ResetRolloverMaxAmount resets all changes to the "rollover_max_amount" field.
func (*CreditEntryMutation) ResetRolloverType ¶
func (m *CreditEntryMutation) ResetRolloverType()
ResetRolloverType resets all changes to the "rollover_type" field.
func (*CreditEntryMutation) ResetType ¶
func (m *CreditEntryMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*CreditEntryMutation) ResetUpdatedAt ¶
func (m *CreditEntryMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CreditEntryMutation) RolloverMaxAmount ¶
func (m *CreditEntryMutation) RolloverMaxAmount() (r float64, exists bool)
RolloverMaxAmount returns the value of the "rollover_max_amount" field in the mutation.
func (*CreditEntryMutation) RolloverMaxAmountCleared ¶
func (m *CreditEntryMutation) RolloverMaxAmountCleared() bool
RolloverMaxAmountCleared returns if the "rollover_max_amount" field was cleared in this mutation.
func (*CreditEntryMutation) RolloverType ¶
func (m *CreditEntryMutation) RolloverType() (r credit.GrantRolloverType, exists bool)
RolloverType returns the value of the "rollover_type" field in the mutation.
func (*CreditEntryMutation) RolloverTypeCleared ¶
func (m *CreditEntryMutation) RolloverTypeCleared() bool
RolloverTypeCleared returns if the "rollover_type" field was cleared in this mutation.
func (*CreditEntryMutation) SetAmount ¶
func (m *CreditEntryMutation) SetAmount(f float64)
SetAmount sets the "amount" field.
func (*CreditEntryMutation) SetChildrenID ¶
func (m *CreditEntryMutation) SetChildrenID(id pgulid.ULID)
SetChildrenID sets the "children" edge to the CreditEntry entity by id.
func (*CreditEntryMutation) SetCreatedAt ¶
func (m *CreditEntryMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CreditEntryMutation) SetEffectiveAt ¶
func (m *CreditEntryMutation) SetEffectiveAt(t time.Time)
SetEffectiveAt sets the "effective_at" field.
func (*CreditEntryMutation) SetEntryType ¶
func (m *CreditEntryMutation) SetEntryType(ct credit.EntryType)
SetEntryType sets the "entry_type" field.
func (*CreditEntryMutation) SetExpirationAt ¶
func (m *CreditEntryMutation) SetExpirationAt(t time.Time)
SetExpirationAt sets the "expiration_at" field.
func (*CreditEntryMutation) SetExpirationPeriodCount ¶
func (m *CreditEntryMutation) SetExpirationPeriodCount(u uint8)
SetExpirationPeriodCount sets the "expiration_period_count" field.
func (*CreditEntryMutation) SetExpirationPeriodDuration ¶
func (m *CreditEntryMutation) SetExpirationPeriodDuration(cpd credit.ExpirationPeriodDuration)
SetExpirationPeriodDuration sets the "expiration_period_duration" field.
func (*CreditEntryMutation) SetFeatureID ¶
func (m *CreditEntryMutation) SetFeatureID(pg pgulid.ULID)
SetFeatureID sets the "feature_id" field.
func (*CreditEntryMutation) SetField ¶
func (m *CreditEntryMutation) 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 (*CreditEntryMutation) SetID ¶
func (m *CreditEntryMutation) SetID(id pgulid.ULID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of CreditEntry entities.
func (*CreditEntryMutation) SetLedgerID ¶
func (m *CreditEntryMutation) SetLedgerID(pg pgulid.ULID)
SetLedgerID sets the "ledger_id" field.
func (*CreditEntryMutation) SetMetadata ¶
func (m *CreditEntryMutation) SetMetadata(value map[string]string)
SetMetadata sets the "metadata" field.
func (*CreditEntryMutation) SetNamespace ¶
func (m *CreditEntryMutation) SetNamespace(s string)
SetNamespace sets the "namespace" field.
func (*CreditEntryMutation) SetOp ¶
func (m *CreditEntryMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CreditEntryMutation) SetParentID ¶
func (m *CreditEntryMutation) SetParentID(pg pgulid.ULID)
SetParentID sets the "parent_id" field.
func (*CreditEntryMutation) SetPriority ¶
func (m *CreditEntryMutation) SetPriority(u uint8)
SetPriority sets the "priority" field.
func (*CreditEntryMutation) SetRolloverMaxAmount ¶
func (m *CreditEntryMutation) SetRolloverMaxAmount(f float64)
SetRolloverMaxAmount sets the "rollover_max_amount" field.
func (*CreditEntryMutation) SetRolloverType ¶
func (m *CreditEntryMutation) SetRolloverType(crt credit.GrantRolloverType)
SetRolloverType sets the "rollover_type" field.
func (*CreditEntryMutation) SetType ¶
func (m *CreditEntryMutation) SetType(ct credit.GrantType)
SetType sets the "type" field.
func (*CreditEntryMutation) SetUpdatedAt ¶
func (m *CreditEntryMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (CreditEntryMutation) Tx ¶
func (m CreditEntryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CreditEntryMutation) Type ¶
func (m *CreditEntryMutation) Type() string
Type returns the node type of this mutation (CreditEntry).
func (*CreditEntryMutation) TypeCleared ¶
func (m *CreditEntryMutation) TypeCleared() bool
TypeCleared returns if the "type" field was cleared in this mutation.
func (*CreditEntryMutation) UpdatedAt ¶
func (m *CreditEntryMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CreditEntryMutation) Where ¶
func (m *CreditEntryMutation) Where(ps ...predicate.CreditEntry)
Where appends a list predicates to the CreditEntryMutation builder.
func (*CreditEntryMutation) WhereP ¶
func (m *CreditEntryMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CreditEntryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CreditEntryQuery ¶
type CreditEntryQuery struct {
// contains filtered or unexported fields
}
CreditEntryQuery is the builder for querying CreditEntry entities.
func (*CreditEntryQuery) Aggregate ¶
func (ceq *CreditEntryQuery) Aggregate(fns ...AggregateFunc) *CreditEntrySelect
Aggregate returns a CreditEntrySelect configured with the given aggregations.
func (*CreditEntryQuery) All ¶
func (ceq *CreditEntryQuery) All(ctx context.Context) ([]*CreditEntry, error)
All executes the query and returns a list of CreditEntries.
func (*CreditEntryQuery) AllX ¶
func (ceq *CreditEntryQuery) AllX(ctx context.Context) []*CreditEntry
AllX is like All, but panics if an error occurs.
func (*CreditEntryQuery) Clone ¶
func (ceq *CreditEntryQuery) Clone() *CreditEntryQuery
Clone returns a duplicate of the CreditEntryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CreditEntryQuery) Count ¶
func (ceq *CreditEntryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CreditEntryQuery) CountX ¶
func (ceq *CreditEntryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CreditEntryQuery) Exist ¶
func (ceq *CreditEntryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CreditEntryQuery) ExistX ¶
func (ceq *CreditEntryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CreditEntryQuery) First ¶
func (ceq *CreditEntryQuery) First(ctx context.Context) (*CreditEntry, error)
First returns the first CreditEntry entity from the query. Returns a *NotFoundError when no CreditEntry was found.
func (*CreditEntryQuery) FirstID ¶
FirstID returns the first CreditEntry ID from the query. Returns a *NotFoundError when no CreditEntry ID was found.
func (*CreditEntryQuery) FirstIDX ¶
func (ceq *CreditEntryQuery) FirstIDX(ctx context.Context) pgulid.ULID
FirstIDX is like FirstID, but panics if an error occurs.
func (*CreditEntryQuery) FirstX ¶
func (ceq *CreditEntryQuery) FirstX(ctx context.Context) *CreditEntry
FirstX is like First, but panics if an error occurs.
func (*CreditEntryQuery) ForShare ¶
func (ceq *CreditEntryQuery) ForShare(opts ...sql.LockOption) *CreditEntryQuery
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 (*CreditEntryQuery) ForUpdate ¶
func (ceq *CreditEntryQuery) ForUpdate(opts ...sql.LockOption) *CreditEntryQuery
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 (*CreditEntryQuery) GroupBy ¶
func (ceq *CreditEntryQuery) GroupBy(field string, fields ...string) *CreditEntryGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.CreditEntry.Query(). GroupBy(creditentry.FieldCreatedAt). Aggregate(db.Count()). Scan(ctx, &v)
func (*CreditEntryQuery) IDsX ¶
func (ceq *CreditEntryQuery) IDsX(ctx context.Context) []pgulid.ULID
IDsX is like IDs, but panics if an error occurs.
func (*CreditEntryQuery) Limit ¶
func (ceq *CreditEntryQuery) Limit(limit int) *CreditEntryQuery
Limit the number of records to be returned by this query.
func (*CreditEntryQuery) Offset ¶
func (ceq *CreditEntryQuery) Offset(offset int) *CreditEntryQuery
Offset to start from.
func (*CreditEntryQuery) Only ¶
func (ceq *CreditEntryQuery) Only(ctx context.Context) (*CreditEntry, error)
Only returns a single CreditEntry entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CreditEntry entity is found. Returns a *NotFoundError when no CreditEntry entities are found.
func (*CreditEntryQuery) OnlyID ¶
OnlyID is like Only, but returns the only CreditEntry ID in the query. Returns a *NotSingularError when more than one CreditEntry ID is found. Returns a *NotFoundError when no entities are found.
func (*CreditEntryQuery) OnlyIDX ¶
func (ceq *CreditEntryQuery) OnlyIDX(ctx context.Context) pgulid.ULID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CreditEntryQuery) OnlyX ¶
func (ceq *CreditEntryQuery) OnlyX(ctx context.Context) *CreditEntry
OnlyX is like Only, but panics if an error occurs.
func (*CreditEntryQuery) Order ¶
func (ceq *CreditEntryQuery) Order(o ...creditentry.OrderOption) *CreditEntryQuery
Order specifies how the records should be ordered.
func (*CreditEntryQuery) QueryChildren ¶
func (ceq *CreditEntryQuery) QueryChildren() *CreditEntryQuery
QueryChildren chains the current query on the "children" edge.
func (*CreditEntryQuery) QueryFeature ¶
func (ceq *CreditEntryQuery) QueryFeature() *FeatureQuery
QueryFeature chains the current query on the "feature" edge.
func (*CreditEntryQuery) QueryParent ¶
func (ceq *CreditEntryQuery) QueryParent() *CreditEntryQuery
QueryParent chains the current query on the "parent" edge.
func (*CreditEntryQuery) Select ¶
func (ceq *CreditEntryQuery) Select(fields ...string) *CreditEntrySelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.CreditEntry.Query(). Select(creditentry.FieldCreatedAt). Scan(ctx, &v)
func (*CreditEntryQuery) Unique ¶
func (ceq *CreditEntryQuery) Unique(unique bool) *CreditEntryQuery
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 (*CreditEntryQuery) Where ¶
func (ceq *CreditEntryQuery) Where(ps ...predicate.CreditEntry) *CreditEntryQuery
Where adds a new predicate for the CreditEntryQuery builder.
func (*CreditEntryQuery) WithChildren ¶
func (ceq *CreditEntryQuery) WithChildren(opts ...func(*CreditEntryQuery)) *CreditEntryQuery
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*CreditEntryQuery) WithFeature ¶
func (ceq *CreditEntryQuery) WithFeature(opts ...func(*FeatureQuery)) *CreditEntryQuery
WithFeature tells the query-builder to eager-load the nodes that are connected to the "feature" edge. The optional arguments are used to configure the query builder of the edge.
func (*CreditEntryQuery) WithParent ¶
func (ceq *CreditEntryQuery) WithParent(opts ...func(*CreditEntryQuery)) *CreditEntryQuery
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
type CreditEntrySelect ¶
type CreditEntrySelect struct { *CreditEntryQuery // contains filtered or unexported fields }
CreditEntrySelect is the builder for selecting fields of CreditEntry entities.
func (*CreditEntrySelect) Aggregate ¶
func (ces *CreditEntrySelect) Aggregate(fns ...AggregateFunc) *CreditEntrySelect
Aggregate adds the given aggregation functions to the selector query.
func (*CreditEntrySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CreditEntrySelect) Scan ¶
func (ces *CreditEntrySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CreditEntrySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CreditEntryUpdate ¶
type CreditEntryUpdate struct {
// contains filtered or unexported fields
}
CreditEntryUpdate is the builder for updating CreditEntry entities.
func (*CreditEntryUpdate) ClearChildren ¶
func (ceu *CreditEntryUpdate) ClearChildren() *CreditEntryUpdate
ClearChildren clears the "children" edge to the CreditEntry entity.
func (*CreditEntryUpdate) ClearMetadata ¶
func (ceu *CreditEntryUpdate) ClearMetadata() *CreditEntryUpdate
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryUpdate) Exec ¶
func (ceu *CreditEntryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CreditEntryUpdate) ExecX ¶
func (ceu *CreditEntryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryUpdate) Mutation ¶
func (ceu *CreditEntryUpdate) Mutation() *CreditEntryMutation
Mutation returns the CreditEntryMutation object of the builder.
func (*CreditEntryUpdate) Save ¶
func (ceu *CreditEntryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CreditEntryUpdate) SaveX ¶
func (ceu *CreditEntryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CreditEntryUpdate) SetChildren ¶
func (ceu *CreditEntryUpdate) SetChildren(c *CreditEntry) *CreditEntryUpdate
SetChildren sets the "children" edge to the CreditEntry entity.
func (*CreditEntryUpdate) SetChildrenID ¶
func (ceu *CreditEntryUpdate) SetChildrenID(id pgulid.ULID) *CreditEntryUpdate
SetChildrenID sets the "children" edge to the CreditEntry entity by ID.
func (*CreditEntryUpdate) SetMetadata ¶
func (ceu *CreditEntryUpdate) SetMetadata(m map[string]string) *CreditEntryUpdate
SetMetadata sets the "metadata" field.
func (*CreditEntryUpdate) SetNillableChildrenID ¶
func (ceu *CreditEntryUpdate) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryUpdate
SetNillableChildrenID sets the "children" edge to the CreditEntry entity by ID if the given value is not nil.
func (*CreditEntryUpdate) SetUpdatedAt ¶
func (ceu *CreditEntryUpdate) SetUpdatedAt(t time.Time) *CreditEntryUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CreditEntryUpdate) Where ¶
func (ceu *CreditEntryUpdate) Where(ps ...predicate.CreditEntry) *CreditEntryUpdate
Where appends a list predicates to the CreditEntryUpdate builder.
type CreditEntryUpdateOne ¶
type CreditEntryUpdateOne struct {
// contains filtered or unexported fields
}
CreditEntryUpdateOne is the builder for updating a single CreditEntry entity.
func (*CreditEntryUpdateOne) ClearChildren ¶
func (ceuo *CreditEntryUpdateOne) ClearChildren() *CreditEntryUpdateOne
ClearChildren clears the "children" edge to the CreditEntry entity.
func (*CreditEntryUpdateOne) ClearMetadata ¶
func (ceuo *CreditEntryUpdateOne) ClearMetadata() *CreditEntryUpdateOne
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryUpdateOne) Exec ¶
func (ceuo *CreditEntryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CreditEntryUpdateOne) ExecX ¶
func (ceuo *CreditEntryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryUpdateOne) Mutation ¶
func (ceuo *CreditEntryUpdateOne) Mutation() *CreditEntryMutation
Mutation returns the CreditEntryMutation object of the builder.
func (*CreditEntryUpdateOne) Save ¶
func (ceuo *CreditEntryUpdateOne) Save(ctx context.Context) (*CreditEntry, error)
Save executes the query and returns the updated CreditEntry entity.
func (*CreditEntryUpdateOne) SaveX ¶
func (ceuo *CreditEntryUpdateOne) SaveX(ctx context.Context) *CreditEntry
SaveX is like Save, but panics if an error occurs.
func (*CreditEntryUpdateOne) Select ¶
func (ceuo *CreditEntryUpdateOne) Select(field string, fields ...string) *CreditEntryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CreditEntryUpdateOne) SetChildren ¶
func (ceuo *CreditEntryUpdateOne) SetChildren(c *CreditEntry) *CreditEntryUpdateOne
SetChildren sets the "children" edge to the CreditEntry entity.
func (*CreditEntryUpdateOne) SetChildrenID ¶
func (ceuo *CreditEntryUpdateOne) SetChildrenID(id pgulid.ULID) *CreditEntryUpdateOne
SetChildrenID sets the "children" edge to the CreditEntry entity by ID.
func (*CreditEntryUpdateOne) SetMetadata ¶
func (ceuo *CreditEntryUpdateOne) SetMetadata(m map[string]string) *CreditEntryUpdateOne
SetMetadata sets the "metadata" field.
func (*CreditEntryUpdateOne) SetNillableChildrenID ¶
func (ceuo *CreditEntryUpdateOne) SetNillableChildrenID(id *pgulid.ULID) *CreditEntryUpdateOne
SetNillableChildrenID sets the "children" edge to the CreditEntry entity by ID if the given value is not nil.
func (*CreditEntryUpdateOne) SetUpdatedAt ¶
func (ceuo *CreditEntryUpdateOne) SetUpdatedAt(t time.Time) *CreditEntryUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CreditEntryUpdateOne) Where ¶
func (ceuo *CreditEntryUpdateOne) Where(ps ...predicate.CreditEntry) *CreditEntryUpdateOne
Where appends a list predicates to the CreditEntryUpdate builder.
type CreditEntryUpsert ¶
CreditEntryUpsert is the "OnConflict" setter.
func (*CreditEntryUpsert) ClearMetadata ¶
func (u *CreditEntryUpsert) ClearMetadata() *CreditEntryUpsert
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryUpsert) SetMetadata ¶
func (u *CreditEntryUpsert) SetMetadata(v map[string]string) *CreditEntryUpsert
SetMetadata sets the "metadata" field.
func (*CreditEntryUpsert) SetUpdatedAt ¶
func (u *CreditEntryUpsert) SetUpdatedAt(v time.Time) *CreditEntryUpsert
SetUpdatedAt sets the "updated_at" field.
func (*CreditEntryUpsert) UpdateMetadata ¶
func (u *CreditEntryUpsert) UpdateMetadata() *CreditEntryUpsert
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*CreditEntryUpsert) UpdateUpdatedAt ¶
func (u *CreditEntryUpsert) UpdateUpdatedAt() *CreditEntryUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type CreditEntryUpsertBulk ¶
type CreditEntryUpsertBulk struct {
// contains filtered or unexported fields
}
CreditEntryUpsertBulk is the builder for "upsert"-ing a bulk of CreditEntry nodes.
func (*CreditEntryUpsertBulk) ClearMetadata ¶
func (u *CreditEntryUpsertBulk) ClearMetadata() *CreditEntryUpsertBulk
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryUpsertBulk) DoNothing ¶
func (u *CreditEntryUpsertBulk) DoNothing() *CreditEntryUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CreditEntryUpsertBulk) Exec ¶
func (u *CreditEntryUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CreditEntryUpsertBulk) ExecX ¶
func (u *CreditEntryUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryUpsertBulk) Ignore ¶
func (u *CreditEntryUpsertBulk) Ignore() *CreditEntryUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.CreditEntry.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CreditEntryUpsertBulk) SetMetadata ¶
func (u *CreditEntryUpsertBulk) SetMetadata(v map[string]string) *CreditEntryUpsertBulk
SetMetadata sets the "metadata" field.
func (*CreditEntryUpsertBulk) SetUpdatedAt ¶
func (u *CreditEntryUpsertBulk) SetUpdatedAt(v time.Time) *CreditEntryUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*CreditEntryUpsertBulk) Update ¶
func (u *CreditEntryUpsertBulk) Update(set func(*CreditEntryUpsert)) *CreditEntryUpsertBulk
Update allows overriding fields `UPDATE` values. See the CreditEntryCreateBulk.OnConflict documentation for more info.
func (*CreditEntryUpsertBulk) UpdateMetadata ¶
func (u *CreditEntryUpsertBulk) UpdateMetadata() *CreditEntryUpsertBulk
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*CreditEntryUpsertBulk) UpdateNewValues ¶
func (u *CreditEntryUpsertBulk) UpdateNewValues() *CreditEntryUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.CreditEntry.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(creditentry.FieldID) }), ). Exec(ctx)
func (*CreditEntryUpsertBulk) UpdateUpdatedAt ¶
func (u *CreditEntryUpsertBulk) UpdateUpdatedAt() *CreditEntryUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type CreditEntryUpsertOne ¶
type CreditEntryUpsertOne struct {
// contains filtered or unexported fields
}
CreditEntryUpsertOne is the builder for "upsert"-ing
one CreditEntry node.
func (*CreditEntryUpsertOne) ClearMetadata ¶
func (u *CreditEntryUpsertOne) ClearMetadata() *CreditEntryUpsertOne
ClearMetadata clears the value of the "metadata" field.
func (*CreditEntryUpsertOne) DoNothing ¶
func (u *CreditEntryUpsertOne) DoNothing() *CreditEntryUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CreditEntryUpsertOne) Exec ¶
func (u *CreditEntryUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*CreditEntryUpsertOne) ExecX ¶
func (u *CreditEntryUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CreditEntryUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*CreditEntryUpsertOne) IDX ¶
func (u *CreditEntryUpsertOne) IDX(ctx context.Context) pgulid.ULID
IDX is like ID, but panics if an error occurs.
func (*CreditEntryUpsertOne) Ignore ¶
func (u *CreditEntryUpsertOne) Ignore() *CreditEntryUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.CreditEntry.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CreditEntryUpsertOne) SetMetadata ¶
func (u *CreditEntryUpsertOne) SetMetadata(v map[string]string) *CreditEntryUpsertOne
SetMetadata sets the "metadata" field.
func (*CreditEntryUpsertOne) SetUpdatedAt ¶
func (u *CreditEntryUpsertOne) SetUpdatedAt(v time.Time) *CreditEntryUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*CreditEntryUpsertOne) Update ¶
func (u *CreditEntryUpsertOne) Update(set func(*CreditEntryUpsert)) *CreditEntryUpsertOne
Update allows overriding fields `UPDATE` values. See the CreditEntryCreate.OnConflict documentation for more info.
func (*CreditEntryUpsertOne) UpdateMetadata ¶
func (u *CreditEntryUpsertOne) UpdateMetadata() *CreditEntryUpsertOne
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*CreditEntryUpsertOne) UpdateNewValues ¶
func (u *CreditEntryUpsertOne) UpdateNewValues() *CreditEntryUpsertOne
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.CreditEntry.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(creditentry.FieldID) }), ). Exec(ctx)
func (*CreditEntryUpsertOne) UpdateUpdatedAt ¶
func (u *CreditEntryUpsertOne) UpdateUpdatedAt() *CreditEntryUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type Feature ¶
type Feature struct { // ID of the ent. ID pgulid.ULID `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Namespace holds the value of the "namespace" field. Namespace string `json:"namespace,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // MeterSlug holds the value of the "meter_slug" field. MeterSlug string `json:"meter_slug,omitempty"` // MeterGroupByFilters holds the value of the "meter_group_by_filters" field. MeterGroupByFilters map[string]string `json:"meter_group_by_filters,omitempty"` // Archived holds the value of the "archived" field. Archived bool `json:"archived,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FeatureQuery when eager-loading is set. Edges FeatureEdges `json:"edges"` // contains filtered or unexported fields }
Feature is the model entity for the Feature schema.
func (*Feature) QueryCreditGrants ¶
func (f *Feature) QueryCreditGrants() *CreditEntryQuery
QueryCreditGrants queries the "credit_grants" edge of the Feature entity.
func (*Feature) Unwrap ¶
Unwrap unwraps the Feature 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 (*Feature) Update ¶
func (f *Feature) Update() *FeatureUpdateOne
Update returns a builder for updating this Feature. Note that you need to call Feature.Unwrap() before calling this method if this Feature was returned from a transaction, and the transaction was committed or rolled back.
type FeatureClient ¶
type FeatureClient struct {
// contains filtered or unexported fields
}
FeatureClient is a client for the Feature schema.
func NewFeatureClient ¶
func NewFeatureClient(c config) *FeatureClient
NewFeatureClient returns a client for the Feature from the given config.
func (*FeatureClient) Create ¶
func (c *FeatureClient) Create() *FeatureCreate
Create returns a builder for creating a Feature entity.
func (*FeatureClient) CreateBulk ¶
func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk
CreateBulk returns a builder for creating a bulk of Feature entities.
func (*FeatureClient) Delete ¶
func (c *FeatureClient) Delete() *FeatureDelete
Delete returns a delete builder for Feature.
func (*FeatureClient) DeleteOne ¶
func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FeatureClient) DeleteOneID ¶
func (c *FeatureClient) DeleteOneID(id pgulid.ULID) *FeatureDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FeatureClient) Hooks ¶
func (c *FeatureClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FeatureClient) Intercept ¶
func (c *FeatureClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `feature.Intercept(f(g(h())))`.
func (*FeatureClient) Interceptors ¶
func (c *FeatureClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FeatureClient) MapCreateBulk ¶
func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk
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 (*FeatureClient) Query ¶
func (c *FeatureClient) Query() *FeatureQuery
Query returns a query builder for Feature.
func (*FeatureClient) QueryCreditGrants ¶
func (c *FeatureClient) QueryCreditGrants(f *Feature) *CreditEntryQuery
QueryCreditGrants queries the credit_grants edge of a Feature.
func (*FeatureClient) Update ¶
func (c *FeatureClient) Update() *FeatureUpdate
Update returns an update builder for Feature.
func (*FeatureClient) UpdateOne ¶
func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FeatureClient) UpdateOneID ¶
func (c *FeatureClient) UpdateOneID(id pgulid.ULID) *FeatureUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FeatureClient) Use ¶
func (c *FeatureClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `feature.Hooks(f(g(h())))`.
type FeatureCreate ¶
type FeatureCreate struct {
// contains filtered or unexported fields
}
FeatureCreate is the builder for creating a Feature entity.
func (*FeatureCreate) AddCreditGrantIDs ¶
func (fc *FeatureCreate) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureCreate
AddCreditGrantIDs adds the "credit_grants" edge to the CreditEntry entity by IDs.
func (*FeatureCreate) AddCreditGrants ¶
func (fc *FeatureCreate) AddCreditGrants(c ...*CreditEntry) *FeatureCreate
AddCreditGrants adds the "credit_grants" edges to the CreditEntry entity.
func (*FeatureCreate) Exec ¶
func (fc *FeatureCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureCreate) ExecX ¶
func (fc *FeatureCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureCreate) Mutation ¶
func (fc *FeatureCreate) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureCreate) OnConflict ¶
func (fc *FeatureCreate) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Feature.Create(). SetCreatedAt(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.FeatureUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*FeatureCreate) OnConflictColumns ¶
func (fc *FeatureCreate) OnConflictColumns(columns ...string) *FeatureUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Feature.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*FeatureCreate) Save ¶
func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)
Save creates the Feature in the database.
func (*FeatureCreate) SaveX ¶
func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature
SaveX calls Save and panics if Save returns an error.
func (*FeatureCreate) SetArchived ¶
func (fc *FeatureCreate) SetArchived(b bool) *FeatureCreate
SetArchived sets the "archived" field.
func (*FeatureCreate) SetCreatedAt ¶
func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate
SetCreatedAt sets the "created_at" field.
func (*FeatureCreate) SetID ¶
func (fc *FeatureCreate) SetID(pg pgulid.ULID) *FeatureCreate
SetID sets the "id" field.
func (*FeatureCreate) SetMeterGroupByFilters ¶
func (fc *FeatureCreate) SetMeterGroupByFilters(m map[string]string) *FeatureCreate
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureCreate) SetMeterSlug ¶
func (fc *FeatureCreate) SetMeterSlug(s string) *FeatureCreate
SetMeterSlug sets the "meter_slug" field.
func (*FeatureCreate) SetName ¶
func (fc *FeatureCreate) SetName(s string) *FeatureCreate
SetName sets the "name" field.
func (*FeatureCreate) SetNamespace ¶
func (fc *FeatureCreate) SetNamespace(s string) *FeatureCreate
SetNamespace sets the "namespace" field.
func (*FeatureCreate) SetNillableArchived ¶
func (fc *FeatureCreate) SetNillableArchived(b *bool) *FeatureCreate
SetNillableArchived sets the "archived" field if the given value is not nil.
func (*FeatureCreate) SetNillableCreatedAt ¶
func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FeatureCreate) SetNillableID ¶
func (fc *FeatureCreate) SetNillableID(pg *pgulid.ULID) *FeatureCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*FeatureCreate) SetNillableUpdatedAt ¶
func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*FeatureCreate) SetUpdatedAt ¶
func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate
SetUpdatedAt sets the "updated_at" field.
type FeatureCreateBulk ¶
type FeatureCreateBulk struct {
// contains filtered or unexported fields
}
FeatureCreateBulk is the builder for creating many Feature entities in bulk.
func (*FeatureCreateBulk) Exec ¶
func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureCreateBulk) ExecX ¶
func (fcb *FeatureCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureCreateBulk) OnConflict ¶
func (fcb *FeatureCreateBulk) OnConflict(opts ...sql.ConflictOption) *FeatureUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Feature.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.FeatureUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*FeatureCreateBulk) OnConflictColumns ¶
func (fcb *FeatureCreateBulk) OnConflictColumns(columns ...string) *FeatureUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Feature.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type FeatureDelete ¶
type FeatureDelete struct {
// contains filtered or unexported fields
}
FeatureDelete is the builder for deleting a Feature entity.
func (*FeatureDelete) Exec ¶
func (fd *FeatureDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FeatureDelete) ExecX ¶
func (fd *FeatureDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FeatureDelete) Where ¶
func (fd *FeatureDelete) Where(ps ...predicate.Feature) *FeatureDelete
Where appends a list predicates to the FeatureDelete builder.
type FeatureDeleteOne ¶
type FeatureDeleteOne struct {
// contains filtered or unexported fields
}
FeatureDeleteOne is the builder for deleting a single Feature entity.
func (*FeatureDeleteOne) Exec ¶
func (fdo *FeatureDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FeatureDeleteOne) ExecX ¶
func (fdo *FeatureDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureDeleteOne) Where ¶
func (fdo *FeatureDeleteOne) Where(ps ...predicate.Feature) *FeatureDeleteOne
Where appends a list predicates to the FeatureDelete builder.
type FeatureEdges ¶
type FeatureEdges struct { // CreditGrants holds the value of the credit_grants edge. CreditGrants []*CreditEntry `json:"credit_grants,omitempty"` // contains filtered or unexported fields }
FeatureEdges holds the relations/edges for other nodes in the graph.
func (FeatureEdges) CreditGrantsOrErr ¶
func (e FeatureEdges) CreditGrantsOrErr() ([]*CreditEntry, error)
CreditGrantsOrErr returns the CreditGrants value or an error if the edge was not loaded in eager-loading.
type FeatureGroupBy ¶
type FeatureGroupBy struct {
// contains filtered or unexported fields
}
FeatureGroupBy is the group-by builder for Feature entities.
func (*FeatureGroupBy) Aggregate ¶
func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FeatureGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Scan ¶
func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FeatureGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FeatureMutation ¶
type FeatureMutation struct {
// contains filtered or unexported fields
}
FeatureMutation represents an operation that mutates the Feature nodes in the graph.
func (*FeatureMutation) AddCreditGrantIDs ¶
func (m *FeatureMutation) AddCreditGrantIDs(ids ...pgulid.ULID)
AddCreditGrantIDs adds the "credit_grants" edge to the CreditEntry entity by ids.
func (*FeatureMutation) AddField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) AddedEdges ¶
func (m *FeatureMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FeatureMutation) AddedField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) AddedFields ¶
func (m *FeatureMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FeatureMutation) AddedIDs ¶
func (m *FeatureMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FeatureMutation) Archived ¶
func (m *FeatureMutation) Archived() (r bool, exists bool)
Archived returns the value of the "archived" field in the mutation.
func (*FeatureMutation) ClearCreditGrants ¶
func (m *FeatureMutation) ClearCreditGrants()
ClearCreditGrants clears the "credit_grants" edge to the CreditEntry entity.
func (*FeatureMutation) ClearEdge ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ClearField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ClearMeterGroupByFilters ¶
func (m *FeatureMutation) ClearMeterGroupByFilters()
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureMutation) ClearedEdges ¶
func (m *FeatureMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FeatureMutation) ClearedFields ¶
func (m *FeatureMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FeatureMutation) Client ¶
func (m FeatureMutation) 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 (*FeatureMutation) CreatedAt ¶
func (m *FeatureMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*FeatureMutation) CreditGrantsCleared ¶
func (m *FeatureMutation) CreditGrantsCleared() bool
CreditGrantsCleared reports if the "credit_grants" edge to the CreditEntry entity was cleared.
func (*FeatureMutation) CreditGrantsIDs ¶
func (m *FeatureMutation) CreditGrantsIDs() (ids []pgulid.ULID)
CreditGrantsIDs returns the "credit_grants" edge IDs in the mutation.
func (*FeatureMutation) EdgeCleared ¶
func (m *FeatureMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FeatureMutation) Field ¶
func (m *FeatureMutation) 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 (*FeatureMutation) FieldCleared ¶
func (m *FeatureMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FeatureMutation) Fields ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ID ¶
func (m *FeatureMutation) ID() (id pgulid.ULID, 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 (*FeatureMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FeatureMutation) MeterGroupByFilters ¶
func (m *FeatureMutation) MeterGroupByFilters() (r map[string]string, exists bool)
MeterGroupByFilters returns the value of the "meter_group_by_filters" field in the mutation.
func (*FeatureMutation) MeterGroupByFiltersCleared ¶
func (m *FeatureMutation) MeterGroupByFiltersCleared() bool
MeterGroupByFiltersCleared returns if the "meter_group_by_filters" field was cleared in this mutation.
func (*FeatureMutation) MeterSlug ¶
func (m *FeatureMutation) MeterSlug() (r string, exists bool)
MeterSlug returns the value of the "meter_slug" field in the mutation.
func (*FeatureMutation) Name ¶
func (m *FeatureMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FeatureMutation) Namespace ¶
func (m *FeatureMutation) Namespace() (r string, exists bool)
Namespace returns the value of the "namespace" field in the mutation.
func (*FeatureMutation) OldArchived ¶
func (m *FeatureMutation) OldArchived(ctx context.Context) (v bool, err error)
OldArchived returns the old "archived" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) 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 (*FeatureMutation) OldMeterGroupByFilters ¶
func (m *FeatureMutation) OldMeterGroupByFilters(ctx context.Context) (v map[string]string, err error)
OldMeterGroupByFilters returns the old "meter_group_by_filters" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldMeterSlug ¶
func (m *FeatureMutation) OldMeterSlug(ctx context.Context) (v string, err error)
OldMeterSlug returns the old "meter_slug" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldName ¶
func (m *FeatureMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldNamespace ¶
func (m *FeatureMutation) OldNamespace(ctx context.Context) (v string, err error)
OldNamespace returns the old "namespace" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) RemoveCreditGrantIDs ¶
func (m *FeatureMutation) RemoveCreditGrantIDs(ids ...pgulid.ULID)
RemoveCreditGrantIDs removes the "credit_grants" edge to the CreditEntry entity by IDs.
func (*FeatureMutation) RemovedCreditGrantsIDs ¶
func (m *FeatureMutation) RemovedCreditGrantsIDs() (ids []pgulid.ULID)
RemovedCreditGrants returns the removed IDs of the "credit_grants" edge to the CreditEntry entity.
func (*FeatureMutation) RemovedEdges ¶
func (m *FeatureMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FeatureMutation) RemovedIDs ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetArchived ¶
func (m *FeatureMutation) ResetArchived()
ResetArchived resets all changes to the "archived" field.
func (*FeatureMutation) ResetCreatedAt ¶
func (m *FeatureMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*FeatureMutation) ResetCreditGrants ¶
func (m *FeatureMutation) ResetCreditGrants()
ResetCreditGrants resets all changes to the "credit_grants" edge.
func (*FeatureMutation) ResetEdge ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetMeterGroupByFilters ¶
func (m *FeatureMutation) ResetMeterGroupByFilters()
ResetMeterGroupByFilters resets all changes to the "meter_group_by_filters" field.
func (*FeatureMutation) ResetMeterSlug ¶
func (m *FeatureMutation) ResetMeterSlug()
ResetMeterSlug resets all changes to the "meter_slug" field.
func (*FeatureMutation) ResetName ¶
func (m *FeatureMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FeatureMutation) ResetNamespace ¶
func (m *FeatureMutation) ResetNamespace()
ResetNamespace resets all changes to the "namespace" field.
func (*FeatureMutation) ResetUpdatedAt ¶
func (m *FeatureMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*FeatureMutation) SetArchived ¶
func (m *FeatureMutation) SetArchived(b bool)
SetArchived sets the "archived" field.
func (*FeatureMutation) SetCreatedAt ¶
func (m *FeatureMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*FeatureMutation) SetField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) SetID ¶
func (m *FeatureMutation) SetID(id pgulid.ULID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Feature entities.
func (*FeatureMutation) SetMeterGroupByFilters ¶
func (m *FeatureMutation) SetMeterGroupByFilters(value map[string]string)
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureMutation) SetMeterSlug ¶
func (m *FeatureMutation) SetMeterSlug(s string)
SetMeterSlug sets the "meter_slug" field.
func (*FeatureMutation) SetName ¶
func (m *FeatureMutation) SetName(s string)
SetName sets the "name" field.
func (*FeatureMutation) SetNamespace ¶
func (m *FeatureMutation) SetNamespace(s string)
SetNamespace sets the "namespace" field.
func (*FeatureMutation) SetOp ¶
func (m *FeatureMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FeatureMutation) SetUpdatedAt ¶
func (m *FeatureMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (FeatureMutation) Tx ¶
func (m FeatureMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FeatureMutation) Type ¶
func (m *FeatureMutation) Type() string
Type returns the node type of this mutation (Feature).
func (*FeatureMutation) UpdatedAt ¶
func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*FeatureMutation) Where ¶
func (m *FeatureMutation) Where(ps ...predicate.Feature)
Where appends a list predicates to the FeatureMutation builder.
func (*FeatureMutation) WhereP ¶
func (m *FeatureMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FeatureMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FeatureQuery ¶
type FeatureQuery struct {
// contains filtered or unexported fields
}
FeatureQuery is the builder for querying Feature entities.
func (*FeatureQuery) Aggregate ¶
func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect
Aggregate returns a FeatureSelect configured with the given aggregations.
func (*FeatureQuery) All ¶
func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)
All executes the query and returns a list of Features.
func (*FeatureQuery) AllX ¶
func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature
AllX is like All, but panics if an error occurs.
func (*FeatureQuery) Clone ¶
func (fq *FeatureQuery) Clone() *FeatureQuery
Clone returns a duplicate of the FeatureQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FeatureQuery) Count ¶
func (fq *FeatureQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FeatureQuery) CountX ¶
func (fq *FeatureQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FeatureQuery) Exist ¶
func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FeatureQuery) ExistX ¶
func (fq *FeatureQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FeatureQuery) First ¶
func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)
First returns the first Feature entity from the query. Returns a *NotFoundError when no Feature was found.
func (*FeatureQuery) FirstID ¶
FirstID returns the first Feature ID from the query. Returns a *NotFoundError when no Feature ID was found.
func (*FeatureQuery) FirstIDX ¶
func (fq *FeatureQuery) FirstIDX(ctx context.Context) pgulid.ULID
FirstIDX is like FirstID, but panics if an error occurs.
func (*FeatureQuery) FirstX ¶
func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature
FirstX is like First, but panics if an error occurs.
func (*FeatureQuery) ForShare ¶
func (fq *FeatureQuery) ForShare(opts ...sql.LockOption) *FeatureQuery
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 (*FeatureQuery) ForUpdate ¶
func (fq *FeatureQuery) ForUpdate(opts ...sql.LockOption) *FeatureQuery
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 (*FeatureQuery) GroupBy ¶
func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Feature.Query(). GroupBy(feature.FieldCreatedAt). Aggregate(db.Count()). Scan(ctx, &v)
func (*FeatureQuery) IDsX ¶
func (fq *FeatureQuery) IDsX(ctx context.Context) []pgulid.ULID
IDsX is like IDs, but panics if an error occurs.
func (*FeatureQuery) Limit ¶
func (fq *FeatureQuery) Limit(limit int) *FeatureQuery
Limit the number of records to be returned by this query.
func (*FeatureQuery) Offset ¶
func (fq *FeatureQuery) Offset(offset int) *FeatureQuery
Offset to start from.
func (*FeatureQuery) Only ¶
func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)
Only returns a single Feature entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Feature entity is found. Returns a *NotFoundError when no Feature entities are found.
func (*FeatureQuery) OnlyID ¶
OnlyID is like Only, but returns the only Feature ID in the query. Returns a *NotSingularError when more than one Feature ID is found. Returns a *NotFoundError when no entities are found.
func (*FeatureQuery) OnlyIDX ¶
func (fq *FeatureQuery) OnlyIDX(ctx context.Context) pgulid.ULID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FeatureQuery) OnlyX ¶
func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature
OnlyX is like Only, but panics if an error occurs.
func (*FeatureQuery) Order ¶
func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery
Order specifies how the records should be ordered.
func (*FeatureQuery) QueryCreditGrants ¶
func (fq *FeatureQuery) QueryCreditGrants() *CreditEntryQuery
QueryCreditGrants chains the current query on the "credit_grants" edge.
func (*FeatureQuery) Select ¶
func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Feature.Query(). Select(feature.FieldCreatedAt). Scan(ctx, &v)
func (*FeatureQuery) Unique ¶
func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery
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 (*FeatureQuery) Where ¶
func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery
Where adds a new predicate for the FeatureQuery builder.
func (*FeatureQuery) WithCreditGrants ¶
func (fq *FeatureQuery) WithCreditGrants(opts ...func(*CreditEntryQuery)) *FeatureQuery
WithCreditGrants tells the query-builder to eager-load the nodes that are connected to the "credit_grants" edge. The optional arguments are used to configure the query builder of the edge.
type FeatureSelect ¶
type FeatureSelect struct { *FeatureQuery // contains filtered or unexported fields }
FeatureSelect is the builder for selecting fields of Feature entities.
func (*FeatureSelect) Aggregate ¶
func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FeatureSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Scan ¶
func (fs *FeatureSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FeatureSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FeatureUpdate ¶
type FeatureUpdate struct {
// contains filtered or unexported fields
}
FeatureUpdate is the builder for updating Feature entities.
func (*FeatureUpdate) AddCreditGrantIDs ¶
func (fu *FeatureUpdate) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdate
AddCreditGrantIDs adds the "credit_grants" edge to the CreditEntry entity by IDs.
func (*FeatureUpdate) AddCreditGrants ¶
func (fu *FeatureUpdate) AddCreditGrants(c ...*CreditEntry) *FeatureUpdate
AddCreditGrants adds the "credit_grants" edges to the CreditEntry entity.
func (*FeatureUpdate) ClearCreditGrants ¶
func (fu *FeatureUpdate) ClearCreditGrants() *FeatureUpdate
ClearCreditGrants clears all "credit_grants" edges to the CreditEntry entity.
func (*FeatureUpdate) ClearMeterGroupByFilters ¶
func (fu *FeatureUpdate) ClearMeterGroupByFilters() *FeatureUpdate
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureUpdate) Exec ¶
func (fu *FeatureUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureUpdate) ExecX ¶
func (fu *FeatureUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpdate) Mutation ¶
func (fu *FeatureUpdate) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureUpdate) RemoveCreditGrantIDs ¶
func (fu *FeatureUpdate) RemoveCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdate
RemoveCreditGrantIDs removes the "credit_grants" edge to CreditEntry entities by IDs.
func (*FeatureUpdate) RemoveCreditGrants ¶
func (fu *FeatureUpdate) RemoveCreditGrants(c ...*CreditEntry) *FeatureUpdate
RemoveCreditGrants removes "credit_grants" edges to CreditEntry entities.
func (*FeatureUpdate) Save ¶
func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FeatureUpdate) SaveX ¶
func (fu *FeatureUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FeatureUpdate) SetArchived ¶
func (fu *FeatureUpdate) SetArchived(b bool) *FeatureUpdate
SetArchived sets the "archived" field.
func (*FeatureUpdate) SetMeterGroupByFilters ¶
func (fu *FeatureUpdate) SetMeterGroupByFilters(m map[string]string) *FeatureUpdate
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureUpdate) SetName ¶
func (fu *FeatureUpdate) SetName(s string) *FeatureUpdate
SetName sets the "name" field.
func (*FeatureUpdate) SetNillableArchived ¶
func (fu *FeatureUpdate) SetNillableArchived(b *bool) *FeatureUpdate
SetNillableArchived sets the "archived" field if the given value is not nil.
func (*FeatureUpdate) SetNillableName ¶
func (fu *FeatureUpdate) SetNillableName(s *string) *FeatureUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*FeatureUpdate) SetUpdatedAt ¶
func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpdate) Where ¶
func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate
Where appends a list predicates to the FeatureUpdate builder.
type FeatureUpdateOne ¶
type FeatureUpdateOne struct {
// contains filtered or unexported fields
}
FeatureUpdateOne is the builder for updating a single Feature entity.
func (*FeatureUpdateOne) AddCreditGrantIDs ¶
func (fuo *FeatureUpdateOne) AddCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdateOne
AddCreditGrantIDs adds the "credit_grants" edge to the CreditEntry entity by IDs.
func (*FeatureUpdateOne) AddCreditGrants ¶
func (fuo *FeatureUpdateOne) AddCreditGrants(c ...*CreditEntry) *FeatureUpdateOne
AddCreditGrants adds the "credit_grants" edges to the CreditEntry entity.
func (*FeatureUpdateOne) ClearCreditGrants ¶
func (fuo *FeatureUpdateOne) ClearCreditGrants() *FeatureUpdateOne
ClearCreditGrants clears all "credit_grants" edges to the CreditEntry entity.
func (*FeatureUpdateOne) ClearMeterGroupByFilters ¶
func (fuo *FeatureUpdateOne) ClearMeterGroupByFilters() *FeatureUpdateOne
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureUpdateOne) Exec ¶
func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FeatureUpdateOne) ExecX ¶
func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpdateOne) Mutation ¶
func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureUpdateOne) RemoveCreditGrantIDs ¶
func (fuo *FeatureUpdateOne) RemoveCreditGrantIDs(ids ...pgulid.ULID) *FeatureUpdateOne
RemoveCreditGrantIDs removes the "credit_grants" edge to CreditEntry entities by IDs.
func (*FeatureUpdateOne) RemoveCreditGrants ¶
func (fuo *FeatureUpdateOne) RemoveCreditGrants(c ...*CreditEntry) *FeatureUpdateOne
RemoveCreditGrants removes "credit_grants" edges to CreditEntry entities.
func (*FeatureUpdateOne) Save ¶
func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)
Save executes the query and returns the updated Feature entity.
func (*FeatureUpdateOne) SaveX ¶
func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature
SaveX is like Save, but panics if an error occurs.
func (*FeatureUpdateOne) Select ¶
func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FeatureUpdateOne) SetArchived ¶
func (fuo *FeatureUpdateOne) SetArchived(b bool) *FeatureUpdateOne
SetArchived sets the "archived" field.
func (*FeatureUpdateOne) SetMeterGroupByFilters ¶
func (fuo *FeatureUpdateOne) SetMeterGroupByFilters(m map[string]string) *FeatureUpdateOne
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureUpdateOne) SetName ¶
func (fuo *FeatureUpdateOne) SetName(s string) *FeatureUpdateOne
SetName sets the "name" field.
func (*FeatureUpdateOne) SetNillableArchived ¶
func (fuo *FeatureUpdateOne) SetNillableArchived(b *bool) *FeatureUpdateOne
SetNillableArchived sets the "archived" field if the given value is not nil.
func (*FeatureUpdateOne) SetNillableName ¶
func (fuo *FeatureUpdateOne) SetNillableName(s *string) *FeatureUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*FeatureUpdateOne) SetUpdatedAt ¶
func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpdateOne) Where ¶
func (fuo *FeatureUpdateOne) Where(ps ...predicate.Feature) *FeatureUpdateOne
Where appends a list predicates to the FeatureUpdate builder.
type FeatureUpsert ¶
FeatureUpsert is the "OnConflict" setter.
func (*FeatureUpsert) ClearMeterGroupByFilters ¶
func (u *FeatureUpsert) ClearMeterGroupByFilters() *FeatureUpsert
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureUpsert) SetArchived ¶
func (u *FeatureUpsert) SetArchived(v bool) *FeatureUpsert
SetArchived sets the "archived" field.
func (*FeatureUpsert) SetMeterGroupByFilters ¶
func (u *FeatureUpsert) SetMeterGroupByFilters(v map[string]string) *FeatureUpsert
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureUpsert) SetName ¶
func (u *FeatureUpsert) SetName(v string) *FeatureUpsert
SetName sets the "name" field.
func (*FeatureUpsert) SetUpdatedAt ¶
func (u *FeatureUpsert) SetUpdatedAt(v time.Time) *FeatureUpsert
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpsert) UpdateArchived ¶
func (u *FeatureUpsert) UpdateArchived() *FeatureUpsert
UpdateArchived sets the "archived" field to the value that was provided on create.
func (*FeatureUpsert) UpdateMeterGroupByFilters ¶
func (u *FeatureUpsert) UpdateMeterGroupByFilters() *FeatureUpsert
UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.
func (*FeatureUpsert) UpdateName ¶
func (u *FeatureUpsert) UpdateName() *FeatureUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*FeatureUpsert) UpdateUpdatedAt ¶
func (u *FeatureUpsert) UpdateUpdatedAt() *FeatureUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type FeatureUpsertBulk ¶
type FeatureUpsertBulk struct {
// contains filtered or unexported fields
}
FeatureUpsertBulk is the builder for "upsert"-ing a bulk of Feature nodes.
func (*FeatureUpsertBulk) ClearMeterGroupByFilters ¶
func (u *FeatureUpsertBulk) ClearMeterGroupByFilters() *FeatureUpsertBulk
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureUpsertBulk) DoNothing ¶
func (u *FeatureUpsertBulk) DoNothing() *FeatureUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*FeatureUpsertBulk) Exec ¶
func (u *FeatureUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureUpsertBulk) ExecX ¶
func (u *FeatureUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpsertBulk) Ignore ¶
func (u *FeatureUpsertBulk) Ignore() *FeatureUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Feature.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*FeatureUpsertBulk) SetArchived ¶
func (u *FeatureUpsertBulk) SetArchived(v bool) *FeatureUpsertBulk
SetArchived sets the "archived" field.
func (*FeatureUpsertBulk) SetMeterGroupByFilters ¶
func (u *FeatureUpsertBulk) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertBulk
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureUpsertBulk) SetName ¶
func (u *FeatureUpsertBulk) SetName(v string) *FeatureUpsertBulk
SetName sets the "name" field.
func (*FeatureUpsertBulk) SetUpdatedAt ¶
func (u *FeatureUpsertBulk) SetUpdatedAt(v time.Time) *FeatureUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpsertBulk) Update ¶
func (u *FeatureUpsertBulk) Update(set func(*FeatureUpsert)) *FeatureUpsertBulk
Update allows overriding fields `UPDATE` values. See the FeatureCreateBulk.OnConflict documentation for more info.
func (*FeatureUpsertBulk) UpdateArchived ¶
func (u *FeatureUpsertBulk) UpdateArchived() *FeatureUpsertBulk
UpdateArchived sets the "archived" field to the value that was provided on create.
func (*FeatureUpsertBulk) UpdateMeterGroupByFilters ¶
func (u *FeatureUpsertBulk) UpdateMeterGroupByFilters() *FeatureUpsertBulk
UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.
func (*FeatureUpsertBulk) UpdateName ¶
func (u *FeatureUpsertBulk) UpdateName() *FeatureUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*FeatureUpsertBulk) UpdateNewValues ¶
func (u *FeatureUpsertBulk) UpdateNewValues() *FeatureUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Feature.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(feature.FieldID) }), ). Exec(ctx)
func (*FeatureUpsertBulk) UpdateUpdatedAt ¶
func (u *FeatureUpsertBulk) UpdateUpdatedAt() *FeatureUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type FeatureUpsertOne ¶
type FeatureUpsertOne struct {
// contains filtered or unexported fields
}
FeatureUpsertOne is the builder for "upsert"-ing
one Feature node.
func (*FeatureUpsertOne) ClearMeterGroupByFilters ¶
func (u *FeatureUpsertOne) ClearMeterGroupByFilters() *FeatureUpsertOne
ClearMeterGroupByFilters clears the value of the "meter_group_by_filters" field.
func (*FeatureUpsertOne) DoNothing ¶
func (u *FeatureUpsertOne) DoNothing() *FeatureUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*FeatureUpsertOne) Exec ¶
func (u *FeatureUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureUpsertOne) ExecX ¶
func (u *FeatureUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpsertOne) IDX ¶
func (u *FeatureUpsertOne) IDX(ctx context.Context) pgulid.ULID
IDX is like ID, but panics if an error occurs.
func (*FeatureUpsertOne) Ignore ¶
func (u *FeatureUpsertOne) Ignore() *FeatureUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Feature.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*FeatureUpsertOne) SetArchived ¶
func (u *FeatureUpsertOne) SetArchived(v bool) *FeatureUpsertOne
SetArchived sets the "archived" field.
func (*FeatureUpsertOne) SetMeterGroupByFilters ¶
func (u *FeatureUpsertOne) SetMeterGroupByFilters(v map[string]string) *FeatureUpsertOne
SetMeterGroupByFilters sets the "meter_group_by_filters" field.
func (*FeatureUpsertOne) SetName ¶
func (u *FeatureUpsertOne) SetName(v string) *FeatureUpsertOne
SetName sets the "name" field.
func (*FeatureUpsertOne) SetUpdatedAt ¶
func (u *FeatureUpsertOne) SetUpdatedAt(v time.Time) *FeatureUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpsertOne) Update ¶
func (u *FeatureUpsertOne) Update(set func(*FeatureUpsert)) *FeatureUpsertOne
Update allows overriding fields `UPDATE` values. See the FeatureCreate.OnConflict documentation for more info.
func (*FeatureUpsertOne) UpdateArchived ¶
func (u *FeatureUpsertOne) UpdateArchived() *FeatureUpsertOne
UpdateArchived sets the "archived" field to the value that was provided on create.
func (*FeatureUpsertOne) UpdateMeterGroupByFilters ¶
func (u *FeatureUpsertOne) UpdateMeterGroupByFilters() *FeatureUpsertOne
UpdateMeterGroupByFilters sets the "meter_group_by_filters" field to the value that was provided on create.
func (*FeatureUpsertOne) UpdateName ¶
func (u *FeatureUpsertOne) UpdateName() *FeatureUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*FeatureUpsertOne) UpdateNewValues ¶
func (u *FeatureUpsertOne) UpdateNewValues() *FeatureUpsertOne
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.Feature.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(feature.FieldID) }), ). Exec(ctx)
func (*FeatureUpsertOne) UpdateUpdatedAt ¶
func (u *FeatureUpsertOne) UpdateUpdatedAt() *FeatureUpsertOne
UpdateUpdatedAt sets the "updated_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 Ledger ¶
type Ledger struct { // ID of the ent. ID pgulid.ULID `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Namespace holds the value of the "namespace" field. Namespace string `json:"namespace,omitempty"` // Subject holds the value of the "subject" field. Subject string `json:"subject,omitempty"` // Metadata holds the value of the "metadata" field. Metadata map[string]string `json:"metadata,omitempty"` // Highwatermark holds the value of the "highwatermark" field. Highwatermark time.Time `json:"highwatermark,omitempty"` // contains filtered or unexported fields }
Ledger is the model entity for the Ledger schema.
func (*Ledger) Unwrap ¶
Unwrap unwraps the Ledger 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 (*Ledger) Update ¶
func (l *Ledger) Update() *LedgerUpdateOne
Update returns a builder for updating this Ledger. Note that you need to call Ledger.Unwrap() before calling this method if this Ledger was returned from a transaction, and the transaction was committed or rolled back.
type LedgerClient ¶
type LedgerClient struct {
// contains filtered or unexported fields
}
LedgerClient is a client for the Ledger schema.
func NewLedgerClient ¶
func NewLedgerClient(c config) *LedgerClient
NewLedgerClient returns a client for the Ledger from the given config.
func (*LedgerClient) Create ¶
func (c *LedgerClient) Create() *LedgerCreate
Create returns a builder for creating a Ledger entity.
func (*LedgerClient) CreateBulk ¶
func (c *LedgerClient) CreateBulk(builders ...*LedgerCreate) *LedgerCreateBulk
CreateBulk returns a builder for creating a bulk of Ledger entities.
func (*LedgerClient) Delete ¶
func (c *LedgerClient) Delete() *LedgerDelete
Delete returns a delete builder for Ledger.
func (*LedgerClient) DeleteOne ¶
func (c *LedgerClient) DeleteOne(l *Ledger) *LedgerDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LedgerClient) DeleteOneID ¶
func (c *LedgerClient) DeleteOneID(id pgulid.ULID) *LedgerDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LedgerClient) Intercept ¶
func (c *LedgerClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ledger.Intercept(f(g(h())))`.
func (*LedgerClient) Interceptors ¶
func (c *LedgerClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LedgerClient) MapCreateBulk ¶
func (c *LedgerClient) MapCreateBulk(slice any, setFunc func(*LedgerCreate, int)) *LedgerCreateBulk
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 (*LedgerClient) Query ¶
func (c *LedgerClient) Query() *LedgerQuery
Query returns a query builder for Ledger.
func (*LedgerClient) Update ¶
func (c *LedgerClient) Update() *LedgerUpdate
Update returns an update builder for Ledger.
func (*LedgerClient) UpdateOne ¶
func (c *LedgerClient) UpdateOne(l *Ledger) *LedgerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LedgerClient) UpdateOneID ¶
func (c *LedgerClient) UpdateOneID(id pgulid.ULID) *LedgerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LedgerClient) Use ¶
func (c *LedgerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `ledger.Hooks(f(g(h())))`.
type LedgerCreate ¶
type LedgerCreate struct {
// contains filtered or unexported fields
}
LedgerCreate is the builder for creating a Ledger entity.
func (*LedgerCreate) Exec ¶
func (lc *LedgerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LedgerCreate) ExecX ¶
func (lc *LedgerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerCreate) Mutation ¶
func (lc *LedgerCreate) Mutation() *LedgerMutation
Mutation returns the LedgerMutation object of the builder.
func (*LedgerCreate) OnConflict ¶
func (lc *LedgerCreate) OnConflict(opts ...sql.ConflictOption) *LedgerUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Ledger.Create(). SetCreatedAt(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.LedgerUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*LedgerCreate) OnConflictColumns ¶
func (lc *LedgerCreate) OnConflictColumns(columns ...string) *LedgerUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Ledger.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*LedgerCreate) Save ¶
func (lc *LedgerCreate) Save(ctx context.Context) (*Ledger, error)
Save creates the Ledger in the database.
func (*LedgerCreate) SaveX ¶
func (lc *LedgerCreate) SaveX(ctx context.Context) *Ledger
SaveX calls Save and panics if Save returns an error.
func (*LedgerCreate) SetCreatedAt ¶
func (lc *LedgerCreate) SetCreatedAt(t time.Time) *LedgerCreate
SetCreatedAt sets the "created_at" field.
func (*LedgerCreate) SetHighwatermark ¶
func (lc *LedgerCreate) SetHighwatermark(t time.Time) *LedgerCreate
SetHighwatermark sets the "highwatermark" field.
func (*LedgerCreate) SetID ¶
func (lc *LedgerCreate) SetID(pg pgulid.ULID) *LedgerCreate
SetID sets the "id" field.
func (*LedgerCreate) SetMetadata ¶
func (lc *LedgerCreate) SetMetadata(m map[string]string) *LedgerCreate
SetMetadata sets the "metadata" field.
func (*LedgerCreate) SetNamespace ¶
func (lc *LedgerCreate) SetNamespace(s string) *LedgerCreate
SetNamespace sets the "namespace" field.
func (*LedgerCreate) SetNillableCreatedAt ¶
func (lc *LedgerCreate) SetNillableCreatedAt(t *time.Time) *LedgerCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*LedgerCreate) SetNillableHighwatermark ¶
func (lc *LedgerCreate) SetNillableHighwatermark(t *time.Time) *LedgerCreate
SetNillableHighwatermark sets the "highwatermark" field if the given value is not nil.
func (*LedgerCreate) SetNillableID ¶
func (lc *LedgerCreate) SetNillableID(pg *pgulid.ULID) *LedgerCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*LedgerCreate) SetNillableUpdatedAt ¶
func (lc *LedgerCreate) SetNillableUpdatedAt(t *time.Time) *LedgerCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*LedgerCreate) SetSubject ¶
func (lc *LedgerCreate) SetSubject(s string) *LedgerCreate
SetSubject sets the "subject" field.
func (*LedgerCreate) SetUpdatedAt ¶
func (lc *LedgerCreate) SetUpdatedAt(t time.Time) *LedgerCreate
SetUpdatedAt sets the "updated_at" field.
type LedgerCreateBulk ¶
type LedgerCreateBulk struct {
// contains filtered or unexported fields
}
LedgerCreateBulk is the builder for creating many Ledger entities in bulk.
func (*LedgerCreateBulk) Exec ¶
func (lcb *LedgerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LedgerCreateBulk) ExecX ¶
func (lcb *LedgerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerCreateBulk) OnConflict ¶
func (lcb *LedgerCreateBulk) OnConflict(opts ...sql.ConflictOption) *LedgerUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Ledger.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.LedgerUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*LedgerCreateBulk) OnConflictColumns ¶
func (lcb *LedgerCreateBulk) OnConflictColumns(columns ...string) *LedgerUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Ledger.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type LedgerDelete ¶
type LedgerDelete struct {
// contains filtered or unexported fields
}
LedgerDelete is the builder for deleting a Ledger entity.
func (*LedgerDelete) Exec ¶
func (ld *LedgerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LedgerDelete) ExecX ¶
func (ld *LedgerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LedgerDelete) Where ¶
func (ld *LedgerDelete) Where(ps ...predicate.Ledger) *LedgerDelete
Where appends a list predicates to the LedgerDelete builder.
type LedgerDeleteOne ¶
type LedgerDeleteOne struct {
// contains filtered or unexported fields
}
LedgerDeleteOne is the builder for deleting a single Ledger entity.
func (*LedgerDeleteOne) Exec ¶
func (ldo *LedgerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LedgerDeleteOne) ExecX ¶
func (ldo *LedgerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerDeleteOne) Where ¶
func (ldo *LedgerDeleteOne) Where(ps ...predicate.Ledger) *LedgerDeleteOne
Where appends a list predicates to the LedgerDelete builder.
type LedgerGroupBy ¶
type LedgerGroupBy struct {
// contains filtered or unexported fields
}
LedgerGroupBy is the group-by builder for Ledger entities.
func (*LedgerGroupBy) Aggregate ¶
func (lgb *LedgerGroupBy) Aggregate(fns ...AggregateFunc) *LedgerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LedgerGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LedgerGroupBy) Scan ¶
func (lgb *LedgerGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LedgerGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LedgerMutation ¶
type LedgerMutation struct {
// contains filtered or unexported fields
}
LedgerMutation represents an operation that mutates the Ledger nodes in the graph.
func (*LedgerMutation) AddField ¶
func (m *LedgerMutation) 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 (*LedgerMutation) AddedEdges ¶
func (m *LedgerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LedgerMutation) AddedField ¶
func (m *LedgerMutation) 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 (*LedgerMutation) AddedFields ¶
func (m *LedgerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LedgerMutation) AddedIDs ¶
func (m *LedgerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LedgerMutation) ClearEdge ¶
func (m *LedgerMutation) 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 (*LedgerMutation) ClearField ¶
func (m *LedgerMutation) 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 (*LedgerMutation) ClearMetadata ¶
func (m *LedgerMutation) ClearMetadata()
ClearMetadata clears the value of the "metadata" field.
func (*LedgerMutation) ClearedEdges ¶
func (m *LedgerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LedgerMutation) ClearedFields ¶
func (m *LedgerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LedgerMutation) Client ¶
func (m LedgerMutation) 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 (*LedgerMutation) CreatedAt ¶
func (m *LedgerMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*LedgerMutation) EdgeCleared ¶
func (m *LedgerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LedgerMutation) Field ¶
func (m *LedgerMutation) 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 (*LedgerMutation) FieldCleared ¶
func (m *LedgerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LedgerMutation) Fields ¶
func (m *LedgerMutation) 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 (*LedgerMutation) Highwatermark ¶
func (m *LedgerMutation) Highwatermark() (r time.Time, exists bool)
Highwatermark returns the value of the "highwatermark" field in the mutation.
func (*LedgerMutation) ID ¶
func (m *LedgerMutation) ID() (id pgulid.ULID, 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 (*LedgerMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*LedgerMutation) Metadata ¶
func (m *LedgerMutation) Metadata() (r map[string]string, exists bool)
Metadata returns the value of the "metadata" field in the mutation.
func (*LedgerMutation) MetadataCleared ¶
func (m *LedgerMutation) MetadataCleared() bool
MetadataCleared returns if the "metadata" field was cleared in this mutation.
func (*LedgerMutation) Namespace ¶
func (m *LedgerMutation) Namespace() (r string, exists bool)
Namespace returns the value of the "namespace" field in the mutation.
func (*LedgerMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) 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 (*LedgerMutation) OldHighwatermark ¶
OldHighwatermark returns the old "highwatermark" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldMetadata ¶
OldMetadata returns the old "metadata" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldNamespace ¶
func (m *LedgerMutation) OldNamespace(ctx context.Context) (v string, err error)
OldNamespace returns the old "namespace" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldSubject ¶
func (m *LedgerMutation) OldSubject(ctx context.Context) (v string, err error)
OldSubject returns the old "subject" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) RemovedEdges ¶
func (m *LedgerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LedgerMutation) RemovedIDs ¶
func (m *LedgerMutation) 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 (*LedgerMutation) ResetCreatedAt ¶
func (m *LedgerMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*LedgerMutation) ResetEdge ¶
func (m *LedgerMutation) 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 (*LedgerMutation) ResetField ¶
func (m *LedgerMutation) 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 (*LedgerMutation) ResetHighwatermark ¶
func (m *LedgerMutation) ResetHighwatermark()
ResetHighwatermark resets all changes to the "highwatermark" field.
func (*LedgerMutation) ResetMetadata ¶
func (m *LedgerMutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" field.
func (*LedgerMutation) ResetNamespace ¶
func (m *LedgerMutation) ResetNamespace()
ResetNamespace resets all changes to the "namespace" field.
func (*LedgerMutation) ResetSubject ¶
func (m *LedgerMutation) ResetSubject()
ResetSubject resets all changes to the "subject" field.
func (*LedgerMutation) ResetUpdatedAt ¶
func (m *LedgerMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*LedgerMutation) SetCreatedAt ¶
func (m *LedgerMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*LedgerMutation) SetField ¶
func (m *LedgerMutation) 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 (*LedgerMutation) SetHighwatermark ¶
func (m *LedgerMutation) SetHighwatermark(t time.Time)
SetHighwatermark sets the "highwatermark" field.
func (*LedgerMutation) SetID ¶
func (m *LedgerMutation) SetID(id pgulid.ULID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Ledger entities.
func (*LedgerMutation) SetMetadata ¶
func (m *LedgerMutation) SetMetadata(value map[string]string)
SetMetadata sets the "metadata" field.
func (*LedgerMutation) SetNamespace ¶
func (m *LedgerMutation) SetNamespace(s string)
SetNamespace sets the "namespace" field.
func (*LedgerMutation) SetOp ¶
func (m *LedgerMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*LedgerMutation) SetSubject ¶
func (m *LedgerMutation) SetSubject(s string)
SetSubject sets the "subject" field.
func (*LedgerMutation) SetUpdatedAt ¶
func (m *LedgerMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*LedgerMutation) Subject ¶
func (m *LedgerMutation) Subject() (r string, exists bool)
Subject returns the value of the "subject" field in the mutation.
func (LedgerMutation) Tx ¶
func (m LedgerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LedgerMutation) Type ¶
func (m *LedgerMutation) Type() string
Type returns the node type of this mutation (Ledger).
func (*LedgerMutation) UpdatedAt ¶
func (m *LedgerMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*LedgerMutation) Where ¶
func (m *LedgerMutation) Where(ps ...predicate.Ledger)
Where appends a list predicates to the LedgerMutation builder.
func (*LedgerMutation) WhereP ¶
func (m *LedgerMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LedgerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LedgerQuery ¶
type LedgerQuery struct {
// contains filtered or unexported fields
}
LedgerQuery is the builder for querying Ledger entities.
func (*LedgerQuery) Aggregate ¶
func (lq *LedgerQuery) Aggregate(fns ...AggregateFunc) *LedgerSelect
Aggregate returns a LedgerSelect configured with the given aggregations.
func (*LedgerQuery) All ¶
func (lq *LedgerQuery) All(ctx context.Context) ([]*Ledger, error)
All executes the query and returns a list of Ledgers.
func (*LedgerQuery) AllX ¶
func (lq *LedgerQuery) AllX(ctx context.Context) []*Ledger
AllX is like All, but panics if an error occurs.
func (*LedgerQuery) Clone ¶
func (lq *LedgerQuery) Clone() *LedgerQuery
Clone returns a duplicate of the LedgerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LedgerQuery) Count ¶
func (lq *LedgerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LedgerQuery) CountX ¶
func (lq *LedgerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LedgerQuery) Exist ¶
func (lq *LedgerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LedgerQuery) ExistX ¶
func (lq *LedgerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LedgerQuery) First ¶
func (lq *LedgerQuery) First(ctx context.Context) (*Ledger, error)
First returns the first Ledger entity from the query. Returns a *NotFoundError when no Ledger was found.
func (*LedgerQuery) FirstID ¶
FirstID returns the first Ledger ID from the query. Returns a *NotFoundError when no Ledger ID was found.
func (*LedgerQuery) FirstIDX ¶
func (lq *LedgerQuery) FirstIDX(ctx context.Context) pgulid.ULID
FirstIDX is like FirstID, but panics if an error occurs.
func (*LedgerQuery) FirstX ¶
func (lq *LedgerQuery) FirstX(ctx context.Context) *Ledger
FirstX is like First, but panics if an error occurs.
func (*LedgerQuery) ForShare ¶
func (lq *LedgerQuery) ForShare(opts ...sql.LockOption) *LedgerQuery
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 (*LedgerQuery) ForUpdate ¶
func (lq *LedgerQuery) ForUpdate(opts ...sql.LockOption) *LedgerQuery
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 (*LedgerQuery) GroupBy ¶
func (lq *LedgerQuery) GroupBy(field string, fields ...string) *LedgerGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Ledger.Query(). GroupBy(ledger.FieldCreatedAt). Aggregate(db.Count()). Scan(ctx, &v)
func (*LedgerQuery) IDsX ¶
func (lq *LedgerQuery) IDsX(ctx context.Context) []pgulid.ULID
IDsX is like IDs, but panics if an error occurs.
func (*LedgerQuery) Limit ¶
func (lq *LedgerQuery) Limit(limit int) *LedgerQuery
Limit the number of records to be returned by this query.
func (*LedgerQuery) Offset ¶
func (lq *LedgerQuery) Offset(offset int) *LedgerQuery
Offset to start from.
func (*LedgerQuery) Only ¶
func (lq *LedgerQuery) Only(ctx context.Context) (*Ledger, error)
Only returns a single Ledger entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Ledger entity is found. Returns a *NotFoundError when no Ledger entities are found.
func (*LedgerQuery) OnlyID ¶
OnlyID is like Only, but returns the only Ledger ID in the query. Returns a *NotSingularError when more than one Ledger ID is found. Returns a *NotFoundError when no entities are found.
func (*LedgerQuery) OnlyIDX ¶
func (lq *LedgerQuery) OnlyIDX(ctx context.Context) pgulid.ULID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LedgerQuery) OnlyX ¶
func (lq *LedgerQuery) OnlyX(ctx context.Context) *Ledger
OnlyX is like Only, but panics if an error occurs.
func (*LedgerQuery) Order ¶
func (lq *LedgerQuery) Order(o ...ledger.OrderOption) *LedgerQuery
Order specifies how the records should be ordered.
func (*LedgerQuery) Select ¶
func (lq *LedgerQuery) Select(fields ...string) *LedgerSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Ledger.Query(). Select(ledger.FieldCreatedAt). Scan(ctx, &v)
func (*LedgerQuery) Unique ¶
func (lq *LedgerQuery) Unique(unique bool) *LedgerQuery
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 (*LedgerQuery) Where ¶
func (lq *LedgerQuery) Where(ps ...predicate.Ledger) *LedgerQuery
Where adds a new predicate for the LedgerQuery builder.
type LedgerSelect ¶
type LedgerSelect struct { *LedgerQuery // contains filtered or unexported fields }
LedgerSelect is the builder for selecting fields of Ledger entities.
func (*LedgerSelect) Aggregate ¶
func (ls *LedgerSelect) Aggregate(fns ...AggregateFunc) *LedgerSelect
Aggregate adds the given aggregation functions to the selector query.
func (*LedgerSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LedgerSelect) Scan ¶
func (ls *LedgerSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LedgerSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LedgerUpdate ¶
type LedgerUpdate struct {
// contains filtered or unexported fields
}
LedgerUpdate is the builder for updating Ledger entities.
func (*LedgerUpdate) ClearMetadata ¶
func (lu *LedgerUpdate) ClearMetadata() *LedgerUpdate
ClearMetadata clears the value of the "metadata" field.
func (*LedgerUpdate) Exec ¶
func (lu *LedgerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LedgerUpdate) ExecX ¶
func (lu *LedgerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerUpdate) Mutation ¶
func (lu *LedgerUpdate) Mutation() *LedgerMutation
Mutation returns the LedgerMutation object of the builder.
func (*LedgerUpdate) Save ¶
func (lu *LedgerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LedgerUpdate) SaveX ¶
func (lu *LedgerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LedgerUpdate) SetHighwatermark ¶
func (lu *LedgerUpdate) SetHighwatermark(t time.Time) *LedgerUpdate
SetHighwatermark sets the "highwatermark" field.
func (*LedgerUpdate) SetMetadata ¶
func (lu *LedgerUpdate) SetMetadata(m map[string]string) *LedgerUpdate
SetMetadata sets the "metadata" field.
func (*LedgerUpdate) SetNillableHighwatermark ¶
func (lu *LedgerUpdate) SetNillableHighwatermark(t *time.Time) *LedgerUpdate
SetNillableHighwatermark sets the "highwatermark" field if the given value is not nil.
func (*LedgerUpdate) SetUpdatedAt ¶
func (lu *LedgerUpdate) SetUpdatedAt(t time.Time) *LedgerUpdate
SetUpdatedAt sets the "updated_at" field.
func (*LedgerUpdate) Where ¶
func (lu *LedgerUpdate) Where(ps ...predicate.Ledger) *LedgerUpdate
Where appends a list predicates to the LedgerUpdate builder.
type LedgerUpdateOne ¶
type LedgerUpdateOne struct {
// contains filtered or unexported fields
}
LedgerUpdateOne is the builder for updating a single Ledger entity.
func (*LedgerUpdateOne) ClearMetadata ¶
func (luo *LedgerUpdateOne) ClearMetadata() *LedgerUpdateOne
ClearMetadata clears the value of the "metadata" field.
func (*LedgerUpdateOne) Exec ¶
func (luo *LedgerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LedgerUpdateOne) ExecX ¶
func (luo *LedgerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerUpdateOne) Mutation ¶
func (luo *LedgerUpdateOne) Mutation() *LedgerMutation
Mutation returns the LedgerMutation object of the builder.
func (*LedgerUpdateOne) Save ¶
func (luo *LedgerUpdateOne) Save(ctx context.Context) (*Ledger, error)
Save executes the query and returns the updated Ledger entity.
func (*LedgerUpdateOne) SaveX ¶
func (luo *LedgerUpdateOne) SaveX(ctx context.Context) *Ledger
SaveX is like Save, but panics if an error occurs.
func (*LedgerUpdateOne) Select ¶
func (luo *LedgerUpdateOne) Select(field string, fields ...string) *LedgerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LedgerUpdateOne) SetHighwatermark ¶
func (luo *LedgerUpdateOne) SetHighwatermark(t time.Time) *LedgerUpdateOne
SetHighwatermark sets the "highwatermark" field.
func (*LedgerUpdateOne) SetMetadata ¶
func (luo *LedgerUpdateOne) SetMetadata(m map[string]string) *LedgerUpdateOne
SetMetadata sets the "metadata" field.
func (*LedgerUpdateOne) SetNillableHighwatermark ¶
func (luo *LedgerUpdateOne) SetNillableHighwatermark(t *time.Time) *LedgerUpdateOne
SetNillableHighwatermark sets the "highwatermark" field if the given value is not nil.
func (*LedgerUpdateOne) SetUpdatedAt ¶
func (luo *LedgerUpdateOne) SetUpdatedAt(t time.Time) *LedgerUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*LedgerUpdateOne) Where ¶
func (luo *LedgerUpdateOne) Where(ps ...predicate.Ledger) *LedgerUpdateOne
Where appends a list predicates to the LedgerUpdate builder.
type LedgerUpsert ¶
LedgerUpsert is the "OnConflict" setter.
func (*LedgerUpsert) ClearMetadata ¶
func (u *LedgerUpsert) ClearMetadata() *LedgerUpsert
ClearMetadata clears the value of the "metadata" field.
func (*LedgerUpsert) SetHighwatermark ¶
func (u *LedgerUpsert) SetHighwatermark(v time.Time) *LedgerUpsert
SetHighwatermark sets the "highwatermark" field.
func (*LedgerUpsert) SetMetadata ¶
func (u *LedgerUpsert) SetMetadata(v map[string]string) *LedgerUpsert
SetMetadata sets the "metadata" field.
func (*LedgerUpsert) SetUpdatedAt ¶
func (u *LedgerUpsert) SetUpdatedAt(v time.Time) *LedgerUpsert
SetUpdatedAt sets the "updated_at" field.
func (*LedgerUpsert) UpdateHighwatermark ¶
func (u *LedgerUpsert) UpdateHighwatermark() *LedgerUpsert
UpdateHighwatermark sets the "highwatermark" field to the value that was provided on create.
func (*LedgerUpsert) UpdateMetadata ¶
func (u *LedgerUpsert) UpdateMetadata() *LedgerUpsert
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*LedgerUpsert) UpdateUpdatedAt ¶
func (u *LedgerUpsert) UpdateUpdatedAt() *LedgerUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type LedgerUpsertBulk ¶
type LedgerUpsertBulk struct {
// contains filtered or unexported fields
}
LedgerUpsertBulk is the builder for "upsert"-ing a bulk of Ledger nodes.
func (*LedgerUpsertBulk) ClearMetadata ¶
func (u *LedgerUpsertBulk) ClearMetadata() *LedgerUpsertBulk
ClearMetadata clears the value of the "metadata" field.
func (*LedgerUpsertBulk) DoNothing ¶
func (u *LedgerUpsertBulk) DoNothing() *LedgerUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*LedgerUpsertBulk) Exec ¶
func (u *LedgerUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LedgerUpsertBulk) ExecX ¶
func (u *LedgerUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerUpsertBulk) Ignore ¶
func (u *LedgerUpsertBulk) Ignore() *LedgerUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Ledger.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*LedgerUpsertBulk) SetHighwatermark ¶
func (u *LedgerUpsertBulk) SetHighwatermark(v time.Time) *LedgerUpsertBulk
SetHighwatermark sets the "highwatermark" field.
func (*LedgerUpsertBulk) SetMetadata ¶
func (u *LedgerUpsertBulk) SetMetadata(v map[string]string) *LedgerUpsertBulk
SetMetadata sets the "metadata" field.
func (*LedgerUpsertBulk) SetUpdatedAt ¶
func (u *LedgerUpsertBulk) SetUpdatedAt(v time.Time) *LedgerUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*LedgerUpsertBulk) Update ¶
func (u *LedgerUpsertBulk) Update(set func(*LedgerUpsert)) *LedgerUpsertBulk
Update allows overriding fields `UPDATE` values. See the LedgerCreateBulk.OnConflict documentation for more info.
func (*LedgerUpsertBulk) UpdateHighwatermark ¶
func (u *LedgerUpsertBulk) UpdateHighwatermark() *LedgerUpsertBulk
UpdateHighwatermark sets the "highwatermark" field to the value that was provided on create.
func (*LedgerUpsertBulk) UpdateMetadata ¶
func (u *LedgerUpsertBulk) UpdateMetadata() *LedgerUpsertBulk
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*LedgerUpsertBulk) UpdateNewValues ¶
func (u *LedgerUpsertBulk) UpdateNewValues() *LedgerUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Ledger.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(ledger.FieldID) }), ). Exec(ctx)
func (*LedgerUpsertBulk) UpdateUpdatedAt ¶
func (u *LedgerUpsertBulk) UpdateUpdatedAt() *LedgerUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type LedgerUpsertOne ¶
type LedgerUpsertOne struct {
// contains filtered or unexported fields
}
LedgerUpsertOne is the builder for "upsert"-ing
one Ledger node.
func (*LedgerUpsertOne) ClearMetadata ¶
func (u *LedgerUpsertOne) ClearMetadata() *LedgerUpsertOne
ClearMetadata clears the value of the "metadata" field.
func (*LedgerUpsertOne) DoNothing ¶
func (u *LedgerUpsertOne) DoNothing() *LedgerUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*LedgerUpsertOne) Exec ¶
func (u *LedgerUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*LedgerUpsertOne) ExecX ¶
func (u *LedgerUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LedgerUpsertOne) IDX ¶
func (u *LedgerUpsertOne) IDX(ctx context.Context) pgulid.ULID
IDX is like ID, but panics if an error occurs.
func (*LedgerUpsertOne) Ignore ¶
func (u *LedgerUpsertOne) Ignore() *LedgerUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Ledger.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*LedgerUpsertOne) SetHighwatermark ¶
func (u *LedgerUpsertOne) SetHighwatermark(v time.Time) *LedgerUpsertOne
SetHighwatermark sets the "highwatermark" field.
func (*LedgerUpsertOne) SetMetadata ¶
func (u *LedgerUpsertOne) SetMetadata(v map[string]string) *LedgerUpsertOne
SetMetadata sets the "metadata" field.
func (*LedgerUpsertOne) SetUpdatedAt ¶
func (u *LedgerUpsertOne) SetUpdatedAt(v time.Time) *LedgerUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*LedgerUpsertOne) Update ¶
func (u *LedgerUpsertOne) Update(set func(*LedgerUpsert)) *LedgerUpsertOne
Update allows overriding fields `UPDATE` values. See the LedgerCreate.OnConflict documentation for more info.
func (*LedgerUpsertOne) UpdateHighwatermark ¶
func (u *LedgerUpsertOne) UpdateHighwatermark() *LedgerUpsertOne
UpdateHighwatermark sets the "highwatermark" field to the value that was provided on create.
func (*LedgerUpsertOne) UpdateMetadata ¶
func (u *LedgerUpsertOne) UpdateMetadata() *LedgerUpsertOne
UpdateMetadata sets the "metadata" field to the value that was provided on create.
func (*LedgerUpsertOne) UpdateNewValues ¶
func (u *LedgerUpsertOne) UpdateNewValues() *LedgerUpsertOne
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.Ledger.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(ledger.FieldID) }), ). Exec(ctx)
func (*LedgerUpsertOne) UpdateUpdatedAt ¶
func (u *LedgerUpsertOne) UpdateUpdatedAt() *LedgerUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
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 { // CreditEntry is the client for interacting with the CreditEntry builders. CreditEntry *CreditEntryClient // Feature is the client for interacting with the Feature builders. Feature *FeatureClient // Ledger is the client for interacting with the Ledger builders. Ledger *LedgerClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- creditentry.go
- creditentry_create.go
- creditentry_delete.go
- creditentry_query.go
- creditentry_update.go
- ent.go
- feature.go
- feature_create.go
- feature_delete.go
- feature_query.go
- feature_update.go
- ledger.go
- ledger_create.go
- ledger_delete.go
- ledger_query.go
- ledger_update.go
- mutation.go
- runtime.go
- tx.go