db

package
v0.0.0-...-db1a339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypePkg                = "Pkg"
	TypePreservationAction = "PreservationAction"
	TypePreservationTask   = "PreservationTask"
)

Variables

View Source
var ErrTxStarted = errors.New("db: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(db.As(db.Sum(field1), "sum_field1"), (db.As(db.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Pkg is the client for interacting with the Pkg builders.
	Pkg *PkgClient
	// PreservationAction is the client for interacting with the PreservationAction builders.
	PreservationAction *PreservationActionClient
	// PreservationTask is the client for interacting with the PreservationTask builders.
	PreservationTask *PreservationTaskClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Pkg.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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 Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

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 Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Pkg

type Pkg struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// WorkflowID holds the value of the "workflow_id" field.
	WorkflowID string `json:"workflow_id,omitempty"`
	// RunID holds the value of the "run_id" field.
	RunID uuid.UUID `json:"run_id,omitempty"`
	// AipID holds the value of the "aip_id" field.
	AipID uuid.UUID `json:"aip_id,omitempty"`
	// LocationID holds the value of the "location_id" field.
	LocationID uuid.UUID `json:"location_id,omitempty"`
	// Status holds the value of the "status" field.
	Status int8 `json:"status,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt time.Time `json:"completed_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PkgQuery when eager-loading is set.
	Edges PkgEdges `json:"edges"`
	// contains filtered or unexported fields
}

Pkg is the model entity for the Pkg schema.

func (*Pkg) QueryPreservationActions

func (pk *Pkg) QueryPreservationActions() *PreservationActionQuery

QueryPreservationActions queries the "preservation_actions" edge of the Pkg entity.

func (*Pkg) String

func (pk *Pkg) String() string

String implements the fmt.Stringer.

func (*Pkg) Unwrap

func (pk *Pkg) Unwrap() *Pkg

Unwrap unwraps the Pkg 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 (*Pkg) Update

func (pk *Pkg) Update() *PkgUpdateOne

Update returns a builder for updating this Pkg. Note that you need to call Pkg.Unwrap() before calling this method if this Pkg was returned from a transaction, and the transaction was committed or rolled back.

func (*Pkg) Value

func (pk *Pkg) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Pkg. This includes values selected through modifiers, order, etc.

type PkgClient

type PkgClient struct {
	// contains filtered or unexported fields
}

PkgClient is a client for the Pkg schema.

func NewPkgClient

func NewPkgClient(c config) *PkgClient

NewPkgClient returns a client for the Pkg from the given config.

func (*PkgClient) Create

func (c *PkgClient) Create() *PkgCreate

Create returns a builder for creating a Pkg entity.

func (*PkgClient) CreateBulk

func (c *PkgClient) CreateBulk(builders ...*PkgCreate) *PkgCreateBulk

CreateBulk returns a builder for creating a bulk of Pkg entities.

func (*PkgClient) Delete

func (c *PkgClient) Delete() *PkgDelete

Delete returns a delete builder for Pkg.

func (*PkgClient) DeleteOne

func (c *PkgClient) DeleteOne(pk *Pkg) *PkgDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PkgClient) DeleteOneID

func (c *PkgClient) DeleteOneID(id int) *PkgDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PkgClient) Get

func (c *PkgClient) Get(ctx context.Context, id int) (*Pkg, error)

Get returns a Pkg entity by its id.

func (*PkgClient) GetX

func (c *PkgClient) GetX(ctx context.Context, id int) *Pkg

GetX is like Get, but panics if an error occurs.

func (*PkgClient) Hooks

func (c *PkgClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PkgClient) Intercept

func (c *PkgClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pkg.Intercept(f(g(h())))`.

func (*PkgClient) Interceptors

func (c *PkgClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PkgClient) MapCreateBulk

func (c *PkgClient) MapCreateBulk(slice any, setFunc func(*PkgCreate, int)) *PkgCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PkgClient) Query

func (c *PkgClient) Query() *PkgQuery

Query returns a query builder for Pkg.

func (*PkgClient) QueryPreservationActions

func (c *PkgClient) QueryPreservationActions(pk *Pkg) *PreservationActionQuery

QueryPreservationActions queries the preservation_actions edge of a Pkg.

func (*PkgClient) Update

func (c *PkgClient) Update() *PkgUpdate

Update returns an update builder for Pkg.

func (*PkgClient) UpdateOne

func (c *PkgClient) UpdateOne(pk *Pkg) *PkgUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PkgClient) UpdateOneID

func (c *PkgClient) UpdateOneID(id int) *PkgUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PkgClient) Use

func (c *PkgClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pkg.Hooks(f(g(h())))`.

type PkgCreate

type PkgCreate struct {
	// contains filtered or unexported fields
}

PkgCreate is the builder for creating a Pkg entity.

func (*PkgCreate) AddPreservationActionIDs

func (pc *PkgCreate) AddPreservationActionIDs(ids ...int) *PkgCreate

AddPreservationActionIDs adds the "preservation_actions" edge to the PreservationAction entity by IDs.

func (*PkgCreate) AddPreservationActions

func (pc *PkgCreate) AddPreservationActions(p ...*PreservationAction) *PkgCreate

AddPreservationActions adds the "preservation_actions" edges to the PreservationAction entity.

func (*PkgCreate) Exec

func (pc *PkgCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgCreate) ExecX

func (pc *PkgCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkgCreate) Mutation

func (pc *PkgCreate) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgCreate) Save

func (pc *PkgCreate) Save(ctx context.Context) (*Pkg, error)

Save creates the Pkg in the database.

func (*PkgCreate) SaveX

func (pc *PkgCreate) SaveX(ctx context.Context) *Pkg

SaveX calls Save and panics if Save returns an error.

func (*PkgCreate) SetAipID

func (pc *PkgCreate) SetAipID(u uuid.UUID) *PkgCreate

SetAipID sets the "aip_id" field.

func (*PkgCreate) SetCompletedAt

func (pc *PkgCreate) SetCompletedAt(t time.Time) *PkgCreate

SetCompletedAt sets the "completed_at" field.

func (*PkgCreate) SetCreatedAt

func (pc *PkgCreate) SetCreatedAt(t time.Time) *PkgCreate

SetCreatedAt sets the "created_at" field.

func (*PkgCreate) SetLocationID

func (pc *PkgCreate) SetLocationID(u uuid.UUID) *PkgCreate

SetLocationID sets the "location_id" field.

func (*PkgCreate) SetName

func (pc *PkgCreate) SetName(s string) *PkgCreate

SetName sets the "name" field.

func (*PkgCreate) SetNillableAipID

func (pc *PkgCreate) SetNillableAipID(u *uuid.UUID) *PkgCreate

SetNillableAipID sets the "aip_id" field if the given value is not nil.

func (*PkgCreate) SetNillableCompletedAt

func (pc *PkgCreate) SetNillableCompletedAt(t *time.Time) *PkgCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PkgCreate) SetNillableCreatedAt

func (pc *PkgCreate) SetNillableCreatedAt(t *time.Time) *PkgCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PkgCreate) SetNillableLocationID

func (pc *PkgCreate) SetNillableLocationID(u *uuid.UUID) *PkgCreate

SetNillableLocationID sets the "location_id" field if the given value is not nil.

func (*PkgCreate) SetNillableStartedAt

func (pc *PkgCreate) SetNillableStartedAt(t *time.Time) *PkgCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PkgCreate) SetRunID

func (pc *PkgCreate) SetRunID(u uuid.UUID) *PkgCreate

SetRunID sets the "run_id" field.

func (*PkgCreate) SetStartedAt

func (pc *PkgCreate) SetStartedAt(t time.Time) *PkgCreate

SetStartedAt sets the "started_at" field.

func (*PkgCreate) SetStatus

func (pc *PkgCreate) SetStatus(i int8) *PkgCreate

SetStatus sets the "status" field.

func (*PkgCreate) SetWorkflowID

func (pc *PkgCreate) SetWorkflowID(s string) *PkgCreate

SetWorkflowID sets the "workflow_id" field.

type PkgCreateBulk

type PkgCreateBulk struct {
	// contains filtered or unexported fields
}

PkgCreateBulk is the builder for creating many Pkg entities in bulk.

func (*PkgCreateBulk) Exec

func (pcb *PkgCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgCreateBulk) ExecX

func (pcb *PkgCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkgCreateBulk) Save

func (pcb *PkgCreateBulk) Save(ctx context.Context) ([]*Pkg, error)

Save creates the Pkg entities in the database.

func (*PkgCreateBulk) SaveX

func (pcb *PkgCreateBulk) SaveX(ctx context.Context) []*Pkg

SaveX is like Save, but panics if an error occurs.

type PkgDelete

type PkgDelete struct {
	// contains filtered or unexported fields
}

PkgDelete is the builder for deleting a Pkg entity.

func (*PkgDelete) Exec

func (pd *PkgDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PkgDelete) ExecX

func (pd *PkgDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PkgDelete) Where

func (pd *PkgDelete) Where(ps ...predicate.Pkg) *PkgDelete

Where appends a list predicates to the PkgDelete builder.

type PkgDeleteOne

type PkgDeleteOne struct {
	// contains filtered or unexported fields
}

PkgDeleteOne is the builder for deleting a single Pkg entity.

func (*PkgDeleteOne) Exec

func (pdo *PkgDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PkgDeleteOne) ExecX

func (pdo *PkgDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkgDeleteOne) Where

func (pdo *PkgDeleteOne) Where(ps ...predicate.Pkg) *PkgDeleteOne

Where appends a list predicates to the PkgDelete builder.

type PkgEdges

type PkgEdges struct {
	// PreservationActions holds the value of the preservation_actions edge.
	PreservationActions []*PreservationAction `json:"preservation_actions,omitempty"`
	// contains filtered or unexported fields
}

PkgEdges holds the relations/edges for other nodes in the graph.

func (PkgEdges) PreservationActionsOrErr

func (e PkgEdges) PreservationActionsOrErr() ([]*PreservationAction, error)

PreservationActionsOrErr returns the PreservationActions value or an error if the edge was not loaded in eager-loading.

type PkgGroupBy

type PkgGroupBy struct {
	// contains filtered or unexported fields
}

PkgGroupBy is the group-by builder for Pkg entities.

func (*PkgGroupBy) Aggregate

func (pgb *PkgGroupBy) Aggregate(fns ...AggregateFunc) *PkgGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PkgGroupBy) Bool

func (s *PkgGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) BoolX

func (s *PkgGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PkgGroupBy) Bools

func (s *PkgGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) BoolsX

func (s *PkgGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PkgGroupBy) Float64

func (s *PkgGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) Float64X

func (s *PkgGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PkgGroupBy) Float64s

func (s *PkgGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) Float64sX

func (s *PkgGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PkgGroupBy) Int

func (s *PkgGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) IntX

func (s *PkgGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PkgGroupBy) Ints

func (s *PkgGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) IntsX

func (s *PkgGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PkgGroupBy) Scan

func (pgb *PkgGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PkgGroupBy) ScanX

func (s *PkgGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PkgGroupBy) String

func (s *PkgGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) StringX

func (s *PkgGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PkgGroupBy) Strings

func (s *PkgGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PkgGroupBy) StringsX

