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 (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) SetDescription(s string) *RevisionCreate
- func (rc *RevisionCreate) SetExecutedAt(t time.Time) *RevisionCreate
- func (rc *RevisionCreate) SetExecutionState(rs revision.ExecutionState) *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) SetMeta(m map[string]string) *RevisionCreate
- func (rc *RevisionCreate) SetOperatorVersion(s string) *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) AddExecutionTime(t time.Duration)
- func (m *RevisionMutation) AddField(name string, value ent.Value) error
- 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) ClearEdge(name string) error
- func (m *RevisionMutation) ClearField(name string) error
- 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 (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) ExecutionState() (r revision.ExecutionState, 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) 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) Meta() (r map[string]string, exists bool)
- func (m *RevisionMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) OldExecutedAt(ctx context.Context) (v time.Time, err error)
- func (m *RevisionMutation) OldExecutionState(ctx context.Context) (v revision.ExecutionState, 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) OldMeta(ctx context.Context) (v map[string]string, err error)
- func (m *RevisionMutation) OldOperatorVersion(ctx context.Context) (v string, err error)
- func (m *RevisionMutation) Op() Op
- func (m *RevisionMutation) OperatorVersion() (r string, exists 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) ResetDescription()
- func (m *RevisionMutation) ResetEdge(name string) error
- func (m *RevisionMutation) ResetExecutedAt()
- func (m *RevisionMutation) ResetExecutionState()
- func (m *RevisionMutation) ResetExecutionTime()
- func (m *RevisionMutation) ResetField(name string) error
- func (m *RevisionMutation) ResetHash()
- func (m *RevisionMutation) ResetMeta()
- func (m *RevisionMutation) ResetOperatorVersion()
- func (m *RevisionMutation) SetDescription(s string)
- func (m *RevisionMutation) SetExecutedAt(t time.Time)
- func (m *RevisionMutation) SetExecutionState(rs revision.ExecutionState)
- 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) SetMeta(value map[string]string)
- func (m *RevisionMutation) SetOperatorVersion(s string)
- 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) AddExecutionTime(t time.Duration) *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) SetDescription(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetExecutedAt(t time.Time) *RevisionUpdate
- func (ru *RevisionUpdate) SetExecutionState(rs revision.ExecutionState) *RevisionUpdate
- func (ru *RevisionUpdate) SetExecutionTime(t time.Duration) *RevisionUpdate
- func (ru *RevisionUpdate) SetHash(s string) *RevisionUpdate
- func (ru *RevisionUpdate) SetMeta(m map[string]string) *RevisionUpdate
- func (ru *RevisionUpdate) SetOperatorVersion(s string) *RevisionUpdate
- func (ru *RevisionUpdate) Where(ps ...predicate.Revision) *RevisionUpdate
- type RevisionUpdateOne
- func (ruo *RevisionUpdateOne) AddExecutionTime(t time.Duration) *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) SetDescription(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetExecutedAt(t time.Time) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetExecutionState(rs revision.ExecutionState) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetExecutionTime(t time.Duration) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetHash(s string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetMeta(m map[string]string) *RevisionUpdateOne
- func (ruo *RevisionUpdateOne) SetOperatorVersion(s string) *RevisionUpdateOne
- type RevisionUpsert
- func (u *RevisionUpsert) AddExecutionTime(v time.Duration) *RevisionUpsert
- func (u *RevisionUpsert) SetDescription(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetExecutedAt(v time.Time) *RevisionUpsert
- func (u *RevisionUpsert) SetExecutionState(v revision.ExecutionState) *RevisionUpsert
- func (u *RevisionUpsert) SetExecutionTime(v time.Duration) *RevisionUpsert
- func (u *RevisionUpsert) SetHash(v string) *RevisionUpsert
- func (u *RevisionUpsert) SetMeta(v map[string]string) *RevisionUpsert
- func (u *RevisionUpsert) SetOperatorVersion(v string) *RevisionUpsert
- func (u *RevisionUpsert) UpdateDescription() *RevisionUpsert
- func (u *RevisionUpsert) UpdateExecutedAt() *RevisionUpsert
- func (u *RevisionUpsert) UpdateExecutionState() *RevisionUpsert
- func (u *RevisionUpsert) UpdateExecutionTime() *RevisionUpsert
- func (u *RevisionUpsert) UpdateHash() *RevisionUpsert
- func (u *RevisionUpsert) UpdateMeta() *RevisionUpsert
- func (u *RevisionUpsert) UpdateOperatorVersion() *RevisionUpsert
- type RevisionUpsertBulk
- func (u *RevisionUpsertBulk) AddExecutionTime(v time.Duration) *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) SetDescription(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetExecutedAt(v time.Time) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetExecutionState(v revision.ExecutionState) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetExecutionTime(v time.Duration) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetHash(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetMeta(v map[string]string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) SetOperatorVersion(v string) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) Update(set func(*RevisionUpsert)) *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateDescription() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateExecutedAt() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateExecutionState() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateExecutionTime() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateHash() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateMeta() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateNewValues() *RevisionUpsertBulk
- func (u *RevisionUpsertBulk) UpdateOperatorVersion() *RevisionUpsertBulk
- type RevisionUpsertOne
- func (u *RevisionUpsertOne) AddExecutionTime(v time.Duration) *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) SetDescription(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetExecutedAt(v time.Time) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetExecutionState(v revision.ExecutionState) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetExecutionTime(v time.Duration) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetHash(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetMeta(v map[string]string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) SetOperatorVersion(v string) *RevisionUpsertOne
- func (u *RevisionUpsertOne) Update(set func(*RevisionUpsert)) *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateDescription() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateExecutedAt() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateExecutionState() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateExecutionTime() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateHash() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateMeta() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateNewValues() *RevisionUpsertOne
- func (u *RevisionUpsertOne) UpdateOperatorVersion() *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"` // ExecutionState holds the value of the "execution_state" field. ExecutionState revision.ExecutionState `json:"execution_state,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"` // Hash holds the value of the "hash" field. Hash string `json:"hash,omitempty"` // OperatorVersion holds the value of the "operator_version" field. OperatorVersion string `json:"operator_version,omitempty"` // Meta holds the value of the "meta" field. Meta map[string]string `json:"meta,omitempty"` // contains filtered or unexported fields }
Revision is the model entity for the Revision schema.
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 create builder for Revision.
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 delete builder for the given entity.
func (*RevisionClient) DeleteOneID ¶
func (c *RevisionClient) DeleteOneID(id string) *RevisionDeleteOne
DeleteOneID returns a delete builder for the given 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) SetDescription ¶
func (rc *RevisionCreate) SetDescription(s string) *RevisionCreate
SetDescription sets the "description" field.
func (*RevisionCreate) SetExecutedAt ¶
func (rc *RevisionCreate) SetExecutedAt(t time.Time) *RevisionCreate
SetExecutedAt sets the "executed_at" field.
func (*RevisionCreate) SetExecutionState ¶
func (rc *RevisionCreate) SetExecutionState(rs revision.ExecutionState) *RevisionCreate
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (rc *RevisionCreate) SetMeta(m map[string]string) *RevisionCreate
SetMeta sets the "meta" field.
func (*RevisionCreate) SetOperatorVersion ¶
func (rc *RevisionCreate) SetOperatorVersion(s string) *RevisionCreate
SetOperatorVersion sets the "operator_version" 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) 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) 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) 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) 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) 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) 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) ExecutionState ¶
func (m *RevisionMutation) ExecutionState() (r revision.ExecutionState, exists bool)
ExecutionState returns the value of the "execution_state" 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) 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) Meta ¶
func (m *RevisionMutation) Meta() (r map[string]string, exists bool)
Meta returns the value of the "meta" field in the mutation.
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) 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) OldExecutionState ¶
func (m *RevisionMutation) OldExecutionState(ctx context.Context) (v revision.ExecutionState, err error)
OldExecutionState returns the old "execution_state" 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) OldMeta ¶
OldMeta returns the old "meta" 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) OperatorVersion ¶
func (m *RevisionMutation) OperatorVersion() (r string, exists bool)
OperatorVersion returns the value of the "operator_version" field in the 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) 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) ResetExecutedAt ¶
func (m *RevisionMutation) ResetExecutedAt()
ResetExecutedAt resets all changes to the "executed_at" field.
func (*RevisionMutation) ResetExecutionState ¶
func (m *RevisionMutation) ResetExecutionState()
ResetExecutionState resets all changes to the "execution_state" 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) ResetMeta ¶
func (m *RevisionMutation) ResetMeta()
ResetMeta resets all changes to the "meta" field.
func (*RevisionMutation) ResetOperatorVersion ¶
func (m *RevisionMutation) ResetOperatorVersion()
ResetOperatorVersion resets all changes to the "operator_version" field.
func (*RevisionMutation) SetDescription ¶
func (m *RevisionMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*RevisionMutation) SetExecutedAt ¶
func (m *RevisionMutation) SetExecutedAt(t time.Time)
SetExecutedAt sets the "executed_at" field.
func (*RevisionMutation) SetExecutionState ¶
func (m *RevisionMutation) SetExecutionState(rs revision.ExecutionState)
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (m *RevisionMutation) SetMeta(value map[string]string)
SetMeta sets the "meta" field.
func (*RevisionMutation) SetOperatorVersion ¶
func (m *RevisionMutation) SetOperatorVersion(s string)
SetOperatorVersion sets the "operator_version" field.
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) AddExecutionTime ¶
func (ru *RevisionUpdate) AddExecutionTime(t time.Duration) *RevisionUpdate
AddExecutionTime adds t to the "execution_time" 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) SetDescription ¶
func (ru *RevisionUpdate) SetDescription(s string) *RevisionUpdate
SetDescription sets the "description" field.
func (*RevisionUpdate) SetExecutedAt ¶
func (ru *RevisionUpdate) SetExecutedAt(t time.Time) *RevisionUpdate
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpdate) SetExecutionState ¶
func (ru *RevisionUpdate) SetExecutionState(rs revision.ExecutionState) *RevisionUpdate
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (ru *RevisionUpdate) SetMeta(m map[string]string) *RevisionUpdate
SetMeta sets the "meta" field.
func (*RevisionUpdate) SetOperatorVersion ¶
func (ru *RevisionUpdate) SetOperatorVersion(s string) *RevisionUpdate
SetOperatorVersion sets the "operator_version" 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) AddExecutionTime ¶
func (ruo *RevisionUpdateOne) AddExecutionTime(t time.Duration) *RevisionUpdateOne
AddExecutionTime adds t to the "execution_time" 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) SetDescription ¶
func (ruo *RevisionUpdateOne) SetDescription(s string) *RevisionUpdateOne
SetDescription sets the "description" field.
func (*RevisionUpdateOne) SetExecutedAt ¶
func (ruo *RevisionUpdateOne) SetExecutedAt(t time.Time) *RevisionUpdateOne
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpdateOne) SetExecutionState ¶
func (ruo *RevisionUpdateOne) SetExecutionState(rs revision.ExecutionState) *RevisionUpdateOne
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (ruo *RevisionUpdateOne) SetMeta(m map[string]string) *RevisionUpdateOne
SetMeta sets the "meta" field.
func (*RevisionUpdateOne) SetOperatorVersion ¶
func (ruo *RevisionUpdateOne) SetOperatorVersion(s string) *RevisionUpdateOne
SetOperatorVersion sets the "operator_version" field.
type RevisionUpsert ¶
RevisionUpsert is the "OnConflict" setter.
func (*RevisionUpsert) AddExecutionTime ¶
func (u *RevisionUpsert) AddExecutionTime(v time.Duration) *RevisionUpsert
AddExecutionTime adds v to the "execution_time" field.
func (*RevisionUpsert) SetDescription ¶
func (u *RevisionUpsert) SetDescription(v string) *RevisionUpsert
SetDescription sets the "description" field.
func (*RevisionUpsert) SetExecutedAt ¶
func (u *RevisionUpsert) SetExecutedAt(v time.Time) *RevisionUpsert
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsert) SetExecutionState ¶
func (u *RevisionUpsert) SetExecutionState(v revision.ExecutionState) *RevisionUpsert
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (u *RevisionUpsert) SetMeta(v map[string]string) *RevisionUpsert
SetMeta sets the "meta" field.
func (*RevisionUpsert) SetOperatorVersion ¶
func (u *RevisionUpsert) SetOperatorVersion(v string) *RevisionUpsert
SetOperatorVersion sets the "operator_version" field.
func (*RevisionUpsert) UpdateDescription ¶
func (u *RevisionUpsert) UpdateDescription() *RevisionUpsert
UpdateDescription sets the "description" 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) UpdateExecutionState ¶
func (u *RevisionUpsert) UpdateExecutionState() *RevisionUpsert
UpdateExecutionState sets the "execution_state" 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) UpdateMeta ¶
func (u *RevisionUpsert) UpdateMeta() *RevisionUpsert
UpdateMeta sets the "meta" 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.
type RevisionUpsertBulk ¶
type RevisionUpsertBulk struct {
// contains filtered or unexported fields
}
RevisionUpsertBulk is the builder for "upsert"-ing a bulk of Revision nodes.
func (*RevisionUpsertBulk) AddExecutionTime ¶
func (u *RevisionUpsertBulk) AddExecutionTime(v time.Duration) *RevisionUpsertBulk
AddExecutionTime adds v to the "execution_time" 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) SetDescription ¶
func (u *RevisionUpsertBulk) SetDescription(v string) *RevisionUpsertBulk
SetDescription sets the "description" field.
func (*RevisionUpsertBulk) SetExecutedAt ¶
func (u *RevisionUpsertBulk) SetExecutedAt(v time.Time) *RevisionUpsertBulk
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsertBulk) SetExecutionState ¶
func (u *RevisionUpsertBulk) SetExecutionState(v revision.ExecutionState) *RevisionUpsertBulk
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (u *RevisionUpsertBulk) SetMeta(v map[string]string) *RevisionUpsertBulk
SetMeta sets the "meta" field.
func (*RevisionUpsertBulk) SetOperatorVersion ¶
func (u *RevisionUpsertBulk) SetOperatorVersion(v string) *RevisionUpsertBulk
SetOperatorVersion sets the "operator_version" 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) UpdateDescription ¶
func (u *RevisionUpsertBulk) UpdateDescription() *RevisionUpsertBulk
UpdateDescription sets the "description" 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) UpdateExecutionState ¶
func (u *RevisionUpsertBulk) UpdateExecutionState() *RevisionUpsertBulk
UpdateExecutionState sets the "execution_state" 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) UpdateMeta ¶
func (u *RevisionUpsertBulk) UpdateMeta() *RevisionUpsertBulk
UpdateMeta sets the "meta" 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.
type RevisionUpsertOne ¶
type RevisionUpsertOne struct {
// contains filtered or unexported fields
}
RevisionUpsertOne is the builder for "upsert"-ing
one Revision node.
func (*RevisionUpsertOne) AddExecutionTime ¶
func (u *RevisionUpsertOne) AddExecutionTime(v time.Duration) *RevisionUpsertOne
AddExecutionTime adds v to the "execution_time" 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) SetDescription ¶
func (u *RevisionUpsertOne) SetDescription(v string) *RevisionUpsertOne
SetDescription sets the "description" field.
func (*RevisionUpsertOne) SetExecutedAt ¶
func (u *RevisionUpsertOne) SetExecutedAt(v time.Time) *RevisionUpsertOne
SetExecutedAt sets the "executed_at" field.
func (*RevisionUpsertOne) SetExecutionState ¶
func (u *RevisionUpsertOne) SetExecutionState(v revision.ExecutionState) *RevisionUpsertOne
SetExecutionState sets the "execution_state" 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) SetMeta ¶
func (u *RevisionUpsertOne) SetMeta(v map[string]string) *RevisionUpsertOne
SetMeta sets the "meta" field.
func (*RevisionUpsertOne) SetOperatorVersion ¶
func (u *RevisionUpsertOne) SetOperatorVersion(v string) *RevisionUpsertOne
SetOperatorVersion sets the "operator_version" 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) UpdateDescription ¶
func (u *RevisionUpsertOne) UpdateDescription() *RevisionUpsertOne
UpdateDescription sets the "description" 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) UpdateExecutionState ¶
func (u *RevisionUpsertOne) UpdateExecutionState() *RevisionUpsertOne
UpdateExecutionState sets the "execution_state" 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) UpdateMeta ¶
func (u *RevisionUpsertOne) UpdateMeta() *RevisionUpsertOne
UpdateMeta sets the "meta" 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.
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.