Documentation ¶
Index ¶
- Constants
- 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) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (c *Client) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type Revision
- func (r *Revision) AtlasRevision() *migrate.Revision
- func (c *Revision) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (c *Revision) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (r *Revision) String() string
- func (r *Revision) Unwrap() *Revision
- func (r *Revision) Update() *RevisionUpdateOne
- type RevisionClient
- func (c *RevisionClient) Create() *RevisionCreate
- func (c *RevisionClient) CreateBulk(builders ...*RevisionCreate) *RevisionCreateBulk
- func (c *RevisionClient) Delete() *RevisionDelete
- func (c *RevisionClient) DeleteOne(r *Revision) *RevisionDeleteOne
- func (c *RevisionClient) DeleteOneID(id string) *RevisionDeleteOne
- func (c *RevisionClient) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (c *RevisionClient) Get(ctx context.Context, id string) (*Revision, error)
- func (c *RevisionClient) GetX(ctx context.Context, id string) *Revision
- func (c *RevisionClient) Hooks() []Hook
- func (c *RevisionClient) Query() *RevisionQuery
- func (c *RevisionClient) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (c *RevisionClient) Update() *RevisionUpdate
- func (c *RevisionClient) UpdateOne(r *Revision) *RevisionUpdateOne
- func (c *RevisionClient) UpdateOneID(id string) *RevisionUpdateOne
- func (c *RevisionClient) Use(hooks ...Hook)
- type RevisionCreate
- func (rc *RevisionCreate) Exec(ctx context.Context) error
- func (c *RevisionCreate) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (rc *RevisionCreate) ExecX(ctx context.Context)
- func (rc *RevisionCreate) Mutation() *RevisionMutation
- func (rc *RevisionCreate) OnConflict(opts ...sql.ConflictOption) *RevisionUpsertOne
- func (rc *RevisionCreate) OnConflictColumns(columns ...string) *RevisionUpsertOne
- func (c *RevisionCreate) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rc *RevisionCreate) Save(ctx context.Context) (*Revision, error)
- func (rc *RevisionCreate) SaveX(ctx context.Context) *Revision
- func (rc *RevisionCreate) SetApplied(i int) *RevisionCreate
- func (rc *RevisionCreate) SetDescription(s string) *RevisionCreate
- func (rc *RevisionCreate) SetError(s string) *RevisionCreate
- func (rc *RevisionCreate) SetErrorStmt(s string) *RevisionCreate
- func (rc *RevisionCreate) SetExecutedAt(t time.Time) *RevisionCreate
- func (rc *RevisionCreate) SetExecutionTime(t time.Duration) *RevisionCreate
- func (rc *RevisionCreate) SetHash(s string) *RevisionCreate
- func (rc *RevisionCreate) SetID(s string) *RevisionCreate
- func (rc *RevisionCreate) SetNillableApplied(i *int) *RevisionCreate
- func (rc *RevisionCreate) SetNillableError(s *string) *RevisionCreate
- func (rc *RevisionCreate) SetNillableErrorStmt(s *string) *RevisionCreate
- func (rc *RevisionCreate) SetNillableTotal(i *int) *RevisionCreate
- func (rc *RevisionCreate) SetNillableType(mt *migrate.RevisionType) *RevisionCreate
- func (rc *RevisionCreate) SetOperatorVersion(s string) *RevisionCreate
- func (rc *RevisionCreate) SetPartialHashes(s []string) *RevisionCreate
- func (rc *RevisionCreate) SetRevision(rev *migrate.Revision) *RevisionCreate
- func (rc *RevisionCreate) SetTotal(i int) *RevisionCreate
- func (rc *RevisionCreate) SetType(mt migrate.RevisionType) *RevisionCreate
- type RevisionCreateBulk
- func (rcb *RevisionCreateBulk) Exec(ctx context.Context) error
- func (c *RevisionCreateBulk) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (rcb *RevisionCreateBulk) ExecX(ctx context.Context)
- func (rcb *RevisionCreateBulk) OnConflict(opts ...sql.ConflictOption) *RevisionUpsertBulk
- func (rcb *RevisionCreateBulk) OnConflictColumns(columns ...string) *RevisionUpsertBulk
- func (c *RevisionCreateBulk) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rcb *RevisionCreateBulk) Save(ctx context.Context) ([]*Revision, error)
- func (rcb *RevisionCreateBulk) SaveX(ctx context.Context) []*Revision
- type RevisionDelete
- func (rd *RevisionDelete) Exec(ctx context.Context) (int, error)
- func (c *RevisionDelete) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (rd *RevisionDelete) ExecX(ctx context.Context) int
- func (c *RevisionDelete) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rd *RevisionDelete) Where(ps ...predicate.Revision) *RevisionDelete
- type RevisionDeleteOne
- type RevisionGroupBy
- func (rgb *RevisionGroupBy) Aggregate(fns ...AggregateFunc) *RevisionGroupBy
- func (s *RevisionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RevisionGroupBy) BoolX(ctx context.Context) bool
- func (s *RevisionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RevisionGroupBy) BoolsX(ctx context.Context) []bool
- func (c *RevisionGroupBy) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (s *RevisionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RevisionGroupBy) Float64X(ctx context.Context) float64
- func (s *RevisionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RevisionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RevisionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RevisionGroupBy) IntX(ctx context.Context) int
- func (s *RevisionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RevisionGroupBy) IntsX(ctx context.Context) []int
- func (c *RevisionGroupBy) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rgb *RevisionGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *RevisionGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *RevisionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RevisionGroupBy) StringX(ctx context.Context) string
- func (s *RevisionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RevisionGroupBy) StringsX(ctx context.Context) []string
- type RevisionMutation
- func (m *RevisionMutation) AddApplied(i int)
- func (m *RevisionMutation) AddExecutionTime(t time.Duration)
- func (m *RevisionMutation) AddField(name string, value ent.Value) error
- func (m *RevisionMutation) AddTotal(i int)
- func (m *RevisionMutation) AddType(mt migrate.RevisionType)
- func (m *RevisionMutation) AddedApplied() (r int, exists bool)
- func (m *RevisionMutation) AddedEdges() []string
- func (m *RevisionMutation) AddedExecutionTime() (r time.Duration, exists bool)
- func (m *RevisionMutation) AddedField(name string) (ent.Value, bool)
- func (m *RevisionMutation) AddedFields() []string
- func (m *RevisionMutation) AddedIDs(name string) []ent.Value
- func (m *RevisionMutation) AddedTotal() (r int, exists bool)
- func (m *RevisionMutation) AddedType() (r migrate.RevisionType, exists bool)
- func (m *RevisionMutation) Applied() (r int, exists bool)
- func (m *RevisionMutation) ClearEdge(name string) error
- func (m *RevisionMutation) ClearError()
- func (m *RevisionMutation) ClearErrorStmt()
- func (m *RevisionMutation) ClearField(name string) error
- func (m *RevisionMutation) ClearPartialHashes()
- func (m *RevisionMutation) ClearedEdges() []string
- func (m *RevisionMutation) ClearedFields() []string
- func (m RevisionMutation) Client() *Client
- func (m *RevisionMutation) Description() (r string, exists bool)
- func (m *RevisionMutation) EdgeCleared(name string) bool
- func (m *RevisionMutation) Error() (r string, exists bool)
- func (m *RevisionMutation) ErrorCleared() bool
- func (m *RevisionMutation) ErrorStmt() (r string, exists bool)
- func (m *RevisionMutation) ErrorStmtCleared() bool
- func (c *RevisionMutation) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (m *RevisionMutation) ExecutedAt() (r time.Time, exists bool)
- func (m *RevisionMutation) ExecutionTime() (r time.Duration, exists bool)
- func (m *RevisionMutation) Field(name string) (ent.Value, bool)
- func (m *RevisionMutation) FieldCleared(name string) bool
- func (m *RevisionMutation) Fields() []string
- func (m *RevisionMutation) GetType() (r migrate.RevisionType, exists bool)
- func (m *RevisionMutation) Hash() (r string, exists bool)
- func (m *RevisionMutation) ID() (id string, exists bool)
- func (m *RevisionMutation) IDs(ctx context.Context) ([]string, error)
- func (m *RevisionMutation) OldApplied(ctx context.Context) (v int, err error)
- func (m *RevisionMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldError(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldErrorStmt(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldExecutedAt(ctx context.Context) (v time.Time, err error)
- func (m *RevisionMutation) OldExecutionTime(ctx context.Context) (v time.Duration, err error)
- func (m *RevisionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RevisionMutation) OldHash(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldOperatorVersion(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldPartialHashes(ctx context.Context) (v []string, err error)
- func (m *RevisionMutation) OldTotal(ctx context.Context) (v int, err error)
- func (m *RevisionMutation) OldType(ctx context.Context) (v migrate.RevisionType, err error)
- func (m *RevisionMutation) Op() Op
- func (m *RevisionMutation) OperatorVersion() (r string, exists bool)
- func (m *RevisionMutation) PartialHashes() (r []string, exists bool)
- func (m *RevisionMutation) PartialHashesCleared() bool
- func (c *RevisionMutation) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (m *RevisionMutation) RemovedEdges() []string
- func (m *RevisionMutation) RemovedIDs(name string) []ent.Value
- func (m *RevisionMutation) ResetApplied()
- func (m *RevisionMutation) ResetDescription()
- func (m *RevisionMutation) ResetEdge(name string) error
- func (m *RevisionMutation) ResetError()
- func (m *RevisionMutation) ResetErrorStmt()
- func (m *RevisionMutation) ResetExecutedAt()
- func (m *RevisionMutation) ResetExecutionTime()
- func (m *RevisionMutation) ResetField(name string) error
- func (m *RevisionMutation) ResetHash()
- func (m *RevisionMutation) ResetOperatorVersion()
- func (m *RevisionMutation) ResetPartialHashes()
- func (m *RevisionMutation) ResetTotal()
- func (m *RevisionMutation) ResetType()
- func (m *RevisionMutation) SetApplied(i int)
- func (m *RevisionMutation) SetDescription(s string)
- func (m *RevisionMutation) SetError(s string)
- func (m *RevisionMutation) SetErrorStmt(s string)
- func (m *RevisionMutation) SetExecutedAt(t time.Time)
- func (m *RevisionMutation) SetExecutionTime(t time.Duration)
- func (m *RevisionMutation) SetField(name string, value ent.Value) error
- func (m *RevisionMutation) SetHash(s string)
- func (m *RevisionMutation) SetID(id string)
- func (m *RevisionMutation) SetOperatorVersion(s string)
- func (m *RevisionMutation) SetPartialHashes(s []string)
- func (m *RevisionMutation) SetTotal(i int)
- func (m *RevisionMutation) SetType(mt migrate.RevisionType)
- func (m *RevisionMutation) Total() (r int, exists bool)
- func (m RevisionMutation) Tx() (*Tx, error)
- func (m *RevisionMutation) Type() string
- func (m *RevisionMutation) Where(ps ...predicate.Revision)
- type RevisionQuery
- func (rq *RevisionQuery) All(ctx context.Context) ([]*Revision, error)
- func (rq *RevisionQuery) AllX(ctx context.Context) []*Revision
- func (rq *RevisionQuery) Clone() *RevisionQuery
- func (rq *RevisionQuery) Count(ctx context.Context) (int, error)
- func (rq *RevisionQuery) CountX(ctx context.Context) int
- func (c *RevisionQuery) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (rq *RevisionQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RevisionQuery) ExistX(ctx context.Context) bool
- func (rq *RevisionQuery) First(ctx context.Context) (*Revision, error)
- func (rq *RevisionQuery) FirstID(ctx context.Context) (id string, err error)
- func (rq *RevisionQuery) FirstIDX(ctx context.Context) string
- func (rq *RevisionQuery) FirstX(ctx context.Context) *Revision
- func (rq *RevisionQuery) GroupBy(field string, fields ...string) *RevisionGroupBy
- func (rq *RevisionQuery) IDs(ctx context.Context) ([]string, error)
- func (rq *RevisionQuery) IDsX(ctx context.Context) []string
- func (rq *RevisionQuery) Limit(limit int) *RevisionQuery
- func (rq *RevisionQuery) Offset(offset int) *RevisionQuery
- func (rq *RevisionQuery) Only(ctx context.Context) (*Revision, error)
- func (rq *RevisionQuery) OnlyID(ctx context.Context) (id string, err error)
- func (rq *RevisionQuery) OnlyIDX(ctx context.Context) string
- func (rq *RevisionQuery) OnlyX(ctx context.Context) *Revision
- func (rq *RevisionQuery) Order(o ...OrderFunc) *RevisionQuery
- func (c *RevisionQuery) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rq *RevisionQuery) Select(fields ...string) *RevisionSelect
- func (rq *RevisionQuery) Unique(unique bool) *RevisionQuery
- func (rq *RevisionQuery) Where(ps ...predicate.Revision) *RevisionQuery
- type RevisionSelect
- func (s *RevisionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RevisionSelect) BoolX(ctx context.Context) bool
- func (s *RevisionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RevisionSelect) BoolsX(ctx context.Context) []bool
- func (c RevisionSelect) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (s *RevisionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RevisionSelect) Float64X(ctx context.Context) float64
- func (s *RevisionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RevisionSelect) Float64sX(ctx context.Context) []float64
- func (s *RevisionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RevisionSelect) IntX(ctx context.Context) int
- func (s *RevisionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RevisionSelect) IntsX(ctx context.Context) []int
- func (c RevisionSelect) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (rs *RevisionSelect) Scan(ctx context.Context, v interface{}) error
- func (s *RevisionSelect) ScanX(ctx context.Context, v interface{})
- func (s *RevisionSelect) String(ctx context.Context) (_ string, err error)
- func (s *RevisionSelect) StringX(ctx context.Context) string
- func (s *RevisionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RevisionSelect) StringsX(ctx context.Context) []string
- type RevisionUpdate
- func (ru *RevisionUpdate) AddApplied(i int) *RevisionUpdate
- func (ru *RevisionUpdate) AddExecutionTime(t time.Duration) *RevisionUpdate
- func (ru *RevisionUpdate) AddTotal(i int) *RevisionUpdate
- func (ru *RevisionUpdate) AddType(mt migrate.RevisionType) *RevisionUpdate
- func (ru *RevisionUpdate) ClearError() *RevisionUpdate
- func (ru *RevisionUpdate) ClearErrorStmt() *RevisionUpdate
- func (ru *RevisionUpdate) ClearPartialHashes() *RevisionUpdate
- func (ru *RevisionUpdate) Exec(ctx context.Context) error
- func (c *RevisionUpdate) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (ru *RevisionUpdate) ExecX(ctx context.Context)
- func (ru *RevisionUpdate) Mutation() *RevisionMutation
- func (c *RevisionUpdate) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (ru *RevisionUpdate) Save(ctx context.Context) (int, error)
- func (ru *RevisionUpdate) SaveX(ctx context.Context) int
- func (ru *RevisionUpdate) SetApplied(i int) *RevisionUpdate
- func (ru *RevisionUpdate) SetError(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetErrorStmt(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetExecutionTime(t time.Duration) *RevisionUpdate
- func (ru *RevisionUpdate) SetHash(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetNillableApplied(i *int) *RevisionUpdate
- func (ru *RevisionUpdate) SetNillableError(s *string) *RevisionUpdate
- func (ru *RevisionUpdate) SetNillableErrorStmt(s *string) *RevisionUpdate
- func (ru *RevisionUpdate) SetNillableTotal(i *int) *RevisionUpdate
- func (ru *RevisionUpdate) SetNillableType(mt *migrate.RevisionType) *RevisionUpdate
- func (ru *RevisionUpdate) SetOperatorVersion(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetPartialHashes(s []string) *RevisionUpdate
- func (ru *RevisionUpdate) SetTotal(i int) *RevisionUpdate
- func (ru *RevisionUpdate) SetType(mt migrate.RevisionType) *RevisionUpdate
- func (ru *RevisionUpdate) Where(ps ...predicate.Revision) *RevisionUpdate
- type RevisionUpdateOne
- func (ruo *RevisionUpdateOne) AddApplied(i int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) AddExecutionTime(t time.Duration) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) AddTotal(i int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) AddType(mt migrate.RevisionType) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) ClearError() *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) ClearErrorStmt() *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) ClearPartialHashes() *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) Exec(ctx context.Context) error
- func (c *RevisionUpdateOne) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (ruo *RevisionUpdateOne) ExecX(ctx context.Context)
- func (ruo *RevisionUpdateOne) Mutation() *RevisionMutation
- func (c *RevisionUpdateOne) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (ruo *RevisionUpdateOne) Save(ctx context.Context) (*Revision, error)
- func (ruo *RevisionUpdateOne) SaveX(ctx context.Context) *Revision
- func (ruo *RevisionUpdateOne) Select(field string, fields ...string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetApplied(i int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetError(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetErrorStmt(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetExecutionTime(t time.Duration) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetHash(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetNillableApplied(i *int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetNillableError(s *string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetNillableErrorStmt(s *string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetNillableTotal(i *int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetNillableType(mt *migrate.RevisionType) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetOperatorVersion(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetPartialHashes(s []string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetTotal(i int) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetType(mt migrate.RevisionType) *RevisionUpdateOne
- type RevisionUpsert
- func (u *RevisionUpsert) AddApplied(v int) *RevisionUpsert
- func (u *RevisionUpsert) AddExecutionTime(v time.Duration) *RevisionUpsert
- func (u *RevisionUpsert) AddTotal(v int) *RevisionUpsert
- func (u *RevisionUpsert) AddType(v migrate.RevisionType) *RevisionUpsert
- func (u *RevisionUpsert) ClearError() *RevisionUpsert
- func (u *RevisionUpsert) ClearErrorStmt() *RevisionUpsert
- func (u *RevisionUpsert) ClearPartialHashes() *RevisionUpsert
- func (u *RevisionUpsert) SetApplied(v int) *RevisionUpsert
- func (u *RevisionUpsert) SetDescription(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetError(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetErrorStmt(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetExecutedAt(v time.Time) *RevisionUpsert
- func (u *RevisionUpsert) SetExecutionTime(v time.Duration) *RevisionUpsert
- func (u *RevisionUpsert) SetHash(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetOperatorVersion(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetPartialHashes(v []string) *RevisionUpsert
- func (u *RevisionUpsert) SetTotal(v int) *RevisionUpsert
- func (u *RevisionUpsert) SetType(v migrate.RevisionType) *RevisionUpsert
- func (u *RevisionUpsert) UpdateApplied() *RevisionUpsert
- func (u *RevisionUpsert) UpdateDescription() *RevisionUpsert
- func (u *RevisionUpsert) UpdateError() *RevisionUpsert
- func (u *RevisionUpsert) UpdateErrorStmt() *RevisionUpsert
- func (u *RevisionUpsert) UpdateExecutedAt() *RevisionUpsert
- func (u *RevisionUpsert) UpdateExecutionTime() *RevisionUpsert
- func (u *RevisionUpsert) UpdateHash() *RevisionUpsert
- func (u *RevisionUpsert) UpdateOperatorVersion() *RevisionUpsert
- func (u *RevisionUpsert) UpdatePartialHashes() *RevisionUpsert
- func (u *RevisionUpsert) UpdateTotal() *RevisionUpsert
- func (u *RevisionUpsert) UpdateType() *RevisionUpsert
- type RevisionUpsertBulk
- func (u *RevisionUpsertBulk) AddApplied(v int) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) AddExecutionTime(v time.Duration) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) AddTotal(v int) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) AddType(v migrate.RevisionType) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) ClearError() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) ClearErrorStmt() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) ClearPartialHashes() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) DoNothing() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) Exec(ctx context.Context) error
- func (u *RevisionUpsertBulk) ExecX(ctx context.Context)
- func (u *RevisionUpsertBulk) Ignore() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetApplied(v int) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetDescription(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetError(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetErrorStmt(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetExecutedAt(v time.Time) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetExecutionTime(v time.Duration) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetHash(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetOperatorVersion(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetPartialHashes(v []string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetTotal(v int) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetType(v migrate.RevisionType) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) Update(set func(*RevisionUpsert)) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateApplied() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateDescription() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateError() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateErrorStmt() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateExecutedAt() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateExecutionTime() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateHash() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateNewValues() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateOperatorVersion() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdatePartialHashes() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateTotal() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateType() *RevisionUpsertBulk
- type RevisionUpsertOne
- func (u *RevisionUpsertOne) AddApplied(v int) *RevisionUpsertOne
- func (u *RevisionUpsertOne) AddExecutionTime(v time.Duration) *RevisionUpsertOne
- func (u *RevisionUpsertOne) AddTotal(v int) *RevisionUpsertOne
- func (u *RevisionUpsertOne) AddType(v migrate.RevisionType) *RevisionUpsertOne
- func (u *RevisionUpsertOne) ClearError() *RevisionUpsertOne
- func (u *RevisionUpsertOne) ClearErrorStmt() *RevisionUpsertOne
- func (u *RevisionUpsertOne) ClearPartialHashes() *RevisionUpsertOne
- func (u *RevisionUpsertOne) DoNothing() *RevisionUpsertOne
- func (u *RevisionUpsertOne) Exec(ctx context.Context) error
- func (u *RevisionUpsertOne) ExecX(ctx context.Context)
- func (u *RevisionUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *RevisionUpsertOne) IDX(ctx context.Context) string
- func (u *RevisionUpsertOne) Ignore() *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetApplied(v int) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetDescription(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetError(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetErrorStmt(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetExecutedAt(v time.Time) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetExecutionTime(v time.Duration) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetHash(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetOperatorVersion(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetPartialHashes(v []string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetTotal(v int) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetType(v migrate.RevisionType) *RevisionUpsertOne
- func (u *RevisionUpsertOne) Update(set func(*RevisionUpsert)) *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateApplied() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateDescription() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateError() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateErrorStmt() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateExecutedAt() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateExecutionTime() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateHash() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateNewValues() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateOperatorVersion() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdatePartialHashes() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateTotal() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateType() *RevisionUpsertOne
- type Revisions
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type SchemaConfig
- type Tx
- func (tx *Tx) Client() *Client
- func (tx *Tx) Commit() error
- func (c *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
- func (tx *Tx) OnCommit(f CommitHook)
- func (tx *Tx) OnRollback(f RollbackHook)
- func (c *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
- func (tx *Tx) Rollback() error
- 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. TypeRevision = "Revision" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Revision is the client for interacting with the Revision builders. Revision *RevisionClient // 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(). Revision. Query(). Count(ctx)
func (*Client) ExecContext ¶
func (c *Client) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Client) QueryContext ¶
func (c *Client) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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 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 Option ¶
type Option func(*config)
Option function to configure the client.
func AlternateSchema ¶
func AlternateSchema(schemaConfig SchemaConfig) Option
AlternateSchemas allows alternate schema names to be passed into ent operations.
type Revision ¶
type Revision struct { // ID of the ent. ID string `json:"id,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Type holds the value of the "type" field. Type migrate.RevisionType `json:"type,omitempty"` // Applied holds the value of the "applied" field. Applied int `json:"applied,omitempty"` // Total holds the value of the "total" field. Total int `json:"total,omitempty"` // ExecutedAt holds the value of the "executed_at" field. ExecutedAt time.Time `json:"executed_at,omitempty"` // ExecutionTime holds the value of the "execution_time" field. ExecutionTime time.Duration `json:"execution_time,omitempty"` // Error holds the value of the "error" field. Error string `json:"error,omitempty"` // ErrorStmt holds the value of the "error_stmt" field. ErrorStmt string `json:"error_stmt,omitempty"` // Hash holds the value of the "hash" field. Hash string `json:"hash,omitempty"` // PartialHashes holds the value of the "partial_hashes" field. PartialHashes []string `json:"partial_hashes,omitempty"` // OperatorVersion holds the value of the "operator_version" field. OperatorVersion string `json:"operator_version,omitempty"` // contains filtered or unexported fields }
Revision is the model entity for the Revision schema.
func (*Revision) AtlasRevision ¶ added in v0.6.4
AtlasRevision returns an migrate.Revision from the current Revision.
func (*Revision) ExecContext ¶
func (c *Revision) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Revision) QueryContext ¶
func (c *Revision) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Revision) Unwrap ¶
Unwrap unwraps the Revision 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 (*Revision) Update ¶
func (r *Revision) Update() *RevisionUpdateOne
Update returns a builder for updating this Revision. Note that you need to call Revision.Unwrap() before calling this method if this Revision was returned from a transaction, and the transaction was committed or rolled back.
type RevisionClient ¶
type RevisionClient struct {
// contains filtered or unexported fields
}
RevisionClient is a client for the Revision schema.
func NewRevisionClient ¶
func NewRevisionClient(c config) *RevisionClient
NewRevisionClient returns a client for the Revision from the given config.
func (*RevisionClient) Create ¶
func (c *RevisionClient) Create() *RevisionCreate
Create returns a builder for creating a Revision entity.
func (*RevisionClient) CreateBulk ¶
func (c *RevisionClient) CreateBulk(builders ...*RevisionCreate) *RevisionCreateBulk
CreateBulk returns a builder for creating a bulk of Revision entities.
func (*RevisionClient) Delete ¶
func (c *RevisionClient) Delete() *RevisionDelete
Delete returns a delete builder for Revision.
func (*RevisionClient) DeleteOne ¶
func (c *RevisionClient) DeleteOne(r *Revision) *RevisionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RevisionClient) DeleteOneID ¶
func (c *RevisionClient) DeleteOneID(id string) *RevisionDeleteOne
DeleteOne returns a builder for deleting the given entity by its id.
func (*RevisionClient) ExecContext ¶
func (c *RevisionClient) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionClient) GetX ¶
func (c *RevisionClient) GetX(ctx context.Context, id string) *Revision
GetX is like Get, but panics if an error occurs.
func (*RevisionClient) Hooks ¶
func (c *RevisionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RevisionClient) Query ¶
func (c *RevisionClient) Query() *RevisionQuery
Query returns a query builder for Revision.
func (*RevisionClient) QueryContext ¶
func (c *RevisionClient) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionClient) Update ¶
func (c *RevisionClient) Update() *RevisionUpdate
Update returns an update builder for Revision.
func (*RevisionClient) UpdateOne ¶
func (c *RevisionClient) UpdateOne(r *Revision) *RevisionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RevisionClient) UpdateOneID ¶
func (c *RevisionClient) UpdateOneID(id string) *RevisionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RevisionClient) Use ¶
func (c *RevisionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `revision.Hooks(f(g(h())))`.
type RevisionCreate ¶
type RevisionCreate struct {
// contains filtered or unexported fields
}
RevisionCreate is the builder for creating a Revision entity.
func (*RevisionCreate) Exec ¶
func (rc *RevisionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RevisionCreate) ExecContext ¶
func (c *RevisionCreate) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionCreate) ExecX ¶
func (rc *RevisionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionCreate) Mutation ¶
func (rc *RevisionCreate) Mutation() *RevisionMutation
Mutation returns the RevisionMutation object of the builder.
func (*RevisionCreate) OnConflict ¶
func (rc *RevisionCreate) OnConflict(opts ...sql.ConflictOption) *RevisionUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Revision.Create(). SetDescription(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.RevisionUpsert) { SetDescription(v+v). }). Exec(ctx)
func (*RevisionCreate) OnConflictColumns ¶
func (rc *RevisionCreate) OnConflictColumns(columns ...string) *RevisionUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Revision.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*RevisionCreate) QueryContext ¶
func (c *RevisionCreate) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionCreate) Save ¶
func (rc *RevisionCreate) Save(ctx context.Context) (*Revision, error)
Save creates the Revision in the database.
func (*RevisionCreate) SaveX ¶
func (rc *RevisionCreate) SaveX(ctx context.Context) *Revision
SaveX calls Save and panics if Save returns an error.
func (*RevisionCreate) SetApplied ¶ added in v0.6.0
func (rc *RevisionCreate) SetApplied(i int) *RevisionCreate
SetApplied sets the "applied" field.
func (*RevisionCreate) SetDescription ¶
func (rc *RevisionCreate) SetDescription(s string) *RevisionCreate
SetDescription sets the "description" field.
func (*RevisionCreate) SetError ¶ added in v0.6.0
func (rc *RevisionCreate) SetError(s string) *RevisionCreate
SetError sets the "error" field.
func (*RevisionCreate) SetErrorStmt ¶ added in v0.8.0
func (rc *RevisionCreate) SetErrorStmt(s string) *RevisionCreate
SetErrorStmt sets the "error_stmt" field.
func (*RevisionCreate) SetExecutedAt ¶
func (rc *RevisionCreate) SetExecutedAt(t time.Time) *RevisionCreate
SetExecutedAt sets the "executed_at" field.
func (*RevisionCreate) SetExecutionTime ¶
func (rc *RevisionCreate) SetExecutionTime(t time.Duration) *RevisionCreate
SetExecutionTime sets the "execution_time" field.
func (*RevisionCreate) SetHash ¶
func (rc *RevisionCreate) SetHash(s string) *RevisionCreate
SetHash sets the "hash" field.
func (*RevisionCreate) SetID ¶
func (rc *RevisionCreate) SetID(s string) *RevisionCreate
SetID sets the "id" field.
func (*RevisionCreate) SetNillableApplied ¶ added in v0.6.4
func (rc *RevisionCreate) SetNillableApplied(i *int) *RevisionCreate
SetNillableApplied sets the "applied" field if the given value is not nil.
func (*RevisionCreate) SetNillableError ¶ added in v0.6.0
func (rc *RevisionCreate) SetNillableError(s *string) *RevisionCreate
SetNillableError sets the "error" field if the given value is not nil.
func (*RevisionCreate) SetNillableErrorStmt ¶ added in v0.8.0
func (rc *RevisionCreate) SetNillableErrorStmt(s *string) *RevisionCreate
SetNillableErrorStmt sets the "error_stmt" field if the given value is not nil.
func (*RevisionCreate) SetNillableTotal ¶ added in v0.6.4
func (rc *RevisionCreate) SetNillableTotal(i *int) *RevisionCreate
SetNillableTotal sets the "total" field if the given value is not nil.
func (*RevisionCreate) SetNillableType ¶ added in v0.6.4
func (rc *RevisionCreate) SetNillableType(mt *migrate.RevisionType) *RevisionCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*RevisionCreate) SetOperatorVersion ¶
func (rc *RevisionCreate) SetOperatorVersion(s string) *RevisionCreate
SetOperatorVersion sets the "operator_version" field.
func (*RevisionCreate) SetPartialHashes ¶ added in v0.6.0
func (rc *RevisionCreate) SetPartialHashes(s []string) *RevisionCreate
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionCreate) SetRevision ¶ added in v0.6.4
func (rc *RevisionCreate) SetRevision(rev *migrate.Revision) *RevisionCreate
SetRevision takes the values for each field from the given migrate.Revision.
func (*RevisionCreate) SetTotal ¶ added in v0.6.0
func (rc *RevisionCreate) SetTotal(i int) *RevisionCreate
SetTotal sets the "total" field.
func (*RevisionCreate) SetType ¶ added in v0.6.0
func (rc *RevisionCreate) SetType(mt migrate.RevisionType) *RevisionCreate
SetType sets the "type" field.
type RevisionCreateBulk ¶
type RevisionCreateBulk struct {
// contains filtered or unexported fields
}
RevisionCreateBulk is the builder for creating many Revision entities in bulk.
func (*RevisionCreateBulk) Exec ¶
func (rcb *RevisionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RevisionCreateBulk) ExecContext ¶
func (c *RevisionCreateBulk) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionCreateBulk) ExecX ¶
func (rcb *RevisionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionCreateBulk) OnConflict ¶
func (rcb *RevisionCreateBulk) OnConflict(opts ...sql.ConflictOption) *RevisionUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Revision.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.RevisionUpsert) { SetDescription(v+v). }). Exec(ctx)
func (*RevisionCreateBulk) OnConflictColumns ¶
func (rcb *RevisionCreateBulk) OnConflictColumns(columns ...string) *RevisionUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Revision.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*RevisionCreateBulk) QueryContext ¶
func (c *RevisionCreateBulk) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type RevisionDelete ¶
type RevisionDelete struct {
// contains filtered or unexported fields
}
RevisionDelete is the builder for deleting a Revision entity.
func (*RevisionDelete) Exec ¶
func (rd *RevisionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RevisionDelete) ExecContext ¶
func (c *RevisionDelete) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionDelete) ExecX ¶
func (rd *RevisionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RevisionDelete) QueryContext ¶
func (c *RevisionDelete) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionDelete) Where ¶
func (rd *RevisionDelete) Where(ps ...predicate.Revision) *RevisionDelete
Where appends a list predicates to the RevisionDelete builder.
type RevisionDeleteOne ¶
type RevisionDeleteOne struct {
// contains filtered or unexported fields
}
RevisionDeleteOne is the builder for deleting a single Revision entity.
func (*RevisionDeleteOne) Exec ¶
func (rdo *RevisionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RevisionDeleteOne) ExecX ¶
func (rdo *RevisionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RevisionGroupBy ¶
type RevisionGroupBy struct {
// contains filtered or unexported fields
}
RevisionGroupBy is the group-by builder for Revision entities.
func (*RevisionGroupBy) Aggregate ¶
func (rgb *RevisionGroupBy) Aggregate(fns ...AggregateFunc) *RevisionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RevisionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) ExecContext ¶
func (c *RevisionGroupBy) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RevisionGroupBy) QueryContext ¶
func (c *RevisionGroupBy) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionGroupBy) Scan ¶
func (rgb *RevisionGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RevisionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RevisionMutation ¶
type RevisionMutation struct {
// contains filtered or unexported fields
}
RevisionMutation represents an operation that mutates the Revision nodes in the graph.
func (*RevisionMutation) AddApplied ¶ added in v0.6.0
func (m *RevisionMutation) AddApplied(i int)
AddApplied adds i to the "applied" field.
func (*RevisionMutation) AddExecutionTime ¶
func (m *RevisionMutation) AddExecutionTime(t time.Duration)
AddExecutionTime adds t to the "execution_time" field.
func (*RevisionMutation) AddField ¶
func (m *RevisionMutation) 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 (*RevisionMutation) AddTotal ¶ added in v0.6.0
func (m *RevisionMutation) AddTotal(i int)
AddTotal adds i to the "total" field.
func (*RevisionMutation) AddType ¶ added in v0.6.0
func (m *RevisionMutation) AddType(mt migrate.RevisionType)
AddType adds mt to the "type" field.
func (*RevisionMutation) AddedApplied ¶ added in v0.6.0
func (m *RevisionMutation) AddedApplied() (r int, exists bool)
AddedApplied returns the value that was added to the "applied" field in this mutation.
func (*RevisionMutation) AddedEdges ¶
func (m *RevisionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RevisionMutation) AddedExecutionTime ¶
func (m *RevisionMutation) AddedExecutionTime() (r time.Duration, exists bool)
AddedExecutionTime returns the value that was added to the "execution_time" field in this mutation.
func (*RevisionMutation) AddedField ¶
func (m *RevisionMutation) 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 (*RevisionMutation) AddedFields ¶
func (m *RevisionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RevisionMutation) AddedIDs ¶
func (m *RevisionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RevisionMutation) AddedTotal ¶ added in v0.6.0
func (m *RevisionMutation) AddedTotal() (r int, exists bool)
AddedTotal returns the value that was added to the "total" field in this mutation.
func (*RevisionMutation) AddedType ¶ added in v0.6.0
func (m *RevisionMutation) AddedType() (r migrate.RevisionType, exists bool)
AddedType returns the value that was added to the "type" field in this mutation.
func (*RevisionMutation) Applied ¶ added in v0.6.0
func (m *RevisionMutation) Applied() (r int, exists bool)
Applied returns the value of the "applied" field in the mutation.
func (*RevisionMutation) ClearEdge ¶
func (m *RevisionMutation) 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 (*RevisionMutation) ClearError ¶ added in v0.6.0
func (m *RevisionMutation) ClearError()
ClearError clears the value of the "error" field.
func (*RevisionMutation) ClearErrorStmt ¶ added in v0.8.0
func (m *RevisionMutation) ClearErrorStmt()
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionMutation) ClearField ¶
func (m *RevisionMutation) 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 (*RevisionMutation) ClearPartialHashes ¶ added in v0.6.0
func (m *RevisionMutation) ClearPartialHashes()
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionMutation) ClearedEdges ¶
func (m *RevisionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RevisionMutation) ClearedFields ¶
func (m *RevisionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RevisionMutation) Client ¶
func (m RevisionMutation) 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 (*RevisionMutation) Description ¶
func (m *RevisionMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*RevisionMutation) EdgeCleared ¶
func (m *RevisionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RevisionMutation) Error ¶ added in v0.6.0
func (m *RevisionMutation) Error() (r string, exists bool)
Error returns the value of the "error" field in the mutation.
func (*RevisionMutation) ErrorCleared ¶ added in v0.6.0
func (m *RevisionMutation) ErrorCleared() bool
ErrorCleared returns if the "error" field was cleared in this mutation.
func (*RevisionMutation) ErrorStmt ¶ added in v0.8.0
func (m *RevisionMutation) ErrorStmt() (r string, exists bool)
ErrorStmt returns the value of the "error_stmt" field in the mutation.
func (*RevisionMutation) ErrorStmtCleared ¶ added in v0.8.0
func (m *RevisionMutation) ErrorStmtCleared() bool
ErrorStmtCleared returns if the "error_stmt" field was cleared in this mutation.
func (*RevisionMutation) ExecContext ¶
func (c *RevisionMutation) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionMutation) ExecutedAt ¶
func (m *RevisionMutation) ExecutedAt() (r time.Time, exists bool)
ExecutedAt returns the value of the "executed_at" field in the mutation.
func (*RevisionMutation) ExecutionTime ¶
func (m *RevisionMutation) ExecutionTime() (r time.Duration, exists bool)
ExecutionTime returns the value of the "execution_time" field in the mutation.
func (*RevisionMutation) Field ¶
func (m *RevisionMutation) 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 (*RevisionMutation) FieldCleared ¶
func (m *RevisionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RevisionMutation) Fields ¶
func (m *RevisionMutation) 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 (*RevisionMutation) GetType ¶ added in v0.6.0
func (m *RevisionMutation) GetType() (r migrate.RevisionType, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*RevisionMutation) Hash ¶
func (m *RevisionMutation) Hash() (r string, exists bool)
Hash returns the value of the "hash" field in the mutation.
func (*RevisionMutation) ID ¶
func (m *RevisionMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*RevisionMutation) IDs ¶
func (m *RevisionMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RevisionMutation) OldApplied ¶ added in v0.6.0
func (m *RevisionMutation) OldApplied(ctx context.Context) (v int, err error)
OldApplied returns the old "applied" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldDescription ¶
func (m *RevisionMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldError ¶ added in v0.6.0
func (m *RevisionMutation) OldError(ctx context.Context) (v string, err error)
OldError returns the old "error" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldErrorStmt ¶ added in v0.8.0
func (m *RevisionMutation) OldErrorStmt(ctx context.Context) (v string, err error)
OldErrorStmt returns the old "error_stmt" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldExecutedAt ¶
OldExecutedAt returns the old "executed_at" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldExecutionTime ¶
OldExecutionTime returns the old "execution_time" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) 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 (*RevisionMutation) OldHash ¶
func (m *RevisionMutation) OldHash(ctx context.Context) (v string, err error)
OldHash returns the old "hash" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldOperatorVersion ¶
func (m *RevisionMutation) OldOperatorVersion(ctx context.Context) (v string, err error)
OldOperatorVersion returns the old "operator_version" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldPartialHashes ¶ added in v0.6.0
func (m *RevisionMutation) OldPartialHashes(ctx context.Context) (v []string, err error)
OldPartialHashes returns the old "partial_hashes" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldTotal ¶ added in v0.6.0
func (m *RevisionMutation) OldTotal(ctx context.Context) (v int, err error)
OldTotal returns the old "total" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OldType ¶ added in v0.6.0
func (m *RevisionMutation) OldType(ctx context.Context) (v migrate.RevisionType, err error)
OldType returns the old "type" field's value of the Revision entity. If the Revision 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 (*RevisionMutation) OperatorVersion ¶
func (m *RevisionMutation) OperatorVersion() (r string, exists bool)
OperatorVersion returns the value of the "operator_version" field in the mutation.
func (*RevisionMutation) PartialHashes ¶ added in v0.6.0
func (m *RevisionMutation) PartialHashes() (r []string, exists bool)
PartialHashes returns the value of the "partial_hashes" field in the mutation.
func (*RevisionMutation) PartialHashesCleared ¶ added in v0.6.0
func (m *RevisionMutation) PartialHashesCleared() bool
PartialHashesCleared returns if the "partial_hashes" field was cleared in this mutation.
func (*RevisionMutation) QueryContext ¶
func (c *RevisionMutation) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionMutation) RemovedEdges ¶
func (m *RevisionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RevisionMutation) RemovedIDs ¶
func (m *RevisionMutation) 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 (*RevisionMutation) ResetApplied ¶ added in v0.6.0
func (m *RevisionMutation) ResetApplied()
ResetApplied resets all changes to the "applied" field.
func (*RevisionMutation) ResetDescription ¶
func (m *RevisionMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*RevisionMutation) ResetEdge ¶
func (m *RevisionMutation) 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 (*RevisionMutation) ResetError ¶ added in v0.6.0
func (m *RevisionMutation) ResetError()
ResetError resets all changes to the "error" field.
func (*RevisionMutation) ResetErrorStmt ¶ added in v0.8.0
func (m *RevisionMutation) ResetErrorStmt()
ResetErrorStmt resets all changes to the "error_stmt" field.
func (*RevisionMutation) ResetExecutedAt ¶
func (m *RevisionMutation) ResetExecutedAt()
ResetExecutedAt resets all changes to the "executed_at" field.
func (*RevisionMutation) ResetExecutionTime ¶
func (m *RevisionMutation) ResetExecutionTime()
ResetExecutionTime resets all changes to the "execution_time" field.
func (*RevisionMutation) ResetField ¶
func (m *RevisionMutation) 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 (*RevisionMutation) ResetHash ¶
func (m *RevisionMutation) ResetHash()
ResetHash resets all changes to the "hash" field.
func (*RevisionMutation) ResetOperatorVersion ¶
func (m *RevisionMutation) ResetOperatorVersion()
ResetOperatorVersion resets all changes to the "operator_version" field.
func (*RevisionMutation) ResetPartialHashes ¶ added in v0.6.0
func (m *RevisionMutation) ResetPartialHashes()
ResetPartialHashes resets all changes to the "partial_hashes" field.
func (*RevisionMutation) ResetTotal ¶ added in v0.6.0
func (m *RevisionMutation) ResetTotal()
ResetTotal resets all changes to the "total" field.
func (*RevisionMutation) ResetType ¶ added in v0.6.0
func (m *RevisionMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*RevisionMutation) SetApplied ¶ added in v0.6.0
func (m *RevisionMutation) SetApplied(i int)
SetApplied sets the "applied" field.
func (*RevisionMutation) SetDescription ¶
func (m *RevisionMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*RevisionMutation) SetError ¶ added in v0.6.0
func (m *RevisionMutation) SetError(s string)
SetError sets the "error" field.
func (*RevisionMutation) SetErrorStmt ¶ added in v0.8.0
func (m *RevisionMutation) SetErrorStmt(s string)
SetErrorStmt sets the "error_stmt" field.
func (*RevisionMutation) SetExecutedAt ¶
func (m *RevisionMutation) SetExecutedAt(t time.Time)
SetExecutedAt sets the "executed_at" field.
func (*RevisionMutation) SetExecutionTime ¶
func (m *RevisionMutation) SetExecutionTime(t time.Duration)
SetExecutionTime sets the "execution_time" field.
func (*RevisionMutation) SetField ¶
func (m *RevisionMutation) 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 (*RevisionMutation) SetHash ¶
func (m *RevisionMutation) SetHash(s string)
SetHash sets the "hash" field.
func (*RevisionMutation) SetID ¶
func (m *RevisionMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Revision entities.
func (*RevisionMutation) SetOperatorVersion ¶
func (m *RevisionMutation) SetOperatorVersion(s string)
SetOperatorVersion sets the "operator_version" field.
func (*RevisionMutation) SetPartialHashes ¶ added in v0.6.0
func (m *RevisionMutation) SetPartialHashes(s []string)
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionMutation) SetTotal ¶ added in v0.6.0
func (m *RevisionMutation) SetTotal(i int)
SetTotal sets the "total" field.
func (*RevisionMutation) SetType ¶ added in v0.6.0
func (m *RevisionMutation) SetType(mt migrate.RevisionType)
SetType sets the "type" field.
func (*RevisionMutation) Total ¶ added in v0.6.0
func (m *RevisionMutation) Total() (r int, exists bool)
Total returns the value of the "total" field in the mutation.
func (RevisionMutation) Tx ¶
func (m RevisionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RevisionMutation) Type ¶
func (m *RevisionMutation) Type() string
Type returns the node type of this mutation (Revision).
func (*RevisionMutation) Where ¶
func (m *RevisionMutation) Where(ps ...predicate.Revision)
Where appends a list predicates to the RevisionMutation builder.
type RevisionQuery ¶
type RevisionQuery struct {
// contains filtered or unexported fields
}
RevisionQuery is the builder for querying Revision entities.
func (*RevisionQuery) All ¶
func (rq *RevisionQuery) All(ctx context.Context) ([]*Revision, error)
All executes the query and returns a list of Revisions.
func (*RevisionQuery) AllX ¶
func (rq *RevisionQuery) AllX(ctx context.Context) []*Revision
AllX is like All, but panics if an error occurs.
func (*RevisionQuery) Clone ¶
func (rq *RevisionQuery) Clone() *RevisionQuery
Clone returns a duplicate of the RevisionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RevisionQuery) Count ¶
func (rq *RevisionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RevisionQuery) CountX ¶
func (rq *RevisionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RevisionQuery) ExecContext ¶
func (c *RevisionQuery) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionQuery) Exist ¶
func (rq *RevisionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RevisionQuery) ExistX ¶
func (rq *RevisionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RevisionQuery) First ¶
func (rq *RevisionQuery) First(ctx context.Context) (*Revision, error)
First returns the first Revision entity from the query. Returns a *NotFoundError when no Revision was found.
func (*RevisionQuery) FirstID ¶
func (rq *RevisionQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Revision ID from the query. Returns a *NotFoundError when no Revision ID was found.
func (*RevisionQuery) FirstIDX ¶
func (rq *RevisionQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*RevisionQuery) FirstX ¶
func (rq *RevisionQuery) FirstX(ctx context.Context) *Revision
FirstX is like First, but panics if an error occurs.
func (*RevisionQuery) GroupBy ¶
func (rq *RevisionQuery) GroupBy(field string, fields ...string) *RevisionGroupBy
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 { Description string `json:"description,omitempty"` Count int `json:"count,omitempty"` } client.Revision.Query(). GroupBy(revision.FieldDescription). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RevisionQuery) IDs ¶
func (rq *RevisionQuery) IDs(ctx context.Context) ([]string, error)
IDs executes the query and returns a list of Revision IDs.
func (*RevisionQuery) IDsX ¶
func (rq *RevisionQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*RevisionQuery) Limit ¶
func (rq *RevisionQuery) Limit(limit int) *RevisionQuery
Limit adds a limit step to the query.
func (*RevisionQuery) Offset ¶
func (rq *RevisionQuery) Offset(offset int) *RevisionQuery
Offset adds an offset step to the query.
func (*RevisionQuery) Only ¶
func (rq *RevisionQuery) Only(ctx context.Context) (*Revision, error)
Only returns a single Revision entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Revision entity is found. Returns a *NotFoundError when no Revision entities are found.
func (*RevisionQuery) OnlyID ¶
func (rq *RevisionQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Revision ID in the query. Returns a *NotSingularError when more than one Revision ID is found. Returns a *NotFoundError when no entities are found.
func (*RevisionQuery) OnlyIDX ¶
func (rq *RevisionQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RevisionQuery) OnlyX ¶
func (rq *RevisionQuery) OnlyX(ctx context.Context) *Revision
OnlyX is like Only, but panics if an error occurs.
func (*RevisionQuery) Order ¶
func (rq *RevisionQuery) Order(o ...OrderFunc) *RevisionQuery
Order adds an order step to the query.
func (*RevisionQuery) QueryContext ¶
func (c *RevisionQuery) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionQuery) Select ¶
func (rq *RevisionQuery) Select(fields ...string) *RevisionSelect
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 { Description string `json:"description,omitempty"` } client.Revision.Query(). Select(revision.FieldDescription). Scan(ctx, &v)
func (*RevisionQuery) Unique ¶
func (rq *RevisionQuery) Unique(unique bool) *RevisionQuery
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 (*RevisionQuery) Where ¶
func (rq *RevisionQuery) Where(ps ...predicate.Revision) *RevisionQuery
Where adds a new predicate for the RevisionQuery builder.
type RevisionSelect ¶
type RevisionSelect struct { *RevisionQuery // contains filtered or unexported fields }
RevisionSelect is the builder for selecting fields of Revision entities.
func (*RevisionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RevisionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (RevisionSelect) ExecContext ¶
func (c RevisionSelect) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RevisionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RevisionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RevisionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (RevisionSelect) QueryContext ¶
func (c RevisionSelect) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionSelect) Scan ¶
func (rs *RevisionSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RevisionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RevisionUpdate ¶
type RevisionUpdate struct {
// contains filtered or unexported fields
}
RevisionUpdate is the builder for updating Revision entities.
func (*RevisionUpdate) AddApplied ¶ added in v0.6.0
func (ru *RevisionUpdate) AddApplied(i int) *RevisionUpdate
AddApplied adds i to the "applied" field.
func (*RevisionUpdate) AddExecutionTime ¶
func (ru *RevisionUpdate) AddExecutionTime(t time.Duration) *RevisionUpdate
AddExecutionTime adds t to the "execution_time" field.
func (*RevisionUpdate) AddTotal ¶ added in v0.6.0
func (ru *RevisionUpdate) AddTotal(i int) *RevisionUpdate
AddTotal adds i to the "total" field.
func (*RevisionUpdate) AddType ¶ added in v0.6.0
func (ru *RevisionUpdate) AddType(mt migrate.RevisionType) *RevisionUpdate
AddType adds mt to the "type" field.
func (*RevisionUpdate) ClearError ¶ added in v0.6.0
func (ru *RevisionUpdate) ClearError() *RevisionUpdate
ClearError clears the value of the "error" field.
func (*RevisionUpdate) ClearErrorStmt ¶ added in v0.8.0
func (ru *RevisionUpdate) ClearErrorStmt() *RevisionUpdate
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionUpdate) ClearPartialHashes ¶ added in v0.6.0
func (ru *RevisionUpdate) ClearPartialHashes() *RevisionUpdate
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionUpdate) Exec ¶
func (ru *RevisionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RevisionUpdate) ExecContext ¶
func (c *RevisionUpdate) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionUpdate) ExecX ¶
func (ru *RevisionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionUpdate) Mutation ¶
func (ru *RevisionUpdate) Mutation() *RevisionMutation
Mutation returns the RevisionMutation object of the builder.
func (*RevisionUpdate) QueryContext ¶
func (c *RevisionUpdate) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionUpdate) Save ¶
func (ru *RevisionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RevisionUpdate) SaveX ¶
func (ru *RevisionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RevisionUpdate) SetApplied ¶ added in v0.6.0
func (ru *RevisionUpdate) SetApplied(i int) *RevisionUpdate
SetApplied sets the "applied" field.
func (*RevisionUpdate) SetError ¶ added in v0.6.0
func (ru *RevisionUpdate) SetError(s string) *RevisionUpdate
SetError sets the "error" field.
func (*RevisionUpdate) SetErrorStmt ¶ added in v0.8.0
func (ru *RevisionUpdate) SetErrorStmt(s string) *RevisionUpdate
SetErrorStmt sets the "error_stmt" field.
func (*RevisionUpdate) SetExecutionTime ¶
func (ru *RevisionUpdate) SetExecutionTime(t time.Duration) *RevisionUpdate
SetExecutionTime sets the "execution_time" field.
func (*RevisionUpdate) SetHash ¶
func (ru *RevisionUpdate) SetHash(s string) *RevisionUpdate
SetHash sets the "hash" field.
func (*RevisionUpdate) SetNillableApplied ¶ added in v0.6.4
func (ru *RevisionUpdate) SetNillableApplied(i *int) *RevisionUpdate
SetNillableApplied sets the "applied" field if the given value is not nil.
func (*RevisionUpdate) SetNillableError ¶ added in v0.6.0
func (ru *RevisionUpdate) SetNillableError(s *string) *RevisionUpdate
SetNillableError sets the "error" field if the given value is not nil.
func (*RevisionUpdate) SetNillableErrorStmt ¶ added in v0.8.0
func (ru *RevisionUpdate) SetNillableErrorStmt(s *string) *RevisionUpdate
SetNillableErrorStmt sets the "error_stmt" field if the given value is not nil.
func (*RevisionUpdate) SetNillableTotal ¶ added in v0.6.4
func (ru *RevisionUpdate) SetNillableTotal(i *int) *RevisionUpdate
SetNillableTotal sets the "total" field if the given value is not nil.
func (*RevisionUpdate) SetNillableType ¶ added in v0.6.4
func (ru *RevisionUpdate) SetNillableType(mt *migrate.RevisionType) *RevisionUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*RevisionUpdate) SetOperatorVersion ¶
func (ru *RevisionUpdate) SetOperatorVersion(s string) *RevisionUpdate
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpdate) SetPartialHashes ¶ added in v0.6.0
func (ru *RevisionUpdate) SetPartialHashes(s []string) *RevisionUpdate
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionUpdate) SetTotal ¶ added in v0.6.0
func (ru *RevisionUpdate) SetTotal(i int) *RevisionUpdate
SetTotal sets the "total" field.
func (*RevisionUpdate) SetType ¶ added in v0.6.0
func (ru *RevisionUpdate) SetType(mt migrate.RevisionType) *RevisionUpdate
SetType sets the "type" field.
func (*RevisionUpdate) Where ¶
func (ru *RevisionUpdate) Where(ps ...predicate.Revision) *RevisionUpdate
Where appends a list predicates to the RevisionUpdate builder.
type RevisionUpdateOne ¶
type RevisionUpdateOne struct {
// contains filtered or unexported fields
}
RevisionUpdateOne is the builder for updating a single Revision entity.
func (*RevisionUpdateOne) AddApplied ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) AddApplied(i int) *RevisionUpdateOne
AddApplied adds i to the "applied" field.
func (*RevisionUpdateOne) AddExecutionTime ¶
func (ruo *RevisionUpdateOne) AddExecutionTime(t time.Duration) *RevisionUpdateOne
AddExecutionTime adds t to the "execution_time" field.
func (*RevisionUpdateOne) AddTotal ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) AddTotal(i int) *RevisionUpdateOne
AddTotal adds i to the "total" field.
func (*RevisionUpdateOne) AddType ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) AddType(mt migrate.RevisionType) *RevisionUpdateOne
AddType adds mt to the "type" field.
func (*RevisionUpdateOne) ClearError ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) ClearError() *RevisionUpdateOne
ClearError clears the value of the "error" field.
func (*RevisionUpdateOne) ClearErrorStmt ¶ added in v0.8.0
func (ruo *RevisionUpdateOne) ClearErrorStmt() *RevisionUpdateOne
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionUpdateOne) ClearPartialHashes ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) ClearPartialHashes() *RevisionUpdateOne
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionUpdateOne) Exec ¶
func (ruo *RevisionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RevisionUpdateOne) ExecContext ¶
func (c *RevisionUpdateOne) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RevisionUpdateOne) ExecX ¶
func (ruo *RevisionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionUpdateOne) Mutation ¶
func (ruo *RevisionUpdateOne) Mutation() *RevisionMutation
Mutation returns the RevisionMutation object of the builder.
func (*RevisionUpdateOne) QueryContext ¶
func (c *RevisionUpdateOne) QueryContext(ctx context.Context, query string, args ...interface{}) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RevisionUpdateOne) Save ¶
func (ruo *RevisionUpdateOne) Save(ctx context.Context) (*Revision, error)
Save executes the query and returns the updated Revision entity.
func (*RevisionUpdateOne) SaveX ¶
func (ruo *RevisionUpdateOne) SaveX(ctx context.Context) *Revision
SaveX is like Save, but panics if an error occurs.
func (*RevisionUpdateOne) Select ¶
func (ruo *RevisionUpdateOne) Select(field string, fields ...string) *RevisionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RevisionUpdateOne) SetApplied ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetApplied(i int) *RevisionUpdateOne
SetApplied sets the "applied" field.
func (*RevisionUpdateOne) SetError ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetError(s string) *RevisionUpdateOne
SetError sets the "error" field.
func (*RevisionUpdateOne) SetErrorStmt ¶ added in v0.8.0
func (ruo *RevisionUpdateOne) SetErrorStmt(s string) *RevisionUpdateOne
SetErrorStmt sets the "error_stmt" field.
func (*RevisionUpdateOne) SetExecutionTime ¶
func (ruo *RevisionUpdateOne) SetExecutionTime(t time.Duration) *RevisionUpdateOne
SetExecutionTime sets the "execution_time" field.
func (*RevisionUpdateOne) SetHash ¶
func (ruo *RevisionUpdateOne) SetHash(s string) *RevisionUpdateOne
SetHash sets the "hash" field.
func (*RevisionUpdateOne) SetNillableApplied ¶ added in v0.6.4
func (ruo *RevisionUpdateOne) SetNillableApplied(i *int) *RevisionUpdateOne
SetNillableApplied sets the "applied" field if the given value is not nil.
func (*RevisionUpdateOne) SetNillableError ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetNillableError(s *string) *RevisionUpdateOne
SetNillableError sets the "error" field if the given value is not nil.
func (*RevisionUpdateOne) SetNillableErrorStmt ¶ added in v0.8.0
func (ruo *RevisionUpdateOne) SetNillableErrorStmt(s *string) *RevisionUpdateOne
SetNillableErrorStmt sets the "error_stmt" field if the given value is not nil.
func (*RevisionUpdateOne) SetNillableTotal ¶ added in v0.6.4
func (ruo *RevisionUpdateOne) SetNillableTotal(i *int) *RevisionUpdateOne
SetNillableTotal sets the "total" field if the given value is not nil.
func (*RevisionUpdateOne) SetNillableType ¶ added in v0.6.4
func (ruo *RevisionUpdateOne) SetNillableType(mt *migrate.RevisionType) *RevisionUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*RevisionUpdateOne) SetOperatorVersion ¶
func (ruo *RevisionUpdateOne) SetOperatorVersion(s string) *RevisionUpdateOne
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpdateOne) SetPartialHashes ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetPartialHashes(s []string) *RevisionUpdateOne
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionUpdateOne) SetTotal ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetTotal(i int) *RevisionUpdateOne
SetTotal sets the "total" field.
func (*RevisionUpdateOne) SetType ¶ added in v0.6.0
func (ruo *RevisionUpdateOne) SetType(mt migrate.RevisionType) *RevisionUpdateOne
SetType sets the "type" field.
type RevisionUpsert ¶
RevisionUpsert is the "OnConflict" setter.
func (*RevisionUpsert) AddApplied ¶ added in v0.6.0
func (u *RevisionUpsert) AddApplied(v int) *RevisionUpsert
AddApplied adds v to the "applied" field.
func (*RevisionUpsert) AddExecutionTime ¶
func (u *RevisionUpsert) AddExecutionTime(v time.Duration) *RevisionUpsert
AddExecutionTime adds v to the "execution_time" field.
func (*RevisionUpsert) AddTotal ¶ added in v0.6.0
func (u *RevisionUpsert) AddTotal(v int) *RevisionUpsert
AddTotal adds v to the "total" field.
func (*RevisionUpsert) AddType ¶ added in v0.6.0
func (u *RevisionUpsert) AddType(v migrate.RevisionType) *RevisionUpsert
AddType adds v to the "type" field.
func (*RevisionUpsert) ClearError ¶ added in v0.6.0
func (u *RevisionUpsert) ClearError() *RevisionUpsert
ClearError clears the value of the "error" field.
func (*RevisionUpsert) ClearErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsert) ClearErrorStmt() *RevisionUpsert
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionUpsert) ClearPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsert) ClearPartialHashes() *RevisionUpsert
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionUpsert) SetApplied ¶ added in v0.6.0
func (u *RevisionUpsert) SetApplied(v int) *RevisionUpsert
SetApplied sets the "applied" field.
func (*RevisionUpsert) SetDescription ¶
func (u *RevisionUpsert) SetDescription(v string) *RevisionUpsert
SetDescription sets the "description" field.
func (*RevisionUpsert) SetError ¶ added in v0.6.0
func (u *RevisionUpsert) SetError(v string) *RevisionUpsert
SetError sets the "error" field.
func (*RevisionUpsert) SetErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsert) SetErrorStmt(v string) *RevisionUpsert
SetErrorStmt sets the "error_stmt" field.
func (*RevisionUpsert) SetExecutedAt ¶
func (u *RevisionUpsert) SetExecutedAt(v time.Time) *RevisionUpsert
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsert) SetExecutionTime ¶
func (u *RevisionUpsert) SetExecutionTime(v time.Duration) *RevisionUpsert
SetExecutionTime sets the "execution_time" field.
func (*RevisionUpsert) SetHash ¶
func (u *RevisionUpsert) SetHash(v string) *RevisionUpsert
SetHash sets the "hash" field.
func (*RevisionUpsert) SetOperatorVersion ¶
func (u *RevisionUpsert) SetOperatorVersion(v string) *RevisionUpsert
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpsert) SetPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsert) SetPartialHashes(v []string) *RevisionUpsert
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionUpsert) SetTotal ¶ added in v0.6.0
func (u *RevisionUpsert) SetTotal(v int) *RevisionUpsert
SetTotal sets the "total" field.
func (*RevisionUpsert) SetType ¶ added in v0.6.0
func (u *RevisionUpsert) SetType(v migrate.RevisionType) *RevisionUpsert
SetType sets the "type" field.
func (*RevisionUpsert) UpdateApplied ¶ added in v0.6.0
func (u *RevisionUpsert) UpdateApplied() *RevisionUpsert
UpdateApplied sets the "applied" field to the value that was provided on create.
func (*RevisionUpsert) UpdateDescription ¶
func (u *RevisionUpsert) UpdateDescription() *RevisionUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*RevisionUpsert) UpdateError ¶ added in v0.6.0
func (u *RevisionUpsert) UpdateError() *RevisionUpsert
UpdateError sets the "error" field to the value that was provided on create.
func (*RevisionUpsert) UpdateErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsert) UpdateErrorStmt() *RevisionUpsert
UpdateErrorStmt sets the "error_stmt" field to the value that was provided on create.
func (*RevisionUpsert) UpdateExecutedAt ¶
func (u *RevisionUpsert) UpdateExecutedAt() *RevisionUpsert
UpdateExecutedAt sets the "executed_at" field to the value that was provided on create.
func (*RevisionUpsert) UpdateExecutionTime ¶
func (u *RevisionUpsert) UpdateExecutionTime() *RevisionUpsert
UpdateExecutionTime sets the "execution_time" field to the value that was provided on create.
func (*RevisionUpsert) UpdateHash ¶
func (u *RevisionUpsert) UpdateHash() *RevisionUpsert
UpdateHash sets the "hash" field to the value that was provided on create.
func (*RevisionUpsert) UpdateOperatorVersion ¶
func (u *RevisionUpsert) UpdateOperatorVersion() *RevisionUpsert
UpdateOperatorVersion sets the "operator_version" field to the value that was provided on create.
func (*RevisionUpsert) UpdatePartialHashes ¶ added in v0.6.0
func (u *RevisionUpsert) UpdatePartialHashes() *RevisionUpsert
UpdatePartialHashes sets the "partial_hashes" field to the value that was provided on create.
func (*RevisionUpsert) UpdateTotal ¶ added in v0.6.0
func (u *RevisionUpsert) UpdateTotal() *RevisionUpsert
UpdateTotal sets the "total" field to the value that was provided on create.
func (*RevisionUpsert) UpdateType ¶ added in v0.6.0
func (u *RevisionUpsert) UpdateType() *RevisionUpsert
UpdateType sets the "type" field to the value that was provided on create.
type RevisionUpsertBulk ¶
type RevisionUpsertBulk struct {
// contains filtered or unexported fields
}
RevisionUpsertBulk is the builder for "upsert"-ing a bulk of Revision nodes.
func (*RevisionUpsertBulk) AddApplied ¶ added in v0.6.0
func (u *RevisionUpsertBulk) AddApplied(v int) *RevisionUpsertBulk
AddApplied adds v to the "applied" field.
func (*RevisionUpsertBulk) AddExecutionTime ¶
func (u *RevisionUpsertBulk) AddExecutionTime(v time.Duration) *RevisionUpsertBulk
AddExecutionTime adds v to the "execution_time" field.
func (*RevisionUpsertBulk) AddTotal ¶ added in v0.6.0
func (u *RevisionUpsertBulk) AddTotal(v int) *RevisionUpsertBulk
AddTotal adds v to the "total" field.
func (*RevisionUpsertBulk) AddType ¶ added in v0.6.0
func (u *RevisionUpsertBulk) AddType(v migrate.RevisionType) *RevisionUpsertBulk
AddType adds v to the "type" field.
func (*RevisionUpsertBulk) ClearError ¶ added in v0.6.0
func (u *RevisionUpsertBulk) ClearError() *RevisionUpsertBulk
ClearError clears the value of the "error" field.
func (*RevisionUpsertBulk) ClearErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertBulk) ClearErrorStmt() *RevisionUpsertBulk
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionUpsertBulk) ClearPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertBulk) ClearPartialHashes() *RevisionUpsertBulk
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionUpsertBulk) DoNothing ¶
func (u *RevisionUpsertBulk) DoNothing() *RevisionUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*RevisionUpsertBulk) Exec ¶
func (u *RevisionUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RevisionUpsertBulk) ExecX ¶
func (u *RevisionUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionUpsertBulk) Ignore ¶
func (u *RevisionUpsertBulk) Ignore() *RevisionUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Revision.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*RevisionUpsertBulk) SetApplied ¶ added in v0.6.0
func (u *RevisionUpsertBulk) SetApplied(v int) *RevisionUpsertBulk
SetApplied sets the "applied" field.
func (*RevisionUpsertBulk) SetDescription ¶
func (u *RevisionUpsertBulk) SetDescription(v string) *RevisionUpsertBulk
SetDescription sets the "description" field.
func (*RevisionUpsertBulk) SetError ¶ added in v0.6.0
func (u *RevisionUpsertBulk) SetError(v string) *RevisionUpsertBulk
SetError sets the "error" field.
func (*RevisionUpsertBulk) SetErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertBulk) SetErrorStmt(v string) *RevisionUpsertBulk
SetErrorStmt sets the "error_stmt" field.
func (*RevisionUpsertBulk) SetExecutedAt ¶
func (u *RevisionUpsertBulk) SetExecutedAt(v time.Time) *RevisionUpsertBulk
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsertBulk) SetExecutionTime ¶
func (u *RevisionUpsertBulk) SetExecutionTime(v time.Duration) *RevisionUpsertBulk
SetExecutionTime sets the "execution_time" field.
func (*RevisionUpsertBulk) SetHash ¶
func (u *RevisionUpsertBulk) SetHash(v string) *RevisionUpsertBulk
SetHash sets the "hash" field.
func (*RevisionUpsertBulk) SetOperatorVersion ¶
func (u *RevisionUpsertBulk) SetOperatorVersion(v string) *RevisionUpsertBulk
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpsertBulk) SetPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertBulk) SetPartialHashes(v []string) *RevisionUpsertBulk
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionUpsertBulk) SetTotal ¶ added in v0.6.0
func (u *RevisionUpsertBulk) SetTotal(v int) *RevisionUpsertBulk
SetTotal sets the "total" field.
func (*RevisionUpsertBulk) SetType ¶ added in v0.6.0
func (u *RevisionUpsertBulk) SetType(v migrate.RevisionType) *RevisionUpsertBulk
SetType sets the "type" field.
func (*RevisionUpsertBulk) Update ¶
func (u *RevisionUpsertBulk) Update(set func(*RevisionUpsert)) *RevisionUpsertBulk
Update allows overriding fields `UPDATE` values. See the RevisionCreateBulk.OnConflict documentation for more info.
func (*RevisionUpsertBulk) UpdateApplied ¶ added in v0.6.0
func (u *RevisionUpsertBulk) UpdateApplied() *RevisionUpsertBulk
UpdateApplied sets the "applied" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateDescription ¶
func (u *RevisionUpsertBulk) UpdateDescription() *RevisionUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateError ¶ added in v0.6.0
func (u *RevisionUpsertBulk) UpdateError() *RevisionUpsertBulk
UpdateError sets the "error" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertBulk) UpdateErrorStmt() *RevisionUpsertBulk
UpdateErrorStmt sets the "error_stmt" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateExecutedAt ¶
func (u *RevisionUpsertBulk) UpdateExecutedAt() *RevisionUpsertBulk
UpdateExecutedAt sets the "executed_at" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateExecutionTime ¶
func (u *RevisionUpsertBulk) UpdateExecutionTime() *RevisionUpsertBulk
UpdateExecutionTime sets the "execution_time" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateHash ¶
func (u *RevisionUpsertBulk) UpdateHash() *RevisionUpsertBulk
UpdateHash sets the "hash" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateNewValues ¶
func (u *RevisionUpsertBulk) UpdateNewValues() *RevisionUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Revision.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(revision.FieldID) }), ). Exec(ctx)
func (*RevisionUpsertBulk) UpdateOperatorVersion ¶
func (u *RevisionUpsertBulk) UpdateOperatorVersion() *RevisionUpsertBulk
UpdateOperatorVersion sets the "operator_version" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdatePartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertBulk) UpdatePartialHashes() *RevisionUpsertBulk
UpdatePartialHashes sets the "partial_hashes" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateTotal ¶ added in v0.6.0
func (u *RevisionUpsertBulk) UpdateTotal() *RevisionUpsertBulk
UpdateTotal sets the "total" field to the value that was provided on create.
func (*RevisionUpsertBulk) UpdateType ¶ added in v0.6.0
func (u *RevisionUpsertBulk) UpdateType() *RevisionUpsertBulk
UpdateType sets the "type" field to the value that was provided on create.
type RevisionUpsertOne ¶
type RevisionUpsertOne struct {
// contains filtered or unexported fields
}
RevisionUpsertOne is the builder for "upsert"-ing
one Revision node.
func (*RevisionUpsertOne) AddApplied ¶ added in v0.6.0
func (u *RevisionUpsertOne) AddApplied(v int) *RevisionUpsertOne
AddApplied adds v to the "applied" field.
func (*RevisionUpsertOne) AddExecutionTime ¶
func (u *RevisionUpsertOne) AddExecutionTime(v time.Duration) *RevisionUpsertOne
AddExecutionTime adds v to the "execution_time" field.
func (*RevisionUpsertOne) AddTotal ¶ added in v0.6.0
func (u *RevisionUpsertOne) AddTotal(v int) *RevisionUpsertOne
AddTotal adds v to the "total" field.
func (*RevisionUpsertOne) AddType ¶ added in v0.6.0
func (u *RevisionUpsertOne) AddType(v migrate.RevisionType) *RevisionUpsertOne
AddType adds v to the "type" field.
func (*RevisionUpsertOne) ClearError ¶ added in v0.6.0
func (u *RevisionUpsertOne) ClearError() *RevisionUpsertOne
ClearError clears the value of the "error" field.
func (*RevisionUpsertOne) ClearErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertOne) ClearErrorStmt() *RevisionUpsertOne
ClearErrorStmt clears the value of the "error_stmt" field.
func (*RevisionUpsertOne) ClearPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertOne) ClearPartialHashes() *RevisionUpsertOne
ClearPartialHashes clears the value of the "partial_hashes" field.
func (*RevisionUpsertOne) DoNothing ¶
func (u *RevisionUpsertOne) DoNothing() *RevisionUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*RevisionUpsertOne) Exec ¶
func (u *RevisionUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*RevisionUpsertOne) ExecX ¶
func (u *RevisionUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RevisionUpsertOne) ID ¶
func (u *RevisionUpsertOne) ID(ctx context.Context) (id string, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*RevisionUpsertOne) IDX ¶
func (u *RevisionUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*RevisionUpsertOne) Ignore ¶
func (u *RevisionUpsertOne) Ignore() *RevisionUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Revision.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*RevisionUpsertOne) SetApplied ¶ added in v0.6.0
func (u *RevisionUpsertOne) SetApplied(v int) *RevisionUpsertOne
SetApplied sets the "applied" field.
func (*RevisionUpsertOne) SetDescription ¶
func (u *RevisionUpsertOne) SetDescription(v string) *RevisionUpsertOne
SetDescription sets the "description" field.
func (*RevisionUpsertOne) SetError ¶ added in v0.6.0
func (u *RevisionUpsertOne) SetError(v string) *RevisionUpsertOne
SetError sets the "error" field.
func (*RevisionUpsertOne) SetErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertOne) SetErrorStmt(v string) *RevisionUpsertOne
SetErrorStmt sets the "error_stmt" field.
func (*RevisionUpsertOne) SetExecutedAt ¶
func (u *RevisionUpsertOne) SetExecutedAt(v time.Time) *RevisionUpsertOne
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsertOne) SetExecutionTime ¶
func (u *RevisionUpsertOne) SetExecutionTime(v time.Duration) *RevisionUpsertOne
SetExecutionTime sets the "execution_time" field.
func (*RevisionUpsertOne) SetHash ¶
func (u *RevisionUpsertOne) SetHash(v string) *RevisionUpsertOne
SetHash sets the "hash" field.
func (*RevisionUpsertOne) SetOperatorVersion ¶
func (u *RevisionUpsertOne) SetOperatorVersion(v string) *RevisionUpsertOne
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpsertOne) SetPartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertOne) SetPartialHashes(v []string) *RevisionUpsertOne
SetPartialHashes sets the "partial_hashes" field.
func (*RevisionUpsertOne) SetTotal ¶ added in v0.6.0
func (u *RevisionUpsertOne) SetTotal(v int) *RevisionUpsertOne
SetTotal sets the "total" field.
func (*RevisionUpsertOne) SetType ¶ added in v0.6.0
func (u *RevisionUpsertOne) SetType(v migrate.RevisionType) *RevisionUpsertOne
SetType sets the "type" field.
func (*RevisionUpsertOne) Update ¶
func (u *RevisionUpsertOne) Update(set func(*RevisionUpsert)) *RevisionUpsertOne
Update allows overriding fields `UPDATE` values. See the RevisionCreate.OnConflict documentation for more info.
func (*RevisionUpsertOne) UpdateApplied ¶ added in v0.6.0
func (u *RevisionUpsertOne) UpdateApplied() *RevisionUpsertOne
UpdateApplied sets the "applied" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateDescription ¶
func (u *RevisionUpsertOne) UpdateDescription() *RevisionUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateError ¶ added in v0.6.0
func (u *RevisionUpsertOne) UpdateError() *RevisionUpsertOne
UpdateError sets the "error" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateErrorStmt ¶ added in v0.8.0
func (u *RevisionUpsertOne) UpdateErrorStmt() *RevisionUpsertOne
UpdateErrorStmt sets the "error_stmt" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateExecutedAt ¶
func (u *RevisionUpsertOne) UpdateExecutedAt() *RevisionUpsertOne
UpdateExecutedAt sets the "executed_at" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateExecutionTime ¶
func (u *RevisionUpsertOne) UpdateExecutionTime() *RevisionUpsertOne
UpdateExecutionTime sets the "execution_time" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateHash ¶
func (u *RevisionUpsertOne) UpdateHash() *RevisionUpsertOne
UpdateHash sets the "hash" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateNewValues ¶
func (u *RevisionUpsertOne) UpdateNewValues() *RevisionUpsertOne
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.Revision.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(revision.FieldID) }), ). Exec(ctx)
func (*RevisionUpsertOne) UpdateOperatorVersion ¶
func (u *RevisionUpsertOne) UpdateOperatorVersion() *RevisionUpsertOne
UpdateOperatorVersion sets the "operator_version" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdatePartialHashes ¶ added in v0.6.0
func (u *RevisionUpsertOne) UpdatePartialHashes() *RevisionUpsertOne
UpdatePartialHashes sets the "partial_hashes" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateTotal ¶ added in v0.6.0
func (u *RevisionUpsertOne) UpdateTotal() *RevisionUpsertOne
UpdateTotal sets the "total" field to the value that was provided on create.
func (*RevisionUpsertOne) UpdateType ¶ added in v0.6.0
func (u *RevisionUpsertOne) UpdateType() *RevisionUpsertOne
UpdateType sets the "type" field to the value that was provided on create.
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 SchemaConfig ¶
type SchemaConfig = internal.SchemaConfig
SchemaConfig represents alternative schema names for all tables that can be passed at runtime.
type Tx ¶
type Tx struct { // Revision is the client for interacting with the Revision builders. Revision *RevisionClient // 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) ExecContext ¶
func (c *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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.