func (s *PkgGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PkgMutation

type PkgMutation struct {
	// contains filtered or unexported fields
}

PkgMutation represents an operation that mutates the Pkg nodes in the graph.

func (*PkgMutation) AddField

func (m *PkgMutation) 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 (*PkgMutation) AddPreservationActionIDs

func (m *PkgMutation) AddPreservationActionIDs(ids ...int)

AddPreservationActionIDs adds the "preservation_actions" edge to the PreservationAction entity by ids.

func (*PkgMutation) AddStatus

func (m *PkgMutation) AddStatus(i int8)

AddStatus adds i to the "status" field.

func (*PkgMutation) AddedEdges

func (m *PkgMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PkgMutation) AddedField

func (m *PkgMutation) 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 (*PkgMutation) AddedFields

func (m *PkgMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PkgMutation) AddedIDs

func (m *PkgMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PkgMutation) AddedStatus

func (m *PkgMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*PkgMutation) AipID

func (m *PkgMutation) AipID() (r uuid.UUID, exists bool)

AipID returns the value of the "aip_id" field in the mutation.

func (*PkgMutation) AipIDCleared

func (m *PkgMutation) AipIDCleared() bool

AipIDCleared returns if the "aip_id" field was cleared in this mutation.

func (*PkgMutation) ClearAipID

func (m *PkgMutation) ClearAipID()

ClearAipID clears the value of the "aip_id" field.

func (*PkgMutation) ClearCompletedAt

func (m *PkgMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*PkgMutation) ClearEdge

func (m *PkgMutation) 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 (*PkgMutation) ClearField

func (m *PkgMutation) 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 (*PkgMutation) ClearLocationID

func (m *PkgMutation) ClearLocationID()

ClearLocationID clears the value of the "location_id" field.

func (*PkgMutation) ClearPreservationActions

func (m *PkgMutation) ClearPreservationActions()

ClearPreservationActions clears the "preservation_actions" edge to the PreservationAction entity.

func (*PkgMutation) ClearStartedAt

func (m *PkgMutation) ClearStartedAt()

ClearStartedAt clears the value of the "started_at" field.

func (*PkgMutation) ClearedEdges

func (m *PkgMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PkgMutation) ClearedFields

func (m *PkgMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PkgMutation) Client

func (m PkgMutation) 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 (*PkgMutation) CompletedAt

func (m *PkgMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*PkgMutation) CompletedAtCleared

func (m *PkgMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*PkgMutation) CreatedAt

func (m *PkgMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PkgMutation) EdgeCleared

func (m *PkgMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PkgMutation) Field

func (m *PkgMutation) 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 (*PkgMutation) FieldCleared

func (m *PkgMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PkgMutation) Fields

func (m *PkgMutation) 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 (*PkgMutation) ID

func (m *PkgMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PkgMutation) IDs

func (m *PkgMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PkgMutation) LocationID

func (m *PkgMutation) LocationID() (r uuid.UUID, exists bool)

LocationID returns the value of the "location_id" field in the mutation.

func (*PkgMutation) LocationIDCleared

func (m *PkgMutation) LocationIDCleared() bool

LocationIDCleared returns if the "location_id" field was cleared in this mutation.

func (*PkgMutation) Name

func (m *PkgMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PkgMutation) OldAipID

func (m *PkgMutation) OldAipID(ctx context.Context) (v uuid.UUID, err error)

OldAipID returns the old "aip_id" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldCompletedAt

func (m *PkgMutation) OldCompletedAt(ctx context.Context) (v time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldCreatedAt

func (m *PkgMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldField

func (m *PkgMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*PkgMutation) OldLocationID

func (m *PkgMutation) OldLocationID(ctx context.Context) (v uuid.UUID, err error)

OldLocationID returns the old "location_id" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldName

func (m *PkgMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldRunID

func (m *PkgMutation) OldRunID(ctx context.Context) (v uuid.UUID, err error)

OldRunID returns the old "run_id" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldStartedAt

func (m *PkgMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldStatus

func (m *PkgMutation) OldStatus(ctx context.Context) (v int8, err error)

OldStatus returns the old "status" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldWorkflowID

func (m *PkgMutation) OldWorkflowID(ctx context.Context) (v string, err error)

OldWorkflowID returns the old "workflow_id" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) Op

func (m *PkgMutation) Op() Op

Op returns the operation name.

func (*PkgMutation) PreservationActionsCleared

func (m *PkgMutation) PreservationActionsCleared() bool

PreservationActionsCleared reports if the "preservation_actions" edge to the PreservationAction entity was cleared.

func (*PkgMutation) PreservationActionsIDs

func (m *PkgMutation) PreservationActionsIDs() (ids []int)

PreservationActionsIDs returns the "preservation_actions" edge IDs in the mutation.

func (*PkgMutation) RemovePreservationActionIDs

func (m *PkgMutation) RemovePreservationActionIDs(ids ...int)

RemovePreservationActionIDs removes the "preservation_actions" edge to the PreservationAction entity by IDs.

func (*PkgMutation) RemovedEdges

func (m *PkgMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PkgMutation) RemovedIDs

func (m *PkgMutation) 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 (*PkgMutation) RemovedPreservationActionsIDs

func (m *PkgMutation) RemovedPreservationActionsIDs() (ids []int)

RemovedPreservationActions returns the removed IDs of the "preservation_actions" edge to the PreservationAction entity.

func (*PkgMutation) ResetAipID

func (m *PkgMutation) ResetAipID()

ResetAipID resets all changes to the "aip_id" field.

func (*PkgMutation) ResetCompletedAt

func (m *PkgMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*PkgMutation) ResetCreatedAt

func (m *PkgMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PkgMutation) ResetEdge

func (m *PkgMutation) 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 (*PkgMutation) ResetField

func (m *PkgMutation) 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 (*PkgMutation) ResetLocationID

func (m *PkgMutation) ResetLocationID()

ResetLocationID resets all changes to the "location_id" field.

func (*PkgMutation) ResetName

func (m *PkgMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PkgMutation) ResetPreservationActions

func (m *PkgMutation) ResetPreservationActions()

ResetPreservationActions resets all changes to the "preservation_actions" edge.

func (*PkgMutation) ResetRunID

func (m *PkgMutation) ResetRunID()

ResetRunID resets all changes to the "run_id" field.

func (*PkgMutation) ResetStartedAt

func (m *PkgMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*PkgMutation) ResetStatus

func (m *PkgMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PkgMutation) ResetWorkflowID

func (m *PkgMutation) ResetWorkflowID()

ResetWorkflowID resets all changes to the "workflow_id" field.

func (*PkgMutation) RunID

func (m *PkgMutation) RunID() (r uuid.UUID, exists bool)

RunID returns the value of the "run_id" field in the mutation.

func (*PkgMutation) SetAipID

func (m *PkgMutation) SetAipID(u uuid.UUID)

SetAipID sets the "aip_id" field.

func (*PkgMutation) SetCompletedAt

func (m *PkgMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*PkgMutation) SetCreatedAt

func (m *PkgMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PkgMutation) SetField

func (m *PkgMutation) 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 (*PkgMutation) SetLocationID

func (m *PkgMutation) SetLocationID(u uuid.UUID)

SetLocationID sets the "location_id" field.

func (*PkgMutation) SetName

func (m *PkgMutation) SetName(s string)

SetName sets the "name" field.

func (*PkgMutation) SetOp

func (m *PkgMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PkgMutation) SetRunID

func (m *PkgMutation) SetRunID(u uuid.UUID)

SetRunID sets the "run_id" field.

func (*PkgMutation) SetStartedAt

func (m *PkgMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*PkgMutation) SetStatus

func (m *PkgMutation) SetStatus(i int8)

SetStatus sets the "status" field.

func (*PkgMutation) SetWorkflowID

func (m *PkgMutation) SetWorkflowID(s string)

SetWorkflowID sets the "workflow_id" field.

func (*PkgMutation) StartedAt

func (m *PkgMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*PkgMutation) StartedAtCleared

func (m *PkgMutation) StartedAtCleared() bool

StartedAtCleared returns if the "started_at" field was cleared in this mutation.

func (*PkgMutation) Status

func (m *PkgMutation) Status() (r int8, exists bool)

Status returns the value of the "status" field in the mutation.

func (PkgMutation) Tx

func (m PkgMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PkgMutation) Type

func (m *PkgMutation) Type() string

Type returns the node type of this mutation (Pkg).

func (*PkgMutation) Where

func (m *PkgMutation) Where(ps ...predicate.Pkg)

Where appends a list predicates to the PkgMutation builder.

func (*PkgMutation) WhereP

func (m *PkgMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PkgMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*PkgMutation) WorkflowID

func (m *PkgMutation) WorkflowID() (r string, exists bool)

WorkflowID returns the value of the "workflow_id" field in the mutation.

type PkgQuery

type PkgQuery struct {
	// contains filtered or unexported fields
}

PkgQuery is the builder for querying Pkg entities.

func (*PkgQuery) Aggregate

func (pq *PkgQuery) Aggregate(fns ...AggregateFunc) *PkgSelect

Aggregate returns a PkgSelect configured with the given aggregations.

func (*PkgQuery) All

func (pq *PkgQuery) All(ctx context.Context) ([]*Pkg, error)

All executes the query and returns a list of Pkgs.

func (*PkgQuery) AllX

func (pq *PkgQuery) AllX(ctx context.Context) []*Pkg

AllX is like All, but panics if an error occurs.

func (*PkgQuery) Clone

func (pq *PkgQuery) Clone() *PkgQuery

Clone returns a duplicate of the PkgQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PkgQuery) Count

func (pq *PkgQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PkgQuery) CountX

func (pq *PkgQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PkgQuery) Exist

func (pq *PkgQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PkgQuery) ExistX

func (pq *PkgQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PkgQuery) First

func (pq *PkgQuery) First(ctx context.Context) (*Pkg, error)

First returns the first Pkg entity from the query. Returns a *NotFoundError when no Pkg was found.

func (*PkgQuery) FirstID

func (pq *PkgQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Pkg ID from the query. Returns a *NotFoundError when no Pkg ID was found.

func (*PkgQuery) FirstIDX

func (pq *PkgQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PkgQuery) FirstX

func (pq *PkgQuery) FirstX(ctx context.Context) *Pkg

FirstX is like First, but panics if an error occurs.

func (*PkgQuery) GroupBy

func (pq *PkgQuery) GroupBy(field string, fields ...string) *PkgGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Pkg.Query().
	GroupBy(pkg.FieldName).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*PkgQuery) IDs

func (pq *PkgQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Pkg IDs.

func (*PkgQuery) IDsX

func (pq *PkgQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PkgQuery) Limit

func (pq *PkgQuery) Limit(limit int) *PkgQuery

Limit the number of records to be returned by this query.

func (*PkgQuery) Offset

func (pq *PkgQuery) Offset(offset int) *PkgQuery

Offset to start from.

func (*PkgQuery) Only

func (pq *PkgQuery) Only(ctx context.Context) (*Pkg, error)

Only returns a single Pkg entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pkg entity is found. Returns a *NotFoundError when no Pkg entities are found.

func (*PkgQuery) OnlyID

func (pq *PkgQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Pkg ID in the query. Returns a *NotSingularError when more than one Pkg ID is found. Returns a *NotFoundError when no entities are found.

func (*PkgQuery) OnlyIDX

func (pq *PkgQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PkgQuery) OnlyX

func (pq *PkgQuery) OnlyX(ctx context.Context) *Pkg

OnlyX is like Only, but panics if an error occurs.

func (*PkgQuery) Order

func (pq *PkgQuery) Order(o ...pkg.OrderOption) *PkgQuery

Order specifies how the records should be ordered.

func (*PkgQuery) QueryPreservationActions

func (pq *PkgQuery) QueryPreservationActions() *PreservationActionQuery

QueryPreservationActions chains the current query on the "preservation_actions" edge.

func (*PkgQuery) Select

func (pq *PkgQuery) Select(fields ...string) *PkgSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Pkg.Query().
	Select(pkg.FieldName).
	Scan(ctx, &v)

func (*PkgQuery) Unique

func (pq *PkgQuery) Unique(unique bool) *PkgQuery

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 (*PkgQuery) Where

func (pq *PkgQuery) Where(ps ...predicate.Pkg) *PkgQuery

Where adds a new predicate for the PkgQuery builder.

func (*PkgQuery) WithPreservationActions

func (pq *PkgQuery) WithPreservationActions(opts ...func(*PreservationActionQuery)) *PkgQuery

WithPreservationActions tells the query-builder to eager-load the nodes that are connected to the "preservation_actions" edge. The optional arguments are used to configure the query builder of the edge.

type PkgSelect

type PkgSelect struct {
	*PkgQuery
	// contains filtered or unexported fields
}

PkgSelect is the builder for selecting fields of Pkg entities.

func (*PkgSelect) Aggregate

func (ps *PkgSelect) Aggregate(fns ...AggregateFunc) *PkgSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PkgSelect) Bool

func (s *PkgSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PkgSelect) BoolX

func (s *PkgSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PkgSelect) Bools

func (s *PkgSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PkgSelect) BoolsX

func (s *PkgSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PkgSelect) Float64

func (s *PkgSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PkgSelect) Float64X

func (s *PkgSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PkgSelect) Float64s

func (s *PkgSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PkgSelect) Float64sX

func (s *PkgSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PkgSelect) Int

func (s *PkgSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PkgSelect) IntX

func (s *PkgSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PkgSelect) Ints

func (s *PkgSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PkgSelect) IntsX

func (s *PkgSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PkgSelect) Scan

func (ps *PkgSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PkgSelect) ScanX

func (s *PkgSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PkgSelect) String

func (s *PkgSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PkgSelect) StringX

func (s *PkgSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PkgSelect) Strings

func (s *PkgSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PkgSelect) StringsX

func (s *PkgSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PkgUpdate

type PkgUpdate struct {
	// contains filtered or unexported fields
}

PkgUpdate is the builder for updating Pkg entities.

func (*PkgUpdate) AddPreservationActionIDs

func (pu *PkgUpdate) AddPreservationActionIDs(ids ...int) *PkgUpdate

AddPreservationActionIDs adds the "preservation_actions" edge to the PreservationAction entity by IDs.

func (*PkgUpdate) AddPreservationActions

func (pu *PkgUpdate) AddPreservationActions(p ...*PreservationAction) *PkgUpdate

AddPreservationActions adds the "preservation_actions" edges to the PreservationAction entity.

func (*PkgUpdate) AddStatus

func (pu *PkgUpdate) AddStatus(i int8) *PkgUpdate

AddStatus adds i to the "status" field.

func (*PkgUpdate) ClearAipID

func (pu *PkgUpdate) ClearAipID() *PkgUpdate

ClearAipID clears the value of the "aip_id" field.

func (*PkgUpdate) ClearCompletedAt

func (pu *PkgUpdate) ClearCompletedAt() *PkgUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*PkgUpdate) ClearLocationID

func (pu *PkgUpdate) ClearLocationID() *PkgUpdate

ClearLocationID clears the value of the "location_id" field.

func (*PkgUpdate) ClearPreservationActions

func (pu *PkgUpdate) ClearPreservationActions() *PkgUpdate

ClearPreservationActions clears all "preservation_actions" edges to the PreservationAction entity.

func (*PkgUpdate) ClearStartedAt

func (pu *PkgUpdate) ClearStartedAt() *PkgUpdate

ClearStartedAt clears the value of the "started_at" field.

func (*PkgUpdate) Exec

func (pu *PkgUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgUpdate) ExecX

func (pu *PkgUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkgUpdate) Mutation

func (pu *PkgUpdate) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgUpdate) RemovePreservationActionIDs

func (pu *PkgUpdate) RemovePreservationActionIDs(ids ...int) *PkgUpdate

RemovePreservationActionIDs removes the "preservation_actions" edge to PreservationAction entities by IDs.

func (*PkgUpdate) RemovePreservationActions

func (pu *PkgUpdate) RemovePreservationActions(p ...*PreservationAction) *PkgUpdate

RemovePreservationActions removes "preservation_actions" edges to PreservationAction entities.

func (*PkgUpdate) Save

func (pu *PkgUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PkgUpdate) SaveX

func (pu *PkgUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PkgUpdate) SetAipID

func (pu *PkgUpdate) SetAipID(u uuid.UUID) *PkgUpdate

SetAipID sets the "aip_id" field.

func (*PkgUpdate) SetCompletedAt

func (pu *PkgUpdate) SetCompletedAt(t time.Time) *PkgUpdate

SetCompletedAt sets the "completed_at" field.

func (*PkgUpdate) SetLocationID

func (pu *PkgUpdate) SetLocationID(u uuid.UUID) *PkgUpdate

SetLocationID sets the "location_id" field.

func (*PkgUpdate) SetName

func (pu *PkgUpdate) SetName(s string) *PkgUpdate

SetName sets the "name" field.

func (*PkgUpdate) SetNillableAipID

func (pu *PkgUpdate) SetNillableAipID(u *uuid.UUID) *PkgUpdate

SetNillableAipID sets the "aip_id" field if the given value is not nil.

func (*PkgUpdate) SetNillableCompletedAt

func (pu *PkgUpdate) SetNillableCompletedAt(t *time.Time) *PkgUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PkgUpdate) SetNillableLocationID

func (pu *PkgUpdate) SetNillableLocationID(u *uuid.UUID) *PkgUpdate

SetNillableLocationID sets the "location_id" field if the given value is not nil.

func (*PkgUpdate) SetNillableName

func (pu *PkgUpdate) SetNillableName(s *string) *PkgUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PkgUpdate) SetNillableRunID

func (pu *PkgUpdate) SetNillableRunID(u *uuid.UUID) *PkgUpdate

SetNillableRunID sets the "run_id" field if the given value is not nil.

func (*PkgUpdate) SetNillableStartedAt

func (pu *PkgUpdate) SetNillableStartedAt(t *time.Time) *PkgUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PkgUpdate) SetNillableStatus

func (pu *PkgUpdate) SetNillableStatus(i *int8) *PkgUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PkgUpdate) SetNillableWorkflowID

func (pu *PkgUpdate) SetNillableWorkflowID(s *string) *PkgUpdate

SetNillableWorkflowID sets the "workflow_id" field if the given value is not nil.

func (*PkgUpdate) SetRunID

func (pu *PkgUpdate) SetRunID(u uuid.UUID) *PkgUpdate

SetRunID sets the "run_id" field.

func (*PkgUpdate) SetStartedAt

func (pu *PkgUpdate) SetStartedAt(t time.Time) *PkgUpdate

SetStartedAt sets the "started_at" field.

func (*PkgUpdate) SetStatus

func (pu *PkgUpdate) SetStatus(i int8) *PkgUpdate

SetStatus sets the "status" field.

func (*PkgUpdate) SetWorkflowID

func (pu *PkgUpdate) SetWorkflowID(s string) *PkgUpdate

SetWorkflowID sets the "workflow_id" field.

func (*PkgUpdate) Where

func (pu *PkgUpdate) Where(ps ...predicate.Pkg) *PkgUpdate

Where appends a list predicates to the PkgUpdate builder.

type PkgUpdateOne

type PkgUpdateOne struct {
	// contains filtered or unexported fields
}

PkgUpdateOne is the builder for updating a single Pkg entity.

func (*PkgUpdateOne) AddPreservationActionIDs

func (puo *PkgUpdateOne) AddPreservationActionIDs(ids ...int) *PkgUpdateOne

AddPreservationActionIDs adds the "preservation_actions" edge to the PreservationAction entity by IDs.

func (*PkgUpdateOne) AddPreservationActions

func (puo *PkgUpdateOne) AddPreservationActions(p ...*PreservationAction) *PkgUpdateOne

AddPreservationActions adds the "preservation_actions" edges to the PreservationAction entity.

func (*PkgUpdateOne) AddStatus

func (puo *PkgUpdateOne) AddStatus(i int8) *PkgUpdateOne

AddStatus adds i to the "status" field.

func (*PkgUpdateOne) ClearAipID

func (puo *PkgUpdateOne) ClearAipID() *PkgUpdateOne

ClearAipID clears the value of the "aip_id" field.

func (*PkgUpdateOne) ClearCompletedAt

func (puo *PkgUpdateOne) ClearCompletedAt() *PkgUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*PkgUpdateOne) ClearLocationID

func (puo *PkgUpdateOne) ClearLocationID() *PkgUpdateOne

ClearLocationID clears the value of the "location_id" field.

func (*PkgUpdateOne) ClearPreservationActions

func (puo *PkgUpdateOne) ClearPreservationActions() *PkgUpdateOne

ClearPreservationActions clears all "preservation_actions" edges to the PreservationAction entity.

func (*PkgUpdateOne) ClearStartedAt

func (puo *PkgUpdateOne) ClearStartedAt() *PkgUpdateOne

ClearStartedAt clears the value of the "started_at" field.

func (*PkgUpdateOne) Exec

func (puo *PkgUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PkgUpdateOne) ExecX

func (puo *PkgUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PkgUpdateOne) Mutation

func (puo *PkgUpdateOne) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgUpdateOne) RemovePreservationActionIDs

func (puo *PkgUpdateOne) RemovePreservationActionIDs(ids ...int) *PkgUpdateOne

RemovePreservationActionIDs removes the "preservation_actions" edge to PreservationAction entities by IDs.

func (*PkgUpdateOne) RemovePreservationActions

func (puo *PkgUpdateOne) RemovePreservationActions(p ...*PreservationAction) *PkgUpdateOne

RemovePreservationActions removes "preservation_actions" edges to PreservationAction entities.

func (*PkgUpdateOne) Save

func (puo *PkgUpdateOne) Save(ctx context.Context) (*Pkg, error)

Save executes the query and returns the updated Pkg entity.

func (*PkgUpdateOne) SaveX

func (puo *PkgUpdateOne) SaveX(ctx context.Context) *Pkg

SaveX is like Save, but panics if an error occurs.

func (*PkgUpdateOne) Select

func (puo *PkgUpdateOne) Select(field string, fields ...string) *PkgUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PkgUpdateOne) SetAipID

func (puo *PkgUpdateOne) SetAipID(u uuid.UUID) *PkgUpdateOne

SetAipID sets the "aip_id" field.

func (*PkgUpdateOne) SetCompletedAt

func (puo *PkgUpdateOne) SetCompletedAt(t time.Time) *PkgUpdateOne

SetCompletedAt sets the "completed_at" field.

func (*PkgUpdateOne) SetLocationID

func (puo *PkgUpdateOne) SetLocationID(u uuid.UUID) *PkgUpdateOne

SetLocationID sets the "location_id" field.

func (*PkgUpdateOne) SetName

func (puo *PkgUpdateOne) SetName(s string) *PkgUpdateOne

SetName sets the "name" field.

func (*PkgUpdateOne) SetNillableAipID

func (puo *PkgUpdateOne) SetNillableAipID(u *uuid.UUID) *PkgUpdateOne

SetNillableAipID sets the "aip_id" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableCompletedAt

func (puo *PkgUpdateOne) SetNillableCompletedAt(t *time.Time) *PkgUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableLocationID

func (puo *PkgUpdateOne) SetNillableLocationID(u *uuid.UUID) *PkgUpdateOne

SetNillableLocationID sets the "location_id" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableName

func (puo *PkgUpdateOne) SetNillableName(s *string) *PkgUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableRunID

func (puo *PkgUpdateOne) SetNillableRunID(u *uuid.UUID) *PkgUpdateOne

SetNillableRunID sets the "run_id" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableStartedAt

func (puo *PkgUpdateOne) SetNillableStartedAt(t *time.Time) *PkgUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableStatus

func (puo *PkgUpdateOne) SetNillableStatus(i *int8) *PkgUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PkgUpdateOne) SetNillableWorkflowID

func (puo *PkgUpdateOne) SetNillableWorkflowID(s *string) *PkgUpdateOne

SetNillableWorkflowID sets the "workflow_id" field if the given value is not nil.

func (*PkgUpdateOne) SetRunID

func (puo *PkgUpdateOne) SetRunID(u uuid.UUID) *PkgUpdateOne

SetRunID sets the "run_id" field.

func (*PkgUpdateOne) SetStartedAt

func (puo *PkgUpdateOne) SetStartedAt(t time.Time) *PkgUpdateOne

SetStartedAt sets the "started_at" field.

func (*PkgUpdateOne) SetStatus

func (puo *PkgUpdateOne) SetStatus(i int8) *PkgUpdateOne

SetStatus sets the "status" field.

func (*PkgUpdateOne) SetWorkflowID

func (puo *PkgUpdateOne) SetWorkflowID(s string) *PkgUpdateOne

SetWorkflowID sets the "workflow_id" field.

func (*PkgUpdateOne) Where

func (puo *PkgUpdateOne) Where(ps ...predicate.Pkg) *PkgUpdateOne

Where appends a list predicates to the PkgUpdate builder.

type Pkgs

type Pkgs []*Pkg

Pkgs is a parsable slice of Pkg.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type PreservationAction

type PreservationAction struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// WorkflowID holds the value of the "workflow_id" field.
	WorkflowID string `json:"workflow_id,omitempty"`
	// Type holds the value of the "type" field.
	Type int8 `json:"type,omitempty"`
	// Status holds the value of the "status" field.
	Status int8 `json:"status,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt time.Time `json:"completed_at,omitempty"`
	// PackageID holds the value of the "package_id" field.
	PackageID int `json:"package_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PreservationActionQuery when eager-loading is set.
	Edges PreservationActionEdges `json:"edges"`
	// contains filtered or unexported fields
}

PreservationAction is the model entity for the PreservationAction schema.

func (*PreservationAction) QueryPackage

func (pa *PreservationAction) QueryPackage() *PkgQuery

QueryPackage queries the "package" edge of the PreservationAction entity.

func (*PreservationAction) QueryTasks

func (pa *PreservationAction) QueryTasks() *PreservationTaskQuery

QueryTasks queries the "tasks" edge of the PreservationAction entity.

func (*PreservationAction) String

func (pa *PreservationAction) String() string

String implements the fmt.Stringer.

func (*PreservationAction) Unwrap

func (pa *PreservationAction) Unwrap() *PreservationAction

Unwrap unwraps the PreservationAction 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 (*PreservationAction) Update

Update returns a builder for updating this PreservationAction. Note that you need to call PreservationAction.Unwrap() before calling this method if this PreservationAction was returned from a transaction, and the transaction was committed or rolled back.

func (*PreservationAction) Value

func (pa *PreservationAction) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PreservationAction. This includes values selected through modifiers, order, etc.

type PreservationActionClient

type PreservationActionClient struct {
	// contains filtered or unexported fields
}

PreservationActionClient is a client for the PreservationAction schema.

func NewPreservationActionClient

func NewPreservationActionClient(c config) *PreservationActionClient

NewPreservationActionClient returns a client for the PreservationAction from the given config.

func (*PreservationActionClient) Create

Create returns a builder for creating a PreservationAction entity.

func (*PreservationActionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PreservationAction entities.

func (*PreservationActionClient) Delete

Delete returns a delete builder for PreservationAction.

func (*PreservationActionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PreservationActionClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PreservationActionClient) Get

Get returns a PreservationAction entity by its id.

func (*PreservationActionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PreservationActionClient) Hooks

func (c *PreservationActionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PreservationActionClient) Intercept

func (c *PreservationActionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `preservationaction.Intercept(f(g(h())))`.

func (*PreservationActionClient) Interceptors

func (c *PreservationActionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PreservationActionClient) MapCreateBulk

func (c *PreservationActionClient) MapCreateBulk(slice any, setFunc func(*PreservationActionCreate, int)) *PreservationActionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PreservationActionClient) Query

Query returns a query builder for PreservationAction.

func (*PreservationActionClient) QueryPackage

QueryPackage queries the package edge of a PreservationAction.

func (*PreservationActionClient) QueryTasks

QueryTasks queries the tasks edge of a PreservationAction.

func (*PreservationActionClient) Update

Update returns an update builder for PreservationAction.

func (*PreservationActionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PreservationActionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PreservationActionClient) Use

func (c *PreservationActionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `preservationaction.Hooks(f(g(h())))`.

type PreservationActionCreate

type PreservationActionCreate struct {
	// contains filtered or unexported fields
}

PreservationActionCreate is the builder for creating a PreservationAction entity.

func (*PreservationActionCreate) AddTaskIDs

func (pac *PreservationActionCreate) AddTaskIDs(ids ...int) *PreservationActionCreate

AddTaskIDs adds the "tasks" edge to the PreservationTask entity by IDs.

func (*PreservationActionCreate) AddTasks

AddTasks adds the "tasks" edges to the PreservationTask entity.

func (*PreservationActionCreate) Exec

Exec executes the query.

func (*PreservationActionCreate) ExecX

func (pac *PreservationActionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionCreate) Mutation

Mutation returns the PreservationActionMutation object of the builder.

func (*PreservationActionCreate) Save

Save creates the PreservationAction in the database.

func (*PreservationActionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PreservationActionCreate) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*PreservationActionCreate) SetNillableCompletedAt

func (pac *PreservationActionCreate) SetNillableCompletedAt(t *time.Time) *PreservationActionCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationActionCreate) SetNillableStartedAt

func (pac *PreservationActionCreate) SetNillableStartedAt(t *time.Time) *PreservationActionCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationActionCreate) SetPackage

SetPackage sets the "package" edge to the Pkg entity.

func (*PreservationActionCreate) SetPackageID

SetPackageID sets the "package_id" field.

func (*PreservationActionCreate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationActionCreate) SetStatus

SetStatus sets the "status" field.

func (*PreservationActionCreate) SetType

SetType sets the "type" field.

func (*PreservationActionCreate) SetWorkflowID

SetWorkflowID sets the "workflow_id" field.

type PreservationActionCreateBulk

type PreservationActionCreateBulk struct {
	// contains filtered or unexported fields
}

PreservationActionCreateBulk is the builder for creating many PreservationAction entities in bulk.

func (*PreservationActionCreateBulk) Exec

Exec executes the query.

func (*PreservationActionCreateBulk) ExecX

func (pacb *PreservationActionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionCreateBulk) Save

Save creates the PreservationAction entities in the database.

func (*PreservationActionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PreservationActionDelete

type PreservationActionDelete struct {
	// contains filtered or unexported fields
}

PreservationActionDelete is the builder for deleting a PreservationAction entity.

func (*PreservationActionDelete) Exec

func (pad *PreservationActionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PreservationActionDelete) ExecX

func (pad *PreservationActionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionDelete) Where

Where appends a list predicates to the PreservationActionDelete builder.

type PreservationActionDeleteOne

type PreservationActionDeleteOne struct {
	// contains filtered or unexported fields
}

PreservationActionDeleteOne is the builder for deleting a single PreservationAction entity.

func (*PreservationActionDeleteOne) Exec

Exec executes the deletion query.

func (*PreservationActionDeleteOne) ExecX

func (pado *PreservationActionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionDeleteOne) Where

Where appends a list predicates to the PreservationActionDelete builder.

type PreservationActionEdges

type PreservationActionEdges struct {
	// Package holds the value of the package edge.
	Package *Pkg `json:"package,omitempty"`
	// Tasks holds the value of the tasks edge.
	Tasks []*PreservationTask `json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

PreservationActionEdges holds the relations/edges for other nodes in the graph.

func (PreservationActionEdges) PackageOrErr

func (e PreservationActionEdges) PackageOrErr() (*Pkg, error)

PackageOrErr returns the Package value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PreservationActionEdges) TasksOrErr

func (e PreservationActionEdges) TasksOrErr() ([]*PreservationTask, error)

TasksOrErr returns the Tasks value or an error if the edge was not loaded in eager-loading.

type PreservationActionGroupBy

type PreservationActionGroupBy struct {
	// contains filtered or unexported fields
}

PreservationActionGroupBy is the group-by builder for PreservationAction entities.

func (*PreservationActionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PreservationActionGroupBy) Bool

func (s *PreservationActionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) BoolX

func (s *PreservationActionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PreservationActionGroupBy) Bools

func (s *PreservationActionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) BoolsX

func (s *PreservationActionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PreservationActionGroupBy) Float64

func (s *PreservationActionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) Float64X

func (s *PreservationActionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PreservationActionGroupBy) Float64s

func (s *PreservationActionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) Float64sX

func (s *PreservationActionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PreservationActionGroupBy) Int

func (s *PreservationActionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) IntX

func (s *PreservationActionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PreservationActionGroupBy) Ints

func (s *PreservationActionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) IntsX

func (s *PreservationActionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PreservationActionGroupBy) Scan

func (pagb *PreservationActionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PreservationActionGroupBy) ScanX

func (s *PreservationActionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PreservationActionGroupBy) String

func (s *PreservationActionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) StringX

func (s *PreservationActionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PreservationActionGroupBy) Strings

func (s *PreservationActionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PreservationActionGroupBy) StringsX

func (s *PreservationActionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PreservationActionMutation

type PreservationActionMutation struct {
	// contains filtered or unexported fields
}

PreservationActionMutation represents an operation that mutates the PreservationAction nodes in the graph.

func (*PreservationActionMutation) AddField

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) AddStatus

func (m *PreservationActionMutation) AddStatus(i int8)

AddStatus adds i to the "status" field.

func (*PreservationActionMutation) AddTaskIDs

func (m *PreservationActionMutation) AddTaskIDs(ids ...int)

AddTaskIDs adds the "tasks" edge to the PreservationTask entity by ids.

func (*PreservationActionMutation) AddType

func (m *PreservationActionMutation) AddType(i int8)

AddType adds i to the "type" field.

func (*PreservationActionMutation) AddedEdges

func (m *PreservationActionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PreservationActionMutation) AddedField

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) AddedFields

func (m *PreservationActionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PreservationActionMutation) AddedIDs

func (m *PreservationActionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PreservationActionMutation) AddedStatus

func (m *PreservationActionMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*PreservationActionMutation) AddedType

func (m *PreservationActionMutation) AddedType() (r int8, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*PreservationActionMutation) ClearCompletedAt

func (m *PreservationActionMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationActionMutation) ClearEdge

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) ClearField

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) ClearPackage

func (m *PreservationActionMutation) ClearPackage()

ClearPackage clears the "package" edge to the Pkg entity.

func (*PreservationActionMutation) ClearStartedAt

func (m *PreservationActionMutation) ClearStartedAt()

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationActionMutation) ClearTasks

func (m *PreservationActionMutation) ClearTasks()

ClearTasks clears the "tasks" edge to the PreservationTask entity.

func (*PreservationActionMutation) ClearedEdges

func (m *PreservationActionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PreservationActionMutation) ClearedFields

func (m *PreservationActionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PreservationActionMutation) Client

func (m PreservationActionMutation) 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 (*PreservationActionMutation) CompletedAt

func (m *PreservationActionMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*PreservationActionMutation) CompletedAtCleared

func (m *PreservationActionMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*PreservationActionMutation) EdgeCleared

func (m *PreservationActionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PreservationActionMutation) Field

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) FieldCleared

func (m *PreservationActionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PreservationActionMutation) Fields

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) GetType

func (m *PreservationActionMutation) GetType() (r int8, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*PreservationActionMutation) ID

func (m *PreservationActionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PreservationActionMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PreservationActionMutation) OldCompletedAt

func (m *PreservationActionMutation) OldCompletedAt(ctx context.Context) (v time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) OldField

func (m *PreservationActionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*PreservationActionMutation) OldPackageID

func (m *PreservationActionMutation) OldPackageID(ctx context.Context) (v int, err error)

OldPackageID returns the old "package_id" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) OldStartedAt

func (m *PreservationActionMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) OldStatus

func (m *PreservationActionMutation) OldStatus(ctx context.Context) (v int8, err error)

OldStatus returns the old "status" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) OldType

func (m *PreservationActionMutation) OldType(ctx context.Context) (v int8, err error)

OldType returns the old "type" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) OldWorkflowID

func (m *PreservationActionMutation) OldWorkflowID(ctx context.Context) (v string, err error)

OldWorkflowID returns the old "workflow_id" field's value of the PreservationAction entity. If the PreservationAction 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 (*PreservationActionMutation) Op

Op returns the operation name.

func (*PreservationActionMutation) PackageCleared

func (m *PreservationActionMutation) PackageCleared() bool

PackageCleared reports if the "package" edge to the Pkg entity was cleared.

func (*PreservationActionMutation) PackageID

func (m *PreservationActionMutation) PackageID() (r int, exists bool)

PackageID returns the value of the "package_id" field in the mutation.

func (*PreservationActionMutation) PackageIDs

func (m *PreservationActionMutation) PackageIDs() (ids []int)

PackageIDs returns the "package" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PackageID instead. It exists only for internal usage by the builders.

func (*PreservationActionMutation) RemoveTaskIDs

func (m *PreservationActionMutation) RemoveTaskIDs(ids ...int)

RemoveTaskIDs removes the "tasks" edge to the PreservationTask entity by IDs.

func (*PreservationActionMutation) RemovedEdges

func (m *PreservationActionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PreservationActionMutation) RemovedIDs

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) RemovedTasksIDs

func (m *PreservationActionMutation) RemovedTasksIDs() (ids []int)

RemovedTasks returns the removed IDs of the "tasks" edge to the PreservationTask entity.

func (*PreservationActionMutation) ResetCompletedAt

func (m *PreservationActionMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*PreservationActionMutation) ResetEdge

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) ResetField

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) ResetPackage

func (m *PreservationActionMutation) ResetPackage()

ResetPackage resets all changes to the "package" edge.

func (*PreservationActionMutation) ResetPackageID

func (m *PreservationActionMutation) ResetPackageID()

ResetPackageID resets all changes to the "package_id" field.

func (*PreservationActionMutation) ResetStartedAt

func (m *PreservationActionMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*PreservationActionMutation) ResetStatus

func (m *PreservationActionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PreservationActionMutation) ResetTasks

func (m *PreservationActionMutation) ResetTasks()

ResetTasks resets all changes to the "tasks" edge.

func (*PreservationActionMutation) ResetType

func (m *PreservationActionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*PreservationActionMutation) ResetWorkflowID

func (m *PreservationActionMutation) ResetWorkflowID()

ResetWorkflowID resets all changes to the "workflow_id" field.

func (*PreservationActionMutation) SetCompletedAt

func (m *PreservationActionMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*PreservationActionMutation) SetField

func (m *PreservationActionMutation) 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 (*PreservationActionMutation) SetOp

func (m *PreservationActionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PreservationActionMutation) SetPackageID

func (m *PreservationActionMutation) SetPackageID(i int)

SetPackageID sets the "package_id" field.

func (*PreservationActionMutation) SetStartedAt

func (m *PreservationActionMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*PreservationActionMutation) SetStatus

func (m *PreservationActionMutation) SetStatus(i int8)

SetStatus sets the "status" field.

func (*PreservationActionMutation) SetType

func (m *PreservationActionMutation) SetType(i int8)

SetType sets the "type" field.

func (*PreservationActionMutation) SetWorkflowID

func (m *PreservationActionMutation) SetWorkflowID(s string)

SetWorkflowID sets the "workflow_id" field.

func (*PreservationActionMutation) StartedAt

func (m *PreservationActionMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*PreservationActionMutation) StartedAtCleared

func (m *PreservationActionMutation) StartedAtCleared() bool

StartedAtCleared returns if the "started_at" field was cleared in this mutation.

func (*PreservationActionMutation) Status

func (m *PreservationActionMutation) Status() (r int8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*PreservationActionMutation) TasksCleared

func (m *PreservationActionMutation) TasksCleared() bool

TasksCleared reports if the "tasks" edge to the PreservationTask entity was cleared.

func (*PreservationActionMutation) TasksIDs

func (m *PreservationActionMutation) TasksIDs() (ids []int)

TasksIDs returns the "tasks" edge IDs in the mutation.

func (PreservationActionMutation) Tx

func (m PreservationActionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PreservationActionMutation) Type

Type returns the node type of this mutation (PreservationAction).

func (*PreservationActionMutation) Where

Where appends a list predicates to the PreservationActionMutation builder.

func (*PreservationActionMutation) WhereP

func (m *PreservationActionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PreservationActionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*PreservationActionMutation) WorkflowID

func (m *PreservationActionMutation) WorkflowID() (r string, exists bool)

WorkflowID returns the value of the "workflow_id" field in the mutation.

type PreservationActionQuery

type PreservationActionQuery struct {
	// contains filtered or unexported fields
}

PreservationActionQuery is the builder for querying PreservationAction entities.

func (*PreservationActionQuery) Aggregate

Aggregate returns a PreservationActionSelect configured with the given aggregations.

func (*PreservationActionQuery) All

All executes the query and returns a list of PreservationActions.

func (*PreservationActionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PreservationActionQuery) Clone

Clone returns a duplicate of the PreservationActionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PreservationActionQuery) Count

func (paq *PreservationActionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PreservationActionQuery) CountX

func (paq *PreservationActionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PreservationActionQuery) Exist

func (paq *PreservationActionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PreservationActionQuery) ExistX

func (paq *PreservationActionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PreservationActionQuery) First

First returns the first PreservationAction entity from the query. Returns a *NotFoundError when no PreservationAction was found.

func (*PreservationActionQuery) FirstID

func (paq *PreservationActionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PreservationAction ID from the query. Returns a *NotFoundError when no PreservationAction ID was found.

func (*PreservationActionQuery) FirstIDX

func (paq *PreservationActionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PreservationActionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PreservationActionQuery) GroupBy

func (paq *PreservationActionQuery) GroupBy(field string, fields ...string) *PreservationActionGroupBy

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 {
	WorkflowID string `json:"workflow_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PreservationAction.Query().
	GroupBy(preservationaction.FieldWorkflowID).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*PreservationActionQuery) IDs

func (paq *PreservationActionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PreservationAction IDs.

func (*PreservationActionQuery) IDsX

func (paq *PreservationActionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PreservationActionQuery) Limit

Limit the number of records to be returned by this query.

func (*PreservationActionQuery) Offset

Offset to start from.

func (*PreservationActionQuery) Only

Only returns a single PreservationAction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PreservationAction entity is found. Returns a *NotFoundError when no PreservationAction entities are found.

func (*PreservationActionQuery) OnlyID

func (paq *PreservationActionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PreservationAction ID in the query. Returns a *NotSingularError when more than one PreservationAction ID is found. Returns a *NotFoundError when no entities are found.

func (*PreservationActionQuery) OnlyIDX

func (paq *PreservationActionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PreservationActionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PreservationActionQuery) Order

Order specifies how the records should be ordered.

func (*PreservationActionQuery) QueryPackage

func (paq *PreservationActionQuery) QueryPackage() *PkgQuery

QueryPackage chains the current query on the "package" edge.

func (*PreservationActionQuery) QueryTasks

QueryTasks chains the current query on the "tasks" edge.

func (*PreservationActionQuery) Select

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 {
	WorkflowID string `json:"workflow_id,omitempty"`
}

client.PreservationAction.Query().
	Select(preservationaction.FieldWorkflowID).
	Scan(ctx, &v)

func (*PreservationActionQuery) Unique

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 (*PreservationActionQuery) Where

Where adds a new predicate for the PreservationActionQuery builder.

func (*PreservationActionQuery) WithPackage

func (paq *PreservationActionQuery) WithPackage(opts ...func(*PkgQuery)) *PreservationActionQuery

WithPackage tells the query-builder to eager-load the nodes that are connected to the "package" edge. The optional arguments are used to configure the query builder of the edge.

func (*PreservationActionQuery) WithTasks

WithTasks tells the query-builder to eager-load the nodes that are connected to the "tasks" edge. The optional arguments are used to configure the query builder of the edge.

type PreservationActionSelect

type PreservationActionSelect struct {
	*PreservationActionQuery
	// contains filtered or unexported fields
}

PreservationActionSelect is the builder for selecting fields of PreservationAction entities.

func (*PreservationActionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PreservationActionSelect) Bool

func (s *PreservationActionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) BoolX

func (s *PreservationActionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PreservationActionSelect) Bools

func (s *PreservationActionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) BoolsX

func (s *PreservationActionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PreservationActionSelect) Float64

func (s *PreservationActionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) Float64X

func (s *PreservationActionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PreservationActionSelect) Float64s

func (s *PreservationActionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) Float64sX

func (s *PreservationActionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PreservationActionSelect) Int

func (s *PreservationActionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) IntX

func (s *PreservationActionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PreservationActionSelect) Ints

func (s *PreservationActionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) IntsX

func (s *PreservationActionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PreservationActionSelect) Scan

func (pas *PreservationActionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PreservationActionSelect) ScanX

func (s *PreservationActionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PreservationActionSelect) String

func (s *PreservationActionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) StringX

func (s *PreservationActionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PreservationActionSelect) Strings

func (s *PreservationActionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PreservationActionSelect) StringsX

func (s *PreservationActionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PreservationActionUpdate

type PreservationActionUpdate struct {
	// contains filtered or unexported fields
}

PreservationActionUpdate is the builder for updating PreservationAction entities.

func (*PreservationActionUpdate) AddStatus

AddStatus adds i to the "status" field.

func (*PreservationActionUpdate) AddTaskIDs

func (pau *PreservationActionUpdate) AddTaskIDs(ids ...int) *PreservationActionUpdate

AddTaskIDs adds the "tasks" edge to the PreservationTask entity by IDs.

func (*PreservationActionUpdate) AddTasks

AddTasks adds the "tasks" edges to the PreservationTask entity.

func (*PreservationActionUpdate) AddType

AddType adds i to the "type" field.

func (*PreservationActionUpdate) ClearCompletedAt

func (pau *PreservationActionUpdate) ClearCompletedAt() *PreservationActionUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationActionUpdate) ClearPackage

ClearPackage clears the "package" edge to the Pkg entity.

func (*PreservationActionUpdate) ClearStartedAt

func (pau *PreservationActionUpdate) ClearStartedAt() *PreservationActionUpdate

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationActionUpdate) ClearTasks

ClearTasks clears all "tasks" edges to the PreservationTask entity.

func (*PreservationActionUpdate) Exec

Exec executes the query.

func (*PreservationActionUpdate) ExecX

func (pau *PreservationActionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionUpdate) Mutation

Mutation returns the PreservationActionMutation object of the builder.

func (*PreservationActionUpdate) RemoveTaskIDs

func (pau *PreservationActionUpdate) RemoveTaskIDs(ids ...int) *PreservationActionUpdate

RemoveTaskIDs removes the "tasks" edge to PreservationTask entities by IDs.

func (*PreservationActionUpdate) RemoveTasks

RemoveTasks removes "tasks" edges to PreservationTask entities.

func (*PreservationActionUpdate) Save

func (pau *PreservationActionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PreservationActionUpdate) SaveX

func (pau *PreservationActionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PreservationActionUpdate) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*PreservationActionUpdate) SetNillableCompletedAt

func (pau *PreservationActionUpdate) SetNillableCompletedAt(t *time.Time) *PreservationActionUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationActionUpdate) SetNillablePackageID

func (pau *PreservationActionUpdate) SetNillablePackageID(i *int) *PreservationActionUpdate

SetNillablePackageID sets the "package_id" field if the given value is not nil.

func (*PreservationActionUpdate) SetNillableStartedAt

func (pau *PreservationActionUpdate) SetNillableStartedAt(t *time.Time) *PreservationActionUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationActionUpdate) SetNillableStatus

func (pau *PreservationActionUpdate) SetNillableStatus(i *int8) *PreservationActionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PreservationActionUpdate) SetNillableType

func (pau *PreservationActionUpdate) SetNillableType(i *int8) *PreservationActionUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*PreservationActionUpdate) SetNillableWorkflowID

func (pau *PreservationActionUpdate) SetNillableWorkflowID(s *string) *PreservationActionUpdate

SetNillableWorkflowID sets the "workflow_id" field if the given value is not nil.

func (*PreservationActionUpdate) SetPackage

SetPackage sets the "package" edge to the Pkg entity.

func (*PreservationActionUpdate) SetPackageID

SetPackageID sets the "package_id" field.

func (*PreservationActionUpdate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationActionUpdate) SetStatus

SetStatus sets the "status" field.

func (*PreservationActionUpdate) SetType

SetType sets the "type" field.

func (*PreservationActionUpdate) SetWorkflowID

SetWorkflowID sets the "workflow_id" field.

func (*PreservationActionUpdate) Where

Where appends a list predicates to the PreservationActionUpdate builder.

type PreservationActionUpdateOne

type PreservationActionUpdateOne struct {
	// contains filtered or unexported fields
}

PreservationActionUpdateOne is the builder for updating a single PreservationAction entity.

func (*PreservationActionUpdateOne) AddStatus

AddStatus adds i to the "status" field.

func (*PreservationActionUpdateOne) AddTaskIDs

AddTaskIDs adds the "tasks" edge to the PreservationTask entity by IDs.

func (*PreservationActionUpdateOne) AddTasks

AddTasks adds the "tasks" edges to the PreservationTask entity.

func (*PreservationActionUpdateOne) AddType

AddType adds i to the "type" field.

func (*PreservationActionUpdateOne) ClearCompletedAt

func (pauo *PreservationActionUpdateOne) ClearCompletedAt() *PreservationActionUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationActionUpdateOne) ClearPackage

ClearPackage clears the "package" edge to the Pkg entity.

func (*PreservationActionUpdateOne) ClearStartedAt

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationActionUpdateOne) ClearTasks

ClearTasks clears all "tasks" edges to the PreservationTask entity.

func (*PreservationActionUpdateOne) Exec

Exec executes the query on the entity.

func (*PreservationActionUpdateOne) ExecX

func (pauo *PreservationActionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationActionUpdateOne) Mutation

Mutation returns the PreservationActionMutation object of the builder.

func (*PreservationActionUpdateOne) RemoveTaskIDs

func (pauo *PreservationActionUpdateOne) RemoveTaskIDs(ids ...int) *PreservationActionUpdateOne

RemoveTaskIDs removes the "tasks" edge to PreservationTask entities by IDs.

func (*PreservationActionUpdateOne) RemoveTasks

RemoveTasks removes "tasks" edges to PreservationTask entities.

func (*PreservationActionUpdateOne) Save

Save executes the query and returns the updated PreservationAction entity.

func (*PreservationActionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PreservationActionUpdateOne) Select

func (pauo *PreservationActionUpdateOne) Select(field string, fields ...string) *PreservationActionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PreservationActionUpdateOne) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*PreservationActionUpdateOne) SetNillableCompletedAt

func (pauo *PreservationActionUpdateOne) SetNillableCompletedAt(t *time.Time) *PreservationActionUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetNillablePackageID

func (pauo *PreservationActionUpdateOne) SetNillablePackageID(i *int) *PreservationActionUpdateOne

SetNillablePackageID sets the "package_id" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetNillableStartedAt

func (pauo *PreservationActionUpdateOne) SetNillableStartedAt(t *time.Time) *PreservationActionUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetNillableStatus

func (pauo *PreservationActionUpdateOne) SetNillableStatus(i *int8) *PreservationActionUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetNillableType

SetNillableType sets the "type" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetNillableWorkflowID

func (pauo *PreservationActionUpdateOne) SetNillableWorkflowID(s *string) *PreservationActionUpdateOne

SetNillableWorkflowID sets the "workflow_id" field if the given value is not nil.

func (*PreservationActionUpdateOne) SetPackage

SetPackage sets the "package" edge to the Pkg entity.

func (*PreservationActionUpdateOne) SetPackageID

SetPackageID sets the "package_id" field.

func (*PreservationActionUpdateOne) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationActionUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*PreservationActionUpdateOne) SetType

SetType sets the "type" field.

func (*PreservationActionUpdateOne) SetWorkflowID

SetWorkflowID sets the "workflow_id" field.

func (*PreservationActionUpdateOne) Where

Where appends a list predicates to the PreservationActionUpdate builder.

type PreservationActions

type PreservationActions []*PreservationAction

PreservationActions is a parsable slice of PreservationAction.

type PreservationTask

type PreservationTask struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TaskID holds the value of the "task_id" field.
	TaskID uuid.UUID `json:"task_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Status holds the value of the "status" field.
	Status int8 `json:"status,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt holds the value of the "completed_at" field.
	CompletedAt time.Time `json:"completed_at,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// PreservationActionID holds the value of the "preservation_action_id" field.
	PreservationActionID int `json:"preservation_action_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PreservationTaskQuery when eager-loading is set.
	Edges PreservationTaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

PreservationTask is the model entity for the PreservationTask schema.

func (*PreservationTask) QueryAction

func (pt *PreservationTask) QueryAction() *PreservationActionQuery

QueryAction queries the "action" edge of the PreservationTask entity.

func (*PreservationTask) String

func (pt *PreservationTask) String() string

String implements the fmt.Stringer.

func (*PreservationTask) Unwrap

func (pt *PreservationTask) Unwrap() *PreservationTask

Unwrap unwraps the PreservationTask 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 (*PreservationTask) Update

Update returns a builder for updating this PreservationTask. Note that you need to call PreservationTask.Unwrap() before calling this method if this PreservationTask was returned from a transaction, and the transaction was committed or rolled back.

func (*PreservationTask) Value

func (pt *PreservationTask) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PreservationTask. This includes values selected through modifiers, order, etc.

type PreservationTaskClient

type PreservationTaskClient struct {
	// contains filtered or unexported fields
}

PreservationTaskClient is a client for the PreservationTask schema.

func NewPreservationTaskClient

func NewPreservationTaskClient(c config) *PreservationTaskClient

NewPreservationTaskClient returns a client for the PreservationTask from the given config.

func (*PreservationTaskClient) Create

Create returns a builder for creating a PreservationTask entity.

func (*PreservationTaskClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PreservationTask entities.

func (*PreservationTaskClient) Delete

Delete returns a delete builder for PreservationTask.

func (*PreservationTaskClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PreservationTaskClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PreservationTaskClient) Get

Get returns a PreservationTask entity by its id.

func (*PreservationTaskClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PreservationTaskClient) Hooks

func (c *PreservationTaskClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PreservationTaskClient) Intercept

func (c *PreservationTaskClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `preservationtask.Intercept(f(g(h())))`.

func (*PreservationTaskClient) Interceptors

func (c *PreservationTaskClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PreservationTaskClient) MapCreateBulk

func (c *PreservationTaskClient) MapCreateBulk(slice any, setFunc func(*PreservationTaskCreate, int)) *PreservationTaskCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PreservationTaskClient) Query

Query returns a query builder for PreservationTask.

func (*PreservationTaskClient) QueryAction

QueryAction queries the action edge of a PreservationTask.

func (*PreservationTaskClient) Update

Update returns an update builder for PreservationTask.

func (*PreservationTaskClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PreservationTaskClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PreservationTaskClient) Use

func (c *PreservationTaskClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `preservationtask.Hooks(f(g(h())))`.

type PreservationTaskCreate

type PreservationTaskCreate struct {
	// contains filtered or unexported fields
}

PreservationTaskCreate is the builder for creating a PreservationTask entity.

func (*PreservationTaskCreate) Exec

Exec executes the query.

func (*PreservationTaskCreate) ExecX

func (ptc *PreservationTaskCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskCreate) Mutation

Mutation returns the PreservationTaskMutation object of the builder.

func (*PreservationTaskCreate) Save

Save creates the PreservationTask in the database.

func (*PreservationTaskCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PreservationTaskCreate) SetAction

SetAction sets the "action" edge to the PreservationAction entity.

func (*PreservationTaskCreate) SetActionID

func (ptc *PreservationTaskCreate) SetActionID(id int) *PreservationTaskCreate

SetActionID sets the "action" edge to the PreservationAction entity by ID.

func (*PreservationTaskCreate) SetCompletedAt

func (ptc *PreservationTaskCreate) SetCompletedAt(t time.Time) *PreservationTaskCreate

SetCompletedAt sets the "completed_at" field.

func (*PreservationTaskCreate) SetName

SetName sets the "name" field.

func (*PreservationTaskCreate) SetNillableCompletedAt

func (ptc *PreservationTaskCreate) SetNillableCompletedAt(t *time.Time) *PreservationTaskCreate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationTaskCreate) SetNillableStartedAt

func (ptc *PreservationTaskCreate) SetNillableStartedAt(t *time.Time) *PreservationTaskCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationTaskCreate) SetNote

SetNote sets the "note" field.

func (*PreservationTaskCreate) SetPreservationActionID

func (ptc *PreservationTaskCreate) SetPreservationActionID(i int) *PreservationTaskCreate

SetPreservationActionID sets the "preservation_action_id" field.

func (*PreservationTaskCreate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationTaskCreate) SetStatus

SetStatus sets the "status" field.

func (*PreservationTaskCreate) SetTaskID

SetTaskID sets the "task_id" field.

type PreservationTaskCreateBulk

type PreservationTaskCreateBulk struct {
	// contains filtered or unexported fields
}

PreservationTaskCreateBulk is the builder for creating many PreservationTask entities in bulk.

func (*PreservationTaskCreateBulk) Exec

Exec executes the query.

func (*PreservationTaskCreateBulk) ExecX

func (ptcb *PreservationTaskCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskCreateBulk) Save

Save creates the PreservationTask entities in the database.

func (*PreservationTaskCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PreservationTaskDelete

type PreservationTaskDelete struct {
	// contains filtered or unexported fields
}

PreservationTaskDelete is the builder for deleting a PreservationTask entity.

func (*PreservationTaskDelete) Exec

func (ptd *PreservationTaskDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PreservationTaskDelete) ExecX

func (ptd *PreservationTaskDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskDelete) Where

Where appends a list predicates to the PreservationTaskDelete builder.

type PreservationTaskDeleteOne

type PreservationTaskDeleteOne struct {
	// contains filtered or unexported fields
}

PreservationTaskDeleteOne is the builder for deleting a single PreservationTask entity.

func (*PreservationTaskDeleteOne) Exec

Exec executes the deletion query.

func (*PreservationTaskDeleteOne) ExecX

func (ptdo *PreservationTaskDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskDeleteOne) Where

Where appends a list predicates to the PreservationTaskDelete builder.

type PreservationTaskEdges

type PreservationTaskEdges struct {
	// Action holds the value of the action edge.
	Action *PreservationAction `json:"action,omitempty"`
	// contains filtered or unexported fields
}

PreservationTaskEdges holds the relations/edges for other nodes in the graph.

func (PreservationTaskEdges) ActionOrErr

func (e PreservationTaskEdges) ActionOrErr() (*PreservationAction, error)

ActionOrErr returns the Action value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PreservationTaskGroupBy

type PreservationTaskGroupBy struct {
	// contains filtered or unexported fields
}

PreservationTaskGroupBy is the group-by builder for PreservationTask entities.

func (*PreservationTaskGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PreservationTaskGroupBy) Bool

func (s *PreservationTaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) BoolX

func (s *PreservationTaskGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PreservationTaskGroupBy) Bools

func (s *PreservationTaskGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) BoolsX

func (s *PreservationTaskGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PreservationTaskGroupBy) Float64

func (s *PreservationTaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) Float64X

func (s *PreservationTaskGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PreservationTaskGroupBy) Float64s

func (s *PreservationTaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) Float64sX

func (s *PreservationTaskGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PreservationTaskGroupBy) Int

func (s *PreservationTaskGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) IntX

func (s *PreservationTaskGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PreservationTaskGroupBy) Ints

func (s *PreservationTaskGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) IntsX

func (s *PreservationTaskGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PreservationTaskGroupBy) Scan

func (ptgb *PreservationTaskGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PreservationTaskGroupBy) ScanX

func (s *PreservationTaskGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PreservationTaskGroupBy) String

func (s *PreservationTaskGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) StringX

func (s *PreservationTaskGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PreservationTaskGroupBy) Strings

func (s *PreservationTaskGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PreservationTaskGroupBy) StringsX

func (s *PreservationTaskGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PreservationTaskMutation

type PreservationTaskMutation struct {
	// contains filtered or unexported fields
}

PreservationTaskMutation represents an operation that mutates the PreservationTask nodes in the graph.

func (*PreservationTaskMutation) ActionCleared

func (m *PreservationTaskMutation) ActionCleared() bool

ActionCleared reports if the "action" edge to the PreservationAction entity was cleared.

func (*PreservationTaskMutation) ActionID

func (m *PreservationTaskMutation) ActionID() (id int, exists bool)

ActionID returns the "action" edge ID in the mutation.

func (*PreservationTaskMutation) ActionIDs

func (m *PreservationTaskMutation) ActionIDs() (ids []int)

ActionIDs returns the "action" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ActionID instead. It exists only for internal usage by the builders.

func (*PreservationTaskMutation) AddField

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) AddStatus

func (m *PreservationTaskMutation) AddStatus(i int8)

AddStatus adds i to the "status" field.

func (*PreservationTaskMutation) AddedEdges

func (m *PreservationTaskMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PreservationTaskMutation) AddedField

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) AddedFields

func (m *PreservationTaskMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PreservationTaskMutation) AddedIDs

func (m *PreservationTaskMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PreservationTaskMutation) AddedStatus

func (m *PreservationTaskMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*PreservationTaskMutation) ClearAction

func (m *PreservationTaskMutation) ClearAction()

ClearAction clears the "action" edge to the PreservationAction entity.

func (*PreservationTaskMutation) ClearCompletedAt

func (m *PreservationTaskMutation) ClearCompletedAt()

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationTaskMutation) ClearEdge

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ClearField

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ClearStartedAt

func (m *PreservationTaskMutation) ClearStartedAt()

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationTaskMutation) ClearedEdges

func (m *PreservationTaskMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PreservationTaskMutation) ClearedFields

func (m *PreservationTaskMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PreservationTaskMutation) Client

func (m PreservationTaskMutation) 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 (*PreservationTaskMutation) CompletedAt

func (m *PreservationTaskMutation) CompletedAt() (r time.Time, exists bool)

CompletedAt returns the value of the "completed_at" field in the mutation.

func (*PreservationTaskMutation) CompletedAtCleared

func (m *PreservationTaskMutation) CompletedAtCleared() bool

CompletedAtCleared returns if the "completed_at" field was cleared in this mutation.

func (*PreservationTaskMutation) EdgeCleared

func (m *PreservationTaskMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PreservationTaskMutation) Field

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) FieldCleared

func (m *PreservationTaskMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PreservationTaskMutation) Fields

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ID

func (m *PreservationTaskMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PreservationTaskMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PreservationTaskMutation) Name

func (m *PreservationTaskMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PreservationTaskMutation) Note

func (m *PreservationTaskMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*PreservationTaskMutation) OldCompletedAt

func (m *PreservationTaskMutation) OldCompletedAt(ctx context.Context) (v time.Time, err error)

OldCompletedAt returns the old "completed_at" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldField

func (m *PreservationTaskMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*PreservationTaskMutation) OldName

func (m *PreservationTaskMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldNote

func (m *PreservationTaskMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldPreservationActionID

func (m *PreservationTaskMutation) OldPreservationActionID(ctx context.Context) (v int, err error)

OldPreservationActionID returns the old "preservation_action_id" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldStartedAt

func (m *PreservationTaskMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldStatus

func (m *PreservationTaskMutation) OldStatus(ctx context.Context) (v int8, err error)

OldStatus returns the old "status" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) OldTaskID

func (m *PreservationTaskMutation) OldTaskID(ctx context.Context) (v uuid.UUID, err error)

OldTaskID returns the old "task_id" field's value of the PreservationTask entity. If the PreservationTask 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 (*PreservationTaskMutation) Op

func (m *PreservationTaskMutation) Op() Op

Op returns the operation name.

func (*PreservationTaskMutation) PreservationActionID

func (m *PreservationTaskMutation) PreservationActionID() (r int, exists bool)

PreservationActionID returns the value of the "preservation_action_id" field in the mutation.

func (*PreservationTaskMutation) RemovedEdges

func (m *PreservationTaskMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PreservationTaskMutation) RemovedIDs

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ResetAction

func (m *PreservationTaskMutation) ResetAction()

ResetAction resets all changes to the "action" edge.

func (*PreservationTaskMutation) ResetCompletedAt

func (m *PreservationTaskMutation) ResetCompletedAt()

ResetCompletedAt resets all changes to the "completed_at" field.

func (*PreservationTaskMutation) ResetEdge

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ResetField

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) ResetName

func (m *PreservationTaskMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PreservationTaskMutation) ResetNote

func (m *PreservationTaskMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*PreservationTaskMutation) ResetPreservationActionID

func (m *PreservationTaskMutation) ResetPreservationActionID()

ResetPreservationActionID resets all changes to the "preservation_action_id" field.

func (*PreservationTaskMutation) ResetStartedAt

func (m *PreservationTaskMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*PreservationTaskMutation) ResetStatus

func (m *PreservationTaskMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PreservationTaskMutation) ResetTaskID

func (m *PreservationTaskMutation) ResetTaskID()

ResetTaskID resets all changes to the "task_id" field.

func (*PreservationTaskMutation) SetActionID

func (m *PreservationTaskMutation) SetActionID(id int)

SetActionID sets the "action" edge to the PreservationAction entity by id.

func (*PreservationTaskMutation) SetCompletedAt

func (m *PreservationTaskMutation) SetCompletedAt(t time.Time)

SetCompletedAt sets the "completed_at" field.

func (*PreservationTaskMutation) SetField

func (m *PreservationTaskMutation) 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 (*PreservationTaskMutation) SetName

func (m *PreservationTaskMutation) SetName(s string)

SetName sets the "name" field.

func (*PreservationTaskMutation) SetNote

func (m *PreservationTaskMutation) SetNote(s string)

SetNote sets the "note" field.

func (*PreservationTaskMutation) SetOp

func (m *PreservationTaskMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PreservationTaskMutation) SetPreservationActionID

func (m *PreservationTaskMutation) SetPreservationActionID(i int)

SetPreservationActionID sets the "preservation_action_id" field.

func (*PreservationTaskMutation) SetStartedAt

func (m *PreservationTaskMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*PreservationTaskMutation) SetStatus

func (m *PreservationTaskMutation) SetStatus(i int8)

SetStatus sets the "status" field.

func (*PreservationTaskMutation) SetTaskID

func (m *PreservationTaskMutation) SetTaskID(u uuid.UUID)

SetTaskID sets the "task_id" field.

func (*PreservationTaskMutation) StartedAt

func (m *PreservationTaskMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*PreservationTaskMutation) StartedAtCleared

func (m *PreservationTaskMutation) StartedAtCleared() bool

StartedAtCleared returns if the "started_at" field was cleared in this mutation.

func (*PreservationTaskMutation) Status

func (m *PreservationTaskMutation) Status() (r int8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*PreservationTaskMutation) TaskID

func (m *PreservationTaskMutation) TaskID() (r uuid.UUID, exists bool)

TaskID returns the value of the "task_id" field in the mutation.

func (PreservationTaskMutation) Tx

func (m PreservationTaskMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PreservationTaskMutation) Type

func (m *PreservationTaskMutation) Type() string

Type returns the node type of this mutation (PreservationTask).

func (*PreservationTaskMutation) Where

Where appends a list predicates to the PreservationTaskMutation builder.

func (*PreservationTaskMutation) WhereP

func (m *PreservationTaskMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PreservationTaskMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PreservationTaskQuery

type PreservationTaskQuery struct {
	// contains filtered or unexported fields
}

PreservationTaskQuery is the builder for querying PreservationTask entities.

func (*PreservationTaskQuery) Aggregate

Aggregate returns a PreservationTaskSelect configured with the given aggregations.

func (*PreservationTaskQuery) All

All executes the query and returns a list of PreservationTasks.

func (*PreservationTaskQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PreservationTaskQuery) Clone

Clone returns a duplicate of the PreservationTaskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PreservationTaskQuery) Count

func (ptq *PreservationTaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PreservationTaskQuery) CountX

func (ptq *PreservationTaskQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PreservationTaskQuery) Exist

func (ptq *PreservationTaskQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PreservationTaskQuery) ExistX

func (ptq *PreservationTaskQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PreservationTaskQuery) First

First returns the first PreservationTask entity from the query. Returns a *NotFoundError when no PreservationTask was found.

func (*PreservationTaskQuery) FirstID

func (ptq *PreservationTaskQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PreservationTask ID from the query. Returns a *NotFoundError when no PreservationTask ID was found.

func (*PreservationTaskQuery) FirstIDX

func (ptq *PreservationTaskQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PreservationTaskQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PreservationTaskQuery) GroupBy

func (ptq *PreservationTaskQuery) GroupBy(field string, fields ...string) *PreservationTaskGroupBy

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 {
	TaskID uuid.UUID `json:"task_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PreservationTask.Query().
	GroupBy(preservationtask.FieldTaskID).
	Aggregate(db.Count()).
	Scan(ctx, &v)

func (*PreservationTaskQuery) IDs

func (ptq *PreservationTaskQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PreservationTask IDs.

func (*PreservationTaskQuery) IDsX

func (ptq *PreservationTaskQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PreservationTaskQuery) Limit

func (ptq *PreservationTaskQuery) Limit(limit int) *PreservationTaskQuery

Limit the number of records to be returned by this query.

func (*PreservationTaskQuery) Offset

func (ptq *PreservationTaskQuery) Offset(offset int) *PreservationTaskQuery

Offset to start from.

func (*PreservationTaskQuery) Only

Only returns a single PreservationTask entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PreservationTask entity is found. Returns a *NotFoundError when no PreservationTask entities are found.

func (*PreservationTaskQuery) OnlyID

func (ptq *PreservationTaskQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PreservationTask ID in the query. Returns a *NotSingularError when more than one PreservationTask ID is found. Returns a *NotFoundError when no entities are found.

func (*PreservationTaskQuery) OnlyIDX

func (ptq *PreservationTaskQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PreservationTaskQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PreservationTaskQuery) Order

Order specifies how the records should be ordered.

func (*PreservationTaskQuery) QueryAction

func (ptq *PreservationTaskQuery) QueryAction() *PreservationActionQuery

QueryAction chains the current query on the "action" edge.

func (*PreservationTaskQuery) Select

func (ptq *PreservationTaskQuery) Select(fields ...string) *PreservationTaskSelect

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 {
	TaskID uuid.UUID `json:"task_id,omitempty"`
}

client.PreservationTask.Query().
	Select(preservationtask.FieldTaskID).
	Scan(ctx, &v)

func (*PreservationTaskQuery) Unique

func (ptq *PreservationTaskQuery) Unique(unique bool) *PreservationTaskQuery

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 (*PreservationTaskQuery) Where

Where adds a new predicate for the PreservationTaskQuery builder.

func (*PreservationTaskQuery) WithAction

func (ptq *PreservationTaskQuery) WithAction(opts ...func(*PreservationActionQuery)) *PreservationTaskQuery

WithAction tells the query-builder to eager-load the nodes that are connected to the "action" edge. The optional arguments are used to configure the query builder of the edge.

type PreservationTaskSelect

type PreservationTaskSelect struct {
	*PreservationTaskQuery
	// contains filtered or unexported fields
}

PreservationTaskSelect is the builder for selecting fields of PreservationTask entities.

func (*PreservationTaskSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PreservationTaskSelect) Bool

func (s *PreservationTaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) BoolX

func (s *PreservationTaskSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PreservationTaskSelect) Bools

func (s *PreservationTaskSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) BoolsX

func (s *PreservationTaskSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PreservationTaskSelect) Float64

func (s *PreservationTaskSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) Float64X

func (s *PreservationTaskSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PreservationTaskSelect) Float64s

func (s *PreservationTaskSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) Float64sX

func (s *PreservationTaskSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PreservationTaskSelect) Int

func (s *PreservationTaskSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) IntX

func (s *PreservationTaskSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PreservationTaskSelect) Ints

func (s *PreservationTaskSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) IntsX

func (s *PreservationTaskSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PreservationTaskSelect) Scan

func (pts *PreservationTaskSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PreservationTaskSelect) ScanX

func (s *PreservationTaskSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PreservationTaskSelect) String

func (s *PreservationTaskSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) StringX

func (s *PreservationTaskSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PreservationTaskSelect) Strings

func (s *PreservationTaskSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PreservationTaskSelect) StringsX

func (s *PreservationTaskSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PreservationTaskUpdate

type PreservationTaskUpdate struct {
	// contains filtered or unexported fields
}

PreservationTaskUpdate is the builder for updating PreservationTask entities.

func (*PreservationTaskUpdate) AddStatus

AddStatus adds i to the "status" field.

func (*PreservationTaskUpdate) ClearAction

func (ptu *PreservationTaskUpdate) ClearAction() *PreservationTaskUpdate

ClearAction clears the "action" edge to the PreservationAction entity.

func (*PreservationTaskUpdate) ClearCompletedAt

func (ptu *PreservationTaskUpdate) ClearCompletedAt() *PreservationTaskUpdate

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationTaskUpdate) ClearStartedAt

func (ptu *PreservationTaskUpdate) ClearStartedAt() *PreservationTaskUpdate

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationTaskUpdate) Exec

Exec executes the query.

func (*PreservationTaskUpdate) ExecX

func (ptu *PreservationTaskUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskUpdate) Mutation

Mutation returns the PreservationTaskMutation object of the builder.

func (*PreservationTaskUpdate) Save

func (ptu *PreservationTaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PreservationTaskUpdate) SaveX

func (ptu *PreservationTaskUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PreservationTaskUpdate) SetAction

SetAction sets the "action" edge to the PreservationAction entity.

func (*PreservationTaskUpdate) SetActionID

func (ptu *PreservationTaskUpdate) SetActionID(id int) *PreservationTaskUpdate

SetActionID sets the "action" edge to the PreservationAction entity by ID.

func (*PreservationTaskUpdate) SetCompletedAt

func (ptu *PreservationTaskUpdate) SetCompletedAt(t time.Time) *PreservationTaskUpdate

SetCompletedAt sets the "completed_at" field.

func (*PreservationTaskUpdate) SetName

SetName sets the "name" field.

func (*PreservationTaskUpdate) SetNillableCompletedAt

func (ptu *PreservationTaskUpdate) SetNillableCompletedAt(t *time.Time) *PreservationTaskUpdate

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillableName

func (ptu *PreservationTaskUpdate) SetNillableName(s *string) *PreservationTaskUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillableNote

func (ptu *PreservationTaskUpdate) SetNillableNote(s *string) *PreservationTaskUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillablePreservationActionID

func (ptu *PreservationTaskUpdate) SetNillablePreservationActionID(i *int) *PreservationTaskUpdate

SetNillablePreservationActionID sets the "preservation_action_id" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillableStartedAt

func (ptu *PreservationTaskUpdate) SetNillableStartedAt(t *time.Time) *PreservationTaskUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillableStatus

func (ptu *PreservationTaskUpdate) SetNillableStatus(i *int8) *PreservationTaskUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNillableTaskID

func (ptu *PreservationTaskUpdate) SetNillableTaskID(u *uuid.UUID) *PreservationTaskUpdate

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*PreservationTaskUpdate) SetNote

SetNote sets the "note" field.

func (*PreservationTaskUpdate) SetPreservationActionID

func (ptu *PreservationTaskUpdate) SetPreservationActionID(i int) *PreservationTaskUpdate

SetPreservationActionID sets the "preservation_action_id" field.

func (*PreservationTaskUpdate) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationTaskUpdate) SetStatus

SetStatus sets the "status" field.

func (*PreservationTaskUpdate) SetTaskID

SetTaskID sets the "task_id" field.

func (*PreservationTaskUpdate) Where

Where appends a list predicates to the PreservationTaskUpdate builder.

type PreservationTaskUpdateOne

type PreservationTaskUpdateOne struct {
	// contains filtered or unexported fields
}

PreservationTaskUpdateOne is the builder for updating a single PreservationTask entity.

func (*PreservationTaskUpdateOne) AddStatus

AddStatus adds i to the "status" field.

func (*PreservationTaskUpdateOne) ClearAction

ClearAction clears the "action" edge to the PreservationAction entity.

func (*PreservationTaskUpdateOne) ClearCompletedAt

func (ptuo *PreservationTaskUpdateOne) ClearCompletedAt() *PreservationTaskUpdateOne

ClearCompletedAt clears the value of the "completed_at" field.

func (*PreservationTaskUpdateOne) ClearStartedAt

func (ptuo *PreservationTaskUpdateOne) ClearStartedAt() *PreservationTaskUpdateOne

ClearStartedAt clears the value of the "started_at" field.

func (*PreservationTaskUpdateOne) Exec

Exec executes the query on the entity.

func (*PreservationTaskUpdateOne) ExecX

func (ptuo *PreservationTaskUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PreservationTaskUpdateOne) Mutation

Mutation returns the PreservationTaskMutation object of the builder.

func (*PreservationTaskUpdateOne) Save

Save executes the query and returns the updated PreservationTask entity.

func (*PreservationTaskUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PreservationTaskUpdateOne) Select

func (ptuo *PreservationTaskUpdateOne) Select(field string, fields ...string) *PreservationTaskUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PreservationTaskUpdateOne) SetAction

SetAction sets the "action" edge to the PreservationAction entity.

func (*PreservationTaskUpdateOne) SetActionID

SetActionID sets the "action" edge to the PreservationAction entity by ID.

func (*PreservationTaskUpdateOne) SetCompletedAt

SetCompletedAt sets the "completed_at" field.

func (*PreservationTaskUpdateOne) SetName

SetName sets the "name" field.

func (*PreservationTaskUpdateOne) SetNillableCompletedAt

func (ptuo *PreservationTaskUpdateOne) SetNillableCompletedAt(t *time.Time) *PreservationTaskUpdateOne

SetNillableCompletedAt sets the "completed_at" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillableName

func (ptuo *PreservationTaskUpdateOne) SetNillableName(s *string) *PreservationTaskUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillableNote

func (ptuo *PreservationTaskUpdateOne) SetNillableNote(s *string) *PreservationTaskUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillablePreservationActionID

func (ptuo *PreservationTaskUpdateOne) SetNillablePreservationActionID(i *int) *PreservationTaskUpdateOne

SetNillablePreservationActionID sets the "preservation_action_id" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillableStartedAt

func (ptuo *PreservationTaskUpdateOne) SetNillableStartedAt(t *time.Time) *PreservationTaskUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillableStatus

func (ptuo *PreservationTaskUpdateOne) SetNillableStatus(i *int8) *PreservationTaskUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNillableTaskID

func (ptuo *PreservationTaskUpdateOne) SetNillableTaskID(u *uuid.UUID) *PreservationTaskUpdateOne

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*PreservationTaskUpdateOne) SetNote

SetNote sets the "note" field.

func (*PreservationTaskUpdateOne) SetPreservationActionID

func (ptuo *PreservationTaskUpdateOne) SetPreservationActionID(i int) *PreservationTaskUpdateOne

SetPreservationActionID sets the "preservation_action_id" field.

func (*PreservationTaskUpdateOne) SetStartedAt

SetStartedAt sets the "started_at" field.

func (*PreservationTaskUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*PreservationTaskUpdateOne) SetTaskID

SetTaskID sets the "task_id" field.

func (*PreservationTaskUpdateOne) Where

Where appends a list predicates to the PreservationTaskUpdate builder.

type PreservationTasks

type PreservationTasks []*PreservationTask

PreservationTasks is a parsable slice of PreservationTask.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

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

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Pkg is the client for interacting with the Pkg builders.
	Pkg *PkgClient
	// PreservationAction is the client for interacting with the PreservationAction builders.
	PreservationAction *PreservationActionClient
	// PreservationTask is the client for interacting with the PreservationTask builders.
	PreservationTask *PreservationTaskClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

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.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